diff --git a/3rdparty/carotene/hal/CMakeLists.txt b/3rdparty/carotene/hal/CMakeLists.txt index 2fb92b907b..f2ca5fff84 100644 --- a/3rdparty/carotene/hal/CMakeLists.txt +++ b/3rdparty/carotene/hal/CMakeLists.txt @@ -25,6 +25,8 @@ endif() if(CMAKE_COMPILER_IS_GNUCXX) if(X86 OR ARMEABI_V6 OR (MIPS AND ANDROID_COMPILER_VERSION VERSION_LESS "4.6")) list(APPEND TEGRA_COMPILER_FLAGS -fweb -fwrapv -frename-registers -fsched-stalled-insns-dep=100 -fsched-stalled-insns=2) + elseif(CMAKE_COMPILER_IS_CLANGCXX) + list(APPEND TEGRA_COMPILER_FLAGS -fwrapv) else() list(APPEND TEGRA_COMPILER_FLAGS -fweb -fwrapv -frename-registers -fsched2-use-superblocks -fsched2-use-traces -fsched-stalled-insns-dep=100 -fsched-stalled-insns=2) diff --git a/3rdparty/carotene/hal/tegra_hal.hpp b/3rdparty/carotene/hal/tegra_hal.hpp index 401f521a64..37e7472282 100644 --- a/3rdparty/carotene/hal/tegra_hal.hpp +++ b/3rdparty/carotene/hal/tegra_hal.hpp @@ -1178,12 +1178,12 @@ struct SepFilterCtx CAROTENE_NS::BORDER_MODE border; }; inline int TEGRA_SEPFILTERINIT(cvhalFilter2D **context, int src_type, int dst_type, int kernel_type, - uchar *kernelx_data, size_t , int kernelx_width, int kernelx_height, - uchar *kernely_data, size_t kernely_step, int kernely_width, int kernely_height, + uchar *kernelx_data, int kernelx_length, + uchar *kernely_data, int kernely_length, int anchor_x, int anchor_y, double delta, int borderType) { if(!context || !kernelx_data || !kernely_data || src_type != CV_8UC1 || dst_type != CV_16SC1 || - !(kernelx_width == 3 && kernelx_height == 1) || !(kernely_width == 1 && kernely_height == 3) || + kernelx_length != 3 || kernely_length != 3 || delta != 0 || anchor_x != 1 || anchor_y != 1) return CV_HAL_ERROR_NOT_IMPLEMENTED; @@ -1225,24 +1225,24 @@ inline int TEGRA_SEPFILTERINIT(cvhalFilter2D **context, int src_type, int dst_ty ctx->kernelx_data[1]=kernelx_data[1]; ctx->kernelx_data[2]=kernelx_data[2]; ctx->kernely_data[0]=kernely_data[0]; - ctx->kernely_data[1]=kernely_data[kernely_step]; - ctx->kernely_data[2]=kernely_data[2*kernely_step]; + ctx->kernely_data[1]=kernely_data[1]; + ctx->kernely_data[2]=kernely_data[2]; break; case CV_8SC1: ctx->kernelx_data[0]=((char*)kernelx_data)[0]; ctx->kernelx_data[1]=((char*)kernelx_data)[1]; ctx->kernelx_data[2]=((char*)kernelx_data)[2]; ctx->kernely_data[0]=((char*)kernely_data)[0]; - ctx->kernely_data[1]=((char*)(kernely_data+kernely_step))[0]; - ctx->kernely_data[2]=((char*)(kernely_data+2*kernely_step))[0]; + ctx->kernely_data[1]=((char*)kernely_data)[1]; + ctx->kernely_data[2]=((char*)kernely_data)[2]; break; case CV_16UC1: ctx->kernelx_data[0]=((int16_t*)kernelx_data)[0]; ctx->kernelx_data[1]=((int16_t*)kernelx_data)[1]; ctx->kernelx_data[2]=((int16_t*)kernelx_data)[2]; ctx->kernely_data[0]=((int16_t*)kernely_data)[0]; - ctx->kernely_data[1]=((int16_t*)(kernely_data+kernely_step))[0]; - ctx->kernely_data[2]=((int16_t*)(kernely_data+2*kernely_step))[0]; + ctx->kernely_data[1]=((int16_t*)kernely_data)[1]; + ctx->kernely_data[2]=((int16_t*)kernely_data)[2]; default: delete ctx; return CV_HAL_ERROR_NOT_IMPLEMENTED; diff --git a/3rdparty/carotene/src/common.hpp b/3rdparty/carotene/src/common.hpp index e46231a58a..823ddf1ccf 100644 --- a/3rdparty/carotene/src/common.hpp +++ b/3rdparty/carotene/src/common.hpp @@ -41,6 +41,7 @@ #define CAROTENE_SRC_COMMON_HPP #include +#include #include #if defined WITH_NEON && (defined __ARM_NEON__ || defined __ARM_NEON) diff --git a/3rdparty/ffmpeg/ffmpeg.cmake b/3rdparty/ffmpeg/ffmpeg.cmake index 193b5d8905..d89b0a573a 100644 --- a/3rdparty/ffmpeg/ffmpeg.cmake +++ b/3rdparty/ffmpeg/ffmpeg.cmake @@ -1,8 +1,8 @@ -# Binary branch name: ffmpeg/master_20160715 -# Binaries were created for OpenCV: 0e6aa189cb9a9642b0ae7983d301693516faad5d -set(FFMPEG_BINARIES_COMMIT "7eef9080d3271c7547d303fa839a62e1124ff1e6") -set(FFMPEG_FILE_HASH_BIN32 "3bb2a8388af90adf6c762210e696400d") -set(FFMPEG_FILE_HASH_BIN64 "ebcfc963f0a94f7e83d58d60eaf23849") +# Binary branch name: ffmpeg/master_20160908 +# Binaries were created for OpenCV: 11a65475d8d460a01c8818c5a2d0544ec49d7d68 +set(FFMPEG_BINARIES_COMMIT "03835134465888981e066434dc95009e8328d4ea") +set(FFMPEG_FILE_HASH_BIN32 "32ba7790b0ac7a6dc66be91603637a7d") +set(FFMPEG_FILE_HASH_BIN64 "068ecaa459a5571e7909cff90999a420") set(FFMPEG_FILE_HASH_CMAKE "f99941d10c1e87bf16b9055e8fc91ab2") set(FFMPEG_DOWNLOAD_URL ${OPENCV_FFMPEG_URL};$ENV{OPENCV_FFMPEG_URL};https://raw.githubusercontent.com/opencv/opencv_3rdparty/${FFMPEG_BINARIES_COMMIT}/ffmpeg/) diff --git a/3rdparty/libpng/CHANGES b/3rdparty/libpng/CHANGES index 2e4d2bb292..d4f0c8ba19 100644 --- a/3rdparty/libpng/CHANGES +++ b/3rdparty/libpng/CHANGES @@ -5063,7 +5063,8 @@ Version 1.6.15beta04 [November 4, 2014] Version 1.6.15beta05 [November 5, 2014] Use png_get_libpng_ver(NULL) instead of PNG_LIBPNG_VER_STRING in example.c, pngtest.c, and applications in the contrib directory. - Avoid out-of-bounds memory access in png_user_version_check(). + Fixed an out-of-range read in png_user_version_check() (Bug report from + Qixue Xiao, CVE-2015-8540). Simplified and future-proofed png_user_version_check(). Fixed GCC unsigned int->float warnings. Various versions of GCC seem to generate warnings when an unsigned value is implicitly @@ -5409,11 +5410,271 @@ Version 1.6.19rc03 [November 3, 2015] Version 1.6.19rc04 [November 5, 2015] Fixed new bug with CRC error after reading an over-length palette - (bug report by Cosmin Truta). + (bug report by Cosmin Truta) (CVE-2015-8126). Version 1.6.19 [November 12, 2015] Cleaned up coding style in png_handle_PLTE(). +Version 1.6.20beta01 [November 20, 2015] + Avoid potential pointer overflow/underflow in png_handle_sPLT() and + png_handle_pCAL() (Bug report by John Regehr). + +Version 1.6.20beta02 [November 23, 2015] + Fixed incorrect implementation of png_set_PLTE() that uses png_ptr + not info_ptr, that left png_set_PLTE() open to the CVE-2015-8126 + vulnerability. Fixes CVE-2015-8472. + +Version 1.6.20beta03 [November 24, 2015] + Backported tests from libpng-1.7.0beta69. + +Version 1.6.20rc01 [November 26, 2015] + Fixed an error in handling of bad zlib CMINFO field in pngfix, found by + American Fuzzy Lop, reported by Brian Carpenter. inflate() doesn't + immediately fault a bad CMINFO field; instead a 'too far back' error + happens later (at least some times). pngfix failed to limit CMINFO to + the allowed values but then assumed that window_bits was in range, + triggering an assert. The bug is mostly harmless; the PNG file cannot + be fixed. + +Version 1.6.20rc02 [November 29, 2015] + In libpng 1.6 zlib initialization was changed to use the window size + in the zlib stream, not a fixed value. This causes some invalid images, + where CINFO is too large, to display 'correctly' if the rest of the + data is valid. This provides a workaround for zlib versions where the + error arises (ones that support the API change to use the window size + in the stream). + +Version 1.6.20 [December 3, 2015] + No changes. + +Version 1.6.21beta01 [December 11, 2015] + Fixed syntax "$(command)" in tests/pngstest that some shells other than + bash could not parse (Bug report by Nelson Beebe). Use `command` instead. + +Version 1.6.21beta02 [December 14, 2015] + Moved png_check_keyword() from pngwutil.c to pngset.c + Removed LE/BE dependencies in pngvalid, to 'fix' the current problem + in the BigEndian tests by not testing it, making the BE code the same + as the LE version. + Fixes to pngvalid for various reduced build configurations (eliminate unused + statics) and a fix for the case in rgb_to_gray when the digitize option + reduces graylo to 0, producing a large error. + +Version 1.6.21beta03 [December 18, 2015] + Widened the 'limit' check on the internally calculated error limits in + the 'DIGITIZE' case (the code used prior to 1.7 for rgb_to_gray error + checks) and changed the check to only operate in non-release builds + (base build type not RC or RELEASE.) + Fixed undefined behavior in pngvalid.c, undefined because + (png_byte) << shift is undefined if it changes the signed bit + (because png_byte is promoted to int). The libpng exported functions + png_get_uint_32 and png_get_uint_16 handle this. (Bug reported by + David Drysdale as a result of reports from UBSAN in clang 3.8). + This changes pngvalid to use BE random numbers; this used to produce + errors but these should not be fixed as a result of the previous changes. + +Version 1.6.21rc01 [January 4, 2016] + In projects/vstudio, combined readme.txt and WARNING into README.txt + +Version 1.6.21rc02 [January 7, 2016] + Relocated assert() in contrib/tools/pngfix.c, bug found by American + Fuzzy Lop, reported by Brian Carpenter. + Marked 'limit' UNUSED in transform_range_check(). This only affects + release builds. + +Version 1.6.21 [January 15, 2016] + Worked around a false-positive Coverity issue in pngvalid.c. + +Version 1.6.22beta01 [January 23, 2016] + Changed PNG_USE_MKSTEMP to __COVERITY__ to select alternate + "tmpfile()" implementation in contrib/libtests/pngstest.c + Fixed NO_STDIO build of pngunknown.c to skip calling png_init_io() + if there is no stdio.h support. + Added a png_image_write_to_memory() API and a number of assist macros + to allow an application that uses the simplified API write to bypass + stdio and write directly to memory. + Added some warnings (png.h) and some check code to detect *possible* + overflow in the ROW_STRIDE and simplified image SIZE macros. This + disallows image width/height/format that *might* overflow. This is + a quiet API change that limits in-memory image size (uncompressed) to + less than 4GByte and image row size (stride) to less than 2GByte. + Revised workaround for false-positive Coverity issue in pngvalid.c. + +Version 1.6.22beta02 [February 8, 2016] + Only use exit(77) in configure builds. + Corrected error in PNG_IMAGE_PNG_SIZE_MAX. This new macro underreported + the palette size because it failed to take into account that the memory + palette has to be expanded to full RGB when it is written to PNG. + Updated CMakeLists.txt, added supporting scripts/gen*.cmake.in + and test.cmake.in (Roger Leigh). + Relaxed limit checks on gamma values in pngrtran.c. As suggested in + the comments gamma values outside the range currently permitted + by png_set_alpha_mode are useful for HDR data encoding. These values + are already permitted by png_set_gamma so it is reasonable caution to + extend the png_set_alpha_mode range as HDR imaging systems are starting + to emerge. + +Version 1.6.22beta03 [March 9, 2016] + Added a common-law trademark notice and export control information + to the LICENSE file, png.h, and the man page. + Restored "& 0xff" in png_save_uint_16() and png_save_uint_32() that + were accidentally removed from libpng-1.6.17. + Changed PNG_INFO_cHNK and PNG_FREE_cHNK from 0xnnnn to 0xnnnnU in png.h + (Robert C. Seacord). + Removed dubious "#if INT_MAX" test from png.h that was added to + libpng-1.6.19beta02 (John Bowler). + Add ${INCLUDES} in scripts/genout.cmake.in (Bug report by Nixon Kwok). + Updated LICENSE to say files in the contrib directory are not + necessarily under the libpng license, and that some makefiles have + other copyright owners. + Added INTEL-SSE2 support (Mike Klein and Matt Sarett, Google, Inc.). + Made contrib/libtests/timepng more robust. The code no longer gives + up/fails on invalid PNG data, it just skips it (with error messages). + The code no longer fails on PNG files with data beyond IEND. Options + exist to use png_read_png (reading the whole image, not by row) and, in + that case, to apply any of the supported transforms. This makes for + more realistic testing; the decoded data actually gets used in a + meaningful fashion (John Bowler). + Fixed some misleading indentation (Krishnaraj Bhat). + +Version 1.6.22beta04 [April 5, 2016] + Force GCC compilation to C89 if needed (Dagobert Michelsen). + SSE filter speed improvements for bpp=3: + memcpy-free implementations of load3() / store3(). + call load3() only when needed at the end of a scanline. + +Version 1.6.22beta05 [April 27, 2016] + Added PNG_FAST_FILTERS macro (defined as + PNG_FILTER_NONE|PNG_FILTER_SUB|PNG_FILTER_UP). + Various fixes for contrib/libtests/timepng.c + Moved INTEL-SSE code from pngpriv.h into contrib/intel/intel_sse.patch. + Fixed typo (missing underscore) in #define PNG_READ_16_TO_8_SUPPORTED + (Bug report by Y.Ohashik). + +Version 1.6.22beta06 [May 5, 2016] + Rebased contrib/intel_sse.patch. + Quieted two Coverity issues in contrib/libtests/timepng.c. + Fixed issues with scripts/genout.cmake.in (David Capello, Nixon Kwok): + Added support to use multiple directories in ZLIBINCDIR variable, + Fixed CMAKE_C_FLAGS with multiple values when genout is compiled on MSVC, + Fixed pnglibconf.c compilation on OS X including the sysroot path. + +Version 1.6.22rc01 [May 14, 2016] + No changes. + +Version 1.6.22rc02 [May 16, 2016] + Removed contrib/timepng from default build; it does not build on platforms + that don't supply clock_gettime(). + +Version 1.6.22rc03 [May 17, 2016] + Restored contrib/timepng to default build but check for the presence + of clock_gettime() in configure.ac and Makefile.am. + +Version 1.6.22 [May 26, 2016] + No changes. + +Version 1.6.23beta01 [May 29, 2016] + Stop a potential memory leak in png_set_tRNS() (Bug report by Ted Ying). + Fixed the progressive reader to handle empty first IDAT chunk properly + (patch by Timothy Nikkel). This bug was introduced in libpng-1.6.0 and + only affected the libpng16 branch. + Added tests in pngvalid.c to check zero-length IDAT chunks in various + positions. Fixed the sequential reader to handle these more robustly + (John Bowler). + +Version 1.6.23rc01 [June 2, 2016] + Corrected progressive read input buffer in pngvalid.c. The previous version + the code invariably passed just one byte at a time to libpng. The intent + was to pass a random number of bytes in the range 0..511. + Moved sse2 prototype from pngpriv.h to contrib/intel/intel_sse.patch. + Added missing ")" in pngerror.c (Matt Sarrett). + +Version 1.6.23rc02 [June 4, 2016] + Fixed undefined behavior in png_push_save_buffer(). Do not call + memcpy() with a null source, even if count is zero (Leon Scroggins III). + +Version 1.6.23 [June 9, 2016] + Fixed bad link to RFC2083 in png.5 (Nikola Forro). + +Version 1.6.24beta01 [June 11, 2016] + Avoid potential overflow of the PNG_IMAGE_SIZE macro. This macro + is not used within libpng, but is used in some of the examples. + +Version 1.6.24beta02 [June 23, 2016] + Correct filter heuristic overflow handling. This was broken when the + write filter code was moved out-of-line; if there is a single filter and + the heuristic sum overflows the calculation of the filtered line is not + completed. In versions prior to 1.6 the code was duplicated in-line + and the check not performed, so the filter operation completed; however, + in the multi-filter case where the sum is performed the 'none' filter would + be selected if all the sums overflowed, even if it wasn't in the filter + list. The fix to the first problem is simply to provide PNG_SIZE_MAX as + the current lmins sum value; this means the sum can never exceed it and + overflows silently. A reasonable compiler that does choose to inline + the code will simply eliminate the sum check. + The fix to the second problem is to use high precision arithmetic (this is + implemented in 1.7), however a simple safe fix here is to chose the lowest + numbered filter in the list from png_set_filter (this only works if the + first problem is also fixed) (John Bowler). + Use a more efficient absolute value calculation on SSE2 (Matthieu Darbois). + Fixed the case where PNG_IMAGE_BUFFER_SIZE can overflow in the application + as a result of the application using an increased 'row_stride'; previously + png_image_finish_read only checked for overflow on the base calculation of + components. (I.e. it checked for overflow of a 32-bit number on the total + number of pixel components in the output format, not the possibly padded row + length and not the number of bytes, which for linear formats is twice the + number of components.) + MSVC does not like '-(unsigned)', so replaced it with 0U-(unsigned) + MSVC does not like (uInt) = -(unsigned) (i.e. as an initializer), unless + the conversion is explicitly invoked by a cast. + Put the SKIP definition in the correct place. It needs to come after the + png.h include (see all the other .c files in contrib/libtests) because it + depends on PNG_LIBPNG_VER. + Removed the three compile warning options from the individual project + files into the zlib.props globals. It increases the warning level from 4 + to All and adds a list of the warnings that need to be turned off. This is + semi-documentary; the intent is to tell libpng users which warnings have + been examined and judged non-fixable at present. The warning about + structure padding is fixable, but it would be a signficant change (moving + structure members around). + +Version 1.6.24beta03 [July 4, 2016] + Optimized absolute value calculation in filter selection, similar to + code in the PAETH decoder in pngrutil.c. Build with PNG_USE_ABS to + use this. + Added pngcp to the build together with a pngcp.dfa configuration test. + Added high resolution timing to pngcp. + Added "Common linking failures" section to INSTALL. + Relocated misplaced #endif in png.c sRGB profile checking. + Fixed two Coverity issues in pngcp.c. + +Version 1.6.24beta04 [July 8, 2016] + Avoid filter-selection heuristic sum calculations in cases where only one + filter is a candidate for selection. This trades off code size (added + private png_setup_*_row_only() functions) for speed. + +Version 1.6.24beta05 [July 13, 2016] + Fixed some indentation to comply with our coding style. + Added contrib/tools/reindent. + +Version 1.6.24beta06 [July 18, 2016] + Fixed more indentation to comply with our coding style. + Eliminated unnecessary tests of boolean png_isaligned() vs 0. + +Version 1.6.24rc01 [July 25, 2016] + No changes. + +Version 1.6.24rc02 [August 1, 2016] + Conditionally compile SSE2 headers in contrib/intel/intel_sse.patch + Conditionally compile png_decompress_chunk(). + +Version 1.6.24rc03 [August 2, 2016] + Conditionally compile ARM_NEON headers in pngpriv.h + Updated contrib/intel/intel_sse.patch + +Version 1.6.24[August 4, 2016] + No changes. + Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit https://lists.sourceforge.net/lists/listinfo/png-mng-implement diff --git a/3rdparty/libpng/CMakeLists.txt b/3rdparty/libpng/CMakeLists.txt index fee9c99bbe..99e4663033 100644 --- a/3rdparty/libpng/CMakeLists.txt +++ b/3rdparty/libpng/CMakeLists.txt @@ -33,6 +33,12 @@ if(ENABLE_NEON) add_definitions(-DPNG_ARM_NEON_OPT=2) endif() +if(ENABLE_SSE + AND (NOT MSVC OR (MSVC_VERSION GREATER 1799))) # MSVS2013+ (issue #7232) + list(APPEND lib_srcs contrib/intel/intel_init.c contrib/intel/filter_sse2_intrinsics.c) + add_definitions(-DPNG_INTEL_SSE) +endif() + # ---------------------------------------------------------------------------------- # Define the library target: # ---------------------------------------------------------------------------------- diff --git a/3rdparty/libpng/LICENSE b/3rdparty/libpng/LICENSE index 11f6ffe5db..d20f39e2b9 100644 --- a/3rdparty/libpng/LICENSE +++ b/3rdparty/libpng/LICENSE @@ -10,8 +10,8 @@ this sentence. This code is released under the libpng license. -libpng versions 1.0.7, July 1, 2000, through 1.6.19, November 12, 2015, are -Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, are +libpng versions 1.0.7, July 1, 2000 through 1.6.24, August 4, 2016 are +Copyright (c) 2000-2002, 2004, 2006-2016 Glenn Randers-Pehrson, are derived from libpng-1.0.6, and are distributed according to the same disclaimer and license as libpng-1.0.6 with the following individuals added to the list of Contributing Authors: @@ -32,6 +32,10 @@ and with the following additions to the disclaimer: risk of satisfactory quality, performance, accuracy, and effort is with the user. +Some files in the "contrib" directory and some configure-generated +files that are distributed with libpng have other copyright owners and +are released under other open source licenses. + libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from libpng-0.96, and are distributed according to the same disclaimer and @@ -55,6 +59,9 @@ Contributing Authors: Greg Roelofs Tom Tanner +Some files in the "scripts" directory have other copyright owners +but are released under this license. + libpng versions 0.5, May 1995, through 0.88, January 1996, are Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. @@ -95,18 +102,29 @@ appreciated. END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. -A "png_get_copyright" function is available, for convenient use in "about" -boxes and the like: +TRADEMARK: - printf("%s", png_get_copyright(NULL)); +The name "libpng" has not been registered by the Copyright owner +as a trademark in any jurisdiction. However, because libpng has +been distributed and maintained world-wide, continually since 1995, +the Copyright owner claims "common-law trademark protection" in any +jurisdiction where common-law trademark is recognized. -Also, the PNG logo (in PNG format, of course) is supplied in the -files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). +OSI CERTIFICATION: Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a certification mark of the Open Source Initiative. OSI has not addressed the additional disclaimers inserted at version 1.0.7. +EXPORT CONTROL: + +The Copyright owner believes that the Export Control Classification +Number (ECCN) for libpng is EAR99, which means not subject to export +controls or International Traffic in Arms Regulations (ITAR) because +it is open source, publicly available software, that does not contain +any encryption software. See the EAR, paragraphs 734.3(b)(3) and +734.7(b). + Glenn Randers-Pehrson glennrp at users.sourceforge.net -November 12, 2015 +August 4, 2016 diff --git a/3rdparty/libpng/README b/3rdparty/libpng/README index 17484e0fd7..a8fba9168b 100644 --- a/3rdparty/libpng/README +++ b/3rdparty/libpng/README @@ -1,4 +1,4 @@ -README for libpng version 1.6.19 - November 12, 2015 (shared library 16.0) +README for libpng version 1.6.24 - August 4, 2016 (shared library 16.0) See the note about version numbers near the top of png.h See INSTALL for instructions on how to install libpng. diff --git a/3rdparty/libpng/arm/arm_init.c b/3rdparty/libpng/arm/arm_init.c index fb3d50d04a..02df812e77 100644 --- a/3rdparty/libpng/arm/arm_init.c +++ b/3rdparty/libpng/arm/arm_init.c @@ -1,9 +1,9 @@ /* arm_init.c - NEON optimised filter functions * - * Copyright (c) 2014 Glenn Randers-Pehrson + * Copyright (c) 2014,2016 Glenn Randers-Pehrson * Written by Mans Rullgard, 2011. - * Last changed in libpng 1.6.16 [December 22, 2014] + * Last changed in libpng 1.6.22 [May 26, 2016] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -66,6 +66,7 @@ png_init_filter_functions_neon(png_structp pp, unsigned int bpp) * wrong order of the 'ON' and 'default' cases. UNSET now defaults to OFF, * as documented in png.h */ + png_debug(1, "in png_init_filter_functions_neon"); #ifdef PNG_ARM_NEON_API_SUPPORTED switch ((pp->options >> PNG_ARM_NEON) & 3) { diff --git a/3rdparty/libpng/arm/filter_neon_intrinsics.c b/3rdparty/libpng/arm/filter_neon_intrinsics.c index d42c788909..ea7e356bcc 100644 --- a/3rdparty/libpng/arm/filter_neon_intrinsics.c +++ b/3rdparty/libpng/arm/filter_neon_intrinsics.c @@ -1,11 +1,11 @@ /* filter_neon_intrinsics.c - NEON optimised filter functions * - * Copyright (c) 2014 Glenn Randers-Pehrson + * Copyright (c) 2014,2016 Glenn Randers-Pehrson * Written by James Yu , October 2013. * Based on filter_neon.S, written by Mans Rullgard, 2011. * - * Last changed in libpng 1.6.16 [December 22, 2014] + * Last changed in libpng 1.6.22 [May 26, 2016] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -47,6 +47,8 @@ png_read_filter_row_up_neon(png_row_infop row_info, png_bytep row, png_bytep rp_stop = row + row_info->rowbytes; png_const_bytep pp = prev_row; + png_debug(1, "in png_read_filter_row_up_neon"); + for (; rp < rp_stop; rp += 16, pp += 16) { uint8x16_t qrp, qpp; @@ -72,6 +74,8 @@ png_read_filter_row_sub3_neon(png_row_infop row_info, png_bytep row, uint8x8x4_t vdest; vdest.val[3] = vdup_n_u8(0); + png_debug(1, "in png_read_filter_row_sub3_neon"); + for (; rp < rp_stop;) { uint8x8_t vtmp1, vtmp2; @@ -113,6 +117,8 @@ png_read_filter_row_sub4_neon(png_row_infop row_info, png_bytep row, uint8x8x4_t vdest; vdest.val[3] = vdup_n_u8(0); + png_debug(1, "in png_read_filter_row_sub4_neon"); + for (; rp < rp_stop; rp += 16) { uint32x2x4_t vtmp = vld4_u32(png_ptr(uint32_t,rp)); @@ -148,6 +154,8 @@ png_read_filter_row_avg3_neon(png_row_infop row_info, png_bytep row, vrpt = png_ptr(uint8x8x2_t,&vtmp); vrp = *vrpt; + png_debug(1, "in png_read_filter_row_avg3_neon"); + for (; rp < rp_stop; pp += 12) { uint8x8_t vtmp1, vtmp2, vtmp3; @@ -207,6 +215,8 @@ png_read_filter_row_avg4_neon(png_row_infop row_info, png_bytep row, uint8x8x4_t vdest; vdest.val[3] = vdup_n_u8(0); + png_debug(1, "in png_read_filter_row_avg4_neon"); + for (; rp < rp_stop; rp += 16, pp += 16) { uint32x2x4_t vtmp; @@ -280,6 +290,8 @@ png_read_filter_row_paeth3_neon(png_row_infop row_info, png_bytep row, vrpt = png_ptr(uint8x8x2_t,&vtmp); vrp = *vrpt; + png_debug(1, "in png_read_filter_row_paeth3_neon"); + for (; rp < rp_stop; pp += 12) { uint8x8x2_t *vppt; @@ -339,6 +351,8 @@ png_read_filter_row_paeth4_neon(png_row_infop row_info, png_bytep row, uint8x8x4_t vdest; vdest.val[3] = vdup_n_u8(0); + png_debug(1, "in png_read_filter_row_paeth4_neon"); + for (; rp < rp_stop; rp += 16, pp += 16) { uint32x2x4_t vtmp; diff --git a/3rdparty/libpng/contrib/intel/INSTALL b/3rdparty/libpng/contrib/intel/INSTALL new file mode 100644 index 0000000000..cd5cdd94eb --- /dev/null +++ b/3rdparty/libpng/contrib/intel/INSTALL @@ -0,0 +1,158 @@ +Enabling SSE support + +Copyright (c) 2016 Google, Inc. +Written by Mike Klein, Matt Sarett + +This INSTALL file written by Glenn Randers-Pehrson, 2016. + +If you have moved intel_init.c and filter_sse2_intrinsics.c to a different +directory, be sure to update the '#include "../../pngpriv.h"' line in both +files if necessary to point to the correct relative location of pngpriv.h +with respect to the new location of those files. + +To enable SSE support in libpng, follow the instructions in I, II, or III, +below: + +I. Using patched "configure" scripts: + +First, apply intel_sse.patch in your build directory. + + patch -i contrib/intel/intel_sse.patch -p1 + +Then, if you are not building in a new GIT clone, e.g., in a tar +distribution, remove any existing pre-built configure scripts: + + ./configure --enable-maintainer-mode + make maintainer-clean + ./autogen.sh --maintainer --clean + +Finally, configure libpng with -DPNG_INTEL_SSE in CPPFLAGS: + + ./autogen.sh --maintainer + CPPFLAGS="-DPNG_INTEL_SSE" ./configure [options] + make CPPFLAGS="-DPNG_INTEL_SSE" [options] + make + +II. Using a custom makefile: + +If you are using a custom makefile makefile, you will have to update it +manually to include contrib/intel/*.o in the dependencies, and to define +PNG_INTEL_SSE. + +III. Using manually updated "configure" scripts: + +If you prefer, manually edit pngpriv.h, configure.ac, and Makefile.am, +following the instructions below, then follow the instructions in +section II of INSTALL in the main libpng directory, then configure libpng +with -DPNG_INTEL_SSE in CPPFLAGS. + +1. Add the following code to configure.ac under HOST SPECIFIC OPTIONS +directly beneath the section for ARM: + +-----------------cut---------------- +# INTEL +# ===== +# +# INTEL SSE (SIMD) support. + +AC_ARG_ENABLE([intel-sse], + AS_HELP_STRING([[[--enable-intel-sse]]], + [Enable Intel SSE optimizations: =no/off, yes/on:] + [no/off: disable the optimizations;] + [yes/on: enable the optimizations.] + [If not specified: determined by the compiler.]), + [case "$enableval" in + no|off) + # disable the default enabling: + AC_DEFINE([PNG_INTEL_SSE_OPT], [0], + [Disable Intel SSE optimizations]) + # Prevent inclusion of the assembler files below: + enable_intel_sse=no;; + yes|on) + AC_DEFINE([PNG_INTEL_SSE_OPT], [1], + [Enable Intel SSE optimizations]);; + *) + AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value]) + esac]) + +# Add Intel specific files to all builds where the host_cpu is Intel ('x86*') +# or where Intel optimizations were explicitly requested (this allows a +# fallback if a future host CPU does not match 'x86*') +AM_CONDITIONAL([PNG_INTEL_SSE], + [test "$enable_intel_sse" != 'no' && + case "$host_cpu" in + i?86|x86_64) :;; + *) test "$enable_intel_sse" != '';; + esac]) +-----------------cut---------------- + +2. Add the following code to Makefile.am under HOST SPECIFIC OPTIONS +directly beneath the "if PNG_ARM_NEON ... endif" statement: + +-----------------cut---------------- +if PNG_INTEL_SSE +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += contrib/intel/intel_init.c\ + contrib/intel/filter_sse2_intrinsics.c +endif +-----------------cut---------------- + +3. Add the following lines to pngpriv.h, following the PNG_ARM_NEON_OPT +code: + +-----------------cut---------------- +#ifndef PNG_INTEL_SSE_OPT +# ifdef PNG_INTEL_SSE + /* Only check for SSE if the build configuration has been modified to + * enable SSE optimizations. This means that these optimizations will + * be off by default. See contrib/intel for more details. + */ +# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \ + defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \ + (defined(_M_IX86_FP) && _M_IX86_FP >= 2) +# define PNG_INTEL_SSE_OPT 1 +# endif +# endif +#endif + +#if PNG_INTEL_SSE_OPT > 0 +# ifndef PNG_INTEL_SSE_IMPLEMENTATION +# if defined(__SSE4_1__) || defined(__AVX__) + /* We are not actually using AVX, but checking for AVX is the best + way we can detect SSE4.1 and SSSE3 on MSVC. + */ +# define PNG_INTEL_SSE_IMPLEMENTATION 3 +# elif defined(__SSSE3__) +# define PNG_INTEL_SSE_IMPLEMENTATION 2 +# elif defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \ + (defined(_M_IX86_FP) && _M_IX86_FP >= 2) +# define PNG_INTEL_SSE_IMPLEMENTATION 1 +# else +# define PNG_INTEL_SSE_IMPLEMENTATION 0 +# endif +# endif + +# if PNG_INTEL_SSE_IMPLEMENTATION > 0 +# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2 +# endif +#endif + +-----------------cut---------------- + +4. Add the following lines to pngpriv.h, following the prototype for +png_read_filter_row_paeth4_neon: + +-----------------cut---------------- +PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); +PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); +PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_sse2,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); +PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_sse2,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); +PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_sse2,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); +PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_sse2,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); + +-----------------cut---------------- diff --git a/3rdparty/libpng/contrib/intel/filter_sse2_intrinsics.c b/3rdparty/libpng/contrib/intel/filter_sse2_intrinsics.c new file mode 100644 index 0000000000..2bde138719 --- /dev/null +++ b/3rdparty/libpng/contrib/intel/filter_sse2_intrinsics.c @@ -0,0 +1,381 @@ + +/* filter_sse2_intrinsics.c - SSE2 optimized filter functions + * + * Copyright (c) 2016 Google, Inc. + * Written by Mike Klein and Matt Sarett + * Derived from arm/filter_neon_intrinsics.c, which was + * Copyright (c) 2014,2016 Glenn Randers-Pehrson + * + * Last changed in libpng 1.6.24 [August 4, 2016] + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +#include "../../pngpriv.h" + +#ifdef PNG_READ_SUPPORTED + +#if PNG_INTEL_SSE_IMPLEMENTATION > 0 + +#include + +/* Functions in this file look at most 3 pixels (a,b,c) to predict the 4th (d). + * They're positioned like this: + * prev: c b + * row: a d + * The Sub filter predicts d=a, Avg d=(a+b)/2, and Paeth predicts d to be + * whichever of a, b, or c is closest to p=a+b-c. + */ + +static __m128i load4(const void* p) { + return _mm_cvtsi32_si128(*(const int*)p); +} + +static void store4(void* p, __m128i v) { + *(int*)p = _mm_cvtsi128_si32(v); +} + +static __m128i load3(const void* p) { + /* We'll load 2 bytes, then 1 byte, + * then mask them together, and finally load into SSE. + */ + const png_uint_16* p01 = p; + const png_byte* p2 = (const png_byte*)(p01+1); + + png_uint_32 v012 = (png_uint_32)(*p01) + | (png_uint_32)(*p2) << 16; + return load4(&v012); +} + +static void store3(void* p, __m128i v) { + /* We'll pull from SSE as a 32-bit int, then write + * its bottom two bytes, then its third byte. + */ + png_uint_32 v012; + store4(&v012, v); + + png_uint_16* p01 = p; + png_byte* p2 = (png_byte*)(p01+1); + *p01 = v012; + *p2 = v012 >> 16; +} + +void png_read_filter_row_sub3_sse2(png_row_infop row_info, png_bytep row, + png_const_bytep prev) +{ + /* The Sub filter predicts each pixel as the previous pixel, a. + * There is no pixel to the left of the first pixel. It's encoded directly. + * That works with our main loop if we just say that left pixel was zero. + */ + (void) prev; //unused parameter + png_debug(1, "in png_read_filter_row_sub3_sse2"); + __m128i a, d = _mm_setzero_si128(); + + png_size_t rb = row_info->rowbytes; + while (rb >= 4) { + a = d; d = load4(row); + d = _mm_add_epi8(d, a); + store3(row, d); + + row += 3; + rb -= 3; + } + if (rb > 0) { + a = d; d = load3(row); + d = _mm_add_epi8(d, a); + store3(row, d); + + row += 3; + rb -= 3; + } +} + +void png_read_filter_row_sub4_sse2(png_row_infop row_info, png_bytep row, + png_const_bytep prev) +{ + /* The Sub filter predicts each pixel as the previous pixel, a. + * There is no pixel to the left of the first pixel. It's encoded directly. + * That works with our main loop if we just say that left pixel was zero. + */ + (void) prev; //unused parameter + png_debug(1, "in png_read_filter_row_sub4_sse2"); + __m128i a, d = _mm_setzero_si128(); + + png_size_t rb = row_info->rowbytes; + while (rb > 0) { + a = d; d = load4(row); + d = _mm_add_epi8(d, a); + store4(row, d); + + row += 4; + rb -= 4; + } +} + +void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row, + png_const_bytep prev) +{ + /* The Avg filter predicts each pixel as the (truncated) average of a and b. + * There's no pixel to the left of the first pixel. Luckily, it's + * predicted to be half of the pixel above it. So again, this works + * perfectly with our loop if we make sure a starts at zero. + */ + png_debug(1, "in png_read_filter_row_avg3_sse2"); + const __m128i zero = _mm_setzero_si128(); + __m128i b; + __m128i a, d = zero; + + png_size_t rb = row_info->rowbytes; + while (rb >= 4) { + b = load4(prev); + a = d; d = load4(row ); + + /* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */ + __m128i avg = _mm_avg_epu8(a,b); + /* ...but we can fix it up by subtracting off 1 if it rounded up. */ + avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b), + _mm_set1_epi8(1))); + d = _mm_add_epi8(d, avg); + store3(row, d); + + prev += 3; + row += 3; + rb -= 3; + } + if (rb > 0) { + b = load3(prev); + a = d; d = load3(row ); + + /* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */ + __m128i avg = _mm_avg_epu8(a,b); + /* ...but we can fix it up by subtracting off 1 if it rounded up. */ + avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b), + _mm_set1_epi8(1))); + + d = _mm_add_epi8(d, avg); + store3(row, d); + + prev += 3; + row += 3; + rb -= 3; + } +} + +void png_read_filter_row_avg4_sse2(png_row_infop row_info, png_bytep row, + png_const_bytep prev) +{ + /* The Avg filter predicts each pixel as the (truncated) average of a and b. + * There's no pixel to the left of the first pixel. Luckily, it's + * predicted to be half of the pixel above it. So again, this works + * perfectly with our loop if we make sure a starts at zero. + */ + png_debug(1, "in png_read_filter_row_avg4_sse2"); + const __m128i zero = _mm_setzero_si128(); + __m128i b; + __m128i a, d = zero; + + png_size_t rb = row_info->rowbytes; + while (rb > 0) { + b = load4(prev); + a = d; d = load4(row ); + + /* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */ + __m128i avg = _mm_avg_epu8(a,b); + /* ...but we can fix it up by subtracting off 1 if it rounded up. */ + avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b), + _mm_set1_epi8(1))); + + d = _mm_add_epi8(d, avg); + store4(row, d); + + prev += 4; + row += 4; + rb -= 4; + } +} + +/* Returns |x| for 16-bit lanes. */ +static __m128i abs_i16(__m128i x) { +#if PNG_INTEL_SSE_IMPLEMENTATION >= 2 + return _mm_abs_epi16(x); +#else + /* Read this all as, return x<0 ? -x : x. + * To negate two's complement, you flip all the bits then add 1. + */ + __m128i is_negative = _mm_cmplt_epi16(x, _mm_setzero_si128()); + + /* Flip negative lanes. */ + x = _mm_xor_si128(x, is_negative); + + /* +1 to negative lanes, else +0. */ + x = _mm_sub_epi16(x, is_negative); + return x; +#endif +} + +/* Bytewise c ? t : e. */ +static __m128i if_then_else(__m128i c, __m128i t, __m128i e) { +#if PNG_INTEL_SSE_IMPLEMENTATION >= 3 + return _mm_blendv_epi8(e,t,c); +#else + return _mm_or_si128(_mm_and_si128(c, t), _mm_andnot_si128(c, e)); +#endif +} + +void png_read_filter_row_paeth3_sse2(png_row_infop row_info, png_bytep row, + png_const_bytep prev) +{ + /* Paeth tries to predict pixel d using the pixel to the left of it, a, + * and two pixels from the previous row, b and c: + * prev: c b + * row: a d + * The Paeth function predicts d to be whichever of a, b, or c is nearest to + * p=a+b-c. + * + * The first pixel has no left context, and so uses an Up filter, p = b. + * This works naturally with our main loop's p = a+b-c if we force a and c + * to zero. + * Here we zero b and d, which become c and a respectively at the start of + * the loop. + */ + png_debug(1, "in png_read_filter_row_paeth3_sse2"); + const __m128i zero = _mm_setzero_si128(); + __m128i c, b = zero, + a, d = zero; + + png_size_t rb = row_info->rowbytes; + while (rb >= 4) { + /* It's easiest to do this math (particularly, deal with pc) with 16-bit + * intermediates. + */ + c = b; b = _mm_unpacklo_epi8(load4(prev), zero); + a = d; d = _mm_unpacklo_epi8(load4(row ), zero); + + /* (p-a) == (a+b-c - a) == (b-c) */ + __m128i pa = _mm_sub_epi16(b,c); + + /* (p-b) == (a+b-c - b) == (a-c) */ + __m128i pb = _mm_sub_epi16(a,c); + + /* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */ + __m128i pc = _mm_add_epi16(pa,pb); + + pa = abs_i16(pa); /* |p-a| */ + pb = abs_i16(pb); /* |p-b| */ + pc = abs_i16(pc); /* |p-c| */ + + __m128i smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb)); + + /* Paeth breaks ties favoring a over b over c. */ + __m128i nearest = if_then_else(_mm_cmpeq_epi16(smallest, pa), a, + if_then_else(_mm_cmpeq_epi16(smallest, pb), b, + c)); + + /* Note `_epi8`: we need addition to wrap modulo 255. */ + d = _mm_add_epi8(d, nearest); + store3(row, _mm_packus_epi16(d,d)); + + prev += 3; + row += 3; + rb -= 3; + } + if (rb > 0) { + /* It's easiest to do this math (particularly, deal with pc) with 16-bit + * intermediates. + */ + c = b; b = _mm_unpacklo_epi8(load3(prev), zero); + a = d; d = _mm_unpacklo_epi8(load3(row ), zero); + + /* (p-a) == (a+b-c - a) == (b-c) */ + __m128i pa = _mm_sub_epi16(b,c); + + /* (p-b) == (a+b-c - b) == (a-c) */ + __m128i pb = _mm_sub_epi16(a,c); + + /* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */ + __m128i pc = _mm_add_epi16(pa,pb); + + pa = abs_i16(pa); /* |p-a| */ + pb = abs_i16(pb); /* |p-b| */ + pc = abs_i16(pc); /* |p-c| */ + + __m128i smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb)); + + /* Paeth breaks ties favoring a over b over c. */ + __m128i nearest = if_then_else(_mm_cmpeq_epi16(smallest, pa), a, + if_then_else(_mm_cmpeq_epi16(smallest, pb), b, + c)); + + /* Note `_epi8`: we need addition to wrap modulo 255. */ + d = _mm_add_epi8(d, nearest); + store3(row, _mm_packus_epi16(d,d)); + + prev += 3; + row += 3; + rb -= 3; + } +} + +void png_read_filter_row_paeth4_sse2(png_row_infop row_info, png_bytep row, + png_const_bytep prev) +{ + /* Paeth tries to predict pixel d using the pixel to the left of it, a, + * and two pixels from the previous row, b and c: + * prev: c b + * row: a d + * The Paeth function predicts d to be whichever of a, b, or c is nearest to + * p=a+b-c. + * + * The first pixel has no left context, and so uses an Up filter, p = b. + * This works naturally with our main loop's p = a+b-c if we force a and c + * to zero. + * Here we zero b and d, which become c and a respectively at the start of + * the loop. + */ + png_debug(1, "in png_read_filter_row_paeth4_sse2"); + const __m128i zero = _mm_setzero_si128(); + __m128i c, b = zero, + a, d = zero; + + png_size_t rb = row_info->rowbytes; + while (rb > 0) { + /* It's easiest to do this math (particularly, deal with pc) with 16-bit + * intermediates. + */ + c = b; b = _mm_unpacklo_epi8(load4(prev), zero); + a = d; d = _mm_unpacklo_epi8(load4(row ), zero); + + /* (p-a) == (a+b-c - a) == (b-c) */ + __m128i pa = _mm_sub_epi16(b,c); + + /* (p-b) == (a+b-c - b) == (a-c) */ + __m128i pb = _mm_sub_epi16(a,c); + + /* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */ + __m128i pc = _mm_add_epi16(pa,pb); + + pa = abs_i16(pa); /* |p-a| */ + pb = abs_i16(pb); /* |p-b| */ + pc = abs_i16(pc); /* |p-c| */ + + __m128i smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb)); + + /* Paeth breaks ties favoring a over b over c. */ + __m128i nearest = if_then_else(_mm_cmpeq_epi16(smallest, pa), a, + if_then_else(_mm_cmpeq_epi16(smallest, pb), b, + c)); + + /* Note `_epi8`: we need addition to wrap modulo 255. */ + d = _mm_add_epi8(d, nearest); + store4(row, _mm_packus_epi16(d,d)); + + prev += 4; + row += 4; + rb -= 4; + } +} + +#endif /* PNG_INTEL_SSE_IMPLEMENTATION > 0 */ +#endif /* READ */ diff --git a/3rdparty/libpng/contrib/intel/intel_init.c b/3rdparty/libpng/contrib/intel/intel_init.c new file mode 100644 index 0000000000..328e90e9af --- /dev/null +++ b/3rdparty/libpng/contrib/intel/intel_init.c @@ -0,0 +1,54 @@ + +/* intel_init.c - SSE2 optimized filter functions + * + * Copyright (c) 2016 Google, Inc. + * Written by Mike Klein and Matt Sarett + * Derived from arm/arm_init.c, which was + * Copyright (c) 2014,2016 Glenn Randers-Pehrson + * + * Last changed in libpng 1.6.22 [May 26, 2016] + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +#include "../../pngpriv.h" + +#ifdef PNG_READ_SUPPORTED +#if PNG_INTEL_SSE_IMPLEMENTATION > 0 + +void +png_init_filter_functions_sse2(png_structp pp, unsigned int bpp) +{ + /* The techniques used to implement each of these filters in SSE operate on + * one pixel at a time. + * So they generally speed up 3bpp images about 3x, 4bpp images about 4x. + * They can scale up to 6 and 8 bpp images and down to 2 bpp images, + * but they'd not likely have any benefit for 1bpp images. + * Most of these can be implemented using only MMX and 64-bit registers, + * but they end up a bit slower than using the equally-ubiquitous SSE2. + */ + png_debug(1, "in png_init_filter_functions_sse2"); + if (bpp == 3) + { + pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_sse2; + pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_sse2; + pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = + png_read_filter_row_paeth3_sse2; + } + else if (bpp == 4) + { + pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_sse2; + pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_sse2; + pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = + png_read_filter_row_paeth4_sse2; + } + + /* No need optimize PNG_FILTER_VALUE_UP. The compiler should + * autovectorize. + */ +} + +#endif /* PNG_INTEL_SSE_IMPLEMENTATION > 0 */ +#endif /* PNG_READ_SUPPORTED */ diff --git a/3rdparty/libpng/contrib/intel/intel_sse.patch b/3rdparty/libpng/contrib/intel/intel_sse.patch new file mode 100644 index 0000000000..c5579e3abd --- /dev/null +++ b/3rdparty/libpng/contrib/intel/intel_sse.patch @@ -0,0 +1,187 @@ +diff --git a/configure.ac b/configure.ac +--- a/configure.ac 2016-05-25 18:59:10.000000000 -0400 ++++ b/configure.ac 2016-05-25 19:48:10.631751170 -0400 +@@ -341,16 +341,50 @@ AC_ARG_ENABLE([arm-neon], + + AM_CONDITIONAL([PNG_ARM_NEON], + [test "$enable_arm_neon" != 'no' && + case "$host_cpu" in + arm*|aarch64*) :;; + *) test "$enable_arm_neon" != '';; + esac]) + ++# INTEL ++# ===== ++# ++# INTEL SSE (SIMD) support. ++ ++AC_ARG_ENABLE([intel-sse], ++ AS_HELP_STRING([[[--enable-intel-sse]]], ++ [Enable Intel SSE optimizations: =no/off, yes/on:] ++ [no/off: disable the optimizations;] ++ [yes/on: enable the optimizations.] ++ [If not specified: determined by the compiler.]), ++ [case "$enableval" in ++ no|off) ++ # disable the default enabling: ++ AC_DEFINE([PNG_INTEL_SSE_OPT], [0], ++ [Disable Intel SSE optimizations]) ++ # Prevent inclusion of the assembler files below: ++ enable_intel_sse=no;; ++ yes|on) ++ AC_DEFINE([PNG_INTEL_SSE_OPT], [1], ++ [Enable Intel SSE optimizations]);; ++ *) ++ AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value]) ++ esac]) ++ ++# Add Intel specific files to all builds where the host_cpu is Intel ('x86*') ++# or where Intel optimizations were explicitly requested (this allows a ++# fallback if a future host CPU does not match 'x86*') ++AM_CONDITIONAL([PNG_INTEL_SSE], ++ [test "$enable_intel_sse" != 'no' && ++ case "$host_cpu" in ++ i?86|x86_64) :;; ++ *) test "$enable_intel_sse" != '';; ++ esac]) + AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]]) + + # Config files, substituting as above + AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in]) + AC_CONFIG_FILES([libpng-config:libpng-config.in], + [chmod +x libpng-config]) + + AC_OUTPUT +diff --git a/Makefile.am b/Makefile.am +--- a/Makefile.am 2016-05-17 18:15:12.000000000 -0400 ++++ b/Makefile.am 2016-05-25 19:48:10.631751170 -0400 +@@ -92,16 +92,20 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SO + pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c\ + png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngusr.dfa + + if PNG_ARM_NEON + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\ + arm/filter_neon.S arm/filter_neon_intrinsics.c + endif + ++if PNG_INTEL_SSE ++libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += contrib/intel/intel_init.c\ ++ contrib/intel/filter_sse2_intrinsics.c ++endif + nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h + + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \ + -version-number @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0 + + if HAVE_LD_VERSION_SCRIPT + # Versioned symbols and restricted exports + if HAVE_SOLARIS_LD +diff --git a/pngpriv.h b/pngpriv.h +--- a/pngpriv.h 2016-08-01 18:13:38.770128810 -0500 ++++ b/pngpriv.h 2016-08-01 18:50:19.130179017 -0500 +@@ -177,16 +177,52 @@ + # endif /* !PNG_ARM_NEON_IMPLEMENTATION */ + + # ifndef PNG_ARM_NEON_IMPLEMENTATION + /* Use the intrinsics code by default. */ + # define PNG_ARM_NEON_IMPLEMENTATION 1 + # endif + #endif /* PNG_ARM_NEON_OPT > 0 */ + ++#ifndef PNG_INTEL_SSE_OPT ++# ifdef PNG_INTEL_SSE ++ /* Only check for SSE if the build configuration has been modified to ++ * enable SSE optimizations. This means that these optimizations will ++ * be off by default. See contrib/intel for more details. ++ */ ++# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \ ++ defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \ ++ (defined(_M_IX86_FP) && _M_IX86_FP >= 2) ++# define PNG_INTEL_SSE_OPT 1 ++# endif ++# endif ++#endif ++ ++#if PNG_INTEL_SSE_OPT > 0 ++# ifndef PNG_INTEL_SSE_IMPLEMENTATION ++# if defined(__SSE4_1__) || defined(__AVX__) ++ /* We are not actually using AVX, but checking for AVX is the best ++ way we can detect SSE4.1 and SSSE3 on MSVC. ++ */ ++# define PNG_INTEL_SSE_IMPLEMENTATION 3 ++# elif defined(__SSSE3__) ++# define PNG_INTEL_SSE_IMPLEMENTATION 2 ++# elif defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \ ++ (defined(_M_IX86_FP) && _M_IX86_FP >= 2) ++# define PNG_INTEL_SSE_IMPLEMENTATION 1 ++# else ++# define PNG_INTEL_SSE_IMPLEMENTATION 0 ++# endif ++# endif ++ ++# if PNG_INTEL_SSE_IMPLEMENTATION > 0 ++# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2 ++# endif ++#endif ++ + /* Is this a build of a DLL where compilation of the object modules requires + * different preprocessor settings to those required for a simple library? If + * so PNG_BUILD_DLL must be set. + * + * If libpng is used inside a DLL but that DLL does not export the libpng APIs + * PNG_BUILD_DLL must not be set. To avoid the code below kicking in build a + * static library of libpng then link the DLL against that. + */ +@@ -1185,16 +1221,31 @@ PNG_INTERNAL_FUNCTION(void,png_read_filt + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); + PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_neon,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); + PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); + PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); + #endif ++ ++#if PNG_INTEL_SSE_IMPLEMENTATION > 0 ++PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop ++ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop ++ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_sse2,(png_row_infop ++ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_sse2,(png_row_infop ++ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_sse2,(png_row_infop ++ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_sse2,(png_row_infop ++ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); ++#endif + + /* Choose the best filter to use and filter the row data */ + PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr, + png_row_infop row_info),PNG_EMPTY); + + #ifdef PNG_SEQUENTIAL_READ_SUPPORTED + PNG_INTERNAL_FUNCTION(void,png_read_IDAT_data,(png_structrp png_ptr, + png_bytep output, png_alloc_size_t avail_out),PNG_EMPTY); +@@ -1914,16 +1965,20 @@ PNG_INTERNAL_FUNCTION(void, PNG_FILTER_O + /* List *all* the possible optimizations here - this branch is required if + * the builder of libpng passes the definition of PNG_FILTER_OPTIMIZATIONS in + * CFLAGS in place of CPPFLAGS *and* uses symbol prefixing. + */ + # if PNG_ARM_NEON_OPT > 0 + PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon, + (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); + # endif ++# if PNG_INTEL_SSE_IMPLEMENTATION > 0 ++PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2, ++ (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); ++# endif + #endif + + PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr, + png_const_charp key, png_bytep new_key), PNG_EMPTY); + + /* Maintainer: Put new private prototypes here ^ */ + + #include "pngdebug.h" diff --git a/3rdparty/libpng/opencv-libpng.patch b/3rdparty/libpng/opencv-libpng.patch index 9fac20355e..b76f87c523 100644 --- a/3rdparty/libpng/opencv-libpng.patch +++ b/3rdparty/libpng/opencv-libpng.patch @@ -1,6 +1,67 @@ +diff --git a/3rdparty/libpng/CMakeLists.txt b/3rdparty/libpng/CMakeLists.txt +index fee9c99..eaf2095 100644 +--- a/3rdparty/libpng/CMakeLists.txt ++++ b/3rdparty/libpng/CMakeLists.txt +@@ -33,6 +33,11 @@ if(ENABLE_NEON) + add_definitions(-DPNG_ARM_NEON_OPT=2) + endif() + ++if(ENABLE_SSE) ++ list(APPEND lib_srcs contrib/intel/intel_init.c contrib/intel/filter_sse2_intrinsics.c) ++ add_definitions(-DPNG_INTEL_SSE) ++endif() ++ + # ---------------------------------------------------------------------------------- + # Define the library target: + # ---------------------------------------------------------------------------------- +diff --git a/3rdparty/libpng/pngpriv.h b/3rdparty/libpng/pngpriv.h +index fe3355d..c0aa785 100644 --- a/3rdparty/libpng/pngpriv.h +++ b/3rdparty/libpng/pngpriv.h -@@ -457,7 +457,7 @@ +@@ -182,6 +182,42 @@ + # endif + #endif /* PNG_ARM_NEON_OPT > 0 */ + ++#ifndef PNG_INTEL_SSE_OPT ++# ifdef PNG_INTEL_SSE ++ /* Only check for SSE if the build configuration has been modified to ++ * enable SSE optimizations. This means that these optimizations will ++ * be off by default. See contrib/intel for more details. ++ */ ++# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \ ++ defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \ ++ (defined(_M_IX86_FP) && _M_IX86_FP >= 2) ++# define PNG_INTEL_SSE_OPT 1 ++# endif ++# endif ++#endif ++ ++#if defined(PNG_INTEL_SSE_OPT) && PNG_INTEL_SSE_OPT > 0 ++# ifndef PNG_INTEL_SSE_IMPLEMENTATION ++# if defined(__SSE4_1__) || defined(__AVX__) ++ /* We are not actually using AVX, but checking for AVX is the best ++ way we can detect SSE4.1 and SSSE3 on MSVC. ++ */ ++# define PNG_INTEL_SSE_IMPLEMENTATION 3 ++# elif defined(__SSSE3__) ++# define PNG_INTEL_SSE_IMPLEMENTATION 2 ++# elif defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \ ++ (defined(_M_IX86_FP) && _M_IX86_FP >= 2) ++# define PNG_INTEL_SSE_IMPLEMENTATION 1 ++# else ++# define PNG_INTEL_SSE_IMPLEMENTATION 0 ++# endif ++# endif ++ ++# if PNG_INTEL_SSE_IMPLEMENTATION > 0 ++# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2 ++# endif ++#endif ++ + /* Is this a build of a DLL where compilation of the object modules requires + * different preprocessor settings to those required for a simple library? If + * so PNG_BUILD_DLL must be set. +@@ -457,7 +493,7 @@ /* Memory model/platform independent fns */ #ifndef PNG_ABORT @@ -9,3 +70,36 @@ # define PNG_ABORT() ExitProcess(0) # else # define PNG_ABORT() abort() +@@ -1190,6 +1226,21 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop + PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); + #endif ++ ++#if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0 ++PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop ++ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop ++ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_sse2,(png_row_infop ++ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_sse2,(png_row_infop ++ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_sse2,(png_row_infop ++ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_sse2,(png_row_infop ++ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); ++#endif + + /* Choose the best filter to use and filter the row data */ + PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr, +@@ -1919,6 +1970,10 @@ PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS, (png_structp png_ptr, + PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon, + (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); + # endif ++# if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0 ++PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2, ++ (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); ++# endif + #endif + + PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr, diff --git a/3rdparty/libpng/png.c b/3rdparty/libpng/png.c index 6fcfad72ec..0843ebbc26 100644 --- a/3rdparty/libpng/png.c +++ b/3rdparty/libpng/png.c @@ -1,8 +1,8 @@ /* png.c - location for general purpose libpng functions * - * Last changed in libpng 1.6.19 [November 12, 2015] - * Copyright (c) 1998-2015 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -14,7 +14,7 @@ #include "pngpriv.h" /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_6_19 Your_png_h_is_not_version_1_6_19; +typedef png_libpng_version_1_6_24 Your_png_h_is_not_version_1_6_24; /* Tells libpng that we have already handled the first "num_bytes" bytes * of the PNG file signature. If the PNG data is embedded into another @@ -85,7 +85,7 @@ png_zalloc,(voidpf png_ptr, uInt items, uInt size),PNG_ALLOCATED) if (items >= (~(png_alloc_size_t)0)/size) { png_warning (png_voidcast(png_structrp, png_ptr), - "Potential overflow in png_zalloc()"); + "Potential overflow in png_zalloc()"); return NULL; } @@ -172,10 +172,10 @@ png_calculate_crc(png_structrp png_ptr, png_const_bytep ptr, png_size_t length) int png_user_version_check(png_structrp png_ptr, png_const_charp user_png_ver) { - /* Libpng versions 1.0.0 and later are binary compatible if the version - * string matches through the second '.'; we must recompile any - * applications that use any older library version. - */ + /* Libpng versions 1.0.0 and later are binary compatible if the version + * string matches through the second '.'; we must recompile any + * applications that use any older library version. + */ if (user_png_ver != NULL) { @@ -297,7 +297,7 @@ png_create_png_struct,(png_const_charp user_png_ver, png_voidp error_ptr, if (png_user_version_check(&create_struct, user_png_ver) != 0) { png_structrp png_ptr = png_voidcast(png_structrp, - png_malloc_warn(&create_struct, (sizeof *png_ptr))); + png_malloc_warn(&create_struct, (sizeof *png_ptr))); if (png_ptr != NULL) { @@ -346,7 +346,7 @@ png_create_info_struct,(png_const_structrp png_ptr),PNG_ALLOCATED) * has always been done in 'example.c'. */ info_ptr = png_voidcast(png_inforp, png_malloc_base(png_ptr, - (sizeof *info_ptr))); + (sizeof *info_ptr))); if (info_ptr != NULL) memset(info_ptr, 0, (sizeof *info_ptr)); @@ -402,7 +402,7 @@ png_destroy_info_struct(png_const_structrp png_ptr, png_infopp info_ptr_ptr) */ PNG_FUNCTION(void,PNGAPI png_info_init_3,(png_infopp ptr_ptr, png_size_t png_info_struct_size), - PNG_DEPRECATED) + PNG_DEPRECATED) { png_inforp info_ptr = *ptr_ptr; @@ -417,7 +417,7 @@ png_info_init_3,(png_infopp ptr_ptr, png_size_t png_info_struct_size), /* The following line is why this API should not be used: */ free(info_ptr); info_ptr = png_voidcast(png_inforp, png_malloc_base(NULL, - (sizeof *info_ptr))); + (sizeof *info_ptr))); if (info_ptr == NULL) return; *ptr_ptr = info_ptr; @@ -430,7 +430,7 @@ png_info_init_3,(png_infopp ptr_ptr, png_size_t png_info_struct_size), /* The following API is not called internally */ void PNGAPI png_data_freer(png_const_structrp png_ptr, png_inforp info_ptr, - int freer, png_uint_32 mask) + int freer, png_uint_32 mask) { png_debug(1, "in png_data_freer"); @@ -449,7 +449,7 @@ png_data_freer(png_const_structrp png_ptr, png_inforp info_ptr, void PNGAPI png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask, - int num) + int num) { png_debug(1, "in png_free_data"); @@ -775,14 +775,15 @@ png_get_copyright(png_const_structrp png_ptr) #else # ifdef __STDC__ return PNG_STRING_NEWLINE \ - "libpng version 1.6.19 - November 12, 2015" PNG_STRING_NEWLINE \ - "Copyright (c) 1998-2015 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ + "libpng version 1.6.24 - August 4, 2016" PNG_STRING_NEWLINE \ + "Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson" \ + PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ PNG_STRING_NEWLINE; # else - return "libpng version 1.6.19 - November 12, 2015\ - Copyright (c) 1998-2015 Glenn Randers-Pehrson\ + return "libpng version 1.6.24 - August 4, 2016\ + Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; # endif @@ -1032,7 +1033,7 @@ png_zstream_error(png_structrp png_ptr, int ret) #ifdef PNG_GAMMA_SUPPORTED /* always set if COLORSPACE */ static int png_colorspace_check_gamma(png_const_structrp png_ptr, - png_colorspacerp colorspace, png_fixed_point gAMA, int from) + png_colorspacerp colorspace, png_fixed_point gAMA, int from) /* This is called to check a new gamma value against an existing one. The * routine returns false if the new gamma value should not be written. * @@ -1046,7 +1047,7 @@ png_colorspace_check_gamma(png_const_structrp png_ptr, png_fixed_point gtest; if ((colorspace->flags & PNG_COLORSPACE_HAVE_GAMMA) != 0 && - (png_muldiv(>est, colorspace->gamma, PNG_FP_1, gAMA) == 0 || + (png_muldiv(>est, colorspace->gamma, PNG_FP_1, gAMA) == 0 || png_gamma_significant(gtest) != 0)) { /* Either this is an sRGB image, in which case the calculated gamma @@ -1058,7 +1059,7 @@ png_colorspace_check_gamma(png_const_structrp png_ptr, if ((colorspace->flags & PNG_COLORSPACE_FROM_sRGB) != 0 || from == 2) { png_chunk_report(png_ptr, "gamma value does not match sRGB", - PNG_CHUNK_ERROR); + PNG_CHUNK_ERROR); /* Do not overwrite an sRGB value */ return from == 2; } @@ -1066,7 +1067,7 @@ png_colorspace_check_gamma(png_const_structrp png_ptr, else /* sRGB tag not involved */ { png_chunk_report(png_ptr, "gamma value does not match libpng estimate", - PNG_CHUNK_WARNING); + PNG_CHUNK_WARNING); return from == 1; } } @@ -1076,7 +1077,7 @@ png_colorspace_check_gamma(png_const_structrp png_ptr, void /* PRIVATE */ png_colorspace_set_gamma(png_const_structrp png_ptr, - png_colorspacerp colorspace, png_fixed_point gAMA) + png_colorspacerp colorspace, png_fixed_point gAMA) { /* Changed in libpng-1.5.4 to limit the values to ensure overflow can't * occur. Since the fixed point representation is asymetrical it is @@ -1634,8 +1635,8 @@ static const png_xy sRGB_xy = /* From ITU-R BT.709-3 */ static int png_colorspace_set_xy_and_XYZ(png_const_structrp png_ptr, - png_colorspacerp colorspace, const png_xy *xy, const png_XYZ *XYZ, - int preferred) + png_colorspacerp colorspace, const png_xy *xy, const png_XYZ *XYZ, + int preferred) { if ((colorspace->flags & PNG_COLORSPACE_INVALID) != 0) return 0; @@ -1682,7 +1683,7 @@ png_colorspace_set_xy_and_XYZ(png_const_structrp png_ptr, int /* PRIVATE */ png_colorspace_set_chromaticities(png_const_structrp png_ptr, - png_colorspacerp colorspace, const png_xy *xy, int preferred) + png_colorspacerp colorspace, const png_xy *xy, int preferred) { /* We must check the end points to ensure they are reasonable - in the past * color management systems have crashed as a result of getting bogus @@ -1696,7 +1697,7 @@ png_colorspace_set_chromaticities(png_const_structrp png_ptr, { case 0: /* success */ return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, xy, &XYZ, - preferred); + preferred); case 1: /* We can't invert the chromaticities so we can't produce value XYZ @@ -1719,7 +1720,7 @@ png_colorspace_set_chromaticities(png_const_structrp png_ptr, int /* PRIVATE */ png_colorspace_set_endpoints(png_const_structrp png_ptr, - png_colorspacerp colorspace, const png_XYZ *XYZ_in, int preferred) + png_colorspacerp colorspace, const png_XYZ *XYZ_in, int preferred) { png_XYZ XYZ = *XYZ_in; png_xy xy; @@ -1728,7 +1729,7 @@ png_colorspace_set_endpoints(png_const_structrp png_ptr, { case 0: return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, &xy, &XYZ, - preferred); + preferred); case 1: /* End points are invalid. */ @@ -1785,7 +1786,7 @@ is_ICC_signature(png_alloc_size_t it) static int png_icc_profile_error(png_const_structrp png_ptr, png_colorspacerp colorspace, - png_const_charp name, png_alloc_size_t value, png_const_charp reason) + png_const_charp name, png_alloc_size_t value, png_const_charp reason) { size_t pos; char message[196]; /* see below for calculation */ @@ -1810,8 +1811,8 @@ png_icc_profile_error(png_const_structrp png_ptr, png_colorspacerp colorspace, char number[PNG_NUMBER_BUFFER_SIZE]; /* +24 = 114*/ pos = png_safecat(message, (sizeof message), pos, - png_format_number(number, number+(sizeof number), - PNG_NUMBER_FORMAT_x, value)); + png_format_number(number, number+(sizeof number), + PNG_NUMBER_FORMAT_x, value)); pos = png_safecat(message, (sizeof message), pos, "h: "); /*+2 = 116*/ } # endif @@ -1825,7 +1826,7 @@ png_icc_profile_error(png_const_structrp png_ptr, png_colorspacerp colorspace, * application errors the PNG won't be written.) */ png_chunk_report(png_ptr, message, - (colorspace != NULL) ? PNG_CHUNK_ERROR : PNG_CHUNK_WRITE_ERROR); + (colorspace != NULL) ? PNG_CHUNK_ERROR : PNG_CHUNK_WRITE_ERROR); return 0; } @@ -1834,7 +1835,7 @@ png_icc_profile_error(png_const_structrp png_ptr, png_colorspacerp colorspace, #ifdef PNG_sRGB_SUPPORTED int /* PRIVATE */ png_colorspace_set_sRGB(png_const_structrp png_ptr, png_colorspacerp colorspace, - int intent) + int intent) { /* sRGB sets known gamma, end points and (from the chunk) intent. */ /* IMPORTANT: these are not necessarily the values found in an ICC profile @@ -1871,10 +1872,10 @@ png_colorspace_set_sRGB(png_const_structrp png_ptr, png_colorspacerp colorspace, */ if (intent < 0 || intent >= PNG_sRGB_INTENT_LAST) return png_icc_profile_error(png_ptr, colorspace, "sRGB", - (unsigned)intent, "invalid sRGB rendering intent"); + (unsigned)intent, "invalid sRGB rendering intent"); if ((colorspace->flags & PNG_COLORSPACE_HAVE_INTENT) != 0 && - colorspace->rendering_intent != intent) + colorspace->rendering_intent != intent) return png_icc_profile_error(png_ptr, colorspace, "sRGB", (unsigned)intent, "inconsistent rendering intents"); @@ -1888,8 +1889,8 @@ png_colorspace_set_sRGB(png_const_structrp png_ptr, png_colorspacerp colorspace, * warn but overwrite the value with the correct one. */ if ((colorspace->flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0 && - !png_colorspace_endpoints_match(&sRGB_xy, &colorspace->end_points_xy, - 100)) + !png_colorspace_endpoints_match(&sRGB_xy, &colorspace->end_points_xy, + 100)) png_chunk_report(png_ptr, "cHRM chunk does not match sRGB", PNG_CHUNK_ERROR); @@ -1897,7 +1898,7 @@ png_colorspace_set_sRGB(png_const_structrp png_ptr, png_colorspacerp colorspace, * returns true when the 'from' argument corresponds to sRGB (2). */ (void)png_colorspace_check_gamma(png_ptr, colorspace, PNG_GAMMA_sRGB_INVERSE, - 2/*from sRGB*/); + 2/*from sRGB*/); /* intent: bugs in GCC force 'int' to be used as the parameter type. */ colorspace->rendering_intent = (png_uint_16)intent; @@ -1932,19 +1933,19 @@ static const png_byte D50_nCIEXYZ[12] = int /* PRIVATE */ png_icc_check_length(png_const_structrp png_ptr, png_colorspacerp colorspace, - png_const_charp name, png_uint_32 profile_length) + png_const_charp name, png_uint_32 profile_length) { if (profile_length < 132) return png_icc_profile_error(png_ptr, colorspace, name, profile_length, - "too short"); + "too short"); return 1; } int /* PRIVATE */ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, - png_const_charp name, png_uint_32 profile_length, - png_const_bytep profile/* first 132 bytes only */, int color_type) + png_const_charp name, png_uint_32 profile_length, + png_const_bytep profile/* first 132 bytes only */, int color_type) { png_uint_32 temp; @@ -1956,18 +1957,18 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, temp = png_get_uint_32(profile); if (temp != profile_length) return png_icc_profile_error(png_ptr, colorspace, name, temp, - "length does not match profile"); + "length does not match profile"); temp = (png_uint_32) (*(profile+8)); if (temp > 3 && (profile_length & 3)) return png_icc_profile_error(png_ptr, colorspace, name, profile_length, - "invalid length"); + "invalid length"); temp = png_get_uint_32(profile+128); /* tag count: 12 bytes/tag */ if (temp > 357913930 || /* (2^32-4-132)/12: maximum possible tag count */ profile_length < 132+12*temp) /* truncated tag table */ return png_icc_profile_error(png_ptr, colorspace, name, temp, - "tag count too large"); + "tag count too large"); /* The 'intent' must be valid or we can't store it, ICC limits the intent to * 16 bits. @@ -1975,14 +1976,14 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, temp = png_get_uint_32(profile+64); if (temp >= 0xffff) /* The ICC limit */ return png_icc_profile_error(png_ptr, colorspace, name, temp, - "invalid rendering intent"); + "invalid rendering intent"); /* This is just a warning because the profile may be valid in future * versions. */ if (temp >= PNG_sRGB_INTENT_LAST) (void)png_icc_profile_error(png_ptr, NULL, name, temp, - "intent outside defined range"); + "intent outside defined range"); /* At this point the tag table can't be checked because it hasn't necessarily * been loaded; however, various header fields can be checked. These checks @@ -1999,7 +2000,7 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, temp = png_get_uint_32(profile+36); /* signature 'ascp' */ if (temp != 0x61637370) return png_icc_profile_error(png_ptr, colorspace, name, temp, - "invalid signature"); + "invalid signature"); /* Currently the PCS illuminant/adopted white point (the computational * white point) are required to be D50, @@ -2010,7 +2011,7 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, */ if (memcmp(profile+68, D50_nCIEXYZ, 12) != 0) (void)png_icc_profile_error(png_ptr, NULL, name, 0/*no tag value*/, - "PCS illuminant is not D50"); + "PCS illuminant is not D50"); /* The PNG spec requires this: * "If the iCCP chunk is present, the image samples conform to the colour @@ -2038,18 +2039,18 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, case 0x52474220: /* 'RGB ' */ if ((color_type & PNG_COLOR_MASK_COLOR) == 0) return png_icc_profile_error(png_ptr, colorspace, name, temp, - "RGB color space not permitted on grayscale PNG"); + "RGB color space not permitted on grayscale PNG"); break; case 0x47524159: /* 'GRAY' */ if ((color_type & PNG_COLOR_MASK_COLOR) != 0) return png_icc_profile_error(png_ptr, colorspace, name, temp, - "Gray color space not permitted on RGB PNG"); + "Gray color space not permitted on RGB PNG"); break; default: return png_icc_profile_error(png_ptr, colorspace, name, temp, - "invalid ICC profile color space"); + "invalid ICC profile color space"); } /* It is up to the application to check that the profile class matches the @@ -2074,7 +2075,7 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, case 0x61627374: /* 'abst' */ /* May not be embedded in an image */ return png_icc_profile_error(png_ptr, colorspace, name, temp, - "invalid embedded Abstract ICC profile"); + "invalid embedded Abstract ICC profile"); case 0x6c696e6b: /* 'link' */ /* DeviceLink profiles cannot be interpreted in a non-device specific @@ -2084,7 +2085,7 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, * PNG. */ return png_icc_profile_error(png_ptr, colorspace, name, temp, - "unexpected DeviceLink ICC profile class"); + "unexpected DeviceLink ICC profile class"); case 0x6e6d636c: /* 'nmcl' */ /* A NamedColor profile is also device specific, however it doesn't @@ -2092,7 +2093,7 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, * certainly it will fail the tests below. */ (void)png_icc_profile_error(png_ptr, NULL, name, temp, - "unexpected NamedColor ICC profile class"); + "unexpected NamedColor ICC profile class"); break; default: @@ -2102,7 +2103,7 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, * understood profiles. */ (void)png_icc_profile_error(png_ptr, NULL, name, temp, - "unrecognized ICC profile class"); + "unrecognized ICC profile class"); break; } @@ -2118,7 +2119,7 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, default: return png_icc_profile_error(png_ptr, colorspace, name, temp, - "unexpected ICC PCS encoding"); + "unexpected ICC PCS encoding"); } return 1; @@ -2126,8 +2127,8 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, int /* PRIVATE */ png_icc_check_tag_table(png_const_structrp png_ptr, png_colorspacerp colorspace, - png_const_charp name, png_uint_32 profile_length, - png_const_bytep profile /* header plus whole tag table */) + png_const_charp name, png_uint_32 profile_length, + png_const_bytep profile /* header plus whole tag table */) { png_uint_32 tag_count = png_get_uint_32(profile+128); png_uint_32 itag; @@ -2155,7 +2156,7 @@ png_icc_check_tag_table(png_const_structrp png_ptr, png_colorspacerp colorspace, * alignment. */ (void)png_icc_profile_error(png_ptr, NULL, name, tag_id, - "ICC profile tag start not a multiple of 4"); + "ICC profile tag start not a multiple of 4"); } /* This is a hard error; potentially it can cause read outside the @@ -2163,7 +2164,7 @@ png_icc_check_tag_table(png_const_structrp png_ptr, png_colorspacerp colorspace, */ if (tag_start > profile_length || tag_length > profile_length - tag_start) return png_icc_profile_error(png_ptr, colorspace, name, tag_id, - "ICC profile tag outside profile"); + "ICC profile tag outside profile"); } return 1; /* success, maybe with warnings */ @@ -2191,22 +2192,22 @@ static const struct */ /* adler32, crc32, MD5[4], intent, date, length, file-name */ PNG_ICC_CHECKSUM(0x0a3fd9f6, 0x3b8772b9, - PNG_MD5(0x29f83dde, 0xaff255ae, 0x7842fae4, 0xca83390d), 0, 0, - "2009/03/27 21:36:31", 3048, "sRGB_IEC61966-2-1_black_scaled.icc") + PNG_MD5(0x29f83dde, 0xaff255ae, 0x7842fae4, 0xca83390d), 0, 0, + "2009/03/27 21:36:31", 3048, "sRGB_IEC61966-2-1_black_scaled.icc") /* ICC sRGB v2 perceptual no black-compensation: */ PNG_ICC_CHECKSUM(0x4909e5e1, 0x427ebb21, - PNG_MD5(0xc95bd637, 0xe95d8a3b, 0x0df38f99, 0xc1320389), 1, 0, - "2009/03/27 21:37:45", 3052, "sRGB_IEC61966-2-1_no_black_scaling.icc") + PNG_MD5(0xc95bd637, 0xe95d8a3b, 0x0df38f99, 0xc1320389), 1, 0, + "2009/03/27 21:37:45", 3052, "sRGB_IEC61966-2-1_no_black_scaling.icc") PNG_ICC_CHECKSUM(0xfd2144a1, 0x306fd8ae, - PNG_MD5(0xfc663378, 0x37e2886b, 0xfd72e983, 0x8228f1b8), 0, 0, - "2009/08/10 17:28:01", 60988, "sRGB_v4_ICC_preference_displayclass.icc") + PNG_MD5(0xfc663378, 0x37e2886b, 0xfd72e983, 0x8228f1b8), 0, 0, + "2009/08/10 17:28:01", 60988, "sRGB_v4_ICC_preference_displayclass.icc") /* ICC sRGB v4 perceptual */ PNG_ICC_CHECKSUM(0x209c35d2, 0xbbef7812, - PNG_MD5(0x34562abf, 0x994ccd06, 0x6d2c5721, 0xd0d68c5d), 0, 0, - "2007/07/25 00:05:37", 60960, "sRGB_v4_ICC_preference.icc") + PNG_MD5(0x34562abf, 0x994ccd06, 0x6d2c5721, 0xd0d68c5d), 0, 0, + "2007/07/25 00:05:37", 60960, "sRGB_v4_ICC_preference.icc") /* The following profiles have no known MD5 checksum. If there is a match * on the (empty) MD5 the other fields are used to attempt a match and @@ -2214,8 +2215,8 @@ static const struct * which suggests that they were also made by Hewlett Packard. */ PNG_ICC_CHECKSUM(0xa054d762, 0x5d5129ce, - PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 1, 0, - "2004/07/21 18:57:42", 3024, "sRGB_IEC61966-2-1_noBPC.icc") + PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 1, 0, + "2004/07/21 18:57:42", 3024, "sRGB_IEC61966-2-1_noBPC.icc") /* This is a 'mntr' (display) profile with a mediaWhitePointTag that does not * match the D50 PCS illuminant in the header (it is in fact the D65 values, @@ -2225,17 +2226,17 @@ static const struct * chromaticAdaptationTag. */ PNG_ICC_CHECKSUM(0xf784f3fb, 0x182ea552, - PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 0, 1/*broken*/, - "1998/02/09 06:49:00", 3144, "HP-Microsoft sRGB v2 perceptual") + PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 0, 1/*broken*/, + "1998/02/09 06:49:00", 3144, "HP-Microsoft sRGB v2 perceptual") PNG_ICC_CHECKSUM(0x0398f3fc, 0xf29e526d, - PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 1, 1/*broken*/, - "1998/02/09 06:49:00", 3144, "HP-Microsoft sRGB v2 media-relative") + PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 1, 1/*broken*/, + "1998/02/09 06:49:00", 3144, "HP-Microsoft sRGB v2 media-relative") }; static int png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr, - png_const_bytep profile, uLong adler) + png_const_bytep profile, uLong adler) { /* The quick check is to verify just the MD5 signature and trust the * rest of the data. Because the profile has already been verified for @@ -2319,7 +2320,7 @@ png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr, * which is made irrelevant by this error. */ png_chunk_report(png_ptr, "known incorrect sRGB profile", - PNG_CHUNK_ERROR); + PNG_CHUNK_ERROR); } /* Warn that this being done; this isn't even an error since @@ -2329,8 +2330,8 @@ png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr, else if (png_sRGB_checks[i].have_md5 == 0) { png_chunk_report(png_ptr, - "out-of-date sRGB profile with no signature", - PNG_CHUNK_WARNING); + "out-of-date sRGB profile with no signature", + PNG_CHUNK_WARNING); } return 1+png_sRGB_checks[i].is_broken; @@ -2343,7 +2344,7 @@ png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr, * Fall through to "no match". */ png_chunk_report(png_ptr, - "Not recognizing known sRGB profile that has been edited", + "Not recognizing known sRGB profile that has been edited", PNG_CHUNK_WARNING); break; # endif @@ -2353,38 +2354,36 @@ png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr, return 0; /* no match */ } -#endif /* PNG_sRGB_PROFILE_CHECKS >= 0 */ void /* PRIVATE */ png_icc_set_sRGB(png_const_structrp png_ptr, - png_colorspacerp colorspace, png_const_bytep profile, uLong adler) + png_colorspacerp colorspace, png_const_bytep profile, uLong adler) { /* Is this profile one of the known ICC sRGB profiles? If it is, just set * the sRGB information. */ -#if PNG_sRGB_PROFILE_CHECKS >= 0 if (png_compare_ICC_profile_with_sRGB(png_ptr, profile, adler) != 0) -#endif (void)png_colorspace_set_sRGB(png_ptr, colorspace, (int)/*already checked*/png_get_uint_32(profile+64)); } +#endif /* PNG_sRGB_PROFILE_CHECKS >= 0 */ #endif /* sRGB */ int /* PRIVATE */ png_colorspace_set_ICC(png_const_structrp png_ptr, png_colorspacerp colorspace, - png_const_charp name, png_uint_32 profile_length, png_const_bytep profile, - int color_type) + png_const_charp name, png_uint_32 profile_length, png_const_bytep profile, + int color_type) { if ((colorspace->flags & PNG_COLORSPACE_INVALID) != 0) return 0; if (png_icc_check_length(png_ptr, colorspace, name, profile_length) != 0 && png_icc_check_header(png_ptr, colorspace, name, profile_length, profile, - color_type) != 0 && + color_type) != 0 && png_icc_check_tag_table(png_ptr, colorspace, name, profile_length, - profile) != 0) + profile) != 0) { -# ifdef PNG_sRGB_SUPPORTED +# if defined(PNG_sRGB_SUPPORTED) && PNG_sRGB_PROFILE_CHECKS >= 0 /* If no sRGB support, don't try storing sRGB information */ png_icc_set_sRGB(png_ptr, colorspace, profile, 0); # endif @@ -2443,7 +2442,7 @@ png_colorspace_set_rgb_coefficients(png_structrp png_ptr) /* Check for an internal error. */ if (r+g+b != 32768) png_error(png_ptr, - "internal error handling cHRM coefficients"); + "internal error handling cHRM coefficients"); else { @@ -2469,7 +2468,7 @@ png_colorspace_set_rgb_coefficients(png_structrp png_ptr) static int /* PRIVATE */ png_gt(size_t a, size_t b) { - return a > b; + return a > b; } #else # define png_gt(a,b) ((a) > (b)) @@ -2477,9 +2476,9 @@ png_gt(size_t a, size_t b) void /* PRIVATE */ png_check_IHDR(png_const_structrp png_ptr, - png_uint_32 width, png_uint_32 height, int bit_depth, - int color_type, int interlace_type, int compression_type, - int filter_type) + png_uint_32 width, png_uint_32 height, int bit_depth, + int color_type, int interlace_type, int compression_type, + int filter_type) { int error = 0; @@ -2642,7 +2641,7 @@ png_check_IHDR(png_const_structrp png_ptr, int /* PRIVATE */ png_check_fp_number(png_const_charp string, png_size_t size, int *statep, - png_size_tp whereami) + png_size_tp whereami) { int state = *statep; png_size_t i = *whereami; @@ -3805,25 +3804,25 @@ png_gamma_16bit_correct(unsigned int value, png_fixed_point gamma_val) { if (value > 0 && value < 65535) { -# ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED - /* The same (unsigned int)->(double) constraints apply here as above, - * however in this case the (unsigned int) to (int) conversion can - * overflow on an ANSI-C90 compliant system so the cast needs to ensure - * that this is not possible. - */ - double r = floor(65535*pow((png_int_32)value/65535., - gamma_val*.00001)+.5); - return (png_uint_16)r; -# else - png_int_32 lg2 = png_log16bit(value); - png_fixed_point res; +# ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED + /* The same (unsigned int)->(double) constraints apply here as above, + * however in this case the (unsigned int) to (int) conversion can + * overflow on an ANSI-C90 compliant system so the cast needs to ensure + * that this is not possible. + */ + double r = floor(65535*pow((png_int_32)value/65535., + gamma_val*.00001)+.5); + return (png_uint_16)r; +# else + png_int_32 lg2 = png_log16bit(value); + png_fixed_point res; - if (png_muldiv(&res, gamma_val, lg2, PNG_FP_1) != 0) - return png_exp16bit(res); + if (png_muldiv(&res, gamma_val, lg2, PNG_FP_1) != 0) + return png_exp16bit(res); - /* Overflow. */ - value = 0; -# endif + /* Overflow. */ + value = 0; +# endif } return (png_uint_16)value; @@ -3862,7 +3861,7 @@ png_gamma_correct(png_structrp png_ptr, unsigned int value, */ static void png_build_16bit_table(png_structrp png_ptr, png_uint_16pp *ptable, - PNG_CONST unsigned int shift, PNG_CONST png_fixed_point gamma_val) + PNG_CONST unsigned int shift, PNG_CONST png_fixed_point gamma_val) { /* Various values derived from 'shift': */ PNG_CONST unsigned int num = 1U << (8U - shift); @@ -3939,7 +3938,7 @@ png_build_16bit_table(png_structrp png_ptr, png_uint_16pp *ptable, */ static void png_build_16to8_table(png_structrp png_ptr, png_uint_16pp *ptable, - PNG_CONST unsigned int shift, PNG_CONST png_fixed_point gamma_val) + PNG_CONST unsigned int shift, PNG_CONST png_fixed_point gamma_val) { PNG_CONST unsigned int num = 1U << (8U - shift); PNG_CONST unsigned int max = (1U << (16U - shift))-1U; @@ -4007,7 +4006,7 @@ png_build_16to8_table(png_structrp png_ptr, png_uint_16pp *ptable, */ static void png_build_8bit_table(png_structrp png_ptr, png_bytepp ptable, - PNG_CONST png_fixed_point gamma_val) + PNG_CONST png_fixed_point gamma_val) { unsigned int i; png_bytep table = *ptable = (png_bytep)png_malloc(png_ptr, 256); @@ -4087,131 +4086,133 @@ png_destroy_gamma_table(png_structrp png_ptr) void /* PRIVATE */ png_build_gamma_table(png_structrp png_ptr, int bit_depth) { - png_debug(1, "in png_build_gamma_table"); + png_debug(1, "in png_build_gamma_table"); - /* Remove any existing table; this copes with multiple calls to - * png_read_update_info. The warning is because building the gamma tables - * multiple times is a performance hit - it's harmless but the ability to call - * png_read_update_info() multiple times is new in 1.5.6 so it seems sensible - * to warn if the app introduces such a hit. - */ - if (png_ptr->gamma_table != NULL || png_ptr->gamma_16_table != NULL) - { - png_warning(png_ptr, "gamma table being rebuilt"); - png_destroy_gamma_table(png_ptr); - } + /* Remove any existing table; this copes with multiple calls to + * png_read_update_info. The warning is because building the gamma tables + * multiple times is a performance hit - it's harmless but the ability to + * call png_read_update_info() multiple times is new in 1.5.6 so it seems + * sensible to warn if the app introduces such a hit. + */ + if (png_ptr->gamma_table != NULL || png_ptr->gamma_16_table != NULL) + { + png_warning(png_ptr, "gamma table being rebuilt"); + png_destroy_gamma_table(png_ptr); + } - if (bit_depth <= 8) - { - png_build_8bit_table(png_ptr, &png_ptr->gamma_table, - png_ptr->screen_gamma > 0 ? png_reciprocal2(png_ptr->colorspace.gamma, - png_ptr->screen_gamma) : PNG_FP_1); + if (bit_depth <= 8) + { + png_build_8bit_table(png_ptr, &png_ptr->gamma_table, + png_ptr->screen_gamma > 0 ? + png_reciprocal2(png_ptr->colorspace.gamma, + png_ptr->screen_gamma) : PNG_FP_1); #if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \ defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if ((png_ptr->transformations & (PNG_COMPOSE | PNG_RGB_TO_GRAY)) != 0) - { - png_build_8bit_table(png_ptr, &png_ptr->gamma_to_1, - png_reciprocal(png_ptr->colorspace.gamma)); + if ((png_ptr->transformations & (PNG_COMPOSE | PNG_RGB_TO_GRAY)) != 0) + { + png_build_8bit_table(png_ptr, &png_ptr->gamma_to_1, + png_reciprocal(png_ptr->colorspace.gamma)); - png_build_8bit_table(png_ptr, &png_ptr->gamma_from_1, - png_ptr->screen_gamma > 0 ? png_reciprocal(png_ptr->screen_gamma) : - png_ptr->colorspace.gamma/* Probably doing rgb_to_gray */); - } + png_build_8bit_table(png_ptr, &png_ptr->gamma_from_1, + png_ptr->screen_gamma > 0 ? + png_reciprocal(png_ptr->screen_gamma) : + png_ptr->colorspace.gamma/* Probably doing rgb_to_gray */); + } #endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */ - } + } #ifdef PNG_16BIT_SUPPORTED - else - { - png_byte shift, sig_bit; + else + { + png_byte shift, sig_bit; - if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) != 0) - { - sig_bit = png_ptr->sig_bit.red; + if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) != 0) + { + sig_bit = png_ptr->sig_bit.red; - if (png_ptr->sig_bit.green > sig_bit) - sig_bit = png_ptr->sig_bit.green; + if (png_ptr->sig_bit.green > sig_bit) + sig_bit = png_ptr->sig_bit.green; - if (png_ptr->sig_bit.blue > sig_bit) - sig_bit = png_ptr->sig_bit.blue; - } - else - sig_bit = png_ptr->sig_bit.gray; + if (png_ptr->sig_bit.blue > sig_bit) + sig_bit = png_ptr->sig_bit.blue; + } + else + sig_bit = png_ptr->sig_bit.gray; - /* 16-bit gamma code uses this equation: - * - * ov = table[(iv & 0xff) >> gamma_shift][iv >> 8] - * - * Where 'iv' is the input color value and 'ov' is the output value - - * pow(iv, gamma). - * - * Thus the gamma table consists of up to 256 256-entry tables. The table - * is selected by the (8-gamma_shift) most significant of the low 8 bits of - * the color value then indexed by the upper 8 bits: - * - * table[low bits][high 8 bits] - * - * So the table 'n' corresponds to all those 'iv' of: - * - * ..<(n+1 << gamma_shift)-1> - * - */ - if (sig_bit > 0 && sig_bit < 16U) - /* shift == insignificant bits */ - shift = (png_byte)((16U - sig_bit) & 0xff); + /* 16-bit gamma code uses this equation: + * + * ov = table[(iv & 0xff) >> gamma_shift][iv >> 8] + * + * Where 'iv' is the input color value and 'ov' is the output value - + * pow(iv, gamma). + * + * Thus the gamma table consists of up to 256 256-entry tables. The table + * is selected by the (8-gamma_shift) most significant of the low 8 bits + * of the color value then indexed by the upper 8 bits: + * + * table[low bits][high 8 bits] + * + * So the table 'n' corresponds to all those 'iv' of: + * + * ..<(n+1 << gamma_shift)-1> + * + */ + if (sig_bit > 0 && sig_bit < 16U) + /* shift == insignificant bits */ + shift = (png_byte)((16U - sig_bit) & 0xff); - else - shift = 0; /* keep all 16 bits */ + else + shift = 0; /* keep all 16 bits */ - if ((png_ptr->transformations & (PNG_16_TO_8 | PNG_SCALE_16_TO_8)) != 0) - { - /* PNG_MAX_GAMMA_8 is the number of bits to keep - effectively - * the significant bits in the *input* when the output will - * eventually be 8 bits. By default it is 11. - */ - if (shift < (16U - PNG_MAX_GAMMA_8)) - shift = (16U - PNG_MAX_GAMMA_8); - } + if ((png_ptr->transformations & (PNG_16_TO_8 | PNG_SCALE_16_TO_8)) != 0) + { + /* PNG_MAX_GAMMA_8 is the number of bits to keep - effectively + * the significant bits in the *input* when the output will + * eventually be 8 bits. By default it is 11. + */ + if (shift < (16U - PNG_MAX_GAMMA_8)) + shift = (16U - PNG_MAX_GAMMA_8); + } - if (shift > 8U) - shift = 8U; /* Guarantees at least one table! */ + if (shift > 8U) + shift = 8U; /* Guarantees at least one table! */ - png_ptr->gamma_shift = shift; + png_ptr->gamma_shift = shift; - /* NOTE: prior to 1.5.4 this test used to include PNG_BACKGROUND (now - * PNG_COMPOSE). This effectively smashed the background calculation for - * 16-bit output because the 8-bit table assumes the result will be reduced - * to 8 bits. - */ - if ((png_ptr->transformations & (PNG_16_TO_8 | PNG_SCALE_16_TO_8)) != 0) - png_build_16to8_table(png_ptr, &png_ptr->gamma_16_table, shift, - png_ptr->screen_gamma > 0 ? png_product2(png_ptr->colorspace.gamma, - png_ptr->screen_gamma) : PNG_FP_1); + /* NOTE: prior to 1.5.4 this test used to include PNG_BACKGROUND (now + * PNG_COMPOSE). This effectively smashed the background calculation for + * 16-bit output because the 8-bit table assumes the result will be + * reduced to 8 bits. + */ + if ((png_ptr->transformations & (PNG_16_TO_8 | PNG_SCALE_16_TO_8)) != 0) + png_build_16to8_table(png_ptr, &png_ptr->gamma_16_table, shift, + png_ptr->screen_gamma > 0 ? png_product2(png_ptr->colorspace.gamma, + png_ptr->screen_gamma) : PNG_FP_1); - else - png_build_16bit_table(png_ptr, &png_ptr->gamma_16_table, shift, - png_ptr->screen_gamma > 0 ? png_reciprocal2(png_ptr->colorspace.gamma, - png_ptr->screen_gamma) : PNG_FP_1); + else + png_build_16bit_table(png_ptr, &png_ptr->gamma_16_table, shift, + png_ptr->screen_gamma > 0 ? png_reciprocal2(png_ptr->colorspace.gamma, + png_ptr->screen_gamma) : PNG_FP_1); #if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \ defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if ((png_ptr->transformations & (PNG_COMPOSE | PNG_RGB_TO_GRAY)) != 0) - { - png_build_16bit_table(png_ptr, &png_ptr->gamma_16_to_1, shift, - png_reciprocal(png_ptr->colorspace.gamma)); + if ((png_ptr->transformations & (PNG_COMPOSE | PNG_RGB_TO_GRAY)) != 0) + { + png_build_16bit_table(png_ptr, &png_ptr->gamma_16_to_1, shift, + png_reciprocal(png_ptr->colorspace.gamma)); - /* Notice that the '16 from 1' table should be full precision, however - * the lookup on this table still uses gamma_shift, so it can't be. - * TODO: fix this. - */ - png_build_16bit_table(png_ptr, &png_ptr->gamma_16_from_1, shift, - png_ptr->screen_gamma > 0 ? png_reciprocal(png_ptr->screen_gamma) : - png_ptr->colorspace.gamma/* Probably doing rgb_to_gray */); - } + /* Notice that the '16 from 1' table should be full precision, however + * the lookup on this table still uses gamma_shift, so it can't be. + * TODO: fix this. + */ + png_build_16bit_table(png_ptr, &png_ptr->gamma_16_from_1, shift, + png_ptr->screen_gamma > 0 ? png_reciprocal(png_ptr->screen_gamma) : + png_ptr->colorspace.gamma/* Probably doing rgb_to_gray */); + } #endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */ - } + } #endif /* 16BIT */ } #endif /* READ_GAMMA */ diff --git a/3rdparty/libpng/png.h b/3rdparty/libpng/png.h index c83051b1ca..ebfb3dd02e 100644 --- a/3rdparty/libpng/png.h +++ b/3rdparty/libpng/png.h @@ -1,9 +1,9 @@ /* png.h - header file for PNG reference library * - * libpng version 1.6.19, November 12, 2015 + * libpng version 1.6.24, August 4, 2016 * - * Copyright (c) 1998-2015 Glenn Randers-Pehrson + * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -12,7 +12,8 @@ * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.6.19, November 12, 2015: Glenn + * libpng versions 0.97, January 1998, through 1.6.24, August 4, 2016: + * Glenn Randers-Pehrson. * See also "Contributing Authors", below. */ @@ -24,8 +25,12 @@ * * This code is released under the libpng license. * - * libpng versions 1.0.7, July 1, 2000, through 1.6.19, November 12, 2015, are - * Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, are + * Some files in the "contrib" directory and some configure-generated + * files that are distributed with libpng have other copyright owners and + * are released under other open source licenses. + * + * libpng versions 1.0.7, July 1, 2000 through 1.6.24, August 4, 2016 are + * Copyright (c) 2000-2002, 2004, 2006-2016 Glenn Randers-Pehrson, are * derived from libpng-1.0.6, and are distributed according to the same * disclaimer and license as libpng-1.0.6 with the following individuals * added to the list of Contributing Authors: @@ -46,6 +51,10 @@ * risk of satisfactory quality, performance, accuracy, and effort is with * the user. * + * Some files in the "contrib" directory have other copyright owners and + * are released under other open source licenses. + * + * * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are * Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from * libpng-0.96, and are distributed according to the same disclaimer and @@ -56,6 +65,9 @@ * Glenn Randers-Pehrson * Willem van Schaik * + * Some files in the "scripts" directory have different copyright owners + * but are also released under this license. + * * libpng versions 0.89, June 1996, through 0.96, May 1997, are * Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, * and are distributed according to the same disclaimer and license as @@ -69,6 +81,9 @@ * Greg Roelofs * Tom Tanner * + * Some files in the "scripts" directory have other copyright owners + * but are released under this license. + * * libpng versions 0.5, May 1995, through 0.88, January 1996, are * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * @@ -108,6 +123,29 @@ * appreciated. * * END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. + * + * TRADEMARK: + * + * The name "libpng" has not been registered by the Copyright owner + * as a trademark in any jurisdiction. However, because libpng has + * been distributed and maintained world-wide, continually since 1995, + * the Copyright owner claims "common-law trademark protection" in any + * jurisdiction where common-law trademark is recognized. + * + * OSI CERTIFICATION: + * + * Libpng is OSI Certified Open Source Software. OSI Certified Open Source is + * a certification mark of the Open Source Initiative. OSI has not addressed + * the additional disclaimers inserted at version 1.0.7. + * + * EXPORT CONTROL: + * + * The Copyright owner believes that the Export Control Classification + * Number (ECCN) for libpng is EAR99, which means not subject to export + * controls or International Traffic in Arms Regulations (ITAR) because + * it is open source, publicly available software, that does not contain + * any encryption software. See the EAR, paragraphs 734.3(b)(3) and + * 734.7(b). */ /* @@ -120,12 +158,6 @@ * files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). */ -/* - * Libpng is OSI Certified Open Source Software. OSI Certified Open Source is - * a certification mark of the Open Source Initiative. OSI has not addressed - * the additional disclaimers inserted at version 1.0.7. - */ - /* * The contributing authors would like to thank all those who helped * with testing, bug fixes, and patience. This wouldn't have been @@ -181,11 +213,11 @@ * ... * 1.0.19 10 10019 10.so.0.19[.0] * ... - * 1.2.53 13 10253 12.so.0.53[.0] + * 1.2.56 13 10256 12.so.0.56[.0] * ... - * 1.5.23 15 10523 15.so.15.23[.0] + * 1.5.27 15 10527 15.so.15.27[.0] * ... - * 1.6.19 16 10619 16.so.16.19[.0] + * 1.6.24 16 10624 16.so.16.24[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be @@ -213,13 +245,13 @@ * Y2K compliance in libpng: * ========================= * - * November 12, 2015 + * August 4, 2016 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. * * This is your unofficial assurance that libpng from version 0.71 and - * upward through 1.6.19 are Y2K compliant. It is my belief that + * upward through 1.6.24 are Y2K compliant. It is my belief that * earlier versions were also Y2K compliant. * * Libpng only has two year fields. One is a 2-byte unsigned integer @@ -281,9 +313,8 @@ */ /* Version information for png.h - this should match the version in png.c */ -#define PNG_LIBPNG_VER_STRING "1.6.19" -#define PNG_HEADER_VERSION_STRING \ - " libpng version 1.6.19 - November 12, 2015\n" +#define PNG_LIBPNG_VER_STRING "1.6.24" +#define PNG_HEADER_VERSION_STRING " libpng version 1.6.24 - August 4, 2016\n" #define PNG_LIBPNG_VER_SONUM 16 #define PNG_LIBPNG_VER_DLLNUM 16 @@ -291,7 +322,7 @@ /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ #define PNG_LIBPNG_VER_MAJOR 1 #define PNG_LIBPNG_VER_MINOR 6 -#define PNG_LIBPNG_VER_RELEASE 19 +#define PNG_LIBPNG_VER_RELEASE 24 /* This should match the numeric part of the final component of * PNG_LIBPNG_VER_STRING, omitting any leading zero: @@ -322,20 +353,20 @@ * version 1.0.0 was mis-numbered 100 instead of 10000). From * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */ -#define PNG_LIBPNG_VER 10619 /* 1.6.19 */ +#define PNG_LIBPNG_VER 10624 /* 1.6.24 */ /* Library configuration: these options cannot be changed after * the library has been built. */ #ifndef PNGLCONF_H - /* If pnglibconf.h is missing, you can - * copy scripts/pnglibconf.h.prebuilt to pnglibconf.h - */ +/* If pnglibconf.h is missing, you can + * copy scripts/pnglibconf.h.prebuilt to pnglibconf.h + */ # include "pnglibconf.h" #endif #ifndef PNG_VERSION_INFO_ONLY - /* Machine specific configuration. */ +/* Machine specific configuration. */ # include "pngconf.h" #endif @@ -432,7 +463,7 @@ extern "C" { /* This triggers a compiler error in png.c, if png.c and png.h * do not agree upon the version number. */ -typedef char* png_libpng_version_1_6_19; +typedef char* png_libpng_version_1_6_24; /* Basic control structions. Read libpng-manual.txt or libpng.3 for more info. * @@ -625,17 +656,17 @@ typedef png_time * * png_timepp; */ typedef struct png_unknown_chunk_t { - png_byte name[5]; /* Textual chunk name with '\0' terminator */ - png_byte *data; /* Data, should not be modified on read! */ - png_size_t size; + png_byte name[5]; /* Textual chunk name with '\0' terminator */ + png_byte *data; /* Data, should not be modified on read! */ + png_size_t size; - /* On write 'location' must be set using the flag values listed below. - * Notice that on read it is set by libpng however the values stored have - * more bits set than are listed below. Always treat the value as a - * bitmask. On write set only one bit - setting multiple bits may cause the - * chunk to be written in multiple places. - */ - png_byte location; /* mode of operation at read time */ + /* On write 'location' must be set using the flag values listed below. + * Notice that on read it is set by libpng however the values stored have + * more bits set than are listed below. Always treat the value as a + * bitmask. On write set only one bit - setting multiple bits may cause the + * chunk to be written in multiple places. + */ + png_byte location; /* mode of operation at read time */ } png_unknown_chunk; @@ -733,24 +764,22 @@ typedef png_unknown_chunk * * png_unknown_chunkpp; * data in the info_struct to be written into the output file. The values * of the PNG_INFO_ defines should NOT be changed. */ -#define PNG_INFO_gAMA 0x0001 -#define PNG_INFO_sBIT 0x0002 -#define PNG_INFO_cHRM 0x0004 -#define PNG_INFO_PLTE 0x0008 -#define PNG_INFO_tRNS 0x0010 -#define PNG_INFO_bKGD 0x0020 -#define PNG_INFO_hIST 0x0040 -#define PNG_INFO_pHYs 0x0080 -#define PNG_INFO_oFFs 0x0100 -#define PNG_INFO_tIME 0x0200 -#define PNG_INFO_pCAL 0x0400 -#define PNG_INFO_sRGB 0x0800 /* GR-P, 0.96a */ -#define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */ -#define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ -#define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ -#if INT_MAX >= 0x8000 /* else this might break */ -#define PNG_INFO_IDAT 0x8000 /* ESR, 1.0.6 */ -#endif +#define PNG_INFO_gAMA 0x0001U +#define PNG_INFO_sBIT 0x0002U +#define PNG_INFO_cHRM 0x0004U +#define PNG_INFO_PLTE 0x0008U +#define PNG_INFO_tRNS 0x0010U +#define PNG_INFO_bKGD 0x0020U +#define PNG_INFO_hIST 0x0040U +#define PNG_INFO_pHYs 0x0080U +#define PNG_INFO_oFFs 0x0100U +#define PNG_INFO_tIME 0x0200U +#define PNG_INFO_pCAL 0x0400U +#define PNG_INFO_sRGB 0x0800U /* GR-P, 0.96a */ +#define PNG_INFO_iCCP 0x1000U /* ESR, 1.0.6 */ +#define PNG_INFO_sPLT 0x2000U /* ESR, 1.0.6 */ +#define PNG_INFO_sCAL 0x4000U /* ESR, 1.0.6 */ +#define PNG_INFO_IDAT 0x8000U /* ESR, 1.0.6 */ /* This is used for the transformation routines, as some of them * change these values for the row. It also should enable using @@ -1321,7 +1350,7 @@ PNG_EXPORT(229, void, png_set_scale_16, (png_structrp png_ptr)); #endif #ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED -#define PNG_READ_16_TO_8 SUPPORTED /* Name prior to 1.5.4 */ +#define PNG_READ_16_TO_8_SUPPORTED /* Name prior to 1.5.4 */ /* Strip the second byte of information from a 16-bit depth file. */ PNG_EXPORT(48, void, png_set_strip_16, (png_structrp png_ptr)); #endif @@ -1472,8 +1501,8 @@ PNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method, #define PNG_FILTER_UP 0x20 #define PNG_FILTER_AVG 0x40 #define PNG_FILTER_PAETH 0x80 -#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \ - PNG_FILTER_AVG | PNG_FILTER_PAETH) +#define PNG_FAST_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP) +#define PNG_ALL_FILTERS (PNG_FAST_FILTERS | PNG_FILTER_AVG | PNG_FILTER_PAETH) /* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. * These defines should NOT be changed. @@ -1750,21 +1779,21 @@ PNG_EXPORT(99, void, png_data_freer, (png_const_structrp png_ptr, #define PNG_SET_WILL_FREE_DATA 1 #define PNG_USER_WILL_FREE_DATA 2 /* Flags for png_ptr->free_me and info_ptr->free_me */ -#define PNG_FREE_HIST 0x0008 -#define PNG_FREE_ICCP 0x0010 -#define PNG_FREE_SPLT 0x0020 -#define PNG_FREE_ROWS 0x0040 -#define PNG_FREE_PCAL 0x0080 -#define PNG_FREE_SCAL 0x0100 +#define PNG_FREE_HIST 0x0008U +#define PNG_FREE_ICCP 0x0010U +#define PNG_FREE_SPLT 0x0020U +#define PNG_FREE_ROWS 0x0040U +#define PNG_FREE_PCAL 0x0080U +#define PNG_FREE_SCAL 0x0100U #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_FREE_UNKN 0x0200 +# define PNG_FREE_UNKN 0x0200U #endif -/* PNG_FREE_LIST 0x0400 removed in 1.6.0 because it is ignored */ -#define PNG_FREE_PLTE 0x1000 -#define PNG_FREE_TRNS 0x2000 -#define PNG_FREE_TEXT 0x4000 -#define PNG_FREE_ALL 0x7fff -#define PNG_FREE_MUL 0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ +/* PNG_FREE_LIST 0x0400U removed in 1.6.0 because it is ignored */ +#define PNG_FREE_PLTE 0x1000U +#define PNG_FREE_TRNS 0x2000U +#define PNG_FREE_TEXT 0x4000U +#define PNG_FREE_ALL 0x7fffU +#define PNG_FREE_MUL 0x4220U /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ #ifdef PNG_USER_MEM_SUPPORTED PNG_EXPORTA(100, png_voidp, png_malloc_default, (png_const_structrp png_ptr, @@ -2270,8 +2299,10 @@ PNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr, * except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to * be processed by libpng. */ +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED PNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr, int keep, png_const_bytep chunk_list, int num_chunks)); +#endif /* HANDLE_AS_UNKNOWN */ /* The "keep" PNG_HANDLE_CHUNK_ parameter for the specified chunk is returned; * the result is therefore true (non-zero) if special handling is required, @@ -2279,7 +2310,7 @@ PNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr, */ PNG_EXPORT(173, int, png_handle_as_unknown, (png_const_structrp png_ptr, png_const_bytep chunk_name)); -#endif +#endif /* SET_UNKNOWN_CHUNKS */ #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED PNG_EXPORT(174, void, png_set_unknown_chunks, (png_const_structrp png_ptr, @@ -2500,33 +2531,37 @@ PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type, /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ -# define png_composite(composite, fg, alpha, bg) \ - { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \ - * (png_uint_16)(alpha) \ - + (png_uint_16)(bg)*(png_uint_16)(255 \ - - (png_uint_16)(alpha)) + 128); \ - (composite) = (png_byte)(((temp + (temp >> 8)) >> 8) & 0xff); } +# define png_composite(composite, fg, alpha, bg) \ + { \ + png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \ + * (png_uint_16)(alpha) \ + + (png_uint_16)(bg)*(png_uint_16)(255 \ + - (png_uint_16)(alpha)) + 128); \ + (composite) = (png_byte)(((temp + (temp >> 8)) >> 8) & 0xff); \ + } -# define png_composite_16(composite, fg, alpha, bg) \ - { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \ - * (png_uint_32)(alpha) \ - + (png_uint_32)(bg)*(65535 \ - - (png_uint_32)(alpha)) + 32768); \ - (composite) = (png_uint_16)(0xffff & ((temp + (temp >> 16)) >> 16)); } +# define png_composite_16(composite, fg, alpha, bg) \ + { \ + png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \ + * (png_uint_32)(alpha) \ + + (png_uint_32)(bg)*(65535 \ + - (png_uint_32)(alpha)) + 32768); \ + (composite) = (png_uint_16)(0xffff & ((temp + (temp >> 16)) >> 16)); \ + } #else /* Standard method using integer division */ -# define png_composite(composite, fg, alpha, bg) \ - (composite) = \ - (png_byte)(0xff & (((png_uint_16)(fg) * (png_uint_16)(alpha) + \ - (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ - 127) / 255)) +# define png_composite(composite, fg, alpha, bg) \ + (composite) = \ + (png_byte)(0xff & (((png_uint_16)(fg) * (png_uint_16)(alpha) + \ + (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ + 127) / 255)) -# define png_composite_16(composite, fg, alpha, bg) \ - (composite) = \ - (png_uint_16)(0xffff & (((png_uint_32)(fg) * (png_uint_32)(alpha) + \ - (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \ - 32767) / 65535)) +# define png_composite_16(composite, fg, alpha, bg) \ + (composite) = \ + (png_uint_16)(0xffff & (((png_uint_32)(fg) * (png_uint_32)(alpha) + \ + (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \ + 32767) / 65535)) #endif /* READ_COMPOSITE_NODIV */ #ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED @@ -2562,38 +2597,38 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); * format for negative values, which is almost certainly true. */ # define PNG_get_uint_32(buf) \ - (((png_uint_32)(*(buf)) << 24) + \ - ((png_uint_32)(*((buf) + 1)) << 16) + \ - ((png_uint_32)(*((buf) + 2)) << 8) + \ - ((png_uint_32)(*((buf) + 3)))) + (((png_uint_32)(*(buf)) << 24) + \ + ((png_uint_32)(*((buf) + 1)) << 16) + \ + ((png_uint_32)(*((buf) + 2)) << 8) + \ + ((png_uint_32)(*((buf) + 3)))) /* From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the * function) incorrectly returned a value of type png_uint_32. */ # define PNG_get_uint_16(buf) \ - ((png_uint_16) \ - (((unsigned int)(*(buf)) << 8) + \ - ((unsigned int)(*((buf) + 1))))) + ((png_uint_16) \ + (((unsigned int)(*(buf)) << 8) + \ + ((unsigned int)(*((buf) + 1))))) # define PNG_get_int_32(buf) \ - ((png_int_32)((*(buf) & 0x80) \ - ? -((png_int_32)(((png_get_uint_32(buf)^0xffffffffU)+1U)&0x7fffffffU)) \ - : (png_int_32)png_get_uint_32(buf))) + ((png_int_32)((*(buf) & 0x80) \ + ? -((png_int_32)(((png_get_uint_32(buf)^0xffffffffU)+1U)&0x7fffffffU)) \ + : (png_int_32)png_get_uint_32(buf))) - /* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h, - * but defining a macro name prefixed with PNG_PREFIX. - */ +/* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h, + * but defining a macro name prefixed with PNG_PREFIX. + */ # ifndef PNG_PREFIX -# define png_get_uint_32(buf) PNG_get_uint_32(buf) -# define png_get_uint_16(buf) PNG_get_uint_16(buf) -# define png_get_int_32(buf) PNG_get_int_32(buf) +# define png_get_uint_32(buf) PNG_get_uint_32(buf) +# define png_get_uint_16(buf) PNG_get_uint_16(buf) +# define png_get_int_32(buf) PNG_get_int_32(buf) # endif #else # ifdef PNG_PREFIX - /* No macros; revert to the (redefined) function */ -# define PNG_get_uint_32 (png_get_uint_32) -# define PNG_get_uint_16 (png_get_uint_16) -# define PNG_get_int_32 (png_get_int_32) + /* No macros; revert to the (redefined) function */ +# define PNG_get_uint_32 (png_get_uint_32) +# define PNG_get_uint_16 (png_get_uint_16) +# define PNG_get_int_32 (png_get_int_32) # endif #endif @@ -2888,12 +2923,19 @@ typedef struct * is the minimum 'row stride', the minimum count of components between each * row. For a color-mapped image this is the minimum number of bytes in a * row. + * + * WARNING: this macro overflows for some images with more than one component + * and very large image widths. libpng will refuse to process an image where + * this macro would overflow. */ #define PNG_IMAGE_BUFFER_SIZE(image, row_stride)\ (PNG_IMAGE_PIXEL_COMPONENT_SIZE((image).format)*(image).height*(row_stride)) /* Return the size, in bytes, of an image buffer given a png_image and a row * stride - the number of components to leave space for in each row. + * + * WARNING: this macro overflows a 32-bit integer for some large PNG images, + * libpng will refuse to process an image where such an overflow would occur. */ #define PNG_IMAGE_SIZE(image)\ @@ -3014,7 +3056,6 @@ PNG_EXPORT(238, void, png_image_free, (png_imagep image)); #endif /* SIMPLIFIED_READ */ #ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED -#ifdef PNG_STDIO_SUPPORTED /* WRITE APIS * ---------- * For write you must initialize a png_image structure to describe the image to @@ -3031,6 +3072,7 @@ PNG_EXPORT(238, void, png_image_free, (png_imagep image)); * values do not correspond to the colors in sRGB. * colormap_entries: set to the number of entries in the color-map (0 to 256) */ +#ifdef PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED PNG_EXPORT(239, int, png_image_write_to_file, (png_imagep image, const char *file, int convert_to_8bit, const void *buffer, png_int_32 row_stride, const void *colormap)); @@ -3040,8 +3082,9 @@ PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file, int convert_to_8_bit, const void *buffer, png_int_32 row_stride, const void *colormap)); /* Write the image to the given (FILE*). */ +#endif /* SIMPLIFIED_WRITE_STDIO */ -/* With both write APIs if image is in one of the linear formats with 16-bit +/* With all write APIs if image is in one of the linear formats with 16-bit * data then setting convert_to_8_bit will cause the output to be an 8-bit PNG * gamma encoded according to the sRGB specification, otherwise a 16-bit linear * encoded PNG file is written. @@ -3053,13 +3096,103 @@ PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file, * * With all APIs row_stride is handled as in the read APIs - it is the spacing * from one row to the next in component sized units (1 or 2 bytes) and if - * negative indicates a bottom-up row layout in the buffer. If row_stride is zero, - * libpng will calculate it for you from the image width and number of channels. + * negative indicates a bottom-up row layout in the buffer. If row_stride is + * zero, libpng will calculate it for you from the image width and number of + * channels. * - * Note that the write API does not support interlacing, sub-8-bit pixels, indexed - * PNG (color_type 3) or most ancillary chunks. + * Note that the write API does not support interlacing, sub-8-bit pixels or + * most ancillary chunks. If you need to write text chunks (e.g. for copyright + * notices) you need to use one of the other APIs. */ -#endif /* STDIO */ + +PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory, + png_alloc_size_t * PNG_RESTRICT memory_bytes, int convert_to_8_bit, + const void *buffer, png_int_32 row_stride, const void *colormap)); + /* Write the image to the given memory buffer. The function both writes the + * whole PNG data stream to *memory and updates *memory_bytes with the count + * of bytes written. + * + * 'memory' may be NULL. In this case *memory_bytes is not read however on + * success the number of bytes which would have been written will still be + * stored in *memory_bytes. On failure *memory_bytes will contain 0. + * + * If 'memory' is not NULL it must point to memory[*memory_bytes] of + * writeable memory. + * + * If the function returns success memory[*memory_bytes] (if 'memory' is not + * NULL) contains the written PNG data. *memory_bytes will always be less + * than or equal to the original value. + * + * If the function returns false and *memory_bytes was not changed an error + * occured during write. If *memory_bytes was changed, or is not 0 if + * 'memory' was NULL, the write would have succeeded but for the memory + * buffer being too small. *memory_bytes contains the required number of + * bytes and will be bigger that the original value. + */ + +#define png_image_write_get_memory_size(image, size, convert_to_8_bit, buffer,\ + row_stride, colormap)\ + png_image_write_to_memory(&(image), 0, &(size), convert_to_8_bit, buffer,\ + row_stride, colormap) + /* Return the amount of memory in 'size' required to compress this image. + * The png_image structure 'image' must be filled in as in the above + * function and must not be changed before the actual write call, the buffer + * and all other parameters must also be identical to that in the final + * write call. The 'size' variable need not be initialized. + * + * NOTE: the macro returns true/false, if false is returned 'size' will be + * set to zero and the write failed and probably will fail if tried again. + */ + +/* You can pre-allocate the buffer by making sure it is of sufficient size + * regardless of the amount of compression achieved. The buffer size will + * always be bigger than the original image and it will never be filled. The + * following macros are provided to assist in allocating the buffer. + */ +#define PNG_IMAGE_DATA_SIZE(image) (PNG_IMAGE_SIZE(image)+(image).height) + /* The number of uncompressed bytes in the PNG byte encoding of the image; + * uncompressing the PNG IDAT data will give this number of bytes. + * + * NOTE: while PNG_IMAGE_SIZE cannot overflow for an image in memory this + * macro can because of the extra bytes used in the PNG byte encoding. You + * need to avoid this macro if your image size approaches 2^30 in width or + * height. The same goes for the remainder of these macros; they all produce + * bigger numbers than the actual in-memory image size. + */ +#ifndef PNG_ZLIB_MAX_SIZE +# define PNG_ZLIB_MAX_SIZE(b) ((b)+(((b)+7U)>>3)+(((b)+63U)>>6)+11U) + /* An upper bound on the number of compressed bytes given 'b' uncompressed + * bytes. This is based on deflateBounds() in zlib; different + * implementations of zlib compression may conceivably produce more data so + * if your zlib implementation is not zlib itself redefine this macro + * appropriately. + */ +#endif + +#define PNG_IMAGE_COMPRESSED_SIZE_MAX(image)\ + PNG_ZLIB_MAX_SIZE((png_alloc_size_t)PNG_IMAGE_DATA_SIZE(image)) + /* An upper bound on the size of the data in the PNG IDAT chunks. */ + +#define PNG_IMAGE_PNG_SIZE_MAX_(image, image_size)\ + ((8U/*sig*/+25U/*IHDR*/+16U/*gAMA*/+44U/*cHRM*/+12U/*IEND*/+\ + (((image).format&PNG_FORMAT_FLAG_COLORMAP)?/*colormap: PLTE, tRNS*/\ + 12U+3U*(image).colormap_entries/*PLTE data*/+\ + (((image).format&PNG_FORMAT_FLAG_ALPHA)?\ + 12U/*tRNS*/+(image).colormap_entries:0U):0U)+\ + 12U)+(12U*((image_size)/PNG_ZBUF_SIZE))/*IDAT*/+(image_size)) + /* A helper for the following macro; if your compiler cannot handle the + * following macro use this one with the result of + * PNG_IMAGE_COMPRESSED_SIZE_MAX(image) as the second argument (most + * compilers should handle this just fine.) + */ + +#define PNG_IMAGE_PNG_SIZE_MAX(image)\ + PNG_IMAGE_PNG_SIZE_MAX_(image, PNG_IMAGE_COMPRESSED_SIZE_MAX(image)) + /* An upper bound on the total length of the PNG data stream for 'image'. + * The result is of type png_alloc_size_t, on 32-bit systems this may + * overflow even though PNG_IMAGE_DATA_SIZE does not overflow; the write will + * run out of buffer space but return a corrected size which should work. + */ #endif /* SIMPLIFIED_WRITE */ /******************************************************************************* * END OF SIMPLIFIED API @@ -3117,7 +3250,7 @@ PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option, * one to use is one more than this.) */ #ifdef PNG_EXPORT_LAST_ORDINAL - PNG_EXPORT_LAST_ORDINAL(244); + PNG_EXPORT_LAST_ORDINAL(245); #endif #ifdef __cplusplus diff --git a/3rdparty/libpng/pngconf.h b/3rdparty/libpng/pngconf.h index f1b795b478..9da691dbb8 100644 --- a/3rdparty/libpng/pngconf.h +++ b/3rdparty/libpng/pngconf.h @@ -1,9 +1,9 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.6.19, July 23, 2015 + * libpng version 1.6.24, August 4, 2016 * - * Copyright (c) 1998-2015 Glenn Randers-Pehrson + * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -188,27 +188,27 @@ * compatible with GCC or Visual C because of different calling conventions. */ # if PNG_API_RULE == 2 - /* If this line results in an error, either because __watcall is not - * understood or because of a redefine just below you cannot use *this* - * build of the library with the compiler you are using. *This* build was - * build using Watcom and applications must also be built using Watcom! - */ + /* If this line results in an error, either because __watcall is not + * understood or because of a redefine just below you cannot use *this* + * build of the library with the compiler you are using. *This* build was + * build using Watcom and applications must also be built using Watcom! + */ # define PNGCAPI __watcall # endif # if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800)) # define PNGCAPI __cdecl # if PNG_API_RULE == 1 - /* If this line results in an error __stdcall is not understood and - * PNG_API_RULE should not have been set to '1'. - */ + /* If this line results in an error __stdcall is not understood and + * PNG_API_RULE should not have been set to '1'. + */ # define PNGAPI __stdcall # endif # else - /* An older compiler, or one not detected (erroneously) above, - * if necessary override on the command line to get the correct - * variants for the compiler. - */ + /* An older compiler, or one not detected (erroneously) above, + * if necessary override on the command line to get the correct + * variants for the compiler. + */ # ifndef PNGCAPI # define PNGCAPI _cdecl # endif @@ -225,10 +225,10 @@ # if (defined(_MSC_VER) && _MSC_VER < 800) ||\ (defined(__BORLANDC__) && __BORLANDC__ < 0x500) - /* older Borland and MSC - * compilers used '__export' and required this to be after - * the type. - */ + /* older Borland and MSC + * compilers used '__export' and required this to be after + * the type. + */ # ifndef PNG_EXPORT_TYPE # define PNG_EXPORT_TYPE(type) type PNG_IMPEXP # endif @@ -244,9 +244,9 @@ # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) # define PNGAPI _System # else /* !Windows/x86 && !OS/2 */ - /* Use the defaults, or define PNG*API on the command line (but - * this will have to be done for every compile!) - */ + /* Use the defaults, or define PNG*API on the command line (but + * this will have to be done for every compile!) + */ # endif /* other system, !OS/2 */ #endif /* !Windows/x86 */ @@ -267,7 +267,7 @@ */ #ifndef PNG_IMPEXP # if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT) - /* This forces use of a DLL, disallowing static linking */ + /* This forces use of a DLL, disallowing static linking */ # define PNG_IMPEXP PNG_DLL_IMPORT # endif @@ -340,7 +340,7 @@ * less efficient code. */ # if defined(__clang__) && defined(__has_attribute) - /* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */ + /* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */ # if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__) # define PNG_USE_RESULT __attribute__((__warn_unused_result__)) # endif diff --git a/3rdparty/libpng/pngdebug.h b/3rdparty/libpng/pngdebug.h index 6a01b106ed..15a7ed0c95 100644 --- a/3rdparty/libpng/pngdebug.h +++ b/3rdparty/libpng/pngdebug.h @@ -2,7 +2,7 @@ /* pngdebug.h - Debugging macros for libpng, also used in pngtest.c * * Last changed in libpng 1.6.8 [December 19, 2013] - * Copyright (c) 1998-2013 Glenn Randers-Pehrson + * Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * diff --git a/3rdparty/libpng/pngerror.c b/3rdparty/libpng/pngerror.c index 0781866a89..f13b76443a 100644 --- a/3rdparty/libpng/pngerror.c +++ b/3rdparty/libpng/pngerror.c @@ -1,8 +1,8 @@ /* pngerror.c - stub functions for i/o and memory allocation * - * Last changed in libpng 1.6.15 [November 20, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -26,7 +26,7 @@ static PNG_FUNCTION(void, png_default_error,PNGARG((png_const_structrp png_ptr, #ifdef PNG_WARNINGS_SUPPORTED static void /* PRIVATE */ png_default_warning PNGARG((png_const_structrp png_ptr, - png_const_charp warning_message)); + png_const_charp warning_message)); #endif /* WARNINGS */ /* This function is called whenever there is a fatal error. This function @@ -37,14 +37,14 @@ png_default_warning PNGARG((png_const_structrp png_ptr, #ifdef PNG_ERROR_TEXT_SUPPORTED PNG_FUNCTION(void,PNGAPI png_error,(png_const_structrp png_ptr, png_const_charp error_message), - PNG_NORETURN) + PNG_NORETURN) { #ifdef PNG_ERROR_NUMBERS_SUPPORTED char msg[16]; if (png_ptr != NULL) { if ((png_ptr->flags & - (PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) != 0 + (PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) != 0) { if (*error_message == PNG_LITERAL_SHARP) { @@ -65,18 +65,18 @@ png_error,(png_const_structrp png_ptr, png_const_charp error_message), else error_message += offset; - } - - else - { - if ((png_ptr->flags & PNG_FLAG_STRIP_ERROR_TEXT) != 0) - { - msg[0] = '0'; - msg[1] = '\0'; - error_message = msg; } - } - } + + else + { + if ((png_ptr->flags & PNG_FLAG_STRIP_ERROR_TEXT) != 0) + { + msg[0] = '0'; + msg[1] = '\0'; + error_message = msg; + } + } + } } #endif if (png_ptr != NULL && png_ptr->error_fn != NULL) @@ -110,7 +110,7 @@ png_err,(png_const_structrp png_ptr),PNG_NORETURN) */ size_t png_safecat(png_charp buffer, size_t bufsize, size_t pos, - png_const_charp string) + png_const_charp string) { if (buffer != NULL && pos < bufsize) { @@ -131,7 +131,7 @@ png_safecat(png_charp buffer, size_t bufsize, size_t pos, */ png_charp png_format_number(png_const_charp start, png_charp end, int format, - png_alloc_size_t number) + png_alloc_size_t number) { int count = 0; /* number of digits output */ int mincount = 1; /* minimum number required */ @@ -233,7 +233,7 @@ png_warning(png_const_structrp png_ptr, png_const_charp warning_message) } if (png_ptr != NULL && png_ptr->warning_fn != NULL) (*(png_ptr->warning_fn))(png_constcast(png_structrp,png_ptr), - warning_message + offset); + warning_message + offset); else png_default_warning(png_ptr, warning_message + offset); } @@ -245,7 +245,7 @@ png_warning(png_const_structrp png_ptr, png_const_charp warning_message) */ void png_warning_parameter(png_warning_parameters p, int number, - png_const_charp string) + png_const_charp string) { if (number > 0 && number <= PNG_WARNING_PARAMETER_COUNT) (void)png_safecat(p[number-1], (sizeof p[number-1]), 0, string); @@ -253,7 +253,7 @@ png_warning_parameter(png_warning_parameters p, int number, void png_warning_parameter_unsigned(png_warning_parameters p, int number, int format, - png_alloc_size_t value) + png_alloc_size_t value) { char buffer[PNG_NUMBER_BUFFER_SIZE]; png_warning_parameter(p, number, PNG_FORMAT_NUMBER(buffer, format, value)); @@ -261,7 +261,7 @@ png_warning_parameter_unsigned(png_warning_parameters p, int number, int format, void png_warning_parameter_signed(png_warning_parameters p, int number, int format, - png_int_32 value) + png_int_32 value) { png_alloc_size_t u; png_charp str; @@ -282,7 +282,7 @@ png_warning_parameter_signed(png_warning_parameters p, int number, int format, void png_formatted_warning(png_const_structrp png_ptr, png_warning_parameters p, - png_const_charp message) + png_const_charp message) { /* The internal buffer is just 192 bytes - enough for all our messages, * overflow doesn't happen because this code checks! If someone figures @@ -391,10 +391,10 @@ png_benign_error(png_const_structrp png_ptr, png_const_charp error_message) void /* PRIVATE */ png_app_warning(png_const_structrp png_ptr, png_const_charp error_message) { - if ((png_ptr->flags & PNG_FLAG_APP_WARNINGS_WARN) != 0) - png_warning(png_ptr, error_message); - else - png_error(png_ptr, error_message); + if ((png_ptr->flags & PNG_FLAG_APP_WARNINGS_WARN) != 0) + png_warning(png_ptr, error_message); + else + png_error(png_ptr, error_message); # ifndef PNG_ERROR_TEXT_SUPPORTED PNG_UNUSED(error_message) @@ -404,10 +404,10 @@ png_app_warning(png_const_structrp png_ptr, png_const_charp error_message) void /* PRIVATE */ png_app_error(png_const_structrp png_ptr, png_const_charp error_message) { - if ((png_ptr->flags & PNG_FLAG_APP_ERRORS_WARN) != 0) - png_warning(png_ptr, error_message); - else - png_error(png_ptr, error_message); + if ((png_ptr->flags & PNG_FLAG_APP_ERRORS_WARN) != 0) + png_warning(png_ptr, error_message); + else + png_error(png_ptr, error_message); # ifndef PNG_ERROR_TEXT_SUPPORTED PNG_UNUSED(error_message) @@ -478,7 +478,7 @@ png_format_buffer(png_const_structrp png_ptr, png_charp buffer, png_const_charp #if defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED) PNG_FUNCTION(void,PNGAPI png_chunk_error,(png_const_structrp png_ptr, png_const_charp error_message), - PNG_NORETURN) + PNG_NORETURN) { char msg[18+PNG_MAX_ERROR_TEXT]; if (png_ptr == NULL) @@ -620,7 +620,7 @@ png_set_longjmp_fn(png_structrp png_ptr, png_longjmp_ptr longjmp_fn, else { png_ptr->jmp_buf_ptr = png_voidcast(jmp_buf *, - png_malloc_warn(png_ptr, jmp_buf_size)); + png_malloc_warn(png_ptr, jmp_buf_size)); if (png_ptr->jmp_buf_ptr == NULL) return NULL; /* new NULL return on OOM */ @@ -709,7 +709,7 @@ png_free_jmpbuf(png_structrp png_ptr) */ static PNG_FUNCTION(void /* PRIVATE */, png_default_error,(png_const_structrp png_ptr, png_const_charp error_message), - PNG_NORETURN) + PNG_NORETURN) { #ifdef PNG_CONSOLE_IO_SUPPORTED #ifdef PNG_ERROR_NUMBERS_SUPPORTED @@ -768,7 +768,7 @@ png_longjmp,(png_const_structrp png_ptr, int val),PNG_NORETURN) /* If control reaches this point, png_longjmp() must not return. The only * choice is to terminate the whole process (or maybe the thread); to do - * this the ANSI-C abort() function is used unless a different method is + * this the ANSI-C abort() function is used unless a different method is * implemented by overriding the default configuration setting for * PNG_ABORT(). */ @@ -883,7 +883,7 @@ png_set_strip_error_numbers(png_structrp png_ptr, png_uint_32 strip_mode) */ PNG_FUNCTION(void /* PRIVATE */, (PNGCBAPI png_safe_error),(png_structp png_nonconst_ptr, png_const_charp error_message), - PNG_NORETURN) + PNG_NORETURN) { const png_const_structrp png_ptr = png_nonconst_ptr; png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr); @@ -906,7 +906,7 @@ png_safe_error),(png_structp png_nonconst_ptr, png_const_charp error_message), /* Missing longjmp buffer, the following is to help debugging: */ { size_t pos = png_safecat(image->message, (sizeof image->message), 0, - "bad longjmp: "); + "bad longjmp: "); png_safecat(image->message, (sizeof image->message), pos, error_message); } diff --git a/3rdparty/libpng/pngget.c b/3rdparty/libpng/pngget.c index 743a6a9bbc..b3c6863f40 100644 --- a/3rdparty/libpng/pngget.c +++ b/3rdparty/libpng/pngget.c @@ -1,8 +1,8 @@ /* pngget.c - retrieval of values from info struct * - * Last changed in libpng 1.6.17 [March 26, 2015] - * Copyright (c) 1998-2015 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -456,11 +456,11 @@ png_get_pHYs_dpi(png_const_structrp png_ptr, png_const_inforp info_ptr, return (retval); } #endif /* pHYs */ -#endif /* INCH_CONVERSIONS */ +#endif /* INCH_CONVERSIONS */ /* png_get_channels really belongs in here, too, but it's been around longer */ -#endif /* EASY_ACCESS */ +#endif /* EASY_ACCESS */ png_byte PNGAPI @@ -486,7 +486,7 @@ png_get_signature(png_const_structrp png_ptr, png_const_inforp info_ptr) #ifdef PNG_bKGD_SUPPORTED png_uint_32 PNGAPI png_get_bKGD(png_const_structrp png_ptr, png_inforp info_ptr, - png_color_16p *background) + png_color_16p *background) { if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD) != 0 && @@ -526,28 +526,28 @@ png_get_cHRM(png_const_structrp png_ptr, png_const_inforp info_ptr, if (white_x != NULL) *white_x = png_float(png_ptr, - info_ptr->colorspace.end_points_xy.whitex, "cHRM white X"); + info_ptr->colorspace.end_points_xy.whitex, "cHRM white X"); if (white_y != NULL) *white_y = png_float(png_ptr, - info_ptr->colorspace.end_points_xy.whitey, "cHRM white Y"); + info_ptr->colorspace.end_points_xy.whitey, "cHRM white Y"); if (red_x != NULL) *red_x = png_float(png_ptr, info_ptr->colorspace.end_points_xy.redx, - "cHRM red X"); + "cHRM red X"); if (red_y != NULL) *red_y = png_float(png_ptr, info_ptr->colorspace.end_points_xy.redy, - "cHRM red Y"); + "cHRM red Y"); if (green_x != NULL) *green_x = png_float(png_ptr, - info_ptr->colorspace.end_points_xy.greenx, "cHRM green X"); + info_ptr->colorspace.end_points_xy.greenx, "cHRM green X"); if (green_y != NULL) *green_y = png_float(png_ptr, - info_ptr->colorspace.end_points_xy.greeny, "cHRM green Y"); + info_ptr->colorspace.end_points_xy.greeny, "cHRM green Y"); if (blue_x != NULL) *blue_x = png_float(png_ptr, info_ptr->colorspace.end_points_xy.bluex, - "cHRM blue X"); + "cHRM blue X"); if (blue_y != NULL) *blue_y = png_float(png_ptr, info_ptr->colorspace.end_points_xy.bluey, - "cHRM blue Y"); + "cHRM blue Y"); return (PNG_INFO_cHRM); } @@ -556,42 +556,42 @@ png_get_cHRM(png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 PNGAPI png_get_cHRM_XYZ(png_const_structrp png_ptr, png_const_inforp info_ptr, - double *red_X, double *red_Y, double *red_Z, double *green_X, - double *green_Y, double *green_Z, double *blue_X, double *blue_Y, - double *blue_Z) + double *red_X, double *red_Y, double *red_Z, double *green_X, + double *green_Y, double *green_Z, double *blue_X, double *blue_Y, + double *blue_Z) { if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0) + (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0) { png_debug1(1, "in %s retrieval function", "cHRM_XYZ(float)"); if (red_X != NULL) *red_X = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.red_X, - "cHRM red X"); + "cHRM red X"); if (red_Y != NULL) *red_Y = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.red_Y, - "cHRM red Y"); + "cHRM red Y"); if (red_Z != NULL) *red_Z = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.red_Z, - "cHRM red Z"); + "cHRM red Z"); if (green_X != NULL) *green_X = png_float(png_ptr, - info_ptr->colorspace.end_points_XYZ.green_X, "cHRM green X"); + info_ptr->colorspace.end_points_XYZ.green_X, "cHRM green X"); if (green_Y != NULL) *green_Y = png_float(png_ptr, - info_ptr->colorspace.end_points_XYZ.green_Y, "cHRM green Y"); + info_ptr->colorspace.end_points_XYZ.green_Y, "cHRM green Y"); if (green_Z != NULL) *green_Z = png_float(png_ptr, - info_ptr->colorspace.end_points_XYZ.green_Z, "cHRM green Z"); + info_ptr->colorspace.end_points_XYZ.green_Z, "cHRM green Z"); if (blue_X != NULL) *blue_X = png_float(png_ptr, - info_ptr->colorspace.end_points_XYZ.blue_X, "cHRM blue X"); + info_ptr->colorspace.end_points_XYZ.blue_X, "cHRM blue X"); if (blue_Y != NULL) *blue_Y = png_float(png_ptr, - info_ptr->colorspace.end_points_XYZ.blue_Y, "cHRM blue Y"); + info_ptr->colorspace.end_points_XYZ.blue_Y, "cHRM blue Y"); if (blue_Z != NULL) *blue_Z = png_float(png_ptr, - info_ptr->colorspace.end_points_XYZ.blue_Z, "cHRM blue Z"); + info_ptr->colorspace.end_points_XYZ.blue_Z, "cHRM blue Z"); return (PNG_INFO_cHRM); } @@ -681,8 +681,8 @@ png_get_gAMA_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr, png_debug1(1, "in %s retrieval function", "gAMA"); if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) != 0 && - file_gamma != NULL) + (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) != 0 && + file_gamma != NULL) { *file_gamma = info_ptr->colorspace.gamma; return (PNG_INFO_gAMA); @@ -704,7 +704,7 @@ png_get_gAMA(png_const_structrp png_ptr, png_const_inforp info_ptr, file_gamma != NULL) { *file_gamma = png_float(png_ptr, info_ptr->colorspace.gamma, - "png_get_gAMA"); + "png_get_gAMA"); return (PNG_INFO_gAMA); } @@ -901,7 +901,7 @@ png_get_sCAL_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr, */ *width = png_fixed(png_ptr, atof(info_ptr->scal_s_width), "sCAL width"); *height = png_fixed(png_ptr, atof(info_ptr->scal_s_height), - "sCAL height"); + "sCAL height"); return (PNG_INFO_sCAL); } @@ -1142,19 +1142,19 @@ png_get_compression_buffer_size(png_const_structrp png_ptr) return 0; #ifdef PNG_WRITE_SUPPORTED - if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0) + if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0) #endif { #ifdef PNG_SEQUENTIAL_READ_SUPPORTED - return png_ptr->IDAT_read_size; + return png_ptr->IDAT_read_size; #else - return PNG_IDAT_READ_SIZE; + return PNG_IDAT_READ_SIZE; #endif } #ifdef PNG_WRITE_SUPPORTED - else - return png_ptr->zbuffer_size; + else + return png_ptr->zbuffer_size; #endif } diff --git a/3rdparty/libpng/pnginfo.h b/3rdparty/libpng/pnginfo.h index c8c874dd1e..361ed8be70 100644 --- a/3rdparty/libpng/pnginfo.h +++ b/3rdparty/libpng/pnginfo.h @@ -2,7 +2,7 @@ /* pnginfo.h - header file for PNG reference library * * Last changed in libpng 1.6.1 [March 28, 2013] - * Copyright (c) 1998-2013 Glenn Randers-Pehrson + * Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -223,7 +223,7 @@ defined(PNG_READ_BACKGROUND_SUPPORTED) /* Storage for unknown chunks that the library doesn't recognize. */ png_unknown_chunkp unknown_chunks; - /* The type of this field is limited by the type of + /* The type of this field is limited by the type of * png_struct::user_chunk_cache_max, else overflow can occur. */ int unknown_chunks_num; diff --git a/3rdparty/libpng/pnglibconf.h b/3rdparty/libpng/pnglibconf.h index ff5d156a6b..d91d9f4199 100644 --- a/3rdparty/libpng/pnglibconf.h +++ b/3rdparty/libpng/pnglibconf.h @@ -1,8 +1,8 @@ -/* libpng 1.6.19 STANDARD API DEFINITION */ +/* libpng 1.6.24 STANDARD API DEFINITION */ /* pnglibconf.h - library build configuration */ -/* Libpng version 1.6.19 - November 12, 2015 */ +/* Libpng version 1.6.24 - August 4, 2016 */ /* Copyright (c) 1998-2015 Glenn Randers-Pehrson */ @@ -109,6 +109,7 @@ #define PNG_SIMPLIFIED_READ_SUPPORTED #define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED #define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED +#define PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED #define PNG_SIMPLIFIED_WRITE_SUPPORTED #define PNG_STDIO_SUPPORTED #define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED diff --git a/3rdparty/libpng/pngmem.c b/3rdparty/libpng/pngmem.c index 45ac5579b2..6033bf2f56 100644 --- a/3rdparty/libpng/pngmem.c +++ b/3rdparty/libpng/pngmem.c @@ -1,8 +1,8 @@ /* pngmem.c - stub functions for memory allocation * - * Last changed in libpng 1.6.15 [November 20, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -66,7 +66,7 @@ png_calloc,(png_const_structrp png_ptr, png_alloc_size_t size),PNG_ALLOCATED) */ PNG_FUNCTION(png_voidp /* PRIVATE */, png_malloc_base,(png_const_structrp png_ptr, png_alloc_size_t size), - PNG_ALLOCATED) + PNG_ALLOCATED) { /* Moved to png_malloc_base from png_malloc_default in 1.6.0; the DOS * allocators have also been removed in 1.6.0, so any 16-bit system now has @@ -107,7 +107,7 @@ png_malloc_base,(png_const_structrp png_ptr, png_alloc_size_t size), */ static png_voidp png_malloc_array_checked(png_const_structrp png_ptr, int nelements, - size_t element_size) + size_t element_size) { png_alloc_size_t req = nelements; /* known to be > 0 */ @@ -120,7 +120,7 @@ png_malloc_array_checked(png_const_structrp png_ptr, int nelements, PNG_FUNCTION(png_voidp /* PRIVATE */, png_malloc_array,(png_const_structrp png_ptr, int nelements, - size_t element_size),PNG_ALLOCATED) + size_t element_size),PNG_ALLOCATED) { if (nelements <= 0 || element_size == 0) png_error(png_ptr, "internal error: array alloc"); @@ -130,7 +130,7 @@ png_malloc_array,(png_const_structrp png_ptr, int nelements, PNG_FUNCTION(png_voidp /* PRIVATE */, png_realloc_array,(png_const_structrp png_ptr, png_const_voidp old_array, - int old_elements, int add_elements, size_t element_size),PNG_ALLOCATED) + int old_elements, int add_elements, size_t element_size),PNG_ALLOCATED) { /* These are internal errors: */ if (add_elements <= 0 || element_size == 0 || old_elements < 0 || @@ -143,7 +143,7 @@ png_realloc_array,(png_const_structrp png_ptr, png_const_voidp old_array, if (add_elements <= INT_MAX - old_elements) { png_voidp new_array = png_malloc_array_checked(png_ptr, - old_elements+add_elements, element_size); + old_elements+add_elements, element_size); if (new_array != NULL) { @@ -154,7 +154,7 @@ png_realloc_array,(png_const_structrp png_ptr, png_const_voidp old_array, memcpy(new_array, old_array, element_size*(unsigned)old_elements); memset((char*)new_array + element_size*(unsigned)old_elements, 0, - element_size*(unsigned)add_elements); + element_size*(unsigned)add_elements); return new_array; } @@ -187,7 +187,7 @@ png_malloc,(png_const_structrp png_ptr, png_alloc_size_t size),PNG_ALLOCATED) #ifdef PNG_USER_MEM_SUPPORTED PNG_FUNCTION(png_voidp,PNGAPI png_malloc_default,(png_const_structrp png_ptr, png_alloc_size_t size), - PNG_ALLOCATED PNG_DEPRECATED) + PNG_ALLOCATED PNG_DEPRECATED) { png_voidp ret; @@ -210,7 +210,7 @@ png_malloc_default,(png_const_structrp png_ptr, png_alloc_size_t size), */ PNG_FUNCTION(png_voidp,PNGAPI png_malloc_warn,(png_const_structrp png_ptr, png_alloc_size_t size), - PNG_ALLOCATED) + PNG_ALLOCATED) { if (png_ptr != NULL) { diff --git a/3rdparty/libpng/pngpread.c b/3rdparty/libpng/pngpread.c index 9f68f99023..794352f42c 100644 --- a/3rdparty/libpng/pngpread.c +++ b/3rdparty/libpng/pngpread.c @@ -1,8 +1,8 @@ /* pngpread.c - read a png file in push mode * - * Last changed in libpng 1.6.18 [July 23, 2015] - * Copyright (c) 1998-2015 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -77,11 +77,11 @@ png_process_data_pause(png_structrp png_ptr, int save) png_uint_32 PNGAPI png_process_data_skip(png_structrp png_ptr) { - /* TODO: Deprecate and remove this API. - * Somewhere the implementation of this seems to have been lost, - * or abandoned. It was only to support some internal back-door access - * to png_struct) in libpng-1.4.x. - */ +/* TODO: Deprecate and remove this API. + * Somewhere the implementation of this seems to have been lost, + * or abandoned. It was only to support some internal back-door access + * to png_struct) in libpng-1.4.x. + */ png_app_warning(png_ptr, "png_process_data_skip is not implemented in any current version of libpng"); return 0; @@ -133,7 +133,7 @@ png_process_some_data(png_structrp png_ptr, png_inforp info_ptr) void /* PRIVATE */ png_push_read_sig(png_structrp png_ptr, png_inforp info_ptr) { - png_size_t num_checked = png_ptr->sig_bytes, /* SAFE, does not exceed 8 */ + png_size_t num_checked = png_ptr->sig_bytes, /* SAFE, does not exceed 8 */ num_to_check = 8 - num_checked; if (png_ptr->buffer_size < num_to_check) @@ -210,12 +210,14 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) (png_ptr->mode & PNG_HAVE_PLTE) == 0) png_error(png_ptr, "Missing PLTE before IDAT"); - png_ptr->mode |= PNG_HAVE_IDAT; png_ptr->process_mode = PNG_READ_IDAT_MODE; - if ((png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT) == 0) - if (png_ptr->push_length == 0) - return; + if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) + if ((png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT) == 0) + if (png_ptr->push_length == 0) + return; + + png_ptr->mode |= PNG_HAVE_IDAT; if ((png_ptr->mode & PNG_AFTER_IDAT) != 0) png_benign_error(png_ptr, "Too many IDATs found"); @@ -408,7 +410,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) { PNG_PUSH_SAVE_BUFFER_IF_FULL png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length, - PNG_HANDLE_CHUNK_AS_DEFAULT); + PNG_HANDLE_CHUNK_AS_DEFAULT); } png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; @@ -499,7 +501,10 @@ png_push_save_buffer(png_structrp png_ptr) png_error(png_ptr, "Insufficient memory for save_buffer"); } - memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size); + if (old_buffer) + memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size); + else if (png_ptr->save_buffer_size) + png_error(png_ptr, "save_buffer error"); png_free(png_ptr, old_buffer); png_ptr->save_buffer_max = new_max; } @@ -516,7 +521,7 @@ png_push_save_buffer(png_structrp png_ptr) void /* PRIVATE */ png_push_restore_buffer(png_structrp png_ptr, png_bytep buffer, - png_size_t buffer_length) + png_size_t buffer_length) { png_ptr->current_buffer = buffer; png_ptr->current_buffer_size = buffer_length; @@ -619,7 +624,7 @@ png_push_read_IDAT(png_structrp png_ptr) void /* PRIVATE */ png_process_IDAT_data(png_structrp png_ptr, png_bytep buffer, - png_size_t buffer_length) + png_size_t buffer_length) { /* The caller checks for a non-zero buffer length. */ if (!(buffer_length > 0) || buffer == NULL) @@ -662,7 +667,7 @@ png_process_IDAT_data(png_structrp png_ptr, png_bytep buffer, * change the current behavior (see comments in inflate.c * for why this doesn't happen at present with zlib 1.2.5). */ - ret = inflate(&png_ptr->zstream, Z_SYNC_FLUSH); + ret = PNG_INFLATE(png_ptr, Z_SYNC_FLUSH); /* Check for any failure before proceeding. */ if (ret != Z_OK && ret != Z_STREAM_END) @@ -777,7 +782,7 @@ png_push_process_row(png_structrp png_ptr) { if (png_ptr->pass < 6) png_do_read_interlace(&row_info, png_ptr->row_buf + 1, png_ptr->pass, - png_ptr->transformations); + png_ptr->transformations); switch (png_ptr->pass) { @@ -1039,7 +1044,7 @@ png_push_have_row(png_structrp png_ptr, png_bytep row) { if (png_ptr->row_fn != NULL) (*(png_ptr->row_fn))(png_ptr, row, png_ptr->row_number, - (int)png_ptr->pass); + (int)png_ptr->pass); } #ifdef PNG_READ_INTERLACING_SUPPORTED diff --git a/3rdparty/libpng/pngpriv.h b/3rdparty/libpng/pngpriv.h index e30b0434ac..c0aa785f2b 100644 --- a/3rdparty/libpng/pngpriv.h +++ b/3rdparty/libpng/pngpriv.h @@ -1,8 +1,8 @@ /* pngpriv.h - private declarations for use inside libpng * - * Last changed in libpng 1.6.18 [July 23, 2015] - * Copyright (c) 1998-2015 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -182,6 +182,42 @@ # endif #endif /* PNG_ARM_NEON_OPT > 0 */ +#ifndef PNG_INTEL_SSE_OPT +# ifdef PNG_INTEL_SSE + /* Only check for SSE if the build configuration has been modified to + * enable SSE optimizations. This means that these optimizations will + * be off by default. See contrib/intel for more details. + */ +# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \ + defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \ + (defined(_M_IX86_FP) && _M_IX86_FP >= 2) +# define PNG_INTEL_SSE_OPT 1 +# endif +# endif +#endif + +#if defined(PNG_INTEL_SSE_OPT) && PNG_INTEL_SSE_OPT > 0 +# ifndef PNG_INTEL_SSE_IMPLEMENTATION +# if defined(__SSE4_1__) || defined(__AVX__) + /* We are not actually using AVX, but checking for AVX is the best + way we can detect SSE4.1 and SSSE3 on MSVC. + */ +# define PNG_INTEL_SSE_IMPLEMENTATION 3 +# elif defined(__SSSE3__) +# define PNG_INTEL_SSE_IMPLEMENTATION 2 +# elif defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \ + (defined(_M_IX86_FP) && _M_IX86_FP >= 2) +# define PNG_INTEL_SSE_IMPLEMENTATION 1 +# else +# define PNG_INTEL_SSE_IMPLEMENTATION 0 +# endif +# endif + +# if PNG_INTEL_SSE_IMPLEMENTATION > 0 +# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2 +# endif +#endif + /* Is this a build of a DLL where compilation of the object modules requires * different preprocessor settings to those required for a simple library? If * so PNG_BUILD_DLL must be set. @@ -420,10 +456,10 @@ # if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) - /* We need to check that hasn't already been included earlier - * as it seems it doesn't agree with , yet we should really use - * if possible. - */ + /* We need to check that hasn't already been included earlier + * as it seems it doesn't agree with , yet we should really use + * if possible. + */ # if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) # include # endif @@ -431,9 +467,9 @@ # include # endif # if defined(_AMIGA) && defined(__SASC) && defined(_M68881) - /* Amiga SAS/C: We must include builtin FPU functions when compiling using - * MATH=68881 - */ + /* Amiga SAS/C: We must include builtin FPU functions when compiling using + * MATH=68881 + */ # include # endif #endif @@ -1025,7 +1061,7 @@ PNG_INTERNAL_FUNCTION(void,png_write_sBIT,(png_structrp png_ptr, #ifdef PNG_WRITE_cHRM_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_cHRM_fixed,(png_structrp png_ptr, const png_xy *xy), PNG_EMPTY); - /* The xy value must have been previously validated */ + /* The xy value must have been previously validated */ #endif #ifdef PNG_WRITE_sRGB_SUPPORTED @@ -1174,6 +1210,7 @@ PNG_INTERNAL_FUNCTION(void,png_do_write_interlace,(png_row_infop row_info, PNG_INTERNAL_FUNCTION(void,png_read_filter_row,(png_structrp pp, png_row_infop row_info, png_bytep row, png_const_bytep prev_row, int filter),PNG_EMPTY); +#if PNG_ARM_NEON_OPT > 0 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_neon,(png_row_infop @@ -1188,6 +1225,22 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); +#endif + +#if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0 +PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); +PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); +PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_sse2,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); +PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_sse2,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); +PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_sse2,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); +PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_sse2,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); +#endif /* Choose the best filter to use and filter the row data */ PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr, @@ -1215,6 +1268,14 @@ PNG_INTERNAL_FUNCTION(void,png_read_finish_row,(png_structrp png_ptr), /* Initialize the row buffers, etc. */ PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY); +#if PNG_ZLIB_VERNUM >= 0x1240 +PNG_INTERNAL_FUNCTION(int,png_zlib_inflate,(png_structrp png_ptr, int flush), + PNG_EMPTY); +# define PNG_INFLATE(pp, flush) png_zlib_inflate(pp, flush) +#else /* Zlib < 1.2.4 */ +# define PNG_INFLATE(pp, flush) inflate(&(pp)->zstream, flush) +#endif /* Zlib < 1.2.4 */ + #ifdef PNG_READ_TRANSFORMS_SUPPORTED /* Optional call to update the users info structure */ PNG_INTERNAL_FUNCTION(void,png_read_transform_info,(png_structrp png_ptr, @@ -1405,7 +1466,7 @@ PNG_INTERNAL_FUNCTION(void,png_push_have_info,(png_structrp png_ptr, PNG_INTERNAL_FUNCTION(void,png_push_have_end,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_have_row,(png_structrp png_ptr, - png_bytep row),PNG_EMPTY); + png_bytep row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_end,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_process_some_data,(png_structrp png_ptr, @@ -1444,13 +1505,13 @@ PNG_INTERNAL_FUNCTION(void,png_colorspace_set_gamma,(png_const_structrp png_ptr, PNG_INTERNAL_FUNCTION(void,png_colorspace_sync_info,(png_const_structrp png_ptr, png_inforp info_ptr), PNG_EMPTY); - /* Synchronize the info 'valid' flags with the colorspace */ + /* Synchronize the info 'valid' flags with the colorspace */ PNG_INTERNAL_FUNCTION(void,png_colorspace_sync,(png_const_structrp png_ptr, png_inforp info_ptr), PNG_EMPTY); - /* Copy the png_struct colorspace to the info_struct and call the above to - * synchronize the flags. Checks for NULL info_ptr and does nothing. - */ + /* Copy the png_struct colorspace to the info_struct and call the above to + * synchronize the flags. Checks for NULL info_ptr and does nothing. + */ #endif /* Added at libpng version 1.4.0 */ @@ -1905,10 +1966,19 @@ PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS, (png_structp png_ptr, * the builder of libpng passes the definition of PNG_FILTER_OPTIMIZATIONS in * CFLAGS in place of CPPFLAGS *and* uses symbol prefixing. */ +# if PNG_ARM_NEON_OPT > 0 PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon, (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); +# endif +# if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0 +PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2, + (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); +# endif #endif +PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr, + png_const_charp key, png_bytep new_key), PNG_EMPTY); + /* Maintainer: Put new private prototypes here ^ */ #include "pngdebug.h" diff --git a/3rdparty/libpng/pngread.c b/3rdparty/libpng/pngread.c index 48aae84881..1000326922 100644 --- a/3rdparty/libpng/pngread.c +++ b/3rdparty/libpng/pngread.c @@ -1,8 +1,8 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.6.17 [March 26, 2015] - * Copyright (c) 1998-2015 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -28,10 +28,10 @@ png_create_read_struct,(png_const_charp user_png_ver, png_voidp error_ptr, { #ifndef PNG_USER_MEM_SUPPORTED png_structp png_ptr = png_create_png_struct(user_png_ver, error_ptr, - error_fn, warn_fn, NULL, NULL, NULL); + error_fn, warn_fn, NULL, NULL, NULL); #else return png_create_read_struct_2(user_png_ver, error_ptr, error_fn, - warn_fn, NULL, NULL, NULL); + warn_fn, NULL, NULL, NULL); } /* Alternate create PNG structure for reading, and allocate any memory @@ -43,7 +43,7 @@ png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),PNG_ALLOCATED) { png_structp png_ptr = png_create_png_struct(user_png_ver, error_ptr, - error_fn, warn_fn, mem_ptr, malloc_fn, free_fn); + error_fn, warn_fn, mem_ptr, malloc_fn, free_fn); #endif /* USER_MEM */ if (png_ptr != NULL) @@ -127,7 +127,10 @@ png_read_info(png_structrp png_ptr, png_inforp info_ptr) } else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) + { + png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT; png_ptr->mode |= PNG_AFTER_IDAT; + } /* This should be a binary subdivision search or a hash for * matching the chunk name rather than a linear search. @@ -249,7 +252,7 @@ png_read_info(png_structrp png_ptr, png_inforp info_ptr) else png_handle_unknown(png_ptr, info_ptr, length, - PNG_HANDLE_CHUNK_AS_DEFAULT); + PNG_HANDLE_CHUNK_AS_DEFAULT); } } #endif /* SEQUENTIAL_READ */ @@ -276,7 +279,7 @@ png_read_update_info(png_structrp png_ptr, png_inforp info_ptr) /* New in 1.6.0 this avoids the bug of doing the initializations twice */ else png_app_error(png_ptr, - "png_read_update_info/png_start_read_image: duplicate call"); + "png_read_update_info/png_start_read_image: duplicate call"); } } @@ -299,7 +302,7 @@ png_start_read_image(png_structrp png_ptr) /* New in 1.6.0 this avoids the bug of doing the initializations twice */ else png_app_error(png_ptr, - "png_start_read_image/png_read_update_info: duplicate call"); + "png_start_read_image/png_read_update_info: duplicate call"); } } #endif /* SEQUENTIAL_READ */ @@ -537,7 +540,7 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row) { if (png_ptr->row_buf[0] < PNG_FILTER_VALUE_LAST) png_read_filter_row(png_ptr, &row_info, png_ptr->row_buf + 1, - png_ptr->prev_row + 1, png_ptr->row_buf[0]); + png_ptr->prev_row + 1, png_ptr->row_buf[0]); else png_error(png_ptr, "bad adaptive filter value"); } @@ -581,7 +584,7 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row) { if (png_ptr->pass < 6) png_do_read_interlace(&row_info, png_ptr->row_buf + 1, png_ptr->pass, - png_ptr->transformations); + png_ptr->transformations); if (dsp_row != NULL) png_combine_row(png_ptr, dsp_row, 1/*display*/); @@ -716,7 +719,7 @@ png_read_image(png_structrp png_ptr, png_bytepp image) * but the caller should do it! */ png_warning(png_ptr, "Interlace handling should be turned on when " - "using png_read_image"); + "using png_read_image"); /* Make sure this is set correctly */ png_ptr->num_rows = png_ptr->height; } @@ -776,8 +779,8 @@ png_read_end(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED /* Report invalid palette index; added at libng-1.5.10 */ if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - png_ptr->num_palette_max > png_ptr->num_palette) - png_benign_error(png_ptr, "Read palette index exceeding num_palette"); + png_ptr->num_palette_max > png_ptr->num_palette) + png_benign_error(png_ptr, "Read palette index exceeding num_palette"); #endif do @@ -785,6 +788,9 @@ png_read_end(png_structrp png_ptr, png_inforp info_ptr) png_uint_32 length = png_read_chunk_header(png_ptr); png_uint_32 chunk_name = png_ptr->chunk_name; + if (chunk_name != png_IDAT) + png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT; + if (chunk_name == png_IEND) png_handle_IEND(png_ptr, info_ptr, length); @@ -799,9 +805,9 @@ png_read_end(png_structrp png_ptr, png_inforp info_ptr) { if (chunk_name == png_IDAT) { - if ((length > 0) || - (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT) != 0) - png_benign_error(png_ptr, "Too many IDATs found"); + if ((length > 0 && !(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED)) + || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT) != 0) + png_benign_error(png_ptr, ".Too many IDATs found"); } png_handle_unknown(png_ptr, info_ptr, length, keep); if (chunk_name == png_PLTE) @@ -812,10 +818,14 @@ png_read_end(png_structrp png_ptr, png_inforp info_ptr) else if (chunk_name == png_IDAT) { /* Zero length IDATs are legal after the last IDAT has been - * read, but not after other chunks have been read. + * read, but not after other chunks have been read. 1.6 does not + * always read all the deflate data; specifically it cannot be relied + * upon to read the Adler32 at the end. If it doesn't ignore IDAT + * chunks which are longer than zero as well: */ - if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT) != 0) - png_benign_error(png_ptr, "Too many IDATs found"); + if ((length > 0 && !(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED)) + || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT) != 0) + png_benign_error(png_ptr, "..Too many IDATs found"); png_crc_finish(png_ptr, length); } @@ -909,7 +919,7 @@ png_read_end(png_structrp png_ptr, png_inforp info_ptr) else png_handle_unknown(png_ptr, info_ptr, length, - PNG_HANDLE_CHUNK_AS_DEFAULT); + PNG_HANDLE_CHUNK_AS_DEFAULT); } while ((png_ptr->mode & PNG_HAVE_IEND) == 0); } #endif /* SEQUENTIAL_READ */ @@ -1020,8 +1030,7 @@ png_set_read_status_fn(png_structrp png_ptr, png_read_status_ptr read_row_fn) #ifdef PNG_INFO_IMAGE_SUPPORTED void PNGAPI png_read_png(png_structrp png_ptr, png_inforp info_ptr, - int transforms, - voidp params) + int transforms, voidp params) { if (png_ptr == NULL || info_ptr == NULL) return; @@ -1297,7 +1306,7 @@ png_image_read_init(png_imagep image) if (info_ptr != NULL) { png_controlp control = png_voidcast(png_controlp, - png_malloc_warn(png_ptr, (sizeof *control))); + png_malloc_warn(png_ptr, (sizeof *control))); if (control != NULL) { @@ -1460,12 +1469,12 @@ png_image_begin_read_from_stdio(png_imagep image, FILE* file) else return png_image_error(image, - "png_image_begin_read_from_stdio: invalid argument"); + "png_image_begin_read_from_stdio: invalid argument"); } else if (image != NULL) return png_image_error(image, - "png_image_begin_read_from_stdio: incorrect PNG_IMAGE_VERSION"); + "png_image_begin_read_from_stdio: incorrect PNG_IMAGE_VERSION"); return 0; } @@ -1498,12 +1507,12 @@ png_image_begin_read_from_file(png_imagep image, const char *file_name) else return png_image_error(image, - "png_image_begin_read_from_file: invalid argument"); + "png_image_begin_read_from_file: invalid argument"); } else if (image != NULL) return png_image_error(image, - "png_image_begin_read_from_file: incorrect PNG_IMAGE_VERSION"); + "png_image_begin_read_from_file: incorrect PNG_IMAGE_VERSION"); return 0; } @@ -1540,7 +1549,7 @@ png_image_memory_read(png_structp png_ptr, png_bytep out, png_size_t need) } int PNGAPI png_image_begin_read_from_memory(png_imagep image, - png_const_voidp memory, png_size_t size) + png_const_voidp memory, png_size_t size) { if (image != NULL && image->version == PNG_IMAGE_VERSION) { @@ -1563,12 +1572,12 @@ int PNGAPI png_image_begin_read_from_memory(png_imagep image, else return png_image_error(image, - "png_image_begin_read_from_memory: invalid argument"); + "png_image_begin_read_from_memory: invalid argument"); } else if (image != NULL) return png_image_error(image, - "png_image_begin_read_from_memory: incorrect PNG_IMAGE_VERSION"); + "png_image_begin_read_from_memory: incorrect PNG_IMAGE_VERSION"); return 0; } @@ -1614,12 +1623,12 @@ png_image_skip_unused_chunks(png_structrp png_ptr) * IHDR, PLTE, tRNS, IDAT, and IEND chunks. */ png_set_keep_unknown_chunks(png_ptr, PNG_HANDLE_CHUNK_NEVER, - NULL, -1); + NULL, -1); /* But do not ignore image data handling chunks */ png_set_keep_unknown_chunks(png_ptr, PNG_HANDLE_CHUNK_AS_DEFAULT, - chunks_to_process, (int)/*SAFE*/(sizeof chunks_to_process)/5); - } + chunks_to_process, (int)/*SAFE*/(sizeof chunks_to_process)/5); + } } # define PNG_SKIP_CHUNKS(p) png_image_skip_unused_chunks(p) @@ -1686,7 +1695,7 @@ decode_gamma(png_image_read_control *display, png_uint_32 value, int encoding) #ifdef __GNUC__ default: png_error(display->image->opaque->png_ptr, - "unexpected encoding (internal error)"); + "unexpected encoding (internal error)"); #endif } @@ -1695,8 +1704,8 @@ decode_gamma(png_image_read_control *display, png_uint_32 value, int encoding) static png_uint_32 png_colormap_compose(png_image_read_control *display, - png_uint_32 foreground, int foreground_encoding, png_uint_32 alpha, - png_uint_32 background, int encoding) + png_uint_32 foreground, int foreground_encoding, png_uint_32 alpha, + png_uint_32 background, int encoding) { /* The file value is composed on the background, the background has the given * encoding and so does the result, the file is encoded with P_FILE and the @@ -1732,14 +1741,14 @@ png_colormap_compose(png_image_read_control *display, */ static void png_create_colormap_entry(png_image_read_control *display, - png_uint_32 ip, png_uint_32 red, png_uint_32 green, png_uint_32 blue, - png_uint_32 alpha, int encoding) + png_uint_32 ip, png_uint_32 red, png_uint_32 green, png_uint_32 blue, + png_uint_32 alpha, int encoding) { png_imagep image = display->image; const int output_encoding = (image->format & PNG_FORMAT_FLAG_LINEAR) != 0 ? - P_LINEAR : P_sRGB; + P_LINEAR : P_sRGB; const int convert_to_Y = (image->format & PNG_FORMAT_FLAG_COLOR) == 0 && - (red != green || green != blue); + (red != green || green != blue); if (ip > 255) png_error(image->opaque->png_ptr, "color-map index out of range"); @@ -2019,7 +2028,7 @@ make_ga_colormap(png_image_read_control *display) for (g=0; g<6; ++g) png_create_colormap_entry(display, i++, g*51, g*51, g*51, a*51, - P_sRGB); + P_sRGB); } return i; @@ -2043,7 +2052,7 @@ make_rgb_colormap(png_image_read_control *display) for (b=0; b<6; ++b) png_create_colormap_entry(display, i++, r*51, g*51, b*51, 255, - P_sRGB); + P_sRGB); } } @@ -2095,7 +2104,7 @@ png_image_read_colormap(png_voidp argument) else if (display->background == NULL /* no way to remove it */) png_error(png_ptr, - "a background color must be supplied to remove alpha/transparency"); + "background color must be supplied to remove alpha/transparency"); /* Get a copy of the background color (this avoids repeating the checks * below.) The encoding is 8-bit sRGB or 16-bit linear, depending on the @@ -2190,7 +2199,7 @@ png_image_read_colormap(png_voidp argument) */ if (i != trans) png_create_colormap_entry(display, i, val, val, val, 255, - P_FILE/*8-bit with file gamma*/); + P_FILE/*8-bit with file gamma*/); /* Else this entry is transparent. The colors don't matter if * there is an alpha channel (back_alpha == 0), but it does no @@ -2202,7 +2211,7 @@ png_image_read_colormap(png_voidp argument) */ else png_create_colormap_entry(display, i, back_r, back_g, back_b, - back_alpha, output_encoding); + back_alpha, output_encoding); } /* We need libpng to preserve the original encoding. */ @@ -2267,7 +2276,7 @@ png_image_read_colormap(png_voidp argument) * matches. */ png_create_colormap_entry(display, gray, back_g, back_g, - back_g, 65535, P_LINEAR); + back_g, 65535, P_LINEAR); } /* The background passed to libpng, however, must be the @@ -2281,8 +2290,8 @@ png_image_read_colormap(png_voidp argument) * doesn't. */ png_set_background_fixed(png_ptr, &c, - PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/, - 0/*gamma: not used*/); + PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/, + 0/*gamma: not used*/); output_processing = PNG_CMAP_NONE; break; @@ -2312,7 +2321,7 @@ png_image_read_colormap(png_voidp argument) * background color at full precision. */ png_create_colormap_entry(display, 254, back_r, back_g, back_b, - back_alpha, output_encoding); + back_alpha, output_encoding); } else @@ -2380,7 +2389,7 @@ png_image_read_colormap(png_voidp argument) /* And make sure the corresponding palette entry matches. */ png_create_colormap_entry(display, gray, back_g, back_g, - back_g, 65535, P_LINEAR); + back_g, 65535, P_LINEAR); } /* The background passed to libpng, however, must be the sRGB @@ -2390,8 +2399,8 @@ png_image_read_colormap(png_voidp argument) c.gray = c.red = c.green = c.blue = (png_uint_16)gray; png_set_background_fixed(png_ptr, &c, - PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/, - 0/*gamma: not used*/); + PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/, + 0/*gamma: not used*/); output_processing = PNG_CMAP_NONE; } @@ -2411,7 +2420,7 @@ png_image_read_colormap(png_voidp argument) { png_uint_32 gray = (i * 256 + 115) / 231; png_create_colormap_entry(display, i++, gray, gray, gray, - 255, P_sRGB); + 255, P_sRGB); } /* NOTE: this preserves the full precision of the application @@ -2420,13 +2429,13 @@ png_image_read_colormap(png_voidp argument) background_index = i; png_create_colormap_entry(display, i++, back_r, back_g, back_b, #ifdef __COVERITY__ - /* Coverity claims that output_encoding cannot be 2 (P_LINEAR) - * here. - */ 255U, + /* Coverity claims that output_encoding + * cannot be 2 (P_LINEAR) here. + */ 255U, #else - output_encoding == P_LINEAR ? 65535U : 255U, + output_encoding == P_LINEAR ? 65535U : 255U, #endif - output_encoding); + output_encoding); /* For non-opaque input composite on the sRGB background - this * requires inverting the encoding for each component. The input @@ -2464,9 +2473,9 @@ png_image_read_colormap(png_voidp argument) png_uint_32 gray = png_sRGB_table[g*51] * alpha; png_create_colormap_entry(display, i++, - PNG_sRGB_FROM_LINEAR(gray + back_rx), - PNG_sRGB_FROM_LINEAR(gray + back_gx), - PNG_sRGB_FROM_LINEAR(gray + back_bx), 255, P_sRGB); + PNG_sRGB_FROM_LINEAR(gray + back_rx), + PNG_sRGB_FROM_LINEAR(gray + back_gx), + PNG_sRGB_FROM_LINEAR(gray + back_bx), 255, P_sRGB); } } @@ -2492,7 +2501,7 @@ png_image_read_colormap(png_voidp argument) * png_set_tRNS_to_alpha before png_set_background_fixed. */ png_set_rgb_to_gray_fixed(png_ptr, PNG_ERROR_ACTION_NONE, -1, - -1); + -1); data_encoding = P_sRGB; /* The output will now be one or two 8-bit gray or gray+alpha @@ -2568,13 +2577,13 @@ png_image_read_colormap(png_voidp argument) gray = png_sRGB_table[gray]; /* now P_LINEAR */ gray = PNG_DIV257(png_gamma_16bit_correct(gray, - png_ptr->colorspace.gamma)); /* now P_FILE */ + png_ptr->colorspace.gamma)); /* now P_FILE */ /* And make sure the corresponding palette entry contains * exactly the required sRGB value. */ png_create_colormap_entry(display, gray, back_g, back_g, - back_g, 0/*unused*/, output_encoding); + back_g, 0/*unused*/, output_encoding); } else if (output_encoding == P_LINEAR) @@ -2599,8 +2608,8 @@ png_image_read_colormap(png_voidp argument) */ expand_tRNS = 1; png_set_background_fixed(png_ptr, &c, - PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/, - 0/*gamma: not used*/); + PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/, + 0/*gamma: not used*/); } output_processing = PNG_CMAP_NONE; @@ -2634,7 +2643,7 @@ png_image_read_colormap(png_voidp argument) /* Add a transparent entry. */ png_create_colormap_entry(display, cmap_entries, 255, 255, - 255, 0, P_sRGB); + 255, 0, P_sRGB); /* This is stored as the background index for the processing * algorithm. @@ -2655,7 +2664,7 @@ png_image_read_colormap(png_voidp argument) */ for (b=0; b<256; b = (b << 1) | 0x7f) png_create_colormap_entry(display, cmap_entries++, - r, g, b, 128, P_sRGB); + r, g, b, 128, P_sRGB); } } @@ -2682,7 +2691,7 @@ png_image_read_colormap(png_voidp argument) cmap_entries = make_rgb_colormap(display); png_create_colormap_entry(display, cmap_entries, back_r, - back_g, back_b, 0/*unused*/, output_encoding); + back_g, back_b, 0/*unused*/, output_encoding); if (output_encoding == P_LINEAR) { @@ -2704,9 +2713,9 @@ png_image_read_colormap(png_voidp argument) * index. */ if (memcmp((png_const_bytep)display->colormap + - sample_size * cmap_entries, - (png_const_bytep)display->colormap + - sample_size * PNG_RGB_INDEX(r,g,b), + sample_size * cmap_entries, + (png_const_bytep)display->colormap + + sample_size * PNG_RGB_INDEX(r,g,b), sample_size) != 0) { /* The background color must be added. */ @@ -2724,13 +2733,13 @@ png_image_read_colormap(png_voidp argument) */ for (b=0; b<256; b = (b << 1) | 0x7f) png_create_colormap_entry(display, cmap_entries++, - png_colormap_compose(display, r, P_sRGB, 128, - back_r, output_encoding), - png_colormap_compose(display, g, P_sRGB, 128, - back_g, output_encoding), - png_colormap_compose(display, b, P_sRGB, 128, - back_b, output_encoding), - 0/*unused*/, output_encoding); + png_colormap_compose(display, r, P_sRGB, 128, + back_r, output_encoding), + png_colormap_compose(display, g, P_sRGB, 128, + back_g, output_encoding), + png_colormap_compose(display, b, P_sRGB, 128, + back_b, output_encoding), + 0/*unused*/, output_encoding); } } @@ -2748,8 +2757,8 @@ png_image_read_colormap(png_voidp argument) c.blue = (png_uint_16)back_b; png_set_background_fixed(png_ptr, &c, - PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/, - 0/*gamma: not used*/); + PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/, + 0/*gamma: not used*/); output_processing = PNG_CMAP_RGB; } @@ -2801,7 +2810,7 @@ png_image_read_colormap(png_voidp argument) { if (trans[i] == 0) png_create_colormap_entry(display, i, back_r, back_g, - back_b, 0, output_encoding); + back_b, 0, output_encoding); else { @@ -2809,22 +2818,22 @@ png_image_read_colormap(png_voidp argument) * on the sRGB color in 'back'. */ png_create_colormap_entry(display, i, - png_colormap_compose(display, colormap[i].red, P_FILE, - trans[i], back_r, output_encoding), - png_colormap_compose(display, colormap[i].green, P_FILE, - trans[i], back_g, output_encoding), - png_colormap_compose(display, colormap[i].blue, P_FILE, - trans[i], back_b, output_encoding), - output_encoding == P_LINEAR ? trans[i] * 257U : - trans[i], - output_encoding); + png_colormap_compose(display, colormap[i].red, + P_FILE, trans[i], back_r, output_encoding), + png_colormap_compose(display, colormap[i].green, + P_FILE, trans[i], back_g, output_encoding), + png_colormap_compose(display, colormap[i].blue, + P_FILE, trans[i], back_b, output_encoding), + output_encoding == P_LINEAR ? trans[i] * 257U : + trans[i], + output_encoding); } } else png_create_colormap_entry(display, i, colormap[i].red, - colormap[i].green, colormap[i].blue, - i < num_trans ? trans[i] : 255U, P_FILE/*8-bit*/); + colormap[i].green, colormap[i].blue, + i < num_trans ? trans[i] : 255U, P_FILE/*8-bit*/); } /* The PNG data may have indices packed in fewer than 8 bits, it @@ -2838,7 +2847,6 @@ png_image_read_colormap(png_voidp argument) default: png_error(png_ptr, "invalid PNG color type"); /*NOT REACHED*/ - break; } /* Now deal with the output processing */ @@ -2915,7 +2923,7 @@ static int png_image_read_and_map(png_voidp argument) { png_image_read_control *display = png_voidcast(png_image_read_control*, - argument); + argument); png_imagep image = display->image; png_structrp png_ptr = image->opaque->png_ptr; int passes; @@ -3052,7 +3060,7 @@ png_image_read_and_map(png_voidp argument) if (alpha >= 196) *outrow = PNG_RGB_INDEX(inrow[0], inrow[1], - inrow[2]); + inrow[2]); else if (alpha < 64) *outrow = PNG_CMAP_RGB_ALPHA_BACKGROUND; @@ -3104,7 +3112,7 @@ static int png_image_read_colormapped(png_voidp argument) { png_image_read_control *display = png_voidcast(png_image_read_control*, - argument); + argument); png_imagep image = display->image; png_controlp control = image->opaque; png_structrp png_ptr = control->png_ptr; @@ -3237,7 +3245,7 @@ static int png_image_read_composite(png_voidp argument) { png_image_read_control *display = png_voidcast(png_image_read_control*, - argument); + argument); png_imagep image = display->image; png_structrp png_ptr = image->opaque->png_ptr; int passes; @@ -3364,7 +3372,7 @@ static int png_image_read_background(png_voidp argument) { png_image_read_control *display = png_voidcast(png_image_read_control*, - argument); + argument); png_imagep image = display->image; png_structrp png_ptr = image->opaque->png_ptr; png_inforp info_ptr = image->opaque->info_ptr; @@ -3424,8 +3432,7 @@ png_image_read_background(png_voidp argument) for (pass = 0; pass < passes; ++pass) { - png_bytep row = png_voidcast(png_bytep, - display->first_row); + png_bytep row = png_voidcast(png_bytep, display->first_row); unsigned int startx, stepx, stepy; png_uint_32 y; @@ -3453,7 +3460,7 @@ png_image_read_background(png_voidp argument) for (; ylocal_row); + display->local_row); png_bytep outrow = first_row + y * step_row; png_const_bytep end_row = outrow + width; @@ -3498,7 +3505,7 @@ png_image_read_background(png_voidp argument) for (; ylocal_row); + display->local_row); png_bytep outrow = first_row + y * step_row; png_const_bytep end_row = outrow + width; @@ -3545,7 +3552,7 @@ png_image_read_background(png_voidp argument) */ { png_uint_16p first_row = png_voidcast(png_uint_16p, - display->first_row); + display->first_row); /* The division by two is safe because the caller passed in a * stride which was multiplied by 2 (below) to get row_bytes. */ @@ -3595,7 +3602,7 @@ png_image_read_background(png_voidp argument) /* Read the row, which is packed: */ png_read_row(png_ptr, png_voidcast(png_bytep, - display->local_row), NULL); + display->local_row), NULL); inrow = png_voidcast(png_const_uint_16p, display->local_row); /* Now do the pre-multiplication on each pixel in this row. @@ -3644,7 +3651,7 @@ static int png_image_read_direct(png_voidp argument) { png_image_read_control *display = png_voidcast(png_image_read_control*, - argument); + argument); png_imagep image = display->image; png_structrp png_ptr = image->opaque->png_ptr; png_inforp info_ptr = image->opaque->info_ptr; @@ -3695,7 +3702,7 @@ png_image_read_direct(png_voidp argument) do_local_background = 1/*maybe*/; png_set_rgb_to_gray_fixed(png_ptr, PNG_ERROR_ACTION_NONE, - PNG_RGB_TO_GRAY_DEFAULT, PNG_RGB_TO_GRAY_DEFAULT); + PNG_RGB_TO_GRAY_DEFAULT, PNG_RGB_TO_GRAY_DEFAULT); } change &= ~PNG_FORMAT_FLAG_COLOR; @@ -3754,7 +3761,7 @@ png_image_read_direct(png_voidp argument) * final value. */ if (png_muldiv(>est, output_gamma, png_ptr->colorspace.gamma, - PNG_FP_1) != 0 && png_gamma_significant(gtest) == 0) + PNG_FP_1) != 0 && png_gamma_significant(gtest) == 0) do_local_background = 0; else if (mode == PNG_ALPHA_STANDARD) @@ -3817,8 +3824,8 @@ png_image_read_direct(png_voidp argument) * pixels. */ png_set_background_fixed(png_ptr, &c, - PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/, - 0/*gamma: not used*/); + PNG_BACKGROUND_GAMMA_SCREEN, 0/*need_expand*/, + 0/*gamma: not used*/); } else /* compose on row: implemented below. */ @@ -3849,16 +3856,16 @@ png_image_read_direct(png_voidp argument) else filler = 255; -# ifdef PNG_FORMAT_AFIRST_SUPPORTED - if ((format & PNG_FORMAT_FLAG_AFIRST) != 0) - { - where = PNG_FILLER_BEFORE; - change &= ~PNG_FORMAT_FLAG_AFIRST; - } +#ifdef PNG_FORMAT_AFIRST_SUPPORTED + if ((format & PNG_FORMAT_FLAG_AFIRST) != 0) + { + where = PNG_FILLER_BEFORE; + change &= ~PNG_FORMAT_FLAG_AFIRST; + } - else -# endif - where = PNG_FILLER_AFTER; + else +#endif + where = PNG_FILLER_AFTER; png_set_add_alpha(png_ptr, filler, where); } @@ -3966,12 +3973,12 @@ png_image_read_direct(png_voidp argument) if (info_ptr->bit_depth == 16) info_format |= PNG_FORMAT_FLAG_LINEAR; -# ifdef PNG_FORMAT_BGR_SUPPORTED - if ((png_ptr->transformations & PNG_BGR) != 0) - info_format |= PNG_FORMAT_FLAG_BGR; -# endif +#ifdef PNG_FORMAT_BGR_SUPPORTED + if ((png_ptr->transformations & PNG_BGR) != 0) + info_format |= PNG_FORMAT_FLAG_BGR; +#endif -# ifdef PNG_FORMAT_AFIRST_SUPPORTED +#ifdef PNG_FORMAT_AFIRST_SUPPORTED if (do_local_background == 2) { if ((format & PNG_FORMAT_FLAG_AFIRST) != 0) @@ -4068,67 +4075,117 @@ png_image_read_direct(png_voidp argument) int PNGAPI png_image_finish_read(png_imagep image, png_const_colorp background, - void *buffer, png_int_32 row_stride, void *colormap) + void *buffer, png_int_32 row_stride, void *colormap) { if (image != NULL && image->version == PNG_IMAGE_VERSION) { - png_uint_32 check; + /* Check for row_stride overflow. This check is not performed on the + * original PNG format because it may not occur in the output PNG format + * and libpng deals with the issues of reading the original. + */ + const unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format); - if (row_stride == 0) - row_stride = PNG_IMAGE_ROW_STRIDE(*image); - - if (row_stride < 0) - check = -row_stride; - - else - check = row_stride; - - if (image->opaque != NULL && buffer != NULL && - check >= PNG_IMAGE_ROW_STRIDE(*image)) + /* The following checks just the 'row_stride' calculation to ensure it + * fits in a signed 32-bit value. Because channels/components can be + * either 1 or 2 bytes in size the length of a row can still overflow 32 + * bits; this is just to verify that the 'row_stride' argument can be + * represented. + */ + if (image->width <= 0x7FFFFFFFU/channels) /* no overflow */ { - if ((image->format & PNG_FORMAT_FLAG_COLORMAP) == 0 || - (image->colormap_entries > 0 && colormap != NULL)) + png_uint_32 check; + const png_uint_32 png_row_stride = image->width * channels; + + if (row_stride == 0) + row_stride = (png_int_32)/*SAFE*/png_row_stride; + + if (row_stride < 0) + check = -row_stride; + + else + check = row_stride; + + /* This verifies 'check', the absolute value of the actual stride + * passed in and detects overflow in the application calculation (i.e. + * if the app did actually pass in a non-zero 'row_stride'. + */ + if (image->opaque != NULL && buffer != NULL && check >= png_row_stride) { - int result; - png_image_read_control display; - - memset(&display, 0, (sizeof display)); - display.image = image; - display.buffer = buffer; - display.row_stride = row_stride; - display.colormap = colormap; - display.background = background; - display.local_row = NULL; - - /* Choose the correct 'end' routine; for the color-map case all the - * setup has already been done. + /* Now check for overflow of the image buffer calculation; this + * limits the whole image size to 32 bits for API compatibility with + * the current, 32-bit, PNG_IMAGE_BUFFER_SIZE macro. + * + * The PNG_IMAGE_BUFFER_SIZE macro is: + * + * (PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)*height*(row_stride)) + * + * And the component size is always 1 or 2, so make sure that the + * number of *bytes* that the application is saying are available + * does actually fit into a 32-bit number. + * + * NOTE: this will be changed in 1.7 because PNG_IMAGE_BUFFER_SIZE + * will be changed to use png_alloc_size_t; bigger images can be + * accomodated on 64-bit systems. */ - if ((image->format & PNG_FORMAT_FLAG_COLORMAP) != 0) - result = - png_safe_execute(image, png_image_read_colormap, &display) && - png_safe_execute(image, png_image_read_colormapped, &display); + if (image->height <= + 0xFFFFFFFFU/PNG_IMAGE_PIXEL_COMPONENT_SIZE(image->format)/check) + { + if ((image->format & PNG_FORMAT_FLAG_COLORMAP) == 0 || + (image->colormap_entries > 0 && colormap != NULL)) + { + int result; + png_image_read_control display; + + memset(&display, 0, (sizeof display)); + display.image = image; + display.buffer = buffer; + display.row_stride = row_stride; + display.colormap = colormap; + display.background = background; + display.local_row = NULL; + + /* Choose the correct 'end' routine; for the color-map case + * all the setup has already been done. + */ + if ((image->format & PNG_FORMAT_FLAG_COLORMAP) != 0) + result = + png_safe_execute(image, + png_image_read_colormap, &display) && + png_safe_execute(image, + png_image_read_colormapped, &display); + + else + result = + png_safe_execute(image, + png_image_read_direct, &display); + + png_image_free(image); + return result; + } + + else + return png_image_error(image, + "png_image_finish_read[color-map]: no color-map"); + } else - result = - png_safe_execute(image, png_image_read_direct, &display); - - png_image_free(image); - return result; + return png_image_error(image, + "png_image_finish_read: image too large"); } else return png_image_error(image, - "png_image_finish_read[color-map]: no color-map"); + "png_image_finish_read: invalid argument"); } else return png_image_error(image, - "png_image_finish_read: invalid argument"); + "png_image_finish_read: row_stride too large"); } else if (image != NULL) return png_image_error(image, - "png_image_finish_read: damaged PNG_IMAGE_VERSION"); + "png_image_finish_read: damaged PNG_IMAGE_VERSION"); return 0; } diff --git a/3rdparty/libpng/pngrio.c b/3rdparty/libpng/pngrio.c index 38f7fd49d6..7e26e855ca 100644 --- a/3rdparty/libpng/pngrio.c +++ b/3rdparty/libpng/pngrio.c @@ -1,8 +1,8 @@ /* pngrio.c - functions for data input * - * Last changed in libpng 1.6.17 [March 26, 2015] - * Copyright (c) 1998-2015 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -85,7 +85,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length) */ void PNGAPI png_set_read_fn(png_structrp png_ptr, png_voidp io_ptr, - png_rw_ptr read_data_fn) + png_rw_ptr read_data_fn) { if (png_ptr == NULL) return; diff --git a/3rdparty/libpng/pngrtran.c b/3rdparty/libpng/pngrtran.c index f129ef129c..748ffb3ed4 100644 --- a/3rdparty/libpng/pngrtran.c +++ b/3rdparty/libpng/pngrtran.c @@ -1,8 +1,8 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * Last changed in libpng 1.6.19 [November 12, 2015] - * Copyright (c) 1998-2015 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -48,7 +48,7 @@ png_set_crc_action(png_structrp png_ptr, int crit_action, int ancil_action) case PNG_CRC_WARN_DISCARD: /* Not a valid action for critical data */ png_warning(png_ptr, - "Can't discard critical data on CRC error"); + "Can't discard critical data on CRC error"); case PNG_CRC_ERROR_QUIT: /* Error/quit */ case PNG_CRC_DEFAULT: @@ -101,7 +101,7 @@ png_rtran_ok(png_structrp png_ptr, int need_IHDR) { if ((png_ptr->flags & PNG_FLAG_ROW_INIT) != 0) png_app_error(png_ptr, - "invalid after png_start_read_image or png_read_update_info"); + "invalid after png_start_read_image or png_read_update_info"); else if (need_IHDR && (png_ptr->mode & PNG_HAVE_IHDR) == 0) png_app_error(png_ptr, "invalid before the PNG header has been read"); @@ -159,7 +159,7 @@ png_set_background(png_structrp png_ptr, png_set_background_fixed(png_ptr, background_color, background_gamma_code, need_expand, png_fixed(png_ptr, background_gamma, "png_set_background")); } -# endif /* FLOATING_POINT */ +# endif /* FLOATING_POINT */ #endif /* READ_BACKGROUND */ /* Scale 16-bit depth files to 8-bit depth. If both of these are set then the @@ -209,7 +209,7 @@ png_set_strip_alpha(png_structrp png_ptr) #if defined(PNG_READ_ALPHA_MODE_SUPPORTED) || defined(PNG_READ_GAMMA_SUPPORTED) static png_fixed_point translate_gamma_flags(png_structrp png_ptr, png_fixed_point output_gamma, - int is_screen) + int is_screen) { /* Check for flag values. The main reason for having the old Mac value as a * flag is that it is pretty near impossible to work out what the correct @@ -273,7 +273,7 @@ convert_gamma_value(png_structrp png_ptr, double output_gamma) #ifdef PNG_READ_ALPHA_MODE_SUPPORTED void PNGFAPI png_set_alpha_mode_fixed(png_structrp png_ptr, int mode, - png_fixed_point output_gamma) + png_fixed_point output_gamma) { int compose = 0; png_fixed_point file_gamma; @@ -289,9 +289,12 @@ png_set_alpha_mode_fixed(png_structrp png_ptr, int mode, * is expected to be 1 or greater, but this range test allows for some * viewing correction values. The intent is to weed out users of this API * who use the inverse of the gamma value accidentally! Since some of these - * values are reasonable this may have to be changed. + * values are reasonable this may have to be changed: + * + * 1.6.x: changed from 0.07..3 to 0.01..100 (to accomodate the optimal 16-bit + * gamma of 36, and its reciprocal.) */ - if (output_gamma < 70000 || output_gamma > 300000) + if (output_gamma < 1000 || output_gamma > 10000000) png_error(png_ptr, "output gamma out of expected range"); /* The default file gamma is the inverse of the output gamma; the output @@ -374,7 +377,7 @@ png_set_alpha_mode_fixed(png_structrp png_ptr, int mode, if ((png_ptr->transformations & PNG_COMPOSE) != 0) png_error(png_ptr, - "conflicting calls to set alpha mode and background"); + "conflicting calls to set alpha mode and background"); png_ptr->transformations |= PNG_COMPOSE; } @@ -385,7 +388,7 @@ void PNGAPI png_set_alpha_mode(png_structrp png_ptr, int mode, double output_gamma) { png_set_alpha_mode_fixed(png_ptr, mode, convert_gamma_value(png_ptr, - output_gamma)); + output_gamma)); } # endif #endif @@ -799,7 +802,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette, #ifdef PNG_READ_GAMMA_SUPPORTED void PNGFAPI png_set_gamma_fixed(png_structrp png_ptr, png_fixed_point scrn_gamma, - png_fixed_point file_gamma) + png_fixed_point file_gamma) { png_debug(1, "in png_set_gamma_fixed"); @@ -841,7 +844,7 @@ void PNGAPI png_set_gamma(png_structrp png_ptr, double scrn_gamma, double file_gamma) { png_set_gamma_fixed(png_ptr, convert_gamma_value(png_ptr, scrn_gamma), - convert_gamma_value(png_ptr, file_gamma)); + convert_gamma_value(png_ptr, file_gamma)); } # endif /* FLOATING_POINT */ #endif /* READ_GAMMA */ @@ -987,7 +990,7 @@ png_set_rgb_to_gray_fixed(png_structrp png_ptr, int error_action, * that it just worked and get a memory overwrite. */ png_error(png_ptr, - "Cannot do RGB_TO_GRAY without EXPAND_SUPPORTED"); + "Cannot do RGB_TO_GRAY without EXPAND_SUPPORTED"); /* png_ptr->transformations &= ~PNG_RGB_TO_GRAY; */ } @@ -1014,7 +1017,7 @@ png_set_rgb_to_gray_fixed(png_structrp png_ptr, int error_action, { if (red >= 0 && green >= 0) png_app_warning(png_ptr, - "ignoring out of range rgb_to_gray coefficients"); + "ignoring out of range rgb_to_gray coefficients"); /* Use the defaults, from the cHRM chunk if set, else the historical * values which are close to the sRGB/HDTV/ITU-Rec 709 values. See @@ -1023,7 +1026,7 @@ png_set_rgb_to_gray_fixed(png_structrp png_ptr, int error_action, * something has already provided a default. */ if (png_ptr->rgb_to_gray_red_coeff == 0 && - png_ptr->rgb_to_gray_green_coeff == 0) + png_ptr->rgb_to_gray_green_coeff == 0) { png_ptr->rgb_to_gray_red_coeff = 6968; png_ptr->rgb_to_gray_green_coeff = 23434; @@ -1040,10 +1043,10 @@ png_set_rgb_to_gray_fixed(png_structrp png_ptr, int error_action, void PNGAPI png_set_rgb_to_gray(png_structrp png_ptr, int error_action, double red, - double green) + double green) { png_set_rgb_to_gray_fixed(png_ptr, error_action, - png_fixed(png_ptr, red, "rgb to gray red coefficient"), + png_fixed(png_ptr, red, "rgb to gray red coefficient"), png_fixed(png_ptr, green, "rgb to gray green coefficient")); } #endif /* FLOATING POINT */ @@ -1300,7 +1303,7 @@ png_init_read_transformations(png_structrp png_ptr) { if (png_ptr->screen_gamma != 0) /* screen set too */ gamma_correction = png_gamma_threshold(png_ptr->colorspace.gamma, - png_ptr->screen_gamma); + png_ptr->screen_gamma); else /* Assume the output matches the input; a long time default behavior @@ -1581,7 +1584,7 @@ png_init_read_transformations(png_structrp png_ptr) */ if ((png_ptr->transformations & PNG_RGB_TO_GRAY) != 0) png_warning(png_ptr, - "libpng does not support gamma+background+rgb_to_gray"); + "libpng does not support gamma+background+rgb_to_gray"); if ((png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) != 0) { @@ -1617,13 +1620,13 @@ png_init_read_transformations(png_structrp png_ptr) case PNG_BACKGROUND_GAMMA_FILE: g = png_reciprocal(png_ptr->colorspace.gamma); gs = png_reciprocal2(png_ptr->colorspace.gamma, - png_ptr->screen_gamma); + png_ptr->screen_gamma); break; case PNG_BACKGROUND_GAMMA_UNIQUE: g = png_reciprocal(png_ptr->background_gamma); gs = png_reciprocal2(png_ptr->background_gamma, - png_ptr->screen_gamma); + png_ptr->screen_gamma); break; default: g = PNG_FP_1; /* back_1 */ @@ -1651,11 +1654,11 @@ png_init_read_transformations(png_structrp png_ptr) if (png_gamma_significant(g) != 0) { back_1.red = png_gamma_8bit_correct(png_ptr->background.red, - g); + g); back_1.green = png_gamma_8bit_correct( - png_ptr->background.green, g); + png_ptr->background.green, g); back_1.blue = png_gamma_8bit_correct(png_ptr->background.blue, - g); + g); } else @@ -1726,7 +1729,7 @@ png_init_read_transformations(png_structrp png_ptr) case PNG_BACKGROUND_GAMMA_FILE: g = png_reciprocal(png_ptr->colorspace.gamma); gs = png_reciprocal2(png_ptr->colorspace.gamma, - png_ptr->screen_gamma); + png_ptr->screen_gamma); break; case PNG_BACKGROUND_GAMMA_UNIQUE: @@ -1912,7 +1915,7 @@ png_init_read_transformations(png_structrp png_ptr) png_ptr->palette[i].blue = (png_byte)component; } } -#endif /* READ_SHIFT */ +#endif /* READ_SHIFT */ } /* Modify the info structure to reflect the transformations. The @@ -4192,7 +4195,7 @@ png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr) */ static void png_do_expand_palette(png_row_infop row_info, png_bytep row, - png_const_colorp palette, png_const_bytep trans_alpha, int num_trans) + png_const_colorp palette, png_const_bytep trans_alpha, int num_trans) { int shift, value; png_bytep sp, dp; @@ -4499,7 +4502,7 @@ png_do_expand(png_row_infop row_info, png_bytep row, row_info->channels = 2; row_info->pixel_depth = (png_byte)(row_info->bit_depth << 1); row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, - row_width); + row_width); } } else if (row_info->color_type == PNG_COLOR_TYPE_RGB && @@ -4759,7 +4762,7 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info) (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA || row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)) png_do_strip_channel(row_info, png_ptr->row_buf + 1, - 0 /* at_start == false, because SWAP_ALPHA happens later */); + 0 /* at_start == false, because SWAP_ALPHA happens later */); #endif #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED diff --git a/3rdparty/libpng/pngrutil.c b/3rdparty/libpng/pngrutil.c index ee584a8c40..1c8a179443 100644 --- a/3rdparty/libpng/pngrutil.c +++ b/3rdparty/libpng/pngrutil.c @@ -1,8 +1,8 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.6.19 [November 12, 2015] - * Copyright (c) 1998-2015 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -90,7 +90,7 @@ png_get_int_32)(png_const_bytep buf) uval = (uval ^ 0xffffffff) + 1; /* 2's complement: -x = ~x+1 */ if ((uval & 0x80000000) == 0) /* no overflow */ - return -(png_int_32)uval; + return -(png_int_32)uval; /* The following has to be safe; this function only gets called on PNG data * and if we get here that data is invalid. 0 is the most safe value and * if not then an attacker would surely just generate a PNG with 0 instead. @@ -377,10 +377,16 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner) if (((png_ptr->options >> PNG_MAXIMUM_INFLATE_WINDOW) & 3) == PNG_OPTION_ON) + { window_bits = 15; + png_ptr->zstream_start = 0; /* fixed window size */ + } else + { window_bits = 0; + png_ptr->zstream_start = 1; + } # else # define window_bits 0 # endif @@ -429,6 +435,31 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner) #endif } +#if PNG_ZLIB_VERNUM >= 0x1240 +/* Handle the start of the inflate stream if we called inflateInit2(strm,0); + * in this case some zlib versions skip validation of the CINFO field and, in + * certain circumstances, libpng may end up displaying an invalid image, in + * contrast to implementations that call zlib in the normal way (e.g. libpng + * 1.5). + */ +int /* PRIVATE */ +png_zlib_inflate(png_structrp png_ptr, int flush) +{ + if (png_ptr->zstream_start && png_ptr->zstream.avail_in > 0) + { + if ((*png_ptr->zstream.next_in >> 4) > 7) + { + png_ptr->zstream.msg = "invalid window size (libpng)"; + return Z_DATA_ERROR; + } + + png_ptr->zstream_start = 0; + } + + return inflate(&png_ptr->zstream, flush); +} +#endif /* Zlib >= 1.2.4 */ + #ifdef PNG_READ_COMPRESSED_TEXT_SUPPORTED /* png_inflate now returns zlib error codes including Z_OK and Z_STREAM_END to * allow the caller to do multiple calls if required. If the 'finish' flag is @@ -522,7 +553,7 @@ png_inflate(png_structrp png_ptr, png_uint_32 owner, int finish, * the previous chunk of input data. Tell zlib if we have reached the * end of the output buffer. */ - ret = inflate(&png_ptr->zstream, avail_out > 0 ? Z_NO_FLUSH : + ret = PNG_INFLATE(png_ptr, avail_out > 0 ? Z_NO_FLUSH : (finish ? Z_FINISH : Z_SYNC_FLUSH)); } while (ret == Z_OK); @@ -559,6 +590,7 @@ png_inflate(png_structrp png_ptr, png_uint_32 owner, int finish, } } +#if defined(PNG_READ_zTXt_SUPPORTED) || defined (PNG_READ_iTXt_SUPPORTED) /* * Decompress trailing data in a chunk. The assumption is that read_buffer * points at an allocated area holding the contents of a chunk with a @@ -568,9 +600,9 @@ png_inflate(png_structrp png_ptr, png_uint_32 owner, int finish, */ static int png_decompress_chunk(png_structrp png_ptr, - png_uint_32 chunklength, png_uint_32 prefix_size, - png_alloc_size_t *newlength /* must be initialized to the maximum! */, - int terminate /*add a '\0' to the end of the uncompressed data*/) + png_uint_32 chunklength, png_uint_32 prefix_size, + png_alloc_size_t *newlength /* must be initialized to the maximum! */, + int terminate /*add a '\0' to the end of the uncompressed data*/) { /* TODO: implement different limits for different types of chunk. * @@ -607,8 +639,8 @@ png_decompress_chunk(png_structrp png_ptr, png_uint_32 lzsize = chunklength - prefix_size; ret = png_inflate(png_ptr, png_ptr->chunk_name, 1/*finish*/, - /* input: */ png_ptr->read_buffer + prefix_size, &lzsize, - /* output: */ NULL, newlength); + /* input: */ png_ptr->read_buffer + prefix_size, &lzsize, + /* output: */ NULL, newlength); if (ret == Z_STREAM_END) { @@ -628,15 +660,15 @@ png_decompress_chunk(png_structrp png_ptr, */ png_alloc_size_t new_size = *newlength; png_alloc_size_t buffer_size = prefix_size + new_size + - (terminate != 0); + (terminate != 0); png_bytep text = png_voidcast(png_bytep, png_malloc_base(png_ptr, - buffer_size)); + buffer_size)); if (text != NULL) { ret = png_inflate(png_ptr, png_ptr->chunk_name, 1/*finish*/, - png_ptr->read_buffer + prefix_size, &lzsize, - text + prefix_size, newlength); + png_ptr->read_buffer + prefix_size, &lzsize, + text + prefix_size, newlength); if (ret == Z_STREAM_END) { @@ -723,6 +755,7 @@ png_decompress_chunk(png_structrp png_ptr, return Z_MEM_ERROR; } } +#endif /* READ_zTXt || READ_iTXt */ #endif /* READ_COMPRESSED_TEXT */ #ifdef PNG_READ_iCCP_SUPPORTED @@ -731,8 +764,8 @@ png_decompress_chunk(png_structrp png_ptr, */ static int png_inflate_read(png_structrp png_ptr, png_bytep read_buffer, uInt read_size, - png_uint_32p chunk_bytes, png_bytep next_out, png_alloc_size_t *out_size, - int finish) + png_uint_32p chunk_bytes, png_bytep next_out, png_alloc_size_t *out_size, + int finish) { if (png_ptr->zowner == png_ptr->chunk_name) { @@ -771,8 +804,8 @@ png_inflate_read(png_structrp png_ptr, png_bytep read_buffer, uInt read_size, * the available output is produced; this allows reading of truncated * streams. */ - ret = inflate(&png_ptr->zstream, - *chunk_bytes > 0 ? Z_NO_FLUSH : (finish ? Z_FINISH : Z_SYNC_FLUSH)); + ret = PNG_INFLATE(png_ptr, *chunk_bytes > 0 ? + Z_NO_FLUSH : (finish ? Z_FINISH : Z_SYNC_FLUSH)); } while (ret == Z_OK && (*out_size > 0 || png_ptr->zstream.avail_out > 0)); @@ -1261,7 +1294,7 @@ png_handle_cHRM(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) png_ptr->colorspace.flags |= PNG_COLORSPACE_FROM_cHRM; (void)png_colorspace_set_chromaticities(png_ptr, &png_ptr->colorspace, &xy, - 1/*prefer cHRM values*/); + 1/*prefer cHRM values*/); png_colorspace_sync(png_ptr, info_ptr); } #endif @@ -1401,8 +1434,8 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) png_ptr->zstream.next_in = (Bytef*)keyword + (keyword_length+2); png_ptr->zstream.avail_in = read_length; (void)png_inflate_read(png_ptr, local_buffer, - (sizeof local_buffer), &length, profile_header, &size, - 0/*finish: don't, because the output is too small*/); + (sizeof local_buffer), &length, profile_header, &size, + 0/*finish: don't, because the output is too small*/); if (size == 0) { @@ -1412,14 +1445,14 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) png_get_uint_32(profile_header); if (png_icc_check_length(png_ptr, &png_ptr->colorspace, - keyword, profile_length) != 0) + keyword, profile_length) != 0) { /* The length is apparently ok, so we can check the 132 * byte header. */ if (png_icc_check_header(png_ptr, &png_ptr->colorspace, - keyword, profile_length, profile_header, - png_ptr->color_type) != 0) + keyword, profile_length, profile_header, + png_ptr->color_type) != 0) { /* Now read the tag table; a variable size buffer is * needed at this point, allocate one for the whole @@ -1427,20 +1460,20 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) * that none of these stuff will overflow. */ const png_uint_32 tag_count = png_get_uint_32( - profile_header+128); + profile_header+128); png_bytep profile = png_read_buffer(png_ptr, - profile_length, 2/*silent*/); + profile_length, 2/*silent*/); if (profile != NULL) { memcpy(profile, profile_header, - (sizeof profile_header)); + (sizeof profile_header)); size = 12 * tag_count; (void)png_inflate_read(png_ptr, local_buffer, - (sizeof local_buffer), &length, - profile + (sizeof profile_header), &size, 0); + (sizeof local_buffer), &length, + profile + (sizeof profile_header), &size, 0); /* Still expect a buffer error because we expect * there to be some tag data! @@ -1448,22 +1481,22 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) if (size == 0) { if (png_icc_check_tag_table(png_ptr, - &png_ptr->colorspace, keyword, profile_length, - profile) != 0) + &png_ptr->colorspace, keyword, profile_length, + profile) != 0) { /* The profile has been validated for basic * security issues, so read the whole thing in. */ size = profile_length - (sizeof profile_header) - - 12 * tag_count; + - 12 * tag_count; (void)png_inflate_read(png_ptr, local_buffer, - (sizeof local_buffer), &length, - profile + (sizeof profile_header) + - 12 * tag_count, &size, 1/*finish*/); + (sizeof local_buffer), &length, + profile + (sizeof profile_header) + + 12 * tag_count, &size, 1/*finish*/); if (length > 0 && !(png_ptr->flags & - PNG_FLAG_BENIGN_ERRORS_WARN)) + PNG_FLAG_BENIGN_ERRORS_WARN)) errmsg = "extra compressed data"; /* But otherwise allow extra data: */ @@ -1475,34 +1508,34 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) * keep going. */ png_chunk_warning(png_ptr, - "extra compressed data"); + "extra compressed data"); } png_crc_finish(png_ptr, length); finished = 1; -# ifdef PNG_sRGB_SUPPORTED +# if defined(PNG_sRGB_SUPPORTED) && PNG_sRGB_PROFILE_CHECKS >= 0 /* Check for a match against sRGB */ png_icc_set_sRGB(png_ptr, - &png_ptr->colorspace, profile, - png_ptr->zstream.adler); -# endif + &png_ptr->colorspace, profile, + png_ptr->zstream.adler); +# endif /* Steal the profile for info_ptr. */ if (info_ptr != NULL) { png_free_data(png_ptr, info_ptr, - PNG_FREE_ICCP, 0); + PNG_FREE_ICCP, 0); info_ptr->iccp_name = png_voidcast(char*, - png_malloc_base(png_ptr, - keyword_length+1)); + png_malloc_base(png_ptr, + keyword_length+1)); if (info_ptr->iccp_name != NULL) { memcpy(info_ptr->iccp_name, keyword, - keyword_length+1); + keyword_length+1); info_ptr->iccp_proflen = - profile_length; + profile_length; info_ptr->iccp_profile = profile; png_ptr->read_buffer = NULL; /*steal*/ info_ptr->free_me |= PNG_FREE_ICCP; @@ -1670,7 +1703,7 @@ png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) ++entry_start; /* A sample depth should follow the separator, and we should be on it */ - if (entry_start > buffer + length - 2) + if (length < 2U || entry_start > buffer + (length - 2U)) { png_warning(png_ptr, "malformed sPLT chunk"); return; @@ -2174,7 +2207,7 @@ png_handle_pCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) /* We need to have at least 12 bytes after the purpose string * in order to get the parameter information. */ - if (endptr <= buf + 12) + if (endptr - buf <= 12) { png_chunk_benign_error(png_ptr, "invalid"); return; @@ -2239,7 +2272,7 @@ png_handle_pCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) } png_set_pCAL(png_ptr, info_ptr, (png_charp)buffer, X0, X1, type, nparams, - (png_charp)units, params); + (png_charp)units, params); png_free(png_ptr, params); } @@ -2282,7 +2315,7 @@ png_handle_sCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) } png_debug1(2, "Allocating and reading sCAL chunk data (%u bytes)", - length + 1); + length + 1); buffer = png_read_buffer(png_ptr, length+1, 2/*silent*/); @@ -2334,7 +2367,7 @@ png_handle_sCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) else /* This is the (only) success case. */ png_set_sCAL_s(png_ptr, info_ptr, buffer[0], - (png_charp)buffer+1, (png_charp)buffer+heighti); + (png_charp)buffer+1, (png_charp)buffer+heighti); } } #endif @@ -2434,8 +2467,8 @@ png_handle_tEXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) if (buffer == NULL) { - png_chunk_benign_error(png_ptr, "out of memory"); - return; + png_chunk_benign_error(png_ptr, "out of memory"); + return; } png_crc_read(png_ptr, buffer, length); @@ -2542,7 +2575,7 @@ png_handle_zTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) * and text chunks. */ if (png_decompress_chunk(png_ptr, length, keyword_length+2, - &uncompressed_length, 1/*terminate*/) == Z_STREAM_END) + &uncompressed_length, 1/*terminate*/) == Z_STREAM_END) { png_text text; @@ -2682,7 +2715,7 @@ png_handle_iTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) * iCCP and text chunks. */ if (png_decompress_chunk(png_ptr, length, prefix_length, - &uncompressed_length, 1/*terminate*/) == Z_STREAM_END) + &uncompressed_length, 1/*terminate*/) == Z_STREAM_END) buffer = png_ptr->read_buffer; else @@ -2762,7 +2795,7 @@ png_cache_unknown_chunk(png_structrp png_ptr, png_uint_32 length) { /* Do a 'warn' here - it is handled below. */ png_ptr->unknown_chunk.data = png_voidcast(png_bytep, - png_malloc_warn(png_ptr, length)); + png_malloc_warn(png_ptr, length)); } } @@ -2787,7 +2820,7 @@ png_cache_unknown_chunk(png_structrp png_ptr, png_uint_32 length) /* Handle an unknown, or known but disabled, chunk */ void /* PRIVATE */ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr, - png_uint_32 length, int keep) + png_uint_32 length, int keep) { int handled = 0; /* the chunk was handled */ @@ -2825,7 +2858,7 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr, { /* Callback to user unknown chunk handler */ int ret = (*(png_ptr->read_user_chunk_fn))(png_ptr, - &png_ptr->unknown_chunk); + &png_ptr->unknown_chunk); /* ret is: * negative: An error occurred; png_chunk_error will be called. @@ -2859,9 +2892,9 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr, { png_chunk_warning(png_ptr, "Saving unknown chunk:"); png_app_warning(png_ptr, - "forcing save of an unhandled chunk;" - " please call png_set_keep_unknown_chunks"); - /* with keep = PNG_HANDLE_CHUNK_IF_SAFE */ + "forcing save of an unhandled chunk;" + " please call png_set_keep_unknown_chunks"); + /* with keep = PNG_HANDLE_CHUNK_IF_SAFE */ } # endif keep = PNG_HANDLE_CHUNK_IF_SAFE; @@ -2954,7 +2987,7 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr, * out; store the chunk. */ png_set_unknown_chunks(png_ptr, info_ptr, - &png_ptr->unknown_chunk, 1); + &png_ptr->unknown_chunk, 1); handled = 1; # ifdef PNG_USER_LIMITS_SUPPORTED break; @@ -3387,8 +3420,8 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display) /* Everything is aligned for png_uint_16 copies, but try for * png_uint_32 first. */ - if (png_isaligned(dp, png_uint_32) != 0 && - png_isaligned(sp, png_uint_32) != 0 && + if (png_isaligned(dp, png_uint_32) && + png_isaligned(sp, png_uint_32) && bytes_to_copy % (sizeof (png_uint_32)) == 0 && bytes_to_jump % (sizeof (png_uint_32)) == 0) { @@ -3508,7 +3541,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display) #ifdef PNG_READ_INTERLACING_SUPPORTED void /* PRIVATE */ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass, - png_uint_32 transformations /* Because these may affect the byte layout */) + png_uint_32 transformations /* Because these may affect the byte layout */) { /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Offset to next interlace block */ @@ -3752,7 +3785,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass, static void png_read_filter_row_sub(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) + png_const_bytep prev_row) { png_size_t i; png_size_t istop = row_info->rowbytes; @@ -3770,7 +3803,7 @@ png_read_filter_row_sub(png_row_infop row_info, png_bytep row, static void png_read_filter_row_up(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) + png_const_bytep prev_row) { png_size_t i; png_size_t istop = row_info->rowbytes; @@ -3786,7 +3819,7 @@ png_read_filter_row_up(png_row_infop row_info, png_bytep row, static void png_read_filter_row_avg(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) + png_const_bytep prev_row) { png_size_t i; png_bytep rp = row; @@ -3813,7 +3846,7 @@ png_read_filter_row_avg(png_row_infop row_info, png_bytep row, static void png_read_filter_row_paeth_1byte_pixel(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) + png_const_bytep prev_row) { png_bytep rp_end = row + row_info->rowbytes; int a, c; @@ -3861,7 +3894,7 @@ png_read_filter_row_paeth_1byte_pixel(png_row_infop row_info, png_bytep row, static void png_read_filter_row_paeth_multibyte_pixel(png_row_infop row_info, png_bytep row, - png_const_bytep prev_row) + png_const_bytep prev_row) { int bpp = (row_info->pixel_depth + 7) >> 3; png_bytep rp_end = row + bpp; @@ -3946,7 +3979,7 @@ png_init_filter_functions(png_structrp pp) void /* PRIVATE */ png_read_filter_row(png_structrp pp, png_row_infop row_info, png_bytep row, - png_const_bytep prev_row, int filter) + png_const_bytep prev_row, int filter) { /* OPTIMIZATION: DO NOT MODIFY THIS FUNCTION, instead #define * PNG_FILTER_OPTIMIZATIONS to a function that overrides the generic @@ -3964,7 +3997,7 @@ png_read_filter_row(png_structrp pp, png_row_infop row_info, png_bytep row, #ifdef PNG_SEQUENTIAL_READ_SUPPORTED void /* PRIVATE */ png_read_IDAT_data(png_structrp png_ptr, png_bytep output, - png_alloc_size_t avail_out) + png_alloc_size_t avail_out) { /* Loop reading IDATs and decompressing the result into output[avail_out] */ png_ptr->zstream.next_out = output; @@ -4039,7 +4072,7 @@ png_read_IDAT_data(png_structrp png_ptr, png_bytep output, * * TODO: deal more elegantly with truncated IDAT lists. */ - ret = inflate(&png_ptr->zstream, Z_NO_FLUSH); + ret = PNG_INFLATE(png_ptr, Z_NO_FLUSH); /* Take the unconsumed output back. */ if (output != NULL) @@ -4416,42 +4449,42 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) if (row_bytes + 48 > png_ptr->old_big_row_buf_size) { - png_free(png_ptr, png_ptr->big_row_buf); - png_free(png_ptr, png_ptr->big_prev_row); + png_free(png_ptr, png_ptr->big_row_buf); + png_free(png_ptr, png_ptr->big_prev_row); - if (png_ptr->interlaced != 0) - png_ptr->big_row_buf = (png_bytep)png_calloc(png_ptr, - row_bytes + 48); + if (png_ptr->interlaced != 0) + png_ptr->big_row_buf = (png_bytep)png_calloc(png_ptr, + row_bytes + 48); - else - png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, row_bytes + 48); + else + png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, row_bytes + 48); - png_ptr->big_prev_row = (png_bytep)png_malloc(png_ptr, row_bytes + 48); + png_ptr->big_prev_row = (png_bytep)png_malloc(png_ptr, row_bytes + 48); #ifdef PNG_ALIGNED_MEMORY_SUPPORTED - /* Use 16-byte aligned memory for row_buf with at least 16 bytes - * of padding before and after row_buf; treat prev_row similarly. - * NOTE: the alignment is to the start of the pixels, one beyond the start - * of the buffer, because of the filter byte. Prior to libpng 1.5.6 this - * was incorrect; the filter byte was aligned, which had the exact - * opposite effect of that intended. - */ - { - png_bytep temp = png_ptr->big_row_buf + 32; - int extra = (int)((temp - (png_bytep)0) & 0x0f); - png_ptr->row_buf = temp - extra - 1/*filter byte*/; + /* Use 16-byte aligned memory for row_buf with at least 16 bytes + * of padding before and after row_buf; treat prev_row similarly. + * NOTE: the alignment is to the start of the pixels, one beyond the start + * of the buffer, because of the filter byte. Prior to libpng 1.5.6 this + * was incorrect; the filter byte was aligned, which had the exact + * opposite effect of that intended. + */ + { + png_bytep temp = png_ptr->big_row_buf + 32; + int extra = (int)((temp - (png_bytep)0) & 0x0f); + png_ptr->row_buf = temp - extra - 1/*filter byte*/; - temp = png_ptr->big_prev_row + 32; - extra = (int)((temp - (png_bytep)0) & 0x0f); - png_ptr->prev_row = temp - extra - 1/*filter byte*/; - } + temp = png_ptr->big_prev_row + 32; + extra = (int)((temp - (png_bytep)0) & 0x0f); + png_ptr->prev_row = temp - extra - 1/*filter byte*/; + } #else - /* Use 31 bytes of padding before and 17 bytes after row_buf. */ - png_ptr->row_buf = png_ptr->big_row_buf + 31; - png_ptr->prev_row = png_ptr->big_prev_row + 31; + /* Use 31 bytes of padding before and 17 bytes after row_buf. */ + png_ptr->row_buf = png_ptr->big_row_buf + 31; + png_ptr->prev_row = png_ptr->big_prev_row + 31; #endif - png_ptr->old_big_row_buf_size = row_bytes + 48; + png_ptr->old_big_row_buf_size = row_bytes + 48; } #ifdef PNG_MAX_MALLOC_64K diff --git a/3rdparty/libpng/pngset.c b/3rdparty/libpng/pngset.c index 05a2134dbb..cccd9cdc7e 100644 --- a/3rdparty/libpng/pngset.c +++ b/3rdparty/libpng/pngset.c @@ -1,8 +1,8 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.6.19 [November 12, 2015] - * Copyright (c) 1998-2015 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -104,14 +104,14 @@ png_set_cHRM(png_const_structrp png_ptr, png_inforp info_ptr, double green_x, double green_y, double blue_x, double blue_y) { png_set_cHRM_fixed(png_ptr, info_ptr, - png_fixed(png_ptr, white_x, "cHRM White X"), - png_fixed(png_ptr, white_y, "cHRM White Y"), - png_fixed(png_ptr, red_x, "cHRM Red X"), - png_fixed(png_ptr, red_y, "cHRM Red Y"), - png_fixed(png_ptr, green_x, "cHRM Green X"), - png_fixed(png_ptr, green_y, "cHRM Green Y"), - png_fixed(png_ptr, blue_x, "cHRM Blue X"), - png_fixed(png_ptr, blue_y, "cHRM Blue Y")); + png_fixed(png_ptr, white_x, "cHRM White X"), + png_fixed(png_ptr, white_y, "cHRM White Y"), + png_fixed(png_ptr, red_x, "cHRM Red X"), + png_fixed(png_ptr, red_y, "cHRM Red Y"), + png_fixed(png_ptr, green_x, "cHRM Green X"), + png_fixed(png_ptr, green_y, "cHRM Green Y"), + png_fixed(png_ptr, blue_x, "cHRM Blue X"), + png_fixed(png_ptr, blue_y, "cHRM Blue Y")); } void PNGAPI @@ -120,15 +120,15 @@ png_set_cHRM_XYZ(png_const_structrp png_ptr, png_inforp info_ptr, double red_X, double blue_X, double blue_Y, double blue_Z) { png_set_cHRM_XYZ_fixed(png_ptr, info_ptr, - png_fixed(png_ptr, red_X, "cHRM Red X"), - png_fixed(png_ptr, red_Y, "cHRM Red Y"), - png_fixed(png_ptr, red_Z, "cHRM Red Z"), - png_fixed(png_ptr, green_X, "cHRM Green X"), - png_fixed(png_ptr, green_Y, "cHRM Green Y"), - png_fixed(png_ptr, green_Z, "cHRM Green Z"), - png_fixed(png_ptr, blue_X, "cHRM Blue X"), - png_fixed(png_ptr, blue_Y, "cHRM Blue Y"), - png_fixed(png_ptr, blue_Z, "cHRM Blue Z")); + png_fixed(png_ptr, red_X, "cHRM Red X"), + png_fixed(png_ptr, red_Y, "cHRM Red Y"), + png_fixed(png_ptr, red_Z, "cHRM Red Z"), + png_fixed(png_ptr, green_X, "cHRM Green X"), + png_fixed(png_ptr, green_Y, "cHRM Green Y"), + png_fixed(png_ptr, green_Z, "cHRM Green Z"), + png_fixed(png_ptr, blue_X, "cHRM Blue X"), + png_fixed(png_ptr, blue_Y, "cHRM Blue Y"), + png_fixed(png_ptr, blue_Z, "cHRM Blue Z")); } # endif /* FLOATING_POINT */ @@ -316,10 +316,10 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr, length = strlen(units) + 1; png_debug1(3, "allocating units for info (%lu bytes)", - (unsigned long)length); + (unsigned long)length); info_ptr->pcal_units = png_voidcast(png_charp, - png_malloc_warn(png_ptr, length)); + png_malloc_warn(png_ptr, length)); if (info_ptr->pcal_units == NULL) { @@ -398,7 +398,7 @@ png_set_sCAL_s(png_const_structrp png_ptr, png_inforp info_ptr, png_debug1(3, "allocating unit for info (%u bytes)", (unsigned int)lengthw); info_ptr->scal_s_width = png_voidcast(png_charp, - png_malloc_warn(png_ptr, lengthw)); + png_malloc_warn(png_ptr, lengthw)); if (info_ptr->scal_s_width == NULL) { @@ -414,7 +414,7 @@ png_set_sCAL_s(png_const_structrp png_ptr, png_inforp info_ptr, png_debug1(3, "allocating unit for info (%u bytes)", (unsigned int)lengthh); info_ptr->scal_s_height = png_voidcast(png_charp, - png_malloc_warn(png_ptr, lengthh)); + png_malloc_warn(png_ptr, lengthh)); if (info_ptr->scal_s_height == NULL) { @@ -453,9 +453,9 @@ png_set_sCAL(png_const_structrp png_ptr, png_inforp info_ptr, int unit, char sheight[PNG_sCAL_MAX_DIGITS+1]; png_ascii_from_fp(png_ptr, swidth, (sizeof swidth), width, - PNG_sCAL_PRECISION); + PNG_sCAL_PRECISION); png_ascii_from_fp(png_ptr, sheight, (sizeof sheight), height, - PNG_sCAL_PRECISION); + PNG_sCAL_PRECISION); png_set_sCAL_s(png_ptr, info_ptr, unit, swidth, sheight); } @@ -520,8 +520,8 @@ png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr, if (png_ptr == NULL || info_ptr == NULL) return; - max_palette_length = (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ? - (1 << png_ptr->bit_depth) : PNG_MAX_PALETTE_LENGTH; + max_palette_length = (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ? + (1 << info_ptr->bit_depth) : PNG_MAX_PALETTE_LENGTH; if (num_palette < 0 || num_palette > (int) max_palette_length) { @@ -648,7 +648,7 @@ png_set_iCCP(png_const_structrp png_ptr, png_inforp info_ptr, */ { int result = png_colorspace_set_ICC(png_ptr, &info_ptr->colorspace, name, - proflen, profile, info_ptr->color_type); + proflen, profile, info_ptr->color_type); png_colorspace_sync_info(png_ptr, info_ptr); @@ -673,7 +673,7 @@ png_set_iCCP(png_const_structrp png_ptr, png_inforp info_ptr, memcpy(new_iccp_name, name, length); new_iccp_profile = png_voidcast(png_bytep, - png_malloc_warn(png_ptr, proflen)); + png_malloc_warn(png_ptr, proflen)); if (new_iccp_profile == NULL) { @@ -748,14 +748,14 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr, * the overflow checks. */ new_text = png_voidcast(png_textp,png_realloc_array(png_ptr, - info_ptr->text, old_num_text, max_text-old_num_text, - sizeof *new_text)); + info_ptr->text, old_num_text, max_text-old_num_text, + sizeof *new_text)); } if (new_text == NULL) { png_chunk_report(png_ptr, "too many text chunks", - PNG_CHUNK_WRITE_ERROR); + PNG_CHUNK_WRITE_ERROR); return 1; } @@ -783,7 +783,7 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr, text_ptr[i].compression >= PNG_TEXT_COMPRESSION_LAST) { png_chunk_report(png_ptr, "text compression mode is out of range", - PNG_CHUNK_WRITE_ERROR); + PNG_CHUNK_WRITE_ERROR); continue; } @@ -815,7 +815,7 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr, # else /* iTXt */ { png_chunk_report(png_ptr, "iTXt chunk not supported", - PNG_CHUNK_WRITE_ERROR); + PNG_CHUNK_WRITE_ERROR); continue; } # endif @@ -844,7 +844,7 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr, if (textp->key == NULL) { png_chunk_report(png_ptr, "text chunk: out of memory", - PNG_CHUNK_WRITE_ERROR); + PNG_CHUNK_WRITE_ERROR); return 1; } @@ -952,12 +952,14 @@ png_set_tRNS(png_structrp png_ptr, png_inforp info_ptr, png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0); - /* Changed from num_trans to PNG_MAX_PALETTE_LENGTH in version 1.2.1 */ - png_ptr->trans_alpha = info_ptr->trans_alpha = png_voidcast(png_bytep, - png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH)); - if (num_trans > 0 && num_trans <= PNG_MAX_PALETTE_LENGTH) + { + /* Changed from num_trans to PNG_MAX_PALETTE_LENGTH in version 1.2.1 */ + info_ptr->trans_alpha = png_voidcast(png_bytep, + png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH)); memcpy(info_ptr->trans_alpha, trans_alpha, (png_size_t)num_trans); + } + png_ptr->trans_alpha = info_ptr->trans_alpha; } if (trans_color != NULL) @@ -974,7 +976,7 @@ png_set_tRNS(png_structrp png_ptr, png_inforp info_ptr, trans_color->green > sample_max || trans_color->blue > sample_max))) png_warning(png_ptr, - "tRNS chunk has out-of-range samples for bit_depth"); + "tRNS chunk has out-of-range samples for bit_depth"); } #endif @@ -1016,8 +1018,8 @@ png_set_sPLT(png_const_structrp png_ptr, * overflows. Notice that the parameters are (int) and (size_t) */ np = png_voidcast(png_sPLT_tp,png_realloc_array(png_ptr, - info_ptr->splt_palettes, info_ptr->splt_palettes_num, nentries, - sizeof *np)); + info_ptr->splt_palettes, info_ptr->splt_palettes_num, nentries, + sizeof *np)); if (np == NULL) { @@ -1078,7 +1080,7 @@ png_set_sPLT(png_const_structrp png_ptr, * checked it when doing the allocation. */ memcpy(np->entries, entries->entries, - entries->nentries * sizeof (png_sPLT_entry)); + entries->nentries * sizeof (png_sPLT_entry)); /* Note that 'continue' skips the advance of the out pointer and out * count, so an invalid entry is not added. @@ -1108,10 +1110,10 @@ check_location(png_const_structrp png_ptr, int location) { /* Write struct, so unknown chunks come from the app */ png_app_warning(png_ptr, - "png_set_unknown_chunks now expects a valid location"); + "png_set_unknown_chunks now expects a valid location"); /* Use the old behavior */ location = (png_byte)(png_ptr->mode & - (PNG_HAVE_IHDR|PNG_HAVE_PLTE|PNG_AFTER_IDAT)); + (PNG_HAVE_IHDR|PNG_HAVE_PLTE|PNG_AFTER_IDAT)); } /* This need not be an internal error - if the app calls @@ -1134,7 +1136,7 @@ check_location(png_const_structrp png_ptr, int location) void PNGAPI png_set_unknown_chunks(png_const_structrp png_ptr, - png_inforp info_ptr, png_const_unknown_chunkp unknowns, int num_unknowns) + png_inforp info_ptr, png_const_unknown_chunkp unknowns, int num_unknowns) { png_unknown_chunkp np; @@ -1173,13 +1175,13 @@ png_set_unknown_chunks(png_const_structrp png_ptr, * appropriate to read or write. */ np = png_voidcast(png_unknown_chunkp, png_realloc_array(png_ptr, - info_ptr->unknown_chunks, info_ptr->unknown_chunks_num, num_unknowns, - sizeof *np)); + info_ptr->unknown_chunks, info_ptr->unknown_chunks_num, num_unknowns, + sizeof *np)); if (np == NULL) { png_chunk_report(png_ptr, "too many unknown chunks", - PNG_CHUNK_WRITE_ERROR); + PNG_CHUNK_WRITE_ERROR); return; } @@ -1208,12 +1210,12 @@ png_set_unknown_chunks(png_const_structrp png_ptr, else { np->data = png_voidcast(png_bytep, - png_malloc_base(png_ptr, unknowns->size)); + png_malloc_base(png_ptr, unknowns->size)); if (np->data == NULL) { png_chunk_report(png_ptr, "unknown chunk: out of memory", - PNG_CHUNK_WRITE_ERROR); + PNG_CHUNK_WRITE_ERROR); /* But just skip storing the unknown chunk */ continue; } @@ -1420,7 +1422,7 @@ png_set_keep_unknown_chunks(png_structrp png_ptr, int keep, for (i=0; i PNG_UINT_31_MAX) - png_error(png_ptr, "invalid compression buffer size"); + if (size == 0 || size > PNG_UINT_31_MAX) + png_error(png_ptr, "invalid compression buffer size"); # ifdef PNG_SEQUENTIAL_READ_SUPPORTED - if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0) - { - png_ptr->IDAT_read_size = (png_uint_32)size; /* checked above */ - return; - } + if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0) + { + png_ptr->IDAT_read_size = (png_uint_32)size; /* checked above */ + return; + } # endif # ifdef PNG_WRITE_SUPPORTED - if ((png_ptr->mode & PNG_IS_READ_STRUCT) == 0) + if ((png_ptr->mode & PNG_IS_READ_STRUCT) == 0) + { + if (png_ptr->zowner != 0) { - if (png_ptr->zowner != 0) - { - png_warning(png_ptr, - "Compression buffer size cannot be changed because it is in use"); + png_warning(png_ptr, + "Compression buffer size cannot be changed because it is in use"); - return; - } + return; + } #ifndef __COVERITY__ - /* Some compilers complain that this is always false. However, it - * can be true when integer overflow happens. - */ - if (size > ZLIB_IO_MAX) - { - png_warning(png_ptr, - "Compression buffer size limited to system maximum"); - size = ZLIB_IO_MAX; /* must fit */ - } + /* Some compilers complain that this is always false. However, it + * can be true when integer overflow happens. + */ + if (size > ZLIB_IO_MAX) + { + png_warning(png_ptr, + "Compression buffer size limited to system maximum"); + size = ZLIB_IO_MAX; /* must fit */ + } #endif - if (size < 6) - { - /* Deflate will potentially go into an infinite loop on a SYNC_FLUSH - * if this is permitted. - */ - png_warning(png_ptr, - "Compression buffer size cannot be reduced below 6"); + if (size < 6) + { + /* Deflate will potentially go into an infinite loop on a SYNC_FLUSH + * if this is permitted. + */ + png_warning(png_ptr, + "Compression buffer size cannot be reduced below 6"); - return; - } - - if (png_ptr->zbuffer_size != size) - { - png_free_buffer_list(png_ptr, &png_ptr->zbuffer_list); - png_ptr->zbuffer_size = (uInt)size; - } + return; } + + if (png_ptr->zbuffer_size != size) + { + png_free_buffer_list(png_ptr, &png_ptr->zbuffer_list); + png_ptr->zbuffer_size = (uInt)size; + } + } # endif } @@ -1573,7 +1575,7 @@ png_set_user_limits (png_structrp png_ptr, png_uint_32 user_width_max, { /* Images with dimensions larger than these limits will be * rejected by png_set_IHDR(). To accept any PNG datastream - * regardless of dimensions, set both limits to 0x7ffffff. + * regardless of dimensions, set both limits to 0x7fffffff. */ if (png_ptr == NULL) return; @@ -1644,4 +1646,92 @@ png_set_check_for_invalid_index(png_structrp png_ptr, int allowed) png_ptr->num_palette_max = -1; } #endif + +#if defined(PNG_TEXT_SUPPORTED) || defined(PNG_pCAL_SUPPORTED) || \ + defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) +/* Check that the tEXt or zTXt keyword is valid per PNG 1.0 specification, + * and if invalid, correct the keyword rather than discarding the entire + * chunk. The PNG 1.0 specification requires keywords 1-79 characters in + * length, forbids leading or trailing whitespace, multiple internal spaces, + * and the non-break space (0x80) from ISO 8859-1. Returns keyword length. + * + * The 'new_key' buffer must be 80 characters in size (for the keyword plus a + * trailing '\0'). If this routine returns 0 then there was no keyword, or a + * valid one could not be generated, and the caller must png_error. + */ +png_uint_32 /* PRIVATE */ +png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key) +{ +#ifdef PNG_WARNINGS_SUPPORTED + png_const_charp orig_key = key; +#endif + png_uint_32 key_len = 0; + int bad_character = 0; + int space = 1; + + png_debug(1, "in png_check_keyword"); + + if (key == NULL) + { + *new_key = 0; + return 0; + } + + while (*key && key_len < 79) + { + png_byte ch = (png_byte)*key++; + + if ((ch > 32 && ch <= 126) || (ch >= 161 /*&& ch <= 255*/)) + *new_key++ = ch, ++key_len, space = 0; + + else if (space == 0) + { + /* A space or an invalid character when one wasn't seen immediately + * before; output just a space. + */ + *new_key++ = 32, ++key_len, space = 1; + + /* If the character was not a space then it is invalid. */ + if (ch != 32) + bad_character = ch; + } + + else if (bad_character == 0) + bad_character = ch; /* just skip it, record the first error */ + } + + if (key_len > 0 && space != 0) /* trailing space */ + { + --key_len, --new_key; + if (bad_character == 0) + bad_character = 32; + } + + /* Terminate the keyword */ + *new_key = 0; + + if (key_len == 0) + return 0; + +#ifdef PNG_WARNINGS_SUPPORTED + /* Try to only output one warning per keyword: */ + if (*key != 0) /* keyword too long */ + png_warning(png_ptr, "keyword truncated"); + + else if (bad_character != 0) + { + PNG_WARNING_PARAMETERS(p) + + png_warning_parameter(p, 1, orig_key); + png_warning_parameter_signed(p, 2, PNG_NUMBER_FORMAT_02x, bad_character); + + png_formatted_warning(png_ptr, p, "keyword \"@1\": bad character '0x@2'"); + } +#else /* !WARNINGS */ + PNG_UNUSED(png_ptr) +#endif /* !WARNINGS */ + + return key_len; +} +#endif /* TEXT || pCAL || iCCP || sPLT */ #endif /* READ || WRITE */ diff --git a/3rdparty/libpng/pngstruct.h b/3rdparty/libpng/pngstruct.h index c8c0e46e8b..2b0eb49025 100644 --- a/3rdparty/libpng/pngstruct.h +++ b/3rdparty/libpng/pngstruct.h @@ -1,8 +1,8 @@ /* pngstruct.h - header file for PNG reference library * - * Last changed in libpng 1.6.18 [July 23, 2015] - * Copyright (c) 1998-2015 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -249,7 +249,7 @@ struct png_struct_def png_byte filter; /* file filter type (always 0) */ png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ png_byte pass; /* current interlace pass (0 - 6) */ - png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */ + png_byte do_filter; /* row filter flags (see PNG_FILTER_ in png.h ) */ png_byte color_type; /* color type of file */ png_byte bit_depth; /* bit depth of file */ png_byte usr_bit_depth; /* bit depth of users row: write only */ @@ -263,6 +263,9 @@ struct png_struct_def /* pixel depth used for the row buffers */ png_byte transformed_pixel_depth; /* pixel depth after read/write transforms */ +#if PNG_ZLIB_VERNUM >= 0x1240 + png_byte zstream_start; /* at start of an input zlib stream */ +#endif /* Zlib >= 1.2.4 */ #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) png_uint_16 filler; /* filler bytes for pixel expansion */ #endif diff --git a/3rdparty/libpng/pngtrans.c b/3rdparty/libpng/pngtrans.c index 0c0d92d8fd..e5cbd79b9d 100644 --- a/3rdparty/libpng/pngtrans.c +++ b/3rdparty/libpng/pngtrans.c @@ -1,8 +1,8 @@ /* pngtrans.c - transforms the data in a row (used by both readers and writers) * - * Last changed in libpng 1.6.18 [July 23, 2015] - * Copyright (c) 1998-2015 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -172,13 +172,14 @@ png_set_filler(png_structrp png_ptr, png_uint_32 filler, int filler_loc) * size! */ png_app_error(png_ptr, - "png_set_filler is invalid for low bit depth gray output"); + "png_set_filler is invalid for" + " low bit depth gray output"); return; } default: png_app_error(png_ptr, - "png_set_filler: inappropriate color type"); + "png_set_filler: inappropriate color type"); return; } # else @@ -797,7 +798,7 @@ png_set_user_transform_info(png_structrp png_ptr, png_voidp (png_ptr->flags & PNG_FLAG_ROW_INIT) != 0) { png_app_error(png_ptr, - "info change after png_start_read_image or png_read_update_info"); + "info change after png_start_read_image or png_read_update_info"); return; } #endif diff --git a/3rdparty/libpng/pngwio.c b/3rdparty/libpng/pngwio.c index db76e6b8d7..37c7c3a7f0 100644 --- a/3rdparty/libpng/pngwio.c +++ b/3rdparty/libpng/pngwio.c @@ -1,8 +1,8 @@ /* pngwio.c - functions for data output * - * Last changed in libpng 1.6.15 [November 20, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -35,7 +35,7 @@ png_write_data(png_structrp png_ptr, png_const_bytep data, png_size_t length) /* NOTE: write_data_fn must not change the buffer! */ if (png_ptr->write_data_fn != NULL ) (*(png_ptr->write_data_fn))(png_ptr, png_constcast(png_bytep,data), - length); + length); else png_error(png_ptr, "Call to NULL write function"); diff --git a/3rdparty/libpng/pngwrite.c b/3rdparty/libpng/pngwrite.c index 0d4ee9f7ae..aaa2b017df 100644 --- a/3rdparty/libpng/pngwrite.c +++ b/3rdparty/libpng/pngwrite.c @@ -1,8 +1,8 @@ /* pngwrite.c - general routines to write a PNG file * - * Last changed in libpng 1.6.19 [November 12, 2015] - * Copyright (c) 1998-2015 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -12,9 +12,9 @@ */ #include "pngpriv.h" -#if defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) && defined(PNG_STDIO_SUPPORTED) +#ifdef PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED # include -#endif +#endif /* SIMPLIFIED_WRITE_STDIO */ #ifdef PNG_WRITE_SUPPORTED @@ -22,7 +22,7 @@ /* Write out all the unknown chunks for the current given location */ static void write_unknown_chunks(png_structrp png_ptr, png_const_inforp info_ptr, - unsigned int where) + unsigned int where) { if (info_ptr->unknown_chunks_num != 0) { @@ -148,11 +148,11 @@ png_write_info_before_PLTE(png_structrp png_ptr, png_const_inforp info_ptr) # ifdef PNG_WRITE_sRGB_SUPPORTED if ((info_ptr->valid & PNG_INFO_sRGB) != 0) png_app_warning(png_ptr, - "profile matches sRGB but writing iCCP instead"); + "profile matches sRGB but writing iCCP instead"); # endif png_write_iCCP(png_ptr, info_ptr->iccp_name, - info_ptr->iccp_profile); + info_ptr->iccp_profile); } # ifdef PNG_WRITE_sRGB_SUPPORTED else @@ -383,7 +383,7 @@ png_write_end(png_structrp png_ptr, png_inforp info_ptr) for (i = 0; i < info_ptr->num_text; i++) { png_debug2(2, "Writing trailer text chunk %d, type %d", i, - info_ptr->text[i].compression); + info_ptr->text[i].compression); /* An internationalized chunk? */ if (info_ptr->text[i].compression > 0) { @@ -693,7 +693,7 @@ png_write_row(png_structrp png_ptr, png_const_bytep row) return; png_debug2(1, "in png_write_row (row %u, pass %d)", - png_ptr->row_number, png_ptr->pass); + png_ptr->row_number, png_ptr->pass); /* Initialize transformations and other stuff if first time */ if (png_ptr->row_number == 0 && png_ptr->pass == 0) @@ -1069,7 +1069,7 @@ png_set_filter(png_structrp png_ptr, int method, int filters) * is not available so the filter can't be used. Just warn here. */ png_app_warning(png_ptr, - "png_set_filter: UP/AVG/PAETH cannot be added after start"); + "png_set_filter: UP/AVG/PAETH cannot be added after start"); filters &= ~(PNG_FILTER_UP|PNG_FILTER_AVG|PNG_FILTER_PAETH); } @@ -1095,13 +1095,13 @@ png_set_filter(png_structrp png_ptr, int method, int filters) if (png_ptr->try_row == NULL) png_ptr->try_row = png_voidcast(png_bytep, - png_malloc(png_ptr, buf_size)); + png_malloc(png_ptr, buf_size)); if (num_filters > 1) { if (png_ptr->tst_row == NULL) png_ptr->tst_row = png_voidcast(png_bytep, - png_malloc(png_ptr, buf_size)); + png_malloc(png_ptr, buf_size)); } } png_ptr->do_filter = (png_byte)filters; @@ -1452,7 +1452,6 @@ png_write_png(png_structrp png_ptr, png_inforp info_ptr, #ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED -# ifdef PNG_STDIO_SUPPORTED /* currently required for png_image_write_* */ /* Initialize the write structure - general purpose utility. */ static int png_image_write_init(png_imagep image) @@ -1504,6 +1503,10 @@ typedef struct png_const_voidp first_row; ptrdiff_t row_bytes; png_voidp local_row; + /* Byte count for memory writing */ + png_bytep memory; + png_alloc_size_t memory_bytes; /* not used for STDIO */ + png_alloc_size_t output_bytes; /* running total */ } png_image_write_control; /* Write png_uint_16 input to a 16-bit PNG; the png_ptr has already been set to @@ -1625,7 +1628,7 @@ png_write_image_16bit(png_voidp argument) static png_byte png_unpremultiply(png_uint_32 component, png_uint_32 alpha, - png_uint_32 reciprocal/*from the above macro*/) + png_uint_32 reciprocal/*from the above macro*/) { /* The following gives 1.0 for an alpha of 0, which is fine, otherwise if 0/0 * is represented as some other value there is more likely to be a @@ -1845,16 +1848,16 @@ png_image_set_PLTE(png_image_write_control *display) if (channels >= 3) /* RGB */ { palette[i].blue = png_unpremultiply(entry[afirst + (2 ^ bgr)], - alpha, reciprocal); + alpha, reciprocal); palette[i].green = png_unpremultiply(entry[afirst + 1], alpha, - reciprocal); + reciprocal); palette[i].red = png_unpremultiply(entry[afirst + bgr], alpha, - reciprocal); + reciprocal); } else /* gray */ palette[i].blue = palette[i].red = palette[i].green = - png_unpremultiply(entry[afirst], alpha, reciprocal); + png_unpremultiply(entry[afirst], alpha, reciprocal); } } @@ -1901,11 +1904,11 @@ png_image_set_PLTE(png_image_write_control *display) # endif png_set_PLTE(image->opaque->png_ptr, image->opaque->info_ptr, palette, - entries); + entries); if (num_trans > 0) png_set_tRNS(image->opaque->png_ptr, image->opaque->info_ptr, tRNS, - num_trans, NULL); + num_trans, NULL); image->colormap_entries = entries; } @@ -1914,7 +1917,7 @@ static int png_image_write_main(png_voidp argument) { png_image_write_control *display = png_voidcast(png_image_write_control*, - argument); + argument); png_imagep image = display->image; png_structrp png_ptr = image->opaque->png_ptr; png_inforp info_ptr = image->opaque->info_ptr; @@ -1931,9 +1934,43 @@ png_image_write_main(png_voidp argument) png_set_benign_errors(png_ptr, 0/*error*/); # endif - /* Default the 'row_stride' parameter if required. */ - if (display->row_stride == 0) - display->row_stride = PNG_IMAGE_ROW_STRIDE(*image); + /* Default the 'row_stride' parameter if required, also check the row stride + * and total image size to ensure that they are within the system limits. + */ + { + const unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format); + + if (image->width <= 0x7FFFFFFFU/channels) /* no overflow */ + { + png_uint_32 check; + const png_uint_32 png_row_stride = image->width * channels; + + if (display->row_stride == 0) + display->row_stride = (png_int_32)/*SAFE*/png_row_stride; + + if (display->row_stride < 0) + check = -display->row_stride; + + else + check = display->row_stride; + + if (check >= png_row_stride) + { + /* Now check for overflow of the image buffer calculation; this + * limits the whole image size to 32 bits for API compatibility with + * the current, 32-bit, PNG_IMAGE_BUFFER_SIZE macro. + */ + if (image->height > 0xFFFFFFFF/png_row_stride) + png_error(image->opaque->png_ptr, "memory image too large"); + } + + else + png_error(image->opaque->png_ptr, "supplied row stride too small"); + } + + else + png_error(image->opaque->png_ptr, "image row stride too large"); + } /* Set the required transforms then write the rows in the correct order. */ if ((format & PNG_FORMAT_FLAG_COLORMAP) != 0) @@ -1943,24 +1980,24 @@ png_image_write_main(png_voidp argument) png_uint_32 entries = image->colormap_entries; png_set_IHDR(png_ptr, info_ptr, image->width, image->height, - entries > 16 ? 8 : (entries > 4 ? 4 : (entries > 2 ? 2 : 1)), - PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE, - PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + entries > 16 ? 8 : (entries > 4 ? 4 : (entries > 2 ? 2 : 1)), + PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE, + PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); png_image_set_PLTE(display); } else png_error(image->opaque->png_ptr, - "no color-map for color-mapped image"); + "no color-map for color-mapped image"); } else png_set_IHDR(png_ptr, info_ptr, image->width, image->height, - write_16bit ? 16 : 8, - ((format & PNG_FORMAT_FLAG_COLOR) ? PNG_COLOR_MASK_COLOR : 0) + - ((format & PNG_FORMAT_FLAG_ALPHA) ? PNG_COLOR_MASK_ALPHA : 0), - PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + write_16bit ? 16 : 8, + ((format & PNG_FORMAT_FLAG_COLOR) ? PNG_COLOR_MASK_COLOR : 0) + + ((format & PNG_FORMAT_FLAG_ALPHA) ? PNG_COLOR_MASK_ALPHA : 0), + PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); /* Counter-intuitively the data transformations must be called *after* * png_write_info, not before as in the read code, but the 'set' functions @@ -1975,11 +2012,11 @@ png_image_write_main(png_voidp argument) if ((image->flags & PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB) == 0) png_set_cHRM_fixed(png_ptr, info_ptr, - /* color x y */ - /* white */ 31270, 32900, - /* red */ 64000, 33000, - /* green */ 30000, 60000, - /* blue */ 15000, 6000 + /* color x y */ + /* white */ 31270, 32900, + /* red */ 64000, 33000, + /* green */ 30000, 60000, + /* blue */ 15000, 6000 ); } @@ -2073,7 +2110,7 @@ png_image_write_main(png_voidp argument) (colormap == 0 && display->convert_to_8bit != 0)) { png_bytep row = png_voidcast(png_bytep, png_malloc(png_ptr, - png_get_rowbytes(png_ptr, info_ptr))); + png_get_rowbytes(png_ptr, info_ptr))); int result; display->local_row = row; @@ -2110,14 +2147,130 @@ png_image_write_main(png_voidp argument) return 1; } + +static void (PNGCBAPI +image_memory_write)(png_structp png_ptr, png_bytep/*const*/ data, + png_size_t size) +{ + png_image_write_control *display = png_voidcast(png_image_write_control*, + png_ptr->io_ptr/*backdoor: png_get_io_ptr(png_ptr)*/); + const png_alloc_size_t ob = display->output_bytes; + + /* Check for overflow; this should never happen: */ + if (size <= ((png_alloc_size_t)-1) - ob) + { + /* I don't think libpng ever does this, but just in case: */ + if (size > 0) + { + if (display->memory_bytes >= ob+size) /* writing */ + memcpy(display->memory+ob, data, size); + + /* Always update the size: */ + display->output_bytes = ob+size; + } + } + + else + png_error(png_ptr, "png_image_write_to_memory: PNG too big"); +} + +static void (PNGCBAPI +image_memory_flush)(png_structp png_ptr) +{ + PNG_UNUSED(png_ptr) +} + +static int +png_image_write_memory(png_voidp argument) +{ + png_image_write_control *display = png_voidcast(png_image_write_control*, + argument); + + /* The rest of the memory-specific init and write_main in an error protected + * environment. This case needs to use callbacks for the write operations + * since libpng has no built in support for writing to memory. + */ + png_set_write_fn(display->image->opaque->png_ptr, display/*io_ptr*/, + image_memory_write, image_memory_flush); + + return png_image_write_main(display); +} + +int PNGAPI +png_image_write_to_memory(png_imagep image, void *memory, + png_alloc_size_t * PNG_RESTRICT memory_bytes, int convert_to_8bit, + const void *buffer, png_int_32 row_stride, const void *colormap) +{ + /* Write the image to the given buffer, or count the bytes if it is NULL */ + if (image != NULL && image->version == PNG_IMAGE_VERSION) + { + if (memory_bytes != NULL && buffer != NULL) + { + /* This is to give the caller an easier error detection in the NULL + * case and guard against uninitialized variable problems: + */ + if (memory == NULL) + *memory_bytes = 0; + + if (png_image_write_init(image) != 0) + { + png_image_write_control display; + int result; + + memset(&display, 0, (sizeof display)); + display.image = image; + display.buffer = buffer; + display.row_stride = row_stride; + display.colormap = colormap; + display.convert_to_8bit = convert_to_8bit; + display.memory = png_voidcast(png_bytep, memory); + display.memory_bytes = *memory_bytes; + display.output_bytes = 0; + + result = png_safe_execute(image, png_image_write_memory, &display); + png_image_free(image); + + /* write_memory returns true even if we ran out of buffer. */ + if (result) + { + /* On out-of-buffer this function returns '0' but still updates + * memory_bytes: + */ + if (memory != NULL && display.output_bytes > *memory_bytes) + result = 0; + + *memory_bytes = display.output_bytes; + } + + return result; + } + + else + return 0; + } + + else + return png_image_error(image, + "png_image_write_to_memory: invalid argument"); + } + + else if (image != NULL) + return png_image_error(image, + "png_image_write_to_memory: incorrect PNG_IMAGE_VERSION"); + + else + return 0; +} + +#ifdef PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED int PNGAPI png_image_write_to_stdio(png_imagep image, FILE *file, int convert_to_8bit, - const void *buffer, png_int_32 row_stride, const void *colormap) + const void *buffer, png_int_32 row_stride, const void *colormap) { /* Write the image to the given (FILE*). */ if (image != NULL && image->version == PNG_IMAGE_VERSION) { - if (file != NULL) + if (file != NULL && buffer != NULL) { if (png_image_write_init(image) != 0) { @@ -2148,12 +2301,12 @@ png_image_write_to_stdio(png_imagep image, FILE *file, int convert_to_8bit, else return png_image_error(image, - "png_image_write_to_stdio: invalid argument"); + "png_image_write_to_stdio: invalid argument"); } else if (image != NULL) return png_image_error(image, - "png_image_write_to_stdio: incorrect PNG_IMAGE_VERSION"); + "png_image_write_to_stdio: incorrect PNG_IMAGE_VERSION"); else return 0; @@ -2161,20 +2314,20 @@ png_image_write_to_stdio(png_imagep image, FILE *file, int convert_to_8bit, int PNGAPI png_image_write_to_file(png_imagep image, const char *file_name, - int convert_to_8bit, const void *buffer, png_int_32 row_stride, - const void *colormap) + int convert_to_8bit, const void *buffer, png_int_32 row_stride, + const void *colormap) { /* Write the image to the named file. */ if (image != NULL && image->version == PNG_IMAGE_VERSION) { - if (file_name != NULL) + if (file_name != NULL && buffer != NULL) { FILE *fp = fopen(file_name, "wb"); if (fp != NULL) { if (png_image_write_to_stdio(image, fp, convert_to_8bit, buffer, - row_stride, colormap) != 0) + row_stride, colormap) != 0) { int error; /* from fflush/fclose */ @@ -2215,16 +2368,16 @@ png_image_write_to_file(png_imagep image, const char *file_name, else return png_image_error(image, - "png_image_write_to_file: invalid argument"); + "png_image_write_to_file: invalid argument"); } else if (image != NULL) return png_image_error(image, - "png_image_write_to_file: incorrect PNG_IMAGE_VERSION"); + "png_image_write_to_file: incorrect PNG_IMAGE_VERSION"); else return 0; } -# endif /* STDIO */ +#endif /* SIMPLIFIED_WRITE_STDIO */ #endif /* SIMPLIFIED_WRITE */ #endif /* WRITE */ diff --git a/3rdparty/libpng/pngwtran.c b/3rdparty/libpng/pngwtran.c index 5dc949157d..423fb2d5bb 100644 --- a/3rdparty/libpng/pngwtran.c +++ b/3rdparty/libpng/pngwtran.c @@ -1,8 +1,8 @@ /* pngwtran.c - transforms the data in a row for PNG writers * - * Last changed in libpng 1.6.18 [July 23, 2015] - * Copyright (c) 1998-2015 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -525,7 +525,7 @@ png_do_write_transformations(png_structrp png_ptr, png_row_infop row_info) #ifdef PNG_WRITE_FILLER_SUPPORTED if ((png_ptr->transformations & PNG_FILLER) != 0) png_do_strip_channel(row_info, png_ptr->row_buf + 1, - !(png_ptr->flags & PNG_FLAG_FILLER_AFTER)); + !(png_ptr->flags & PNG_FLAG_FILLER_AFTER)); #endif #ifdef PNG_WRITE_PACKSWAP_SUPPORTED @@ -549,7 +549,7 @@ png_do_write_transformations(png_structrp png_ptr, png_row_infop row_info) #ifdef PNG_WRITE_SHIFT_SUPPORTED if ((png_ptr->transformations & PNG_SHIFT) != 0) png_do_shift(row_info, png_ptr->row_buf + 1, - &(png_ptr->shift)); + &(png_ptr->shift)); #endif #ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED diff --git a/3rdparty/libpng/pngwutil.c b/3rdparty/libpng/pngwutil.c index adc4729c24..3f1ed0cc8f 100644 --- a/3rdparty/libpng/pngwutil.c +++ b/3rdparty/libpng/pngwutil.c @@ -1,8 +1,8 @@ /* pngwutil.c - utilities to write a PNG file * - * Last changed in libpng 1.6.19 [November 12, 2015] - * Copyright (c) 1998-2015 Glenn Randers-Pehrson + * Last changed in libpng 1.6.24 [August 4, 2016] + * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -23,10 +23,10 @@ void PNGAPI png_save_uint_32(png_bytep buf, png_uint_32 i) { - buf[0] = (png_byte)(i >> 24); - buf[1] = (png_byte)(i >> 16); - buf[2] = (png_byte)(i >> 8); - buf[3] = (png_byte)(i ); + buf[0] = (png_byte)((i >> 24) & 0xffU); + buf[1] = (png_byte)((i >> 16) & 0xffU); + buf[2] = (png_byte)((i >> 8) & 0xffU); + buf[3] = (png_byte)( i & 0xffU); } /* Place a 16-bit number into a buffer in PNG byte order. @@ -36,8 +36,8 @@ png_save_uint_32(png_bytep buf, png_uint_32 i) void PNGAPI png_save_uint_16(png_bytep buf, unsigned int i) { - buf[0] = (png_byte)(i >> 8); - buf[1] = (png_byte)(i ); + buf[0] = (png_byte)((i >> 8) & 0xffU); + buf[1] = (png_byte)( i & 0xffU); } #endif @@ -59,7 +59,7 @@ png_write_sig(png_structrp png_ptr) /* Write the rest of the 8 byte signature */ png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes], - (png_size_t)(8 - png_ptr->sig_bytes)); + (png_size_t)(8 - png_ptr->sig_bytes)); if (png_ptr->sig_bytes < 3) png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE; @@ -174,7 +174,7 @@ png_write_chunk_end(png_structrp png_ptr) */ static void png_write_complete_chunk(png_structrp png_ptr, png_uint_32 chunk_name, - png_const_bytep data, png_size_t length) + png_const_bytep data, png_size_t length) { if (png_ptr == NULL) return; @@ -191,10 +191,10 @@ png_write_complete_chunk(png_structrp png_ptr, png_uint_32 chunk_name, /* This is the API that calls the internal function above. */ void PNGAPI png_write_chunk(png_structrp png_ptr, png_const_bytep chunk_string, - png_const_bytep data, png_size_t length) + png_const_bytep data, png_size_t length) { png_write_complete_chunk(png_ptr, PNG_CHUNK_FROM_STRING(chunk_string), data, - length); + length); } /* This is used below to find the size of an image to pass to png_deflate_claim, @@ -291,7 +291,7 @@ optimize_cmf(png_bytep data, png_alloc_size_t data_size) /* Initialize the compressor for the appropriate type of compression. */ static int png_deflate_claim(png_structrp png_ptr, png_uint_32 owner, - png_alloc_size_t data_size) + png_alloc_size_t data_size) { if (png_ptr->zowner != 0) { @@ -416,7 +416,7 @@ png_deflate_claim(png_structrp png_ptr, png_uint_32 owner, else { ret = deflateInit2(&png_ptr->zstream, level, method, windowBits, - memLevel, strategy); + memLevel, strategy); if (ret == Z_OK) png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED; @@ -477,7 +477,7 @@ typedef struct static void png_text_compress_init(compression_state *comp, png_const_bytep input, - png_alloc_size_t input_len) + png_alloc_size_t input_len) { comp->input = input; comp->input_len = input_len; @@ -487,7 +487,7 @@ png_text_compress_init(compression_state *comp, png_const_bytep input, /* Compress the data in the compression state input */ static int png_text_compress(png_structrp png_ptr, png_uint_32 chunk_name, - compression_state *comp, png_uint_32 prefix_len) + compression_state *comp, png_uint_32 prefix_len) { int ret; @@ -579,7 +579,7 @@ png_text_compress(png_structrp png_ptr, png_uint_32 chunk_name, /* Compress the data */ ret = deflate(&png_ptr->zstream, - input_len > 0 ? Z_NO_FLUSH : Z_FINISH); + input_len > 0 ? Z_NO_FLUSH : Z_FINISH); /* Claw back input data that was not consumed (because avail_in is * reset above every time round the loop). @@ -665,90 +665,6 @@ png_write_compressed_data_out(png_structrp png_ptr, compression_state *comp) } #endif /* WRITE_COMPRESSED_TEXT */ -#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \ - defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED) -/* Check that the tEXt or zTXt keyword is valid per PNG 1.0 specification, - * and if invalid, correct the keyword rather than discarding the entire - * chunk. The PNG 1.0 specification requires keywords 1-79 characters in - * length, forbids leading or trailing whitespace, multiple internal spaces, - * and the non-break space (0x80) from ISO 8859-1. Returns keyword length. - * - * The 'new_key' buffer must be 80 characters in size (for the keyword plus a - * trailing '\0'). If this routine returns 0 then there was no keyword, or a - * valid one could not be generated, and the caller must png_error. - */ -static png_uint_32 -png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key) -{ - png_const_charp orig_key = key; - png_uint_32 key_len = 0; - int bad_character = 0; - int space = 1; - - png_debug(1, "in png_check_keyword"); - - if (key == NULL) - { - *new_key = 0; - return 0; - } - - while (*key && key_len < 79) - { - png_byte ch = (png_byte)*key++; - - if ((ch > 32 && ch <= 126) || (ch >= 161 /*&& ch <= 255*/)) - *new_key++ = ch, ++key_len, space = 0; - - else if (space == 0) - { - /* A space or an invalid character when one wasn't seen immediately - * before; output just a space. - */ - *new_key++ = 32, ++key_len, space = 1; - - /* If the character was not a space then it is invalid. */ - if (ch != 32) - bad_character = ch; - } - - else if (bad_character == 0) - bad_character = ch; /* just skip it, record the first error */ - } - - if (key_len > 0 && space != 0) /* trailing space */ - { - --key_len, --new_key; - if (bad_character == 0) - bad_character = 32; - } - - /* Terminate the keyword */ - *new_key = 0; - - if (key_len == 0) - return 0; - -#ifdef PNG_WARNINGS_SUPPORTED - /* Try to only output one warning per keyword: */ - if (*key != 0) /* keyword too long */ - png_warning(png_ptr, "keyword truncated"); - - else if (bad_character != 0) - { - PNG_WARNING_PARAMETERS(p) - - png_warning_parameter(p, 1, orig_key); - png_warning_parameter_signed(p, 2, PNG_NUMBER_FORMAT_02x, bad_character); - - png_formatted_warning(png_ptr, p, "keyword \"@1\": bad character '0x@2'"); - } -#endif /* WARNINGS */ - - return key_len; -} -#endif /* WRITE_TEXT || WRITE_pCAL || WRITE_iCCP || WRITE_sPLT */ - /* Write the IHDR chunk, and update the png_struct with the necessary * information. Note that the rest of this code depends upon this * information being correct. @@ -1009,7 +925,7 @@ png_write_PLTE(png_structrp png_ptr, png_const_colorp palette, */ void /* PRIVATE */ png_compress_IDAT(png_structrp png_ptr, png_const_bytep input, - png_alloc_size_t input_len, int flush) + png_alloc_size_t input_len, int flush) { if (png_ptr->zowner != png_IDAT) { @@ -1021,7 +937,7 @@ png_compress_IDAT(png_structrp png_ptr, png_const_bytep input, if (png_ptr->zbuffer_list == NULL) { png_ptr->zbuffer_list = png_voidcast(png_compression_bufferp, - png_malloc(png_ptr, PNG_COMPRESSION_BUFFER_SIZE(png_ptr))); + png_malloc(png_ptr, PNG_COMPRESSION_BUFFER_SIZE(png_ptr))); png_ptr->zbuffer_list->next = NULL; } @@ -1442,7 +1358,7 @@ png_write_tRNS(png_structrp png_ptr, png_const_bytep trans_alpha, /* Write the chunk out as it is */ png_write_complete_chunk(png_ptr, png_tRNS, trans_alpha, - (png_size_t)num_trans); + (png_size_t)num_trans); } else if (color_type == PNG_COLOR_TYPE_GRAY) @@ -1473,7 +1389,7 @@ png_write_tRNS(png_structrp png_ptr, png_const_bytep trans_alpha, #endif { png_app_warning(png_ptr, - "Ignoring attempt to write 16-bit tRNS chunk when bit_depth is 8"); + "Ignoring attempt to write 16-bit tRNS chunk when bit_depth is 8"); return; } @@ -1525,7 +1441,8 @@ png_write_bKGD(png_structrp png_ptr, png_const_color_16p back, int color_type) #endif { png_warning(png_ptr, - "Ignoring attempt to write 16-bit bKGD chunk when bit_depth is 8"); + "Ignoring attempt to write 16-bit bKGD chunk " + "when bit_depth is 8"); return; } @@ -1655,7 +1572,7 @@ png_write_zTXt(png_structrp png_ptr, png_const_charp key, png_const_charp text, /* Compute the compressed data; do it now for the length */ png_text_compress_init(&comp, (png_const_bytep)text, - text == NULL ? 0 : strlen(text)); + text == NULL ? 0 : strlen(text)); if (png_text_compress(png_ptr, png_zTXt, &comp, key_len) != Z_OK) png_error(png_ptr, png_ptr->zstream.msg); @@ -2025,7 +1942,7 @@ png_write_start_row(png_structrp png_ptr) */ if ((filters & (PNG_FILTER_AVG | PNG_FILTER_UP | PNG_FILTER_PAETH)) != 0) png_ptr->prev_row = png_voidcast(png_bytep, - png_calloc(png_ptr, buf_size)); + png_calloc(png_ptr, buf_size)); #endif /* WRITE_FILTER */ #ifdef PNG_WRITE_INTERLACING_SUPPORTED @@ -2328,7 +2245,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass) */ static void /* PRIVATE */ png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row, - png_size_t row_bytes); + png_size_t row_bytes); #ifdef PNG_WRITE_FILTER_SUPPORTED static png_size_t /* PRIVATE */ @@ -2346,14 +2263,22 @@ png_setup_sub_row(png_structrp png_ptr, const png_uint_32 bpp, i++, rp++, dp++) { v = *dp = *rp; +#ifdef PNG_USE_ABS + sum += 128 - abs(v - 128); +#else sum += (v < 128) ? v : 256 - v; +#endif } for (lp = png_ptr->row_buf + 1; i < row_bytes; i++, rp++, lp++, dp++) { v = *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff); +#ifdef PNG_USE_ABS + sum += 128 - abs(v - 128); +#else sum += (v < 128) ? v : 256 - v; +#endif if (sum > lmins) /* We are already worse, don't continue. */ break; @@ -2362,6 +2287,28 @@ png_setup_sub_row(png_structrp png_ptr, const png_uint_32 bpp, return (sum); } +static void /* PRIVATE */ +png_setup_sub_row_only(png_structrp png_ptr, const png_uint_32 bpp, + const png_size_t row_bytes) +{ + png_bytep rp, dp, lp; + png_size_t i; + + png_ptr->try_row[0] = PNG_FILTER_VALUE_SUB; + + for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1; i < bpp; + i++, rp++, dp++) + { + *dp = *rp; + } + + for (lp = png_ptr->row_buf + 1; i < row_bytes; + i++, rp++, lp++, dp++) + { + *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff); + } +} + static png_size_t /* PRIVATE */ png_setup_up_row(png_structrp png_ptr, const png_size_t row_bytes, const png_size_t lmins) @@ -2378,7 +2325,11 @@ png_setup_up_row(png_structrp png_ptr, const png_size_t row_bytes, i++, rp++, pp++, dp++) { v = *dp = (png_byte)(((int)*rp - (int)*pp) & 0xff); +#ifdef PNG_USE_ABS + sum += 128 - abs(v - 128); +#else sum += (v < 128) ? v : 256 - v; +#endif if (sum > lmins) /* We are already worse, don't continue. */ break; @@ -2386,10 +2337,25 @@ png_setup_up_row(png_structrp png_ptr, const png_size_t row_bytes, return (sum); } +static void /* PRIVATE */ +png_setup_up_row_only(png_structrp png_ptr, const png_size_t row_bytes) +{ + png_bytep rp, dp, pp; + png_size_t i; + + png_ptr->try_row[0] = PNG_FILTER_VALUE_UP; + + for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1, + pp = png_ptr->prev_row + 1; i < row_bytes; + i++, rp++, pp++, dp++) + { + *dp = (png_byte)(((int)*rp - (int)*pp) & 0xff); + } +} static png_size_t /* PRIVATE */ png_setup_avg_row(png_structrp png_ptr, const png_uint_32 bpp, - const png_size_t row_bytes, const png_size_t lmins) + const png_size_t row_bytes, const png_size_t lmins) { png_bytep rp, dp, pp, lp; png_uint_32 i; @@ -2399,11 +2365,15 @@ png_setup_avg_row(png_structrp png_ptr, const png_uint_32 bpp, png_ptr->try_row[0] = PNG_FILTER_VALUE_AVG; for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1, - pp = png_ptr->prev_row + 1; i < bpp; i++) + pp = png_ptr->prev_row + 1; i < bpp; i++) { v = *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff); +#ifdef PNG_USE_ABS + sum += 128 - abs(v - 128); +#else sum += (v < 128) ? v : 256 - v; +#endif } for (lp = png_ptr->row_buf + 1; i < row_bytes; i++) @@ -2411,7 +2381,11 @@ png_setup_avg_row(png_structrp png_ptr, const png_uint_32 bpp, v = *dp++ = (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) & 0xff); +#ifdef PNG_USE_ABS + sum += 128 - abs(v - 128); +#else sum += (v < 128) ? v : 256 - v; +#endif if (sum > lmins) /* We are already worse, don't continue. */ break; @@ -2419,6 +2393,27 @@ png_setup_avg_row(png_structrp png_ptr, const png_uint_32 bpp, return (sum); } +static void /* PRIVATE */ +png_setup_avg_row_only(png_structrp png_ptr, const png_uint_32 bpp, + const png_size_t row_bytes) +{ + png_bytep rp, dp, pp, lp; + png_uint_32 i; + + png_ptr->try_row[0] = PNG_FILTER_VALUE_AVG; + + for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1, + pp = png_ptr->prev_row + 1; i < bpp; i++) + { + *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff); + } + + for (lp = png_ptr->row_buf + 1; i < row_bytes; i++) + { + *dp++ = (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) + & 0xff); + } +} static png_size_t /* PRIVATE */ png_setup_paeth_row(png_structrp png_ptr, const png_uint_32 bpp, @@ -2436,7 +2431,11 @@ png_setup_paeth_row(png_structrp png_ptr, const png_uint_32 bpp, { v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); +#ifdef PNG_USE_ABS + sum += 128 - abs(v - 128); +#else sum += (v < 128) ? v : 256 - v; +#endif } for (lp = png_ptr->row_buf + 1, cp = png_ptr->prev_row + 1; i < row_bytes; @@ -2465,7 +2464,11 @@ png_setup_paeth_row(png_structrp png_ptr, const png_uint_32 bpp, v = *dp++ = (png_byte)(((int)*rp++ - p) & 0xff); +#ifdef PNG_USE_ABS + sum += 128 - abs(v - 128); +#else sum += (v < 128) ? v : 256 - v; +#endif if (sum > lmins) /* We are already worse, don't continue. */ break; @@ -2473,6 +2476,48 @@ png_setup_paeth_row(png_structrp png_ptr, const png_uint_32 bpp, return (sum); } +static void /* PRIVATE */ +png_setup_paeth_row_only(png_structrp png_ptr, const png_uint_32 bpp, + const png_size_t row_bytes) +{ + png_bytep rp, dp, pp, cp, lp; + png_size_t i; + + png_ptr->try_row[0] = PNG_FILTER_VALUE_PAETH; + + for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1, + pp = png_ptr->prev_row + 1; i < bpp; i++) + { + *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); + } + + for (lp = png_ptr->row_buf + 1, cp = png_ptr->prev_row + 1; i < row_bytes; + i++) + { + int a, b, c, pa, pb, pc, p; + + b = *pp++; + c = *cp++; + a = *lp++; + + p = b - c; + pc = a - c; + +#ifdef PNG_USE_ABS + pa = abs(p); + pb = abs(pc); + pc = abs(p + pc); +#else + pa = p < 0 ? -p : p; + pb = pc < 0 ? -pc : pc; + pc = (p + pc) < 0 ? -(p + pc) : p + pc; +#endif + + p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c; + + *dp++ = (png_byte)(((int)*rp++ - p) & 0xff); + } +} #endif /* WRITE_FILTER */ void /* PRIVATE */ @@ -2481,7 +2526,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info) #ifndef PNG_WRITE_FILTER_SUPPORTED png_write_filtered_row(png_ptr, png_ptr->row_buf, row_info->rowbytes+1); #else - png_byte filter_to_do = png_ptr->do_filter; + unsigned int filter_to_do = png_ptr->do_filter; png_bytep row_buf; png_bytep best_row; png_uint_32 bpp; @@ -2527,32 +2572,33 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info) */ best_row = png_ptr->row_buf; - - if ((filter_to_do & PNG_FILTER_NONE) != 0 && filter_to_do != PNG_FILTER_NONE) + if (PNG_SIZE_MAX/128 <= row_bytes) { + /* Overflow can occur in the calculation, just select the lowest set + * filter. + */ + filter_to_do &= 0U-filter_to_do; + } + else if ((filter_to_do & PNG_FILTER_NONE) != 0 && + filter_to_do != PNG_FILTER_NONE) + { + /* Overflow not possible and multiple filters in the list, including the + * 'none' filter. + */ png_bytep rp; png_size_t sum = 0; png_size_t i; int v; - if (PNG_SIZE_MAX/128 <= row_bytes) - { - for (i = 0, rp = row_buf + 1; i < row_bytes; i++, rp++) - { - /* Check for overflow */ - if (sum > PNG_SIZE_MAX/128 - 256) - break; - - v = *rp; - sum += (v < 128) ? v : 256 - v; - } - } - else /* Overflow is not possible */ { for (i = 0, rp = row_buf + 1; i < row_bytes; i++, rp++) { v = *rp; +#ifdef PNG_USE_ABS + sum += 128 - abs(v - 128); +#else sum += (v < 128) ? v : 256 - v; +#endif } } @@ -2563,7 +2609,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info) if (filter_to_do == PNG_FILTER_SUB) /* It's the only filter so no testing is needed */ { - (void) png_setup_sub_row(png_ptr, bpp, row_bytes, mins); + png_setup_sub_row_only(png_ptr, bpp, row_bytes); best_row = png_ptr->try_row; } @@ -2572,7 +2618,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info) png_size_t sum; png_size_t lmins = mins; - sum = png_setup_sub_row(png_ptr, bpp, row_bytes, lmins); + sum = png_setup_sub_row(png_ptr, bpp, row_bytes, lmins); if (sum < mins) { @@ -2589,7 +2635,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info) /* Up filter */ if (filter_to_do == PNG_FILTER_UP) { - (void) png_setup_up_row(png_ptr, row_bytes, mins); + png_setup_up_row_only(png_ptr, row_bytes); best_row = png_ptr->try_row; } @@ -2598,7 +2644,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info) png_size_t sum; png_size_t lmins = mins; - sum = png_setup_up_row(png_ptr, row_bytes, lmins); + sum = png_setup_up_row(png_ptr, row_bytes, lmins); if (sum < mins) { @@ -2615,7 +2661,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info) /* Avg filter */ if (filter_to_do == PNG_FILTER_AVG) { - (void) png_setup_avg_row(png_ptr, bpp, row_bytes, mins); + png_setup_avg_row_only(png_ptr, bpp, row_bytes); best_row = png_ptr->try_row; } @@ -2639,9 +2685,9 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info) } /* Paeth filter */ - if ((filter_to_do == PNG_FILTER_PAETH) != 0) + if (filter_to_do == PNG_FILTER_PAETH) { - (void) png_setup_paeth_row(png_ptr, bpp, row_bytes, mins); + png_setup_paeth_row_only(png_ptr, bpp, row_bytes); best_row = png_ptr->try_row; } @@ -2673,7 +2719,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info) /* Do the actual writing of a previously filtered row. */ static void png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row, - png_size_t full_row_length/*includes filter byte*/) + png_size_t full_row_length/*includes filter byte*/) { png_debug(1, "in png_write_filtered_row"); diff --git a/3rdparty/libtiff/CMakeLists.txt b/3rdparty/libtiff/CMakeLists.txt index 13971f16ab..7a5b34c611 100644 --- a/3rdparty/libtiff/CMakeLists.txt +++ b/3rdparty/libtiff/CMakeLists.txt @@ -95,7 +95,7 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267 /wd4305 /wd4306) # vs2008 Win64 ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4703) # vs2012 ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4456 /wd4457 /wd4312) # vs2015 -ocv_warnings_disable(CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018) +ocv_warnings_disable(CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018 /wd4311 /wd4312) if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") diff --git a/3rdparty/openvx/CMakeLists.txt b/3rdparty/openvx/CMakeLists.txt new file mode 100644 index 0000000000..ae9285eaf7 --- /dev/null +++ b/3rdparty/openvx/CMakeLists.txt @@ -0,0 +1,17 @@ +add_library(openvx_hal STATIC src/openvx_hal.cpp) +target_include_directories(openvx_hal PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/modules/core/include + ${OPENVX_INCLUDE_DIR}) +target_link_libraries(openvx_hal LINK_PUBLIC ${OPENVX_LIBRARIES}) +set_target_properties(openvx_hal PROPERTIES POSITION_INDEPENDENT_CODE TRUE) +set_target_properties(openvx_hal PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}) +if(NOT BUILD_SHARED_LIBS) + ocv_install_target(openvx_hal EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev) +endif() + +set(OPENVX_HAL_FOUND TRUE PARENT_SCOPE) +set(OPENVX_HAL_VERSION 0.0.1 PARENT_SCOPE) +set(OPENVX_HAL_LIBRARIES "openvx_hal" PARENT_SCOPE) +set(OPENVX_HAL_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/include/openvx_hal.hpp" PARENT_SCOPE) +set(OPENVX_HAL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include" "${OPENVX_INCLUDE_DIR}" PARENT_SCOPE) diff --git a/3rdparty/openvx/include/openvx_hal.hpp b/3rdparty/openvx/include/openvx_hal.hpp new file mode 100644 index 0000000000..26978e6db2 --- /dev/null +++ b/3rdparty/openvx/include/openvx_hal.hpp @@ -0,0 +1,1062 @@ +#ifndef OPENCV_OPENVX_HAL_HPP_INCLUDED +#define OPENCV_OPENVX_HAL_HPP_INCLUDED + +#include "opencv2/core/hal/interface.h" + +#include "VX/vx.h" +#include "VX/vxu.h" + +#include +#include + +#include +#include + +//================================================================================================== +// utility +// ... + +#if 0 +#include +#define PRINT(...) printf(__VA_ARGS__) +#else +#define PRINT(...) +#endif + +#if __cplusplus >= 201103L +#include +struct Tick +{ + typedef std::chrono::time_point point_t; + point_t start; + point_t point; + Tick() + { + start = std::chrono::steady_clock::now(); + point = std::chrono::steady_clock::now(); + } + inline int one() + { + point_t old = point; + point = std::chrono::steady_clock::now(); + return std::chrono::duration_cast(point - old).count(); + } + inline int total() + { + return std::chrono::duration_cast(std::chrono::steady_clock::now() - start).count(); + } +}; +#endif + +//================================================================================================== +// One more OpenVX C++ binding :-) +// ... + +template +struct VX_Traits +{ + enum { + ImgType = 0, + DataType = 0 + }; +}; + +template <> +struct VX_Traits +{ + enum { + ImgType = VX_DF_IMAGE_U8, + DataType = VX_TYPE_UINT8 + }; +}; + +template <> +struct VX_Traits +{ + enum { + ImgType = VX_DF_IMAGE_U16, + DataType = VX_TYPE_UINT16 + }; +}; + +template <> +struct VX_Traits +{ + enum { + ImgType = VX_DF_IMAGE_S16, + DataType = VX_TYPE_INT16 + }; +}; + +template <> +struct VX_Traits +{ + enum { + ImgType = 0, + DataType = VX_TYPE_FLOAT32 + }; +}; + + +struct vxContext; +struct vxImage; +struct vxErr; + + +struct vxErr +{ + vx_status status; + std::string msg; + vxErr(vx_status status_, const std::string & msg_) : status(status_), msg(msg_) {} + void check() + { + if (status != VX_SUCCESS) + throw *this; + } + void print() + { + PRINT("OpenVX HAL impl error: %d (%s)\n", status, msg.c_str()); + } + static void check(vx_context ctx) + { + vxErr(vxGetStatus((vx_reference)ctx), "context check").check(); + } + static void check(vx_image img) + { + vxErr(vxGetStatus((vx_reference)img), "image check").check(); + } + static void check(vx_matrix mtx) + { + vxErr(vxGetStatus((vx_reference)mtx), "matrix check").check(); + } + static void check(vx_convolution cnv) + { + vxErr(vxGetStatus((vx_reference)cnv), "convolution check").check(); + } + static void check(vx_status s) + { + vxErr(s, "status check").check(); + } +}; + + +struct vxContext +{ + vx_context ctx; + static vxContext * getContext(); +private: + vxContext() + { + ctx = vxCreateContext(); + vxErr::check(ctx); + } + ~vxContext() + { + vxReleaseContext(&ctx); + } +}; + + +struct vxImage +{ + vx_image img; + + template + vxImage(vxContext &ctx, const T *data, size_t step, int w, int h) + { + if (h == 1) + step = w * sizeof(T); + vx_imagepatch_addressing_t addr; + addr.dim_x = w; + addr.dim_y = h; + addr.stride_x = sizeof(T); + addr.stride_y = (vx_int32)step; + addr.scale_x = VX_SCALE_UNITY; + addr.scale_y = VX_SCALE_UNITY; + addr.step_x = 1; + addr.step_y = 1; + void *ptrs[] = { (void*)data }; + img = vxCreateImageFromHandle(ctx.ctx, VX_Traits::ImgType, &addr, ptrs, VX_MEMORY_TYPE_HOST); + vxErr::check(img); + } + vxImage(vxContext &ctx, int imgType, const uchar *data, size_t step, int w, int h) + { + if (h == 1) + step = w; + vx_imagepatch_addressing_t addr[4]; + void *ptrs[4]; + switch (imgType) + { + case VX_DF_IMAGE_U8: + case VX_DF_IMAGE_U16: + case VX_DF_IMAGE_S16: + case VX_DF_IMAGE_U32: + case VX_DF_IMAGE_S32: + case VX_DF_IMAGE_RGB: + case VX_DF_IMAGE_RGBX: + case VX_DF_IMAGE_UYVY: + case VX_DF_IMAGE_YUYV: + addr[0].dim_x = w; + addr[0].dim_y = h; + addr[0].stride_x = imgType == VX_DF_IMAGE_U8 ? 1 : + imgType == VX_DF_IMAGE_RGB ? 3 : + (imgType == VX_DF_IMAGE_U16 || imgType == VX_DF_IMAGE_S16) ? 2 : 4; + addr[0].stride_y = (vx_int32)step; + addr[0].scale_x = VX_SCALE_UNITY; + addr[0].scale_y = VX_SCALE_UNITY; + addr[0].step_x = (imgType == VX_DF_IMAGE_UYVY || imgType == VX_DF_IMAGE_YUYV) ? 2 : 1; + addr[0].step_y = 1; + ptrs[0] = (void*)data; + break; + case VX_DF_IMAGE_NV12: + case VX_DF_IMAGE_NV21: + addr[0].dim_x = w; + addr[0].dim_y = h; + addr[0].stride_x = 1; + addr[0].stride_y = (vx_int32)step; + addr[0].scale_x = VX_SCALE_UNITY; + addr[0].scale_y = VX_SCALE_UNITY; + addr[0].step_x = 1; + addr[0].step_y = 1; + ptrs[0] = (void*)data; + addr[1].dim_x = (w + 1) / 2; + addr[1].dim_y = (h + 1) / 2; + addr[1].stride_x = 2; + addr[1].stride_y = (vx_int32)step; + addr[1].scale_x = VX_SCALE_UNITY; + addr[1].scale_y = VX_SCALE_UNITY; + addr[1].step_x = 2; + addr[1].step_y = 2; + ptrs[1] = (void*)(data + h * step); + break; + case VX_DF_IMAGE_IYUV: + case VX_DF_IMAGE_YUV4: + addr[0].dim_x = w; + addr[0].dim_y = h; + addr[0].stride_x = 1; + addr[0].stride_y = (vx_int32)step; + addr[0].scale_x = VX_SCALE_UNITY; + addr[0].scale_y = VX_SCALE_UNITY; + addr[0].step_x = 1; + addr[0].step_y = 1; + ptrs[0] = (void*)data; + addr[1].dim_x = imgType == VX_DF_IMAGE_YUV4 ? w : (w + 1) / 2; + addr[1].dim_y = imgType == VX_DF_IMAGE_YUV4 ? h : (h + 1) / 2; + addr[1].stride_x = 1; + addr[1].stride_y = (vx_int32)step; + addr[1].scale_x = VX_SCALE_UNITY; + addr[1].scale_y = VX_SCALE_UNITY; + addr[1].step_x = imgType == VX_DF_IMAGE_YUV4 ? 1 : 2; + addr[1].step_y = imgType == VX_DF_IMAGE_YUV4 ? 1 : 2; + ptrs[1] = (void*)(data + h * step); + addr[2].dim_x = addr[1].dim_x; + addr[2].dim_y = addr[1].dim_y; + addr[2].stride_x = 1; + addr[2].stride_y = (vx_int32)step; + addr[2].scale_x = VX_SCALE_UNITY; + addr[2].scale_y = VX_SCALE_UNITY; + addr[2].step_x = addr[1].step_x; + addr[2].step_y = addr[1].step_y; + ptrs[2] = (void*)(data + (h + addr[1].dim_y) * step); + break; + default: + vxErr(VX_ERROR_INVALID_PARAMETERS, "Bad image format").check(); + } + img = vxCreateImageFromHandle(ctx.ctx, imgType, addr, ptrs, VX_MEMORY_TYPE_HOST); + vxErr::check(img); + } + ~vxImage() + { + vxErr::check(vxSwapImageHandle(img, NULL, NULL, 1)); + vxReleaseImage(&img); + } +}; + +struct vxMatrix +{ + vx_matrix mtx; + + template + vxMatrix(vxContext &ctx, const T *data, int w, int h) + { + mtx = vxCreateMatrix(ctx.ctx, VX_Traits::DataType, w, h); + vxErr::check(mtx); + vxErr::check(vxCopyMatrix(mtx, const_cast(data), VX_WRITE_ONLY, VX_MEMORY_TYPE_HOST)); + } + ~vxMatrix() + { + vxReleaseMatrix(&mtx); + } +}; + +struct vxConvolution +{ + vx_convolution cnv; + + vxConvolution(vxContext &ctx, const short *data, int w, int h) + { + cnv = vxCreateConvolution(ctx.ctx, w, h); + vxErr::check(cnv); + vxErr::check(vxCopyConvolutionCoefficients(cnv, const_cast(data), VX_WRITE_ONLY, VX_MEMORY_TYPE_HOST)); + } + ~vxConvolution() + { + vxReleaseConvolution(&cnv); + } +}; + +//================================================================================================== +// real code starts here +// ... + +#define OVX_BINARY_OP(hal_func, ovx_call) \ +template \ +inline int ovx_hal_##hal_func(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t cstep, int w, int h) \ +{ \ + try \ + { \ + vxContext * ctx = vxContext::getContext(); \ + vxImage ia(*ctx, a, astep, w, h); \ + vxImage ib(*ctx, b, bstep, w, h); \ + vxImage ic(*ctx, c, cstep, w, h); \ + ovx_call \ + } \ + catch (vxErr & e) \ + { \ + e.print(); \ + return CV_HAL_ERROR_UNKNOWN; \ + } \ + return CV_HAL_ERROR_OK; \ +} + +OVX_BINARY_OP(add, {vxErr::check(vxuAdd(ctx->ctx, ia.img, ib.img, VX_CONVERT_POLICY_SATURATE, ic.img));}) +OVX_BINARY_OP(sub, {vxErr::check(vxuSubtract(ctx->ctx, ia.img, ib.img, VX_CONVERT_POLICY_SATURATE, ic.img));}) + +OVX_BINARY_OP(absdiff, {vxErr::check(vxuAbsDiff(ctx->ctx, ia.img, ib.img, ic.img));}) + +OVX_BINARY_OP(and, {vxErr::check(vxuAnd(ctx->ctx, ia.img, ib.img, ic.img));}) +OVX_BINARY_OP(or, {vxErr::check(vxuOr(ctx->ctx, ia.img, ib.img, ic.img));}) +OVX_BINARY_OP(xor, {vxErr::check(vxuXor(ctx->ctx, ia.img, ib.img, ic.img));}) + +template +inline int ovx_hal_mul(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t cstep, int w, int h, double scale) +{ + try + { + vxContext * ctx = vxContext::getContext(); + vxImage ia(*ctx, a, astep, w, h); + vxImage ib(*ctx, b, bstep, w, h); + vxImage ic(*ctx, c, cstep, w, h); + vxErr::check(vxuMultiply(ctx->ctx, ia.img, ib.img, (float)scale, VX_CONVERT_POLICY_SATURATE, VX_ROUND_POLICY_TO_ZERO, ic.img)); + } + catch (vxErr & e) + { + e.print(); + return CV_HAL_ERROR_UNKNOWN; + } + return CV_HAL_ERROR_OK; +} + +inline int ovx_hal_not(const uchar *a, size_t astep, uchar *c, size_t cstep, int w, int h) +{ + try + { + vxContext * ctx = vxContext::getContext(); + vxImage ia(*ctx, a, astep, w, h); + vxImage ic(*ctx, c, cstep, w, h); + vxErr::check(vxuNot(ctx->ctx, ia.img, ic.img)); + } + catch (vxErr & e) + { + e.print(); + return CV_HAL_ERROR_UNKNOWN; + } + return CV_HAL_ERROR_OK; +} + +inline int ovx_hal_merge8u(const uchar **src_data, uchar *dst_data, int len, int cn) +{ + if (cn != 3 && cn != 4) + return CV_HAL_ERROR_NOT_IMPLEMENTED; + try + { + vxContext * ctx = vxContext::getContext(); + vxImage ia(*ctx, src_data[0], len, len, 1); + vxImage ib(*ctx, src_data[1], len, len, 1); + vxImage ic(*ctx, src_data[2], len, len, 1); + vxImage id(*ctx, cn == 4 ? VX_DF_IMAGE_RGBX : VX_DF_IMAGE_RGB, dst_data, len, len, 1); + vxErr::check(vxuChannelCombine(ctx->ctx, ia.img, ib.img, ic.img, + cn == 4 ? vxImage(*ctx, src_data[3], len, len, 1).img : NULL, + id.img)); + } + catch (vxErr & e) + { + e.print(); + return CV_HAL_ERROR_UNKNOWN; + } + return CV_HAL_ERROR_OK; +} + + +#if defined OPENCV_IMGPROC_HAL_INTERFACE_H + +inline int ovx_hal_resize(int atype, const uchar *a, size_t astep, int aw, int ah, uchar *b, size_t bstep, int bw, int bh, double inv_scale_x, double inv_scale_y, int interpolation) +{ + try + { + vxContext * ctx = vxContext::getContext(); + vxImage ia(*ctx, a, astep, aw, ah); + vxImage ib(*ctx, b, bstep, bw, bh); + + if(!((atype == CV_8UC1 || atype == CV_8SC1) && + inv_scale_x > 0 && inv_scale_y > 0 && + (bw - 0.5) / inv_scale_x - 0.5 < aw && (bh - 0.5) / inv_scale_y - 0.5 < ah && + (bw + 0.5) / inv_scale_x + 0.5 >= aw && (bh + 0.5) / inv_scale_y + 0.5 >= ah && + std::abs(bw / inv_scale_x - aw) < 0.1 && std::abs(bh / inv_scale_y - ah) < 0.1 )) + return CV_HAL_ERROR_NOT_IMPLEMENTED; + + int mode; + if (interpolation == CV_HAL_INTER_LINEAR) + mode = VX_INTERPOLATION_BILINEAR; + else if (interpolation == CV_HAL_INTER_AREA) + mode = VX_INTERPOLATION_AREA; + else if (interpolation == CV_HAL_INTER_NEAREST) + mode = VX_INTERPOLATION_NEAREST_NEIGHBOR; + else + return CV_HAL_ERROR_NOT_IMPLEMENTED; + + vxErr::check( vxuScaleImage(ctx->ctx, ia.img, ib.img, mode)); + } + catch (vxErr & e) + { + e.print(); + return CV_HAL_ERROR_UNKNOWN; + } + return CV_HAL_ERROR_OK; +} + +inline int ovx_hal_warpAffine(int atype, const uchar *a, size_t astep, int aw, int ah, uchar *b, size_t bstep, int bw, int bh, const double M[6], int interpolation, int borderType, const double borderValue[4]) +{ + try + { + vxContext * ctx = vxContext::getContext(); + vxImage ia(*ctx, a, astep, aw, ah); + vxImage ib(*ctx, b, bstep, bw, bh); + + if (!(atype == CV_8UC1 || atype == CV_8SC1)) + return CV_HAL_ERROR_NOT_IMPLEMENTED; + + vx_border_t border; + switch (borderType) + { + case CV_HAL_BORDER_CONSTANT: + border.mode = VX_BORDER_CONSTANT; + border.constant_value.U8 = (vx_uint8)(borderValue[0]); + break; + case CV_HAL_BORDER_REPLICATE: + border.mode = VX_BORDER_REPLICATE; + break; + default: + return CV_HAL_ERROR_NOT_IMPLEMENTED; + } + + int mode; + if (interpolation == CV_HAL_INTER_LINEAR) + mode = VX_INTERPOLATION_BILINEAR; + else if (interpolation == CV_HAL_INTER_AREA) + mode = VX_INTERPOLATION_AREA; + else if (interpolation == CV_HAL_INTER_NEAREST) + mode = VX_INTERPOLATION_NEAREST_NEIGHBOR; + else + return CV_HAL_ERROR_NOT_IMPLEMENTED; + + std::vector data; + data.reserve(6); + for (int j = 0; j < 3; ++j) + for (int i = 0; i < 2; ++i) + data.push_back((float)(M[i*3+j])); + + vxMatrix mtx(*ctx, data.data(), 2, 3); + //ATTENTION: VX_CONTEXT_IMMEDIATE_BORDER attribute change could lead to strange issues in multi-threaded environments + //since OpenVX standart says nothing about thread-safety for now + vx_border_t prevBorder; + vxErr::check(vxQueryContext(ctx->ctx, VX_CONTEXT_IMMEDIATE_BORDER, &prevBorder, sizeof(prevBorder))); + vxErr::check(vxSetContextAttribute(ctx->ctx, VX_CONTEXT_IMMEDIATE_BORDER, &border, sizeof(border))); + vxErr::check(vxuWarpAffine(ctx->ctx, ia.img, mtx.mtx, mode, ib.img)); + vxErr::check(vxSetContextAttribute(ctx->ctx, VX_CONTEXT_IMMEDIATE_BORDER, &prevBorder, sizeof(prevBorder))); + } + catch (vxErr & e) + { + e.print(); + return CV_HAL_ERROR_UNKNOWN; + } + return CV_HAL_ERROR_OK; +} + +inline int ovx_hal_warpPerspectve(int atype, const uchar *a, size_t astep, int aw, int ah, uchar *b, size_t bstep, int bw, int bh, const double M[9], int interpolation, int borderType, const double borderValue[4]) +{ + try + { + vxContext * ctx = vxContext::getContext(); + vxImage ia(*ctx, a, astep, aw, ah); + vxImage ib(*ctx, b, bstep, bw, bh); + + if (!(atype == CV_8UC1 || atype == CV_8SC1)) + return CV_HAL_ERROR_NOT_IMPLEMENTED; + + vx_border_t border; + switch (borderType) + { + case CV_HAL_BORDER_CONSTANT: + border.mode = VX_BORDER_CONSTANT; + border.constant_value.U8 = (vx_uint8)(borderValue[0]); + break; + case CV_HAL_BORDER_REPLICATE: + border.mode = VX_BORDER_REPLICATE; + break; + default: + return CV_HAL_ERROR_NOT_IMPLEMENTED; + } + + int mode; + if (interpolation == CV_HAL_INTER_LINEAR) + mode = VX_INTERPOLATION_BILINEAR; + else if (interpolation == CV_HAL_INTER_AREA) + mode = VX_INTERPOLATION_AREA; + else if (interpolation == CV_HAL_INTER_NEAREST) + mode = VX_INTERPOLATION_NEAREST_NEIGHBOR; + else + return CV_HAL_ERROR_NOT_IMPLEMENTED; + + std::vector data; + data.reserve(9); + for (int j = 0; j < 3; ++j) + for (int i = 0; i < 3; ++i) + data.push_back((float)(M[i * 3 + j])); + + vxMatrix mtx(*ctx, data.data(), 3, 3); + //ATTENTION: VX_CONTEXT_IMMEDIATE_BORDER attribute change could lead to strange issues in multi-threaded environments + //since OpenVX standart says nothing about thread-safety for now + vx_border_t prevBorder; + vxErr::check(vxQueryContext(ctx->ctx, VX_CONTEXT_IMMEDIATE_BORDER, &prevBorder, sizeof(prevBorder))); + vxErr::check(vxSetContextAttribute(ctx->ctx, VX_CONTEXT_IMMEDIATE_BORDER, &border, sizeof(border))); + vxErr::check(vxuWarpPerspective(ctx->ctx, ia.img, mtx.mtx, mode, ib.img)); + vxErr::check(vxSetContextAttribute(ctx->ctx, VX_CONTEXT_IMMEDIATE_BORDER, &prevBorder, sizeof(prevBorder))); + } + catch (vxErr & e) + { + e.print(); + return CV_HAL_ERROR_UNKNOWN; + } + return CV_HAL_ERROR_OK; +} + +struct cvhalFilter2D; + +struct FilterCtx +{ + vxConvolution cnv; + vx_border_t border; + int dst_type; + FilterCtx(vxContext &ctx, const short *data, int w, int h, int _dst_type, vx_border_t & _border) : + cnv(ctx, data, w, h), dst_type(_dst_type), border(_border) {} +}; + +inline int ovx_hal_filterInit(cvhalFilter2D **filter_context, uchar *kernel_data, size_t kernel_step, int kernel_type, int kernel_width, int kernel_height, + int , int , int src_type, int dst_type, int borderType, double delta, int anchor_x, int anchor_y, bool allowSubmatrix, bool allowInplace) +{ + if (!filter_context || !kernel_data || allowSubmatrix || allowInplace || delta != 0 || + src_type != CV_8UC1 || (dst_type != CV_8UC1 && dst_type != CV_16SC1) || + kernel_width % 2 == 0 || kernel_height % 2 == 0 || anchor_x != kernel_width / 2 || anchor_y != kernel_height / 2) + return CV_HAL_ERROR_NOT_IMPLEMENTED; + + vx_border_t border; + switch (borderType) + { + case CV_HAL_BORDER_CONSTANT: + border.mode = VX_BORDER_CONSTANT; + border.constant_value.U8 = 0; + break; + case CV_HAL_BORDER_REPLICATE: + border.mode = VX_BORDER_REPLICATE; + break; + default: + return CV_HAL_ERROR_NOT_IMPLEMENTED; + } + + vxContext * ctx = vxContext::getContext(); + + std::vector data; + data.reserve(kernel_width*kernel_height); + switch (kernel_type) + { + case CV_8UC1: + for (int j = 0; j < kernel_height; ++j) + { + uchar * row = (uchar*)(kernel_data + kernel_step*j); + for (int i = 0; i < kernel_width; ++i) + data.push_back(row[i]); + } + break; + case CV_8SC1: + for (int j = 0; j < kernel_height; ++j) + { + schar * row = (schar*)(kernel_data + kernel_step*j); + for (int i = 0; i < kernel_width; ++i) + data.push_back(row[i]); + } + break; + case CV_16SC1: + for (int j = 0; j < kernel_height; ++j) + { + short * row = (short*)(kernel_data + kernel_step*j); + for (int i = 0; i < kernel_width; ++i) + data.push_back(row[i]); + } + default: + return CV_HAL_ERROR_NOT_IMPLEMENTED; + } + + FilterCtx* cnv = new FilterCtx(*ctx, data.data(), kernel_width, kernel_height, dst_type, border); + if (!cnv) + return CV_HAL_ERROR_UNKNOWN; + + *filter_context = (cvhalFilter2D*)(cnv); + return CV_HAL_ERROR_OK; +} + +inline int ovx_hal_filterFree(cvhalFilter2D *filter_context) +{ + if (filter_context) + { + delete (FilterCtx*)filter_context; + return CV_HAL_ERROR_OK; + } + else + { + return CV_HAL_ERROR_UNKNOWN; + } +} + +inline int ovx_hal_filter(cvhalFilter2D *filter_context, uchar *a, size_t astep, uchar *b, size_t bstep, int w, int h, int , int , int , int ) +{ + try + { + FilterCtx* cnv = (FilterCtx*)filter_context; + if(!cnv) + vxErr(VX_ERROR_INVALID_PARAMETERS, "Bad HAL context").check(); + + vxContext * ctx = vxContext::getContext(); + vxImage ia(*ctx, a, astep, w, h); + + //ATTENTION: VX_CONTEXT_IMMEDIATE_BORDER attribute change could lead to strange issues in multi-threaded environments + //since OpenVX standart says nothing about thread-safety for now + vx_border_t prevBorder; + vxErr::check(vxQueryContext(ctx->ctx, VX_CONTEXT_IMMEDIATE_BORDER, &prevBorder, sizeof(prevBorder))); + vxErr::check(vxSetContextAttribute(ctx->ctx, VX_CONTEXT_IMMEDIATE_BORDER, &(cnv->border), sizeof(cnv->border))); + if (cnv->dst_type == CV_16SC1) + { + vxImage ib(*ctx, (short*)b, bstep, w, h); + vxErr::check(vxuConvolve(ctx->ctx, ia.img, cnv->cnv.cnv, ib.img)); + } + else + { + vxImage ib(*ctx, b, bstep, w, h); + vxErr::check(vxuConvolve(ctx->ctx, ia.img, cnv->cnv.cnv, ib.img)); + } + vxErr::check(vxSetContextAttribute(ctx->ctx, VX_CONTEXT_IMMEDIATE_BORDER, &prevBorder, sizeof(prevBorder))); + } + catch (vxErr & e) + { + e.print(); + return CV_HAL_ERROR_UNKNOWN; + } + return CV_HAL_ERROR_OK; +} + +inline int ovx_hal_sepFilterInit(cvhalFilter2D **filter_context, int src_type, int dst_type, + int kernel_type, uchar *kernelx_data, int kernelx_length, uchar *kernely_data, int kernely_length, + int anchor_x, int anchor_y, double delta, int borderType) +{ + if (!filter_context || !kernelx_data || !kernely_data || delta != 0 || + src_type != CV_8UC1 || (dst_type != CV_8UC1 && dst_type != CV_16SC1) || + kernelx_length % 2 == 0 || kernely_length % 2 == 0 || anchor_x != kernelx_length / 2 || anchor_y != kernely_length / 2) + return CV_HAL_ERROR_NOT_IMPLEMENTED; + + vx_border_t border; + switch (borderType) + { + case CV_HAL_BORDER_CONSTANT: + border.mode = VX_BORDER_CONSTANT; + border.constant_value.U8 = 0; + break; + case CV_HAL_BORDER_REPLICATE: + border.mode = VX_BORDER_REPLICATE; + break; + default: + return CV_HAL_ERROR_NOT_IMPLEMENTED; + } + + vxContext * ctx = vxContext::getContext(); + + //At the moment OpenVX doesn't support separable filters natively so combine kernels to generic convolution + std::vector data; + data.reserve(kernelx_length*kernely_length); + switch (kernel_type) + { + case CV_8UC1: + for (int j = 0; j < kernely_length; ++j) + for (int i = 0; i < kernelx_length; ++i) + data.push_back((short)(kernely_data[j]) * kernelx_data[i]); + break; + case CV_8SC1: + for (int j = 0; j < kernely_length; ++j) + for (int i = 0; i < kernelx_length; ++i) + data.push_back((short)(((schar*)kernely_data)[j]) * ((schar*)kernelx_data)[i]); + break; + default: + return CV_HAL_ERROR_NOT_IMPLEMENTED; + } + + FilterCtx* cnv = new FilterCtx(*ctx, data.data(), kernelx_length, kernely_length, dst_type, border); + if (!cnv) + return CV_HAL_ERROR_UNKNOWN; + + *filter_context = (cvhalFilter2D*)(cnv); + return CV_HAL_ERROR_OK; +} + +struct MorphCtx +{ + vxMatrix mask; + int operation; + vx_border_t border; + MorphCtx(vxContext &ctx, const uchar *data, int w, int h, int _operation, vx_border_t & _border) : + mask(ctx, data, w, h), operation(_operation), border(_border) {} +}; + +inline int ovx_hal_morphInit(cvhalFilter2D **filter_context, int operation, int src_type, int dst_type, int , int , + int kernel_type, uchar *kernel_data, size_t kernel_step, int kernel_width, int kernel_height, int anchor_x, int anchor_y, + int borderType, const double borderValue[4], int iterations, bool allowSubmatrix, bool allowInplace) +{ + if (!filter_context || !kernel_data || allowSubmatrix || allowInplace || iterations != 1 || + src_type != CV_8UC1 || dst_type != CV_8UC1 || + kernel_width % 2 == 0 || kernel_height % 2 == 0 || anchor_x != kernel_width / 2 || anchor_y != kernel_height / 2) + return CV_HAL_ERROR_NOT_IMPLEMENTED; + + vx_border_t border; + switch (borderType) + { + case CV_HAL_BORDER_CONSTANT: + border.mode = VX_BORDER_CONSTANT; + if (borderValue[0] == DBL_MAX && borderValue[1] == DBL_MAX && borderValue[2] == DBL_MAX && borderValue[3] == DBL_MAX) + { + if (operation == MORPH_ERODE) + border.constant_value.U8 = UCHAR_MAX; + else + border.constant_value.U8 = 0; + } + else + { + border.constant_value.U8 = cv::saturate_cast(borderValue[0]); + } + break; + case CV_HAL_BORDER_REPLICATE: + border.mode = VX_BORDER_REPLICATE; + break; + default: + return CV_HAL_ERROR_NOT_IMPLEMENTED; + } + + vxContext * ctx = vxContext::getContext(); + + std::vector kernel_mat; + kernel_mat.resize(kernel_width * kernel_height); + switch (CV_MAT_DEPTH(kernel_type)) + { + case CV_8U: + case CV_8S: + for (int j = 0; j < kernel_height; ++j) + { + uchar * kernel_row = kernel_data + j * kernel_step; + for (int i = 0; i < kernel_height; ++i) + kernel_mat.push_back(kernel_row[i] ? 255 : 0); + } + break; + case CV_16U: + case CV_16S: + for (int j = 0; j < kernel_height; ++j) + { + short * kernel_row = (short*)(kernel_data + j * kernel_step); + for (int i = 0; i < kernel_height; ++i) + kernel_mat.push_back(kernel_row[i] ? 255 : 0); + } + break; + case CV_32S: + for (int j = 0; j < kernel_height; ++j) + { + int * kernel_row = (int*)(kernel_data + j * kernel_step); + for (int i = 0; i < kernel_height; ++i) + kernel_mat.push_back(kernel_row[i] ? 255 : 0); + } + break; + case CV_32F: + for (int j = 0; j < kernel_height; ++j) + { + float * kernel_row = (float*)(kernel_data + j * kernel_step); + for (int i = 0; i < kernel_height; ++i) + kernel_mat.push_back(kernel_row[i] ? 255 : 0); + } + break; + case CV_64F: + for (int j = 0; j < kernel_height; ++j) + { + double * kernel_row = (double*)(kernel_data + j * kernel_step); + for (int i = 0; i < kernel_height; ++i) + kernel_mat.push_back(kernel_row[i] ? 255 : 0); + } + break; + default: + return CV_HAL_ERROR_NOT_IMPLEMENTED; + } + + MorphCtx* mat; + switch (operation) + { + case MORPH_ERODE: + mat = new MorphCtx(*ctx, kernel_mat.data(), kernel_width, kernel_height, VX_NONLINEAR_FILTER_MIN, border); + case MORPH_DILATE: + mat = new MorphCtx(*ctx, kernel_mat.data(), kernel_width, kernel_height, VX_NONLINEAR_FILTER_MAX, border); + break; + default: + return CV_HAL_ERROR_NOT_IMPLEMENTED; + } + if (!mat) + return CV_HAL_ERROR_UNKNOWN; + + *filter_context = (cvhalFilter2D*)(mat); + return CV_HAL_ERROR_OK; +} + +inline int ovx_hal_morphFree(cvhalFilter2D *filter_context) +{ + if (filter_context) + { + delete (MorphCtx*)filter_context; + return CV_HAL_ERROR_OK; + } + else + { + return CV_HAL_ERROR_UNKNOWN; + } +} + +inline int ovx_hal_morph(cvhalFilter2D *filter_context, uchar *a, size_t astep, uchar *b, size_t bstep, int w, int h, int , int , int , int , int , int , int , int ) +{ + try + { + MorphCtx* mat = (MorphCtx*)filter_context; + if (!mat) + vxErr(VX_ERROR_INVALID_PARAMETERS, "Bad HAL context").check(); + + vxContext * ctx = vxContext::getContext(); + vxImage ia(*ctx, a, astep, w, h); + vxImage ib(*ctx, b, bstep, w, h); + + //ATTENTION: VX_CONTEXT_IMMEDIATE_BORDER attribute change could lead to strange issues in multi-threaded environments + //since OpenVX standart says nothing about thread-safety for now + vx_border_t prevBorder; + vxErr::check(vxQueryContext(ctx->ctx, VX_CONTEXT_IMMEDIATE_BORDER, &prevBorder, sizeof(prevBorder))); + vxErr::check(vxSetContextAttribute(ctx->ctx, VX_CONTEXT_IMMEDIATE_BORDER, &(mat->border), sizeof(mat->border))); + vxErr::check(vxuNonLinearFilter(ctx->ctx, mat->operation, ia.img, mat->mask.mtx, ib.img)); + vxErr::check(vxSetContextAttribute(ctx->ctx, VX_CONTEXT_IMMEDIATE_BORDER, &prevBorder, sizeof(prevBorder))); + } + catch (vxErr & e) + { + e.print(); + return CV_HAL_ERROR_UNKNOWN; + } + return CV_HAL_ERROR_OK; +} + +inline int ovx_hal_cvtBGRtoBGR(const uchar * a, size_t astep, uchar * b, size_t bstep, int w, int h, int depth, int acn, int bcn, bool swapBlue) +{ + if (depth != CV_8U || swapBlue || acn == bcn || (acn != 3 && acn != 4) || (bcn != 3 && bcn != 4)) + return CV_HAL_ERROR_NOT_IMPLEMENTED; + + try + { + vxContext * ctx = vxContext::getContext(); + vxImage ia(*ctx, acn == 3 ? VX_DF_IMAGE_RGB : VX_DF_IMAGE_RGBX, a, astep, w, h); + vxImage ib(*ctx, bcn == 3 ? VX_DF_IMAGE_RGB : VX_DF_IMAGE_RGBX, b, bstep, w, h); + vxErr::check(vxuColorConvert(ctx->ctx, ia.img, ib.img)); + } + catch (vxErr & e) + { + e.print(); + return CV_HAL_ERROR_UNKNOWN; + } + return CV_HAL_ERROR_OK; +} + +inline int ovx_hal_cvtTwoPlaneYUVtoBGR(const uchar * a, size_t astep, uchar * b, size_t bstep, int w, int h, int bcn, bool swapBlue, int uIdx) +{ + if (!swapBlue || (bcn != 3 && bcn != 4)) + return CV_HAL_ERROR_NOT_IMPLEMENTED; + + try + { + vxContext * ctx = vxContext::getContext(); + vxImage ia(*ctx, uIdx ? VX_DF_IMAGE_NV21 : VX_DF_IMAGE_NV12, a, astep, w, h); + vxImage ib(*ctx, bcn == 3 ? VX_DF_IMAGE_RGB : VX_DF_IMAGE_RGBX, b, bstep, w, h); + vxErr::check(vxuColorConvert(ctx->ctx, ia.img, ib.img)); + } + catch (vxErr & e) + { + e.print(); + return CV_HAL_ERROR_UNKNOWN; + } + return CV_HAL_ERROR_OK; +} + +inline int ovx_hal_cvtThreePlaneYUVtoBGR(const uchar * a, size_t astep, uchar * b, size_t bstep, int w, int h, int bcn, bool swapBlue, int uIdx) +{ + if (!swapBlue || (bcn != 3 && bcn != 4) || uIdx) + return CV_HAL_ERROR_NOT_IMPLEMENTED; + + try + { + vxContext * ctx = vxContext::getContext(); + vxImage ia(*ctx, VX_DF_IMAGE_IYUV, a, astep, w, h); + vxImage ib(*ctx, bcn == 3 ? VX_DF_IMAGE_RGB : VX_DF_IMAGE_RGBX, b, bstep, w, h); + vxErr::check(vxuColorConvert(ctx->ctx, ia.img, ib.img)); + } + catch (vxErr & e) + { + e.print(); + return CV_HAL_ERROR_UNKNOWN; + } + return CV_HAL_ERROR_OK; +} + +inline int ovx_hal_cvtBGRtoThreePlaneYUV(const uchar * a, size_t astep, uchar * b, size_t bstep, int w, int h, int acn, bool swapBlue, int uIdx) +{ + if (!swapBlue || (acn != 3 && acn != 4) || uIdx) + return CV_HAL_ERROR_NOT_IMPLEMENTED; + + try + { + vxContext * ctx = vxContext::getContext(); + vxImage ia(*ctx, acn == 3 ? VX_DF_IMAGE_RGB : VX_DF_IMAGE_RGBX, a, astep, w, h); + vxImage ib(*ctx, VX_DF_IMAGE_IYUV, b, bstep, w, h); + vxErr::check(vxuColorConvert(ctx->ctx, ia.img, ib.img)); + } + catch (vxErr & e) + { + e.print(); + return CV_HAL_ERROR_UNKNOWN; + } + return CV_HAL_ERROR_OK; +} + +inline int ovx_hal_cvtOnePlaneYUVtoBGR(const uchar * a, size_t astep, uchar * b, size_t bstep, int w, int h, int bcn, bool swapBlue, int uIdx, int ycn) +{ + if (!swapBlue || (bcn != 3 && bcn != 4) || uIdx) + return CV_HAL_ERROR_NOT_IMPLEMENTED; + + try + { + vxContext * ctx = vxContext::getContext(); + vxImage ia(*ctx, ycn ? VX_DF_IMAGE_UYVY : VX_DF_IMAGE_YUYV, a, astep, w, h); + vxImage ib(*ctx, bcn == 3 ? VX_DF_IMAGE_RGB : VX_DF_IMAGE_RGBX, b, bstep, w, h); + vxErr::check(vxuColorConvert(ctx->ctx, ia.img, ib.img)); + } + catch (vxErr & e) + { + e.print(); + return CV_HAL_ERROR_UNKNOWN; + } + return CV_HAL_ERROR_OK; +} + +#endif + +//================================================================================================== +// functions redefinition +// ... + +#undef cv_hal_add8u +#define cv_hal_add8u ovx_hal_add +#undef cv_hal_add16s +#define cv_hal_add16s ovx_hal_add +#undef cv_hal_sub8u +#define cv_hal_sub8u ovx_hal_sub +#undef cv_hal_sub16s +#define cv_hal_sub16s ovx_hal_sub + +#undef cv_hal_absdiff8u +#define cv_hal_absdiff8u ovx_hal_absdiff +#undef cv_hal_absdiff16s +#define cv_hal_absdiff16s ovx_hal_absdiff + +#undef cv_hal_and8u +#define cv_hal_and8u ovx_hal_and +#undef cv_hal_or8u +#define cv_hal_or8u ovx_hal_or +#undef cv_hal_xor8u +#define cv_hal_xor8u ovx_hal_xor +#undef cv_hal_not8u +#define cv_hal_not8u ovx_hal_not + +#undef cv_hal_mul8u +#define cv_hal_mul8u ovx_hal_mul +#undef cv_hal_mul16s +#define cv_hal_mul16s ovx_hal_mul + +#undef cv_hal_merge8u +#define cv_hal_merge8u ovx_hal_merge8u + +#if defined OPENCV_IMGPROC_HAL_INTERFACE_H + +#undef cv_hal_resize +#define cv_hal_resize ovx_hal_resize +#undef cv_hal_warpAffine +#define cv_hal_warpAffine ovx_hal_warpAffine +#undef cv_hal_warpPerspective +#define cv_hal_warpPerspective ovx_hal_warpPerspectve + +#undef cv_hal_filterInit +#define cv_hal_filterInit ovx_hal_filterInit +#undef cv_hal_filter +#define cv_hal_filter ovx_hal_filter +#undef cv_hal_filterFree +#define cv_hal_filterFree ovx_hal_filterFree + +#undef cv_hal_sepFilterInit +#define cv_hal_sepFilterInit ovx_hal_sepFilterInit +#undef cv_hal_sepFilter +#define cv_hal_sepFilter ovx_hal_filter +#undef cv_hal_sepFilterFree +#define cv_hal_sepFilterFree ovx_hal_filterFree + +#undef cv_hal_morphInit +#define cv_hal_morphInit ovx_hal_morphInit +#undef cv_hal_morph +#define cv_hal_morph ovx_hal_morph +#undef cv_hal_morphFree +#define cv_hal_morphFree ovx_hal_morphFree + +#undef cv_hal_cvtBGRtoBGR +#define cv_hal_cvtBGRtoBGR ovx_hal_cvtBGRtoBGR +#undef cv_hal_cvtTwoPlaneYUVtoBGR +#define cv_hal_cvtTwoPlaneYUVtoBGR ovx_hal_cvtTwoPlaneYUVtoBGR +#undef cv_hal_cvtThreePlaneYUVtoBGR +#define cv_hal_cvtThreePlaneYUVtoBGR ovx_hal_cvtThreePlaneYUVtoBGR +#undef cv_hal_cvtBGRtoThreePlaneYUV +#define cv_hal_cvtBGRtoThreePlaneYUV ovx_hal_cvtBGRtoThreePlaneYUV +#undef cv_hal_cvtOnePlaneYUVtoBGR +#define cv_hal_cvtOnePlaneYUVtoBGR ovx_hal_cvtOnePlaneYUVtoBGR + +#endif + +#endif diff --git a/3rdparty/openvx/src/openvx_hal.cpp b/3rdparty/openvx/src/openvx_hal.cpp new file mode 100644 index 0000000000..e95bbb2b58 --- /dev/null +++ b/3rdparty/openvx/src/openvx_hal.cpp @@ -0,0 +1,8 @@ +#include "openvx_hal.hpp" + +vxContext * vxContext::getContext() +{ + // not thread safe + static vxContext instance; + return &instance; +} diff --git a/CMakeLists.txt b/CMakeLists.txt index 317edbb139..b85990fdc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,10 +164,12 @@ endif() # OpenCV cmake options # ---------------------------------------------------------------------------- +OCV_OPTION(OPENCV_ENABLE_NONFREE "Enable non-free algorithms" OFF) + # Optional 3rd party components # =================================================== OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) ) -OCV_OPTION(WITH_AVFOUNDATION "Use AVFoundation for Video I/O" ON IF IOS) +OCV_OPTION(WITH_AVFOUNDATION "Use AVFoundation for Video I/O (iOS/Mac)" ON IF APPLE) OCV_OPTION(WITH_CARBON "Use Carbon for UI instead of Cocoa" OFF IF APPLE ) OCV_OPTION(WITH_CAROTENE "Use NVidia carotene acceleration library for ARM platform" ON IF (ARM OR AARCH64) AND NOT IOS AND NOT (CMAKE_VERSION VERSION_LESS "2.8.11")) OCV_OPTION(WITH_VTK "Include VTK library support (and build opencv_viz module eiher)" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT AND NOT CMAKE_CROSSCOMPILING) ) @@ -188,6 +190,7 @@ OCV_OPTION(WITH_JPEG "Include JPEG support" ON) OCV_OPTION(WITH_WEBP "Include WebP support" ON IF (NOT IOS AND NOT WINRT) ) OCV_OPTION(WITH_OPENEXR "Include ILM support via OpenEXR" ON IF (NOT IOS AND NOT WINRT) ) OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID AND NOT WINRT) ) +OCV_OPTION(WITH_OPENVX "Include OpenVX support" OFF) OCV_OPTION(WITH_OPENNI "Include OpenNI support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) ) OCV_OPTION(WITH_OPENNI2 "Include OpenNI2 support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) ) OCV_OPTION(WITH_PNG "Include PNG support" ON) @@ -196,7 +199,8 @@ OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" OFF OCV_OPTION(WITH_GIGEAPI "Include Smartek GigE support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) ) OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) ) OCV_OPTION(WITH_WIN32UI "Build with Win32 UI Backend support" ON IF WIN32 AND NOT WINRT) -OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O insted of QTKit" OFF IF APPLE ) +OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O" OFF IF APPLE ) +OCV_OPTION(WITH_QTKIT "Use QTKit Video I/O backend" OFF IF APPLE ) OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF IF (NOT IOS AND NOT WINRT) ) OCV_OPTION(WITH_OPENMP "Include OpenMP support" OFF) OCV_OPTION(WITH_CSTRIPES "Include C= support" OFF IF (WIN32 AND NOT WINRT) ) @@ -222,7 +226,7 @@ OCV_OPTION(WITH_VA "Include VA support" OFF OCV_OPTION(WITH_VA_INTEL "Include Intel VA-API/OpenCL support" OFF IF (UNIX AND NOT ANDROID) ) OCV_OPTION(WITH_GDAL "Include GDAL Support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) ) OCV_OPTION(WITH_GPHOTO2 "Include gPhoto2 library support" ON IF (UNIX AND NOT ANDROID) ) -OCV_OPTION(WITH_LAPACK "Include Lapack library support" ON IF (UNIX AND NOT ANDROID) ) +OCV_OPTION(WITH_LAPACK "Include Lapack library support" ON IF (NOT ANDROID) ) # OpenCV build components # =================================================== @@ -284,6 +288,7 @@ OCV_OPTION(ENABLE_NOISY_WARNINGS "Show all warnings even if they are too no OCV_OPTION(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF ) OCV_OPTION(ANDROID_EXAMPLES_WITH_LIBS "Build binaries of Android examples with native libraries" OFF IF ANDROID ) OCV_OPTION(ENABLE_IMPL_COLLECTION "Collect implementation data on function call" OFF ) +OCV_OPTION(ENABLE_INSTRUMENTATION "Instrument functions to collect calls trace and performance" OFF ) OCV_OPTION(GENERATE_ABI_DESCRIPTOR "Generate XML file for abi_compliance_checker tool" OFF IF UNIX) OCV_OPTION(DOWNLOAD_EXTERNAL_TEST_DATA "Download external test data (Python executable and OPENCV_TEST_DATA_PATH environment variable may be required)" OFF ) @@ -612,6 +617,9 @@ endif() include(cmake/OpenCVDetectVTK.cmake) +if(WITH_OPENVX) + include(cmake/FindOpenVX.cmake) +endif() # ---------------------------------------------------------------------------- # OpenCV HAL @@ -637,6 +645,12 @@ if(NOT DEFINED OpenCV_HAL) set(OpenCV_HAL "OpenCV_HAL") endif() +if(HAVE_OPENVX) + if(NOT ";${OpenCV_HAL};" MATCHES ";openvx;") + set(OpenCV_HAL "openvx;${OpenCV_HAL}") + endif() +endif() + if(WITH_CAROTENE) ocv_debug_message(STATUS "Enable carotene acceleration") if(NOT ";${OpenCV_HAL};" MATCHES ";carotene;") @@ -649,6 +663,10 @@ foreach(hal ${OpenCV_HAL}) add_subdirectory(3rdparty/carotene/hal) ocv_hal_register(CAROTENE_HAL_LIBRARIES CAROTENE_HAL_HEADERS CAROTENE_HAL_INCLUDE_DIRS) list(APPEND OpenCV_USED_HAL "carotene (ver ${CAROTENE_HAL_VERSION})") + elseif(hal STREQUAL "openvx") + add_subdirectory(3rdparty/openvx) + ocv_hal_register(OPENVX_HAL_LIBRARIES OPENVX_HAL_HEADERS OPENVX_HAL_INCLUDE_DIRS) + list(APPEND OpenCV_USED_HAL "openvx (ver ${OPENVX_HAL_VERSION})") else() ocv_debug_message(STATUS "OpenCV HAL: ${hal} ...") ocv_clear_vars(OpenCV_HAL_LIBRARIES OpenCV_HAL_HEADERS OpenCV_HAL_INCLUDE_DIRS) @@ -914,6 +932,11 @@ status(" Disabled:" OPENCV_MODULES_DISABLED_USER THEN ${OPENCV status(" Disabled by dependency:" OPENCV_MODULES_DISABLED_AUTO THEN ${OPENCV_MODULES_DISABLED_AUTO_ST} ELSE "-") status(" Unavailable:" OPENCV_MODULES_DISABLED_FORCE THEN ${OPENCV_MODULES_DISABLED_FORCE_ST} ELSE "-") +if(OPENCV_ENABLE_NONFREE) + status("") + status(" Non-free algorithms are enabled") +endif() + # ========================== Android details ========================== if(ANDROID) status("") @@ -1055,10 +1078,6 @@ if(DEFINED WITH_1394) status(" DC1394 2.x:" HAVE_DC1394_2 THEN "YES (ver ${ALIASOF_libdc1394-2_VERSION})" ELSE NO) endif(DEFINED WITH_1394) -if(DEFINED WITH_AVFOUNDATION) - status(" AVFoundation:" WITH_AVFOUNDATION THEN YES ELSE NO) -endif(DEFINED WITH_AVFOUNDATION) - if(DEFINED WITH_FFMPEG) if(WIN32) status(" FFMPEG:" WITH_FFMPEG THEN "YES (prebuilt binaries)" ELSE NO) @@ -1104,10 +1123,15 @@ if(DEFINED WITH_GIGEAPI) status(" GigEVisionSDK:" HAVE_GIGE_API THEN YES ELSE NO) endif(DEFINED WITH_GIGEAPI) -if(DEFINED WITH_QUICKTIME) +if(DEFINED APPLE) + status(" AVFoundation:" HAVE_AVFOUNDATION THEN YES ELSE NO) + if(WITH_QUICKTIME OR HAVE_QUICKTIME) status(" QuickTime:" HAVE_QUICKTIME THEN YES ELSE NO) - status(" QTKit:" HAVE_QTKIT THEN YES ELSE NO) -endif(DEFINED WITH_QUICKTIME) + endif() + if(WITH_QTKIT OR HAVE_QTKIT) + status(" QTKit:" HAVE_QTKIT THEN "YES (deprecated)" ELSE NO) + endif() +endif(DEFINED APPLE) if(DEFINED WITH_UNICAP) status(" UniCap:" HAVE_UNICAP THEN "YES (ver ${ALIASOF_libunicap_VERSION})" ELSE NO) @@ -1211,6 +1235,7 @@ endif(DEFINED WITH_LAPACK) status(" Use Eigen:" HAVE_EIGEN THEN "YES (ver ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION})" ELSE NO) status(" Use Cuda:" HAVE_CUDA THEN "YES (ver ${CUDA_VERSION_STRING})" ELSE NO) status(" Use OpenCL:" HAVE_OPENCL THEN YES ELSE NO) +status(" Use OpenVX:" HAVE_OPENVX THEN "YES (${OPENVX_LIBS})" ELSE "NO") status(" Use custom HAL:" OpenCV_USED_HAL THEN "YES (${OpenCV_USED_HAL})" ELSE "NO") if(HAVE_CUDA) diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index 497bb7d1f5..f2cdc8751c 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -5,3 +5,5 @@ add_subdirectory(traincascade) add_subdirectory(createsamples) add_subdirectory(annotation) add_subdirectory(visualisation) +add_subdirectory(interactive-calibration) +add_subdirectory(version) diff --git a/apps/interactive-calibration/CMakeLists.txt b/apps/interactive-calibration/CMakeLists.txt index 8174c40734..74a1e169e9 100644 --- a/apps/interactive-calibration/CMakeLists.txt +++ b/apps/interactive-calibration/CMakeLists.txt @@ -5,15 +5,6 @@ if(NOT OCV_DEPENDENCIES_FOUND) return() endif() -find_package(LAPACK) -if(LAPACK_FOUND) - find_file(LAPACK_HEADER "lapacke.h") - if(LAPACK_HEADER) - add_definitions(-DUSE_LAPACK) - link_libraries(${LAPACK_LIBRARIES}) - endif() -endif() - project(interactive-calibration) set(the_target opencv_interactive-calibration) diff --git a/apps/interactive-calibration/calibCommon.hpp b/apps/interactive-calibration/calibCommon.hpp index 4580a302c4..6acf610897 100644 --- a/apps/interactive-calibration/calibCommon.hpp +++ b/apps/interactive-calibration/calibCommon.hpp @@ -1,8 +1,13 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + #ifndef CALIB_COMMON_HPP #define CALIB_COMMON_HPP -#include #include + +#include #include #include @@ -23,7 +28,7 @@ namespace calib static const std::string consoleHelp = "Hot keys:\nesc - exit application\n" "s - save current data to .xml file\n" "r - delete last frame\n" - "u - enable/disable applying undistortion" + "u - enable/disable applying undistortion\n" "d - delete all frames\n" "v - switch visualization"; diff --git a/apps/interactive-calibration/calibController.cpp b/apps/interactive-calibration/calibController.cpp index 186d373aca..1888ee57db 100644 --- a/apps/interactive-calibration/calibController.cpp +++ b/apps/interactive-calibration/calibController.cpp @@ -1,8 +1,13 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + #include "calibController.hpp" #include #include #include + #include #include diff --git a/apps/interactive-calibration/calibController.hpp b/apps/interactive-calibration/calibController.hpp index 170a80a954..7a0f3f76d0 100644 --- a/apps/interactive-calibration/calibController.hpp +++ b/apps/interactive-calibration/calibController.hpp @@ -1,7 +1,12 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + #ifndef CALIB_CONTROLLER_HPP #define CALIB_CONTROLLER_HPP #include "calibCommon.hpp" + #include #include #include diff --git a/apps/interactive-calibration/calibPipeline.cpp b/apps/interactive-calibration/calibPipeline.cpp index 4575a7024a..1047bfce5f 100644 --- a/apps/interactive-calibration/calibPipeline.cpp +++ b/apps/interactive-calibration/calibPipeline.cpp @@ -1,5 +1,11 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + #include "calibPipeline.hpp" + #include + #include using namespace calib; diff --git a/apps/interactive-calibration/calibPipeline.hpp b/apps/interactive-calibration/calibPipeline.hpp index b5d311e17f..1c22b0d85e 100644 --- a/apps/interactive-calibration/calibPipeline.hpp +++ b/apps/interactive-calibration/calibPipeline.hpp @@ -1,7 +1,13 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + + #ifndef CALIB_PIPELINE_HPP #define CALIB_PIPELINE_HPP #include + #include #include "calibCommon.hpp" diff --git a/apps/interactive-calibration/cvCalibrationFork.cpp b/apps/interactive-calibration/cvCalibrationFork.cpp deleted file mode 100644 index c603dbeb87..0000000000 --- a/apps/interactive-calibration/cvCalibrationFork.cpp +++ /dev/null @@ -1,824 +0,0 @@ -#include -#include "linalg.hpp" -#include "cvCalibrationFork.hpp" - -using namespace cv; - -static void subMatrix(const cv::Mat& src, cv::Mat& dst, const std::vector& cols, - const std::vector& rows); -static const char* cvDistCoeffErr = "Distortion coefficients must be 1x4, 4x1, 1x5, 5x1, 1x8, 8x1, 1x12, 12x1, 1x14 or 14x1 floating-point vector"; - -static void cvEvaluateJtJ2(CvMat* _JtJ, - const CvMat* camera_matrix, - const CvMat* distortion_coeffs, - const CvMat* object_points, - const CvMat* param, - const CvMat* npoints, - int flags, int NINTRINSIC, double aspectRatio) -{ - int i, pos, ni, total = 0, npstep = 0, maxPoints = 0; - - npstep = npoints->rows == 1 ? 1 : npoints->step/CV_ELEM_SIZE(npoints->type); - int nimages = npoints->rows*npoints->cols; - for( i = 0; i < nimages; i++ ) - { - ni = npoints->data.i[i*npstep]; - if( ni < 4 ) - { - CV_Error_( CV_StsOutOfRange, ("The number of points in the view #%d is < 4", i)); - } - maxPoints = MAX( maxPoints, ni ); - total += ni; - } - - Mat _Ji( maxPoints*2, NINTRINSIC, CV_64FC1, Scalar(0)); - Mat _Je( maxPoints*2, 6, CV_64FC1 ); - Mat _err( maxPoints*2, 1, CV_64FC1 ); - Mat _m( 1, total, CV_64FC2 ); - const Mat matM = cvarrToMat(object_points); - - cvZero(_JtJ); - for(i = 0, pos = 0; i < nimages; i++, pos += ni ) - { - CvMat _ri, _ti; - ni = npoints->data.i[i*npstep]; - - cvGetRows( param, &_ri, NINTRINSIC + i*6, NINTRINSIC + i*6 + 3 ); - cvGetRows( param, &_ti, NINTRINSIC + i*6 + 3, NINTRINSIC + i*6 + 6 ); - - CvMat _Mi(matM.colRange(pos, pos + ni)); - CvMat _mi(_m.colRange(pos, pos + ni)); - - _Je.resize(ni*2); _Ji.resize(ni*2); _err.resize(ni*2); - CvMat _dpdr(_Je.colRange(0, 3)); - CvMat _dpdt(_Je.colRange(3, 6)); - CvMat _dpdf(_Ji.colRange(0, 2)); - CvMat _dpdc(_Ji.colRange(2, 4)); - CvMat _dpdk(_Ji.colRange(4, NINTRINSIC)); - CvMat _mp(_err.reshape(2, 1)); - - cvProjectPoints2( &_Mi, &_ri, &_ti, camera_matrix, distortion_coeffs, &_mp, &_dpdr, &_dpdt, - (flags & CALIB_FIX_FOCAL_LENGTH) ? 0 : &_dpdf, - (flags & CALIB_FIX_PRINCIPAL_POINT) ? 0 : &_dpdc, &_dpdk, - (flags & CALIB_FIX_ASPECT_RATIO) ? aspectRatio : 0); - cvSub( &_mp, &_mi, &_mp ); - Mat JtJ(cvarrToMat(_JtJ)); - // see HZ: (A6.14) for details on the structure of the Jacobian - JtJ(Rect(0, 0, NINTRINSIC, NINTRINSIC)) += _Ji.t() * _Ji; - JtJ(Rect(NINTRINSIC + i * 6, NINTRINSIC + i * 6, 6, 6)) = _Je.t() * _Je; - JtJ(Rect(NINTRINSIC + i * 6, 0, 6, NINTRINSIC)) = _Ji.t() * _Je; - } -} - -double cvfork::cvCalibrateCamera2( const CvMat* objectPoints, - const CvMat* imagePoints, const CvMat* npoints, - CvSize imageSize, CvMat* cameraMatrix, CvMat* distCoeffs, - CvMat* rvecs, CvMat* tvecs, CvMat* stdDevs, CvMat* perViewErrors, int flags, CvTermCriteria termCrit ) -{ - { - const int NINTRINSIC = CV_CALIB_NINTRINSIC; - double reprojErr = 0; - - Matx33d A; - double k[14] = {0}; - CvMat matA = cvMat(3, 3, CV_64F, A.val), _k; - int i, nimages, maxPoints = 0, ni = 0, pos, total = 0, nparams, npstep, cn; - double aspectRatio = 0.; - - // 0. check the parameters & allocate buffers - if( !CV_IS_MAT(objectPoints) || !CV_IS_MAT(imagePoints) || - !CV_IS_MAT(npoints) || !CV_IS_MAT(cameraMatrix) || !CV_IS_MAT(distCoeffs) ) - CV_Error( CV_StsBadArg, "One of required vector arguments is not a valid matrix" ); - - if( imageSize.width <= 0 || imageSize.height <= 0 ) - CV_Error( CV_StsOutOfRange, "image width and height must be positive" ); - - if( CV_MAT_TYPE(npoints->type) != CV_32SC1 || - (npoints->rows != 1 && npoints->cols != 1) ) - CV_Error( CV_StsUnsupportedFormat, - "the array of point counters must be 1-dimensional integer vector" ); - if(flags & CV_CALIB_TILTED_MODEL) - { - //when the tilted sensor model is used the distortion coefficients matrix must have 14 parameters - if (distCoeffs->cols*distCoeffs->rows != 14) - CV_Error( CV_StsBadArg, "The tilted sensor model must have 14 parameters in the distortion matrix" ); - } - else - { - //when the thin prism model is used the distortion coefficients matrix must have 12 parameters - if(flags & CV_CALIB_THIN_PRISM_MODEL) - if (distCoeffs->cols*distCoeffs->rows != 12) - CV_Error( CV_StsBadArg, "Thin prism model must have 12 parameters in the distortion matrix" ); - } - - nimages = npoints->rows*npoints->cols; - npstep = npoints->rows == 1 ? 1 : npoints->step/CV_ELEM_SIZE(npoints->type); - - if( rvecs ) - { - cn = CV_MAT_CN(rvecs->type); - if( !CV_IS_MAT(rvecs) || - (CV_MAT_DEPTH(rvecs->type) != CV_32F && CV_MAT_DEPTH(rvecs->type) != CV_64F) || - ((rvecs->rows != nimages || (rvecs->cols*cn != 3 && rvecs->cols*cn != 9)) && - (rvecs->rows != 1 || rvecs->cols != nimages || cn != 3)) ) - CV_Error( CV_StsBadArg, "the output array of rotation vectors must be 3-channel " - "1xn or nx1 array or 1-channel nx3 or nx9 array, where n is the number of views" ); - } - - if( tvecs ) - { - cn = CV_MAT_CN(tvecs->type); - if( !CV_IS_MAT(tvecs) || - (CV_MAT_DEPTH(tvecs->type) != CV_32F && CV_MAT_DEPTH(tvecs->type) != CV_64F) || - ((tvecs->rows != nimages || tvecs->cols*cn != 3) && - (tvecs->rows != 1 || tvecs->cols != nimages || cn != 3)) ) - CV_Error( CV_StsBadArg, "the output array of translation vectors must be 3-channel " - "1xn or nx1 array or 1-channel nx3 array, where n is the number of views" ); - } - - if( stdDevs ) - { - cn = CV_MAT_CN(stdDevs->type); - if( !CV_IS_MAT(stdDevs) || - (CV_MAT_DEPTH(stdDevs->type) != CV_32F && CV_MAT_DEPTH(stdDevs->type) != CV_64F) || - ((stdDevs->rows != (nimages*6 + NINTRINSIC) || stdDevs->cols*cn != 1) && - (stdDevs->rows != 1 || stdDevs->cols != (nimages*6 + NINTRINSIC) || cn != 1)) ) - CV_Error( CV_StsBadArg, "the output array of standard deviations vectors must be 1-channel " - "1x(n*6 + NINTRINSIC) or (n*6 + NINTRINSIC)x1 array, where n is the number of views" ); - } - - if( (CV_MAT_TYPE(cameraMatrix->type) != CV_32FC1 && - CV_MAT_TYPE(cameraMatrix->type) != CV_64FC1) || - cameraMatrix->rows != 3 || cameraMatrix->cols != 3 ) - CV_Error( CV_StsBadArg, - "Intrinsic parameters must be 3x3 floating-point matrix" ); - - if( (CV_MAT_TYPE(distCoeffs->type) != CV_32FC1 && - CV_MAT_TYPE(distCoeffs->type) != CV_64FC1) || - (distCoeffs->cols != 1 && distCoeffs->rows != 1) || - (distCoeffs->cols*distCoeffs->rows != 4 && - distCoeffs->cols*distCoeffs->rows != 5 && - distCoeffs->cols*distCoeffs->rows != 8 && - distCoeffs->cols*distCoeffs->rows != 12 && - distCoeffs->cols*distCoeffs->rows != 14) ) - CV_Error( CV_StsBadArg, cvDistCoeffErr ); - - for( i = 0; i < nimages; i++ ) - { - ni = npoints->data.i[i*npstep]; - if( ni < 4 ) - { - CV_Error_( CV_StsOutOfRange, ("The number of points in the view #%d is < 4", i)); - } - maxPoints = MAX( maxPoints, ni ); - total += ni; - } - - Mat matM( 1, total, CV_64FC3 ); - Mat _m( 1, total, CV_64FC2 ); - - if(CV_MAT_CN(objectPoints->type) == 3) { - cvarrToMat(objectPoints).convertTo(matM, CV_64F); - } else { - convertPointsHomogeneous(cvarrToMat(objectPoints), matM); - } - - if(CV_MAT_CN(imagePoints->type) == 2) { - cvarrToMat(imagePoints).convertTo(_m, CV_64F); - } else { - convertPointsHomogeneous(cvarrToMat(imagePoints), _m); - } - - nparams = NINTRINSIC + nimages*6; - Mat _Ji( maxPoints*2, NINTRINSIC, CV_64FC1, Scalar(0)); - Mat _Je( maxPoints*2, 6, CV_64FC1 ); - Mat _err( maxPoints*2, 1, CV_64FC1 ); - - _k = cvMat( distCoeffs->rows, distCoeffs->cols, CV_MAKETYPE(CV_64F,CV_MAT_CN(distCoeffs->type)), k); - if( distCoeffs->rows*distCoeffs->cols*CV_MAT_CN(distCoeffs->type) < 8 ) - { - if( distCoeffs->rows*distCoeffs->cols*CV_MAT_CN(distCoeffs->type) < 5 ) - flags |= CALIB_FIX_K3; - flags |= CALIB_FIX_K4 | CALIB_FIX_K5 | CALIB_FIX_K6; - } - const double minValidAspectRatio = 0.01; - const double maxValidAspectRatio = 100.0; - - // 1. initialize intrinsic parameters & LM solver - if( flags & CALIB_USE_INTRINSIC_GUESS ) - { - cvConvert( cameraMatrix, &matA ); - if( A(0, 0) <= 0 || A(1, 1) <= 0 ) - CV_Error( CV_StsOutOfRange, "Focal length (fx and fy) must be positive" ); - if( A(0, 2) < 0 || A(0, 2) >= imageSize.width || - A(1, 2) < 0 || A(1, 2) >= imageSize.height ) - CV_Error( CV_StsOutOfRange, "Principal point must be within the image" ); - if( fabs(A(0, 1)) > 1e-5 ) - CV_Error( CV_StsOutOfRange, "Non-zero skew is not supported by the function" ); - if( fabs(A(1, 0)) > 1e-5 || fabs(A(2, 0)) > 1e-5 || - fabs(A(2, 1)) > 1e-5 || fabs(A(2,2)-1) > 1e-5 ) - CV_Error( CV_StsOutOfRange, - "The intrinsic matrix must have [fx 0 cx; 0 fy cy; 0 0 1] shape" ); - A(0, 1) = A(1, 0) = A(2, 0) = A(2, 1) = 0.; - A(2, 2) = 1.; - - if( flags & CALIB_FIX_ASPECT_RATIO ) - { - aspectRatio = A(0, 0)/A(1, 1); - - if( aspectRatio < minValidAspectRatio || aspectRatio > maxValidAspectRatio ) - CV_Error( CV_StsOutOfRange, - "The specified aspect ratio (= cameraMatrix[0][0] / cameraMatrix[1][1]) is incorrect" ); - } - cvConvert( distCoeffs, &_k ); - } - else - { - Scalar mean, sdv; - meanStdDev(matM, mean, sdv); - if( fabs(mean[2]) > 1e-5 || fabs(sdv[2]) > 1e-5 ) - CV_Error( CV_StsBadArg, - "For non-planar calibration rigs the initial intrinsic matrix must be specified" ); - for( i = 0; i < total; i++ ) - matM.at(i).z = 0.; - - if( flags & CALIB_FIX_ASPECT_RATIO ) - { - aspectRatio = cvmGet(cameraMatrix,0,0); - aspectRatio /= cvmGet(cameraMatrix,1,1); - if( aspectRatio < minValidAspectRatio || aspectRatio > maxValidAspectRatio ) - CV_Error( CV_StsOutOfRange, - "The specified aspect ratio (= cameraMatrix[0][0] / cameraMatrix[1][1]) is incorrect" ); - } - CvMat _matM(matM), m(_m); - cvInitIntrinsicParams2D( &_matM, &m, npoints, imageSize, &matA, aspectRatio ); - } - - //CvLevMarq solver( nparams, 0, termCrit ); - cvfork::CvLevMarqFork solver( nparams, 0, termCrit ); - Mat allErrors(1, total, CV_64FC2); - - if(flags & CALIB_USE_LU) { - solver.solveMethod = DECOMP_LU; - } - else if(flags & CALIB_USE_QR) - solver.solveMethod = DECOMP_QR; - - { - double* param = solver.param->data.db; - uchar* mask = solver.mask->data.ptr; - - param[0] = A(0, 0); param[1] = A(1, 1); param[2] = A(0, 2); param[3] = A(1, 2); - std::copy(k, k + 14, param + 4); - - if( flags & CV_CALIB_FIX_FOCAL_LENGTH ) - mask[0] = mask[1] = 0; - if( flags & CV_CALIB_FIX_PRINCIPAL_POINT ) - mask[2] = mask[3] = 0; - if( flags & CV_CALIB_ZERO_TANGENT_DIST ) - { - param[6] = param[7] = 0; - mask[6] = mask[7] = 0; - } - if( !(flags & CALIB_RATIONAL_MODEL) ) - flags |= CALIB_FIX_K4 + CALIB_FIX_K5 + CALIB_FIX_K6; - if( !(flags & CV_CALIB_THIN_PRISM_MODEL)) - flags |= CALIB_FIX_S1_S2_S3_S4; - if( !(flags & CV_CALIB_TILTED_MODEL)) - flags |= CALIB_FIX_TAUX_TAUY; - - mask[ 4] = !(flags & CALIB_FIX_K1); - mask[ 5] = !(flags & CALIB_FIX_K2); - mask[ 8] = !(flags & CALIB_FIX_K3); - mask[ 9] = !(flags & CALIB_FIX_K4); - mask[10] = !(flags & CALIB_FIX_K5); - mask[11] = !(flags & CALIB_FIX_K6); - - if(flags & CALIB_FIX_S1_S2_S3_S4) - { - mask[12] = 0; - mask[13] = 0; - mask[14] = 0; - mask[15] = 0; - } - if(flags & CALIB_FIX_TAUX_TAUY) - { - mask[16] = 0; - mask[17] = 0; - } - } - - // 2. initialize extrinsic parameters - for( i = 0, pos = 0; i < nimages; i++, pos += ni ) - { - CvMat _ri, _ti; - ni = npoints->data.i[i*npstep]; - - cvGetRows( solver.param, &_ri, NINTRINSIC + i*6, NINTRINSIC + i*6 + 3 ); - cvGetRows( solver.param, &_ti, NINTRINSIC + i*6 + 3, NINTRINSIC + i*6 + 6 ); - - CvMat _Mi(matM.colRange(pos, pos + ni)); - CvMat _mi(_m.colRange(pos, pos + ni)); - - cvFindExtrinsicCameraParams2( &_Mi, &_mi, &matA, &_k, &_ri, &_ti ); - } - - // 3. run the optimization - for(;;) - { - const CvMat* _param = 0; - CvMat *_JtJ = 0, *_JtErr = 0; - double* _errNorm = 0; - bool proceed = solver.updateAlt( _param, _JtJ, _JtErr, _errNorm ); - double *param = solver.param->data.db, *pparam = solver.prevParam->data.db; - - if( flags & CALIB_FIX_ASPECT_RATIO ) - { - param[0] = param[1]*aspectRatio; - pparam[0] = pparam[1]*aspectRatio; - } - - A(0, 0) = param[0]; A(1, 1) = param[1]; A(0, 2) = param[2]; A(1, 2) = param[3]; - std::copy(param + 4, param + 4 + 14, k); - - if( !proceed ) { - //do errors estimation - if(stdDevs) { - Ptr JtJ(cvCreateMat(nparams, nparams, CV_64F)); - CvMat cvMatM(matM); - cvEvaluateJtJ2(JtJ, &matA, &_k, &cvMatM, solver.param, npoints, flags, NINTRINSIC, aspectRatio); - - Mat mask = cvarrToMat(solver.mask); - int nparams_nz = countNonZero(mask); - Mat JtJinv, JtJN; - JtJN.create(nparams_nz, nparams_nz, CV_64F); - subMatrix(cvarrToMat(JtJ), JtJN, mask, mask); - completeSymm(JtJN, false); - #ifndef USE_LAPACK - cv::invert(JtJN, JtJinv, DECOMP_SVD); - #else - cvfork::invert(JtJN, JtJinv, DECOMP_SVD); - #endif - double sigma2 = norm(allErrors, NORM_L2SQR) / (total - nparams_nz); - Mat stdDevsM = cvarrToMat(stdDevs); - int j = 0; - for (int s = 0; s < nparams; s++) - if(mask.data[s]) { - stdDevsM.at(s) = std::sqrt(JtJinv.at(j,j)*sigma2); - j++; - } - else - stdDevsM.at(s) = 0; - } - break; - } - - reprojErr = 0; - - for( i = 0, pos = 0; i < nimages; i++, pos += ni ) - { - CvMat _ri, _ti; - ni = npoints->data.i[i*npstep]; - - cvGetRows( solver.param, &_ri, NINTRINSIC + i*6, NINTRINSIC + i*6 + 3 ); - cvGetRows( solver.param, &_ti, NINTRINSIC + i*6 + 3, NINTRINSIC + i*6 + 6 ); - - CvMat _Mi(matM.colRange(pos, pos + ni)); - CvMat _mi(_m.colRange(pos, pos + ni)); - CvMat _me(allErrors.colRange(pos, pos + ni)); - - _Je.resize(ni*2); _Ji.resize(ni*2); _err.resize(ni*2); - CvMat _dpdr(_Je.colRange(0, 3)); - CvMat _dpdt(_Je.colRange(3, 6)); - CvMat _dpdf(_Ji.colRange(0, 2)); - CvMat _dpdc(_Ji.colRange(2, 4)); - CvMat _dpdk(_Ji.colRange(4, NINTRINSIC)); - CvMat _mp(_err.reshape(2, 1)); - - if( solver.state == CvLevMarq::CALC_J ) - { - cvProjectPoints2( &_Mi, &_ri, &_ti, &matA, &_k, &_mp, &_dpdr, &_dpdt, - (flags & CALIB_FIX_FOCAL_LENGTH) ? 0 : &_dpdf, - (flags & CALIB_FIX_PRINCIPAL_POINT) ? 0 : &_dpdc, &_dpdk, - (flags & CALIB_FIX_ASPECT_RATIO) ? aspectRatio : 0); - } - else - cvProjectPoints2( &_Mi, &_ri, &_ti, &matA, &_k, &_mp ); - - cvSub( &_mp, &_mi, &_mp ); - - if( solver.state == CvLevMarq::CALC_J ) - { - Mat JtJ(cvarrToMat(_JtJ)), JtErr(cvarrToMat(_JtErr)); - - // see HZ: (A6.14) for details on the structure of the Jacobian - JtJ(Rect(0, 0, NINTRINSIC, NINTRINSIC)) += _Ji.t() * _Ji; - JtJ(Rect(NINTRINSIC + i * 6, NINTRINSIC + i * 6, 6, 6)) = _Je.t() * _Je; - JtJ(Rect(NINTRINSIC + i * 6, 0, 6, NINTRINSIC)) = _Ji.t() * _Je; - - JtErr.rowRange(0, NINTRINSIC) += _Ji.t() * _err; - JtErr.rowRange(NINTRINSIC + i * 6, NINTRINSIC + (i + 1) * 6) = _Je.t() * _err; - - } - if (stdDevs || perViewErrors) - cvCopy(&_mp, &_me); - reprojErr += norm(_err, NORM_L2SQR); - } - - if( _errNorm ) - *_errNorm = reprojErr; - } - - // 4. store the results - cvConvert( &matA, cameraMatrix ); - cvConvert( &_k, distCoeffs ); - - for( i = 0, pos = 0; i < nimages; i++) - { - CvMat src, dst; - if( perViewErrors ) - { - ni = npoints->data.i[i*npstep]; - perViewErrors->data.db[i] = std::sqrt(cv::norm(allErrors.colRange(pos, pos + ni), NORM_L2SQR) / ni); - pos+=ni; - } - - if( rvecs ) - { - src = cvMat( 3, 1, CV_64F, solver.param->data.db + NINTRINSIC + i*6 ); - if( rvecs->rows == nimages && rvecs->cols*CV_MAT_CN(rvecs->type) == 9 ) - { - dst = cvMat( 3, 3, CV_MAT_DEPTH(rvecs->type), - rvecs->data.ptr + rvecs->step*i ); - cvRodrigues2( &src, &matA ); - cvConvert( &matA, &dst ); - } - else - { - dst = cvMat( 3, 1, CV_MAT_DEPTH(rvecs->type), rvecs->rows == 1 ? - rvecs->data.ptr + i*CV_ELEM_SIZE(rvecs->type) : - rvecs->data.ptr + rvecs->step*i ); - cvConvert( &src, &dst ); - } - } - if( tvecs ) - { - src = cvMat( 3, 1, CV_64F, solver.param->data.db + NINTRINSIC + i*6 + 3 ); - dst = cvMat( 3, 1, CV_MAT_DEPTH(tvecs->type), tvecs->rows == 1 ? - tvecs->data.ptr + i*CV_ELEM_SIZE(tvecs->type) : - tvecs->data.ptr + tvecs->step*i ); - cvConvert( &src, &dst ); - } - } - - return std::sqrt(reprojErr/total); - } -} - - -static Mat prepareCameraMatrix(Mat& cameraMatrix0, int rtype) -{ - Mat cameraMatrix = Mat::eye(3, 3, rtype); - if( cameraMatrix0.size() == cameraMatrix.size() ) - cameraMatrix0.convertTo(cameraMatrix, rtype); - return cameraMatrix; -} - -static Mat prepareDistCoeffs(Mat& distCoeffs0, int rtype) -{ - Mat distCoeffs = Mat::zeros(distCoeffs0.cols == 1 ? Size(1, 14) : Size(14, 1), rtype); - if( distCoeffs0.size() == Size(1, 4) || - distCoeffs0.size() == Size(1, 5) || - distCoeffs0.size() == Size(1, 8) || - distCoeffs0.size() == Size(1, 12) || - distCoeffs0.size() == Size(1, 14) || - distCoeffs0.size() == Size(4, 1) || - distCoeffs0.size() == Size(5, 1) || - distCoeffs0.size() == Size(8, 1) || - distCoeffs0.size() == Size(12, 1) || - distCoeffs0.size() == Size(14, 1) ) - { - Mat dstCoeffs(distCoeffs, Rect(0, 0, distCoeffs0.cols, distCoeffs0.rows)); - distCoeffs0.convertTo(dstCoeffs, rtype); - } - return distCoeffs; -} - -static void collectCalibrationData( InputArrayOfArrays objectPoints, - InputArrayOfArrays imagePoints1, - InputArrayOfArrays imagePoints2, - Mat& objPtMat, Mat& imgPtMat1, Mat* imgPtMat2, - Mat& npoints ) -{ - int nimages = (int)objectPoints.total(); - int i, j = 0, ni = 0, total = 0; - CV_Assert(nimages > 0 && nimages == (int)imagePoints1.total() && - (!imgPtMat2 || nimages == (int)imagePoints2.total())); - - for( i = 0; i < nimages; i++ ) - { - ni = objectPoints.getMat(i).checkVector(3, CV_32F); - if( ni <= 0 ) - CV_Error(CV_StsUnsupportedFormat, "objectPoints should contain vector of vectors of points of type Point3f"); - int ni1 = imagePoints1.getMat(i).checkVector(2, CV_32F); - if( ni1 <= 0 ) - CV_Error(CV_StsUnsupportedFormat, "imagePoints1 should contain vector of vectors of points of type Point2f"); - CV_Assert( ni == ni1 ); - - total += ni; - } - - npoints.create(1, (int)nimages, CV_32S); - objPtMat.create(1, (int)total, CV_32FC3); - imgPtMat1.create(1, (int)total, CV_32FC2); - Point2f* imgPtData2 = 0; - - if( imgPtMat2 ) - { - imgPtMat2->create(1, (int)total, CV_32FC2); - imgPtData2 = imgPtMat2->ptr(); - } - - Point3f* objPtData = objPtMat.ptr(); - Point2f* imgPtData1 = imgPtMat1.ptr(); - - for( i = 0; i < nimages; i++, j += ni ) - { - Mat objpt = objectPoints.getMat(i); - Mat imgpt1 = imagePoints1.getMat(i); - ni = objpt.checkVector(3, CV_32F); - npoints.at(i) = ni; - memcpy( objPtData + j, objpt.ptr(), ni*sizeof(objPtData[0]) ); - memcpy( imgPtData1 + j, imgpt1.ptr(), ni*sizeof(imgPtData1[0]) ); - - if( imgPtData2 ) - { - Mat imgpt2 = imagePoints2.getMat(i); - int ni2 = imgpt2.checkVector(2, CV_32F); - CV_Assert( ni == ni2 ); - memcpy( imgPtData2 + j, imgpt2.ptr(), ni*sizeof(imgPtData2[0]) ); - } - } -} - -double cvfork::calibrateCamera(InputArrayOfArrays _objectPoints, - InputArrayOfArrays _imagePoints, - Size imageSize, InputOutputArray _cameraMatrix, InputOutputArray _distCoeffs, - OutputArrayOfArrays _rvecs, OutputArrayOfArrays _tvecs, OutputArray _stdDeviations, OutputArray _perViewErrors, int flags, TermCriteria criteria ) -{ - int rtype = CV_64F; - Mat cameraMatrix = _cameraMatrix.getMat(); - cameraMatrix = prepareCameraMatrix(cameraMatrix, rtype); - Mat distCoeffs = _distCoeffs.getMat(); - distCoeffs = prepareDistCoeffs(distCoeffs, rtype); - if( !(flags & CALIB_RATIONAL_MODEL) && - (!(flags & CALIB_THIN_PRISM_MODEL)) && - (!(flags & CALIB_TILTED_MODEL))) - distCoeffs = distCoeffs.rows == 1 ? distCoeffs.colRange(0, 5) : distCoeffs.rowRange(0, 5); - - int nimages = int(_objectPoints.total()); - CV_Assert( nimages > 0 ); - Mat objPt, imgPt, npoints, rvecM, tvecM, stdDeviationsM, errorsM; - - bool rvecs_needed = _rvecs.needed(), tvecs_needed = _tvecs.needed(), - stddev_needed = _stdDeviations.needed(), errors_needed = _perViewErrors.needed(); - - bool rvecs_mat_vec = _rvecs.isMatVector(); - bool tvecs_mat_vec = _tvecs.isMatVector(); - - if( rvecs_needed ) { - _rvecs.create(nimages, 1, CV_64FC3); - - if(rvecs_mat_vec) - rvecM.create(nimages, 3, CV_64F); - else - rvecM = _rvecs.getMat(); - } - - if( tvecs_needed ) { - _tvecs.create(nimages, 1, CV_64FC3); - - if(tvecs_mat_vec) - tvecM.create(nimages, 3, CV_64F); - else - tvecM = _tvecs.getMat(); - } - - if( stddev_needed ) { - _stdDeviations.create(nimages*6 + CV_CALIB_NINTRINSIC, 1, CV_64F); - stdDeviationsM = _stdDeviations.getMat(); - } - - if( errors_needed) { - _perViewErrors.create(nimages, 1, CV_64F); - errorsM = _perViewErrors.getMat(); - } - - collectCalibrationData( _objectPoints, _imagePoints, noArray(), - objPt, imgPt, 0, npoints ); - CvMat c_objPt = objPt, c_imgPt = imgPt, c_npoints = npoints; - CvMat c_cameraMatrix = cameraMatrix, c_distCoeffs = distCoeffs; - CvMat c_rvecM = rvecM, c_tvecM = tvecM, c_stdDev = stdDeviationsM, c_errors = errorsM; - - double reprojErr = cvfork::cvCalibrateCamera2(&c_objPt, &c_imgPt, &c_npoints, imageSize, - &c_cameraMatrix, &c_distCoeffs, - rvecs_needed ? &c_rvecM : NULL, - tvecs_needed ? &c_tvecM : NULL, - stddev_needed ? &c_stdDev : NULL, - errors_needed ? &c_errors : NULL, flags, criteria ); - - // overly complicated and inefficient rvec/ tvec handling to support vector - for(int i = 0; i < nimages; i++ ) - { - if( rvecs_needed && rvecs_mat_vec) - { - _rvecs.create(3, 1, CV_64F, i, true); - Mat rv = _rvecs.getMat(i); - memcpy(rv.ptr(), rvecM.ptr(i), 3*sizeof(double)); - } - if( tvecs_needed && tvecs_mat_vec) - { - _tvecs.create(3, 1, CV_64F, i, true); - Mat tv = _tvecs.getMat(i); - memcpy(tv.ptr(), tvecM.ptr(i), 3*sizeof(double)); - } - } - - cameraMatrix.copyTo(_cameraMatrix); - distCoeffs.copyTo(_distCoeffs); - - return reprojErr; -} - -double cvfork::calibrateCameraCharuco(InputArrayOfArrays _charucoCorners, InputArrayOfArrays _charucoIds, - Ptr &_board, Size imageSize, - InputOutputArray _cameraMatrix, InputOutputArray _distCoeffs, - OutputArrayOfArrays _rvecs, OutputArrayOfArrays _tvecs, OutputArray _stdDeviations, OutputArray _perViewErrors, - int flags, TermCriteria criteria) { - - CV_Assert(_charucoIds.total() > 0 && (_charucoIds.total() == _charucoCorners.total())); - - // Join object points of charuco corners in a single vector for calibrateCamera() function - std::vector< std::vector< Point3f > > allObjPoints; - allObjPoints.resize(_charucoIds.total()); - for(unsigned int i = 0; i < _charucoIds.total(); i++) { - unsigned int nCorners = (unsigned int)_charucoIds.getMat(i).total(); - CV_Assert(nCorners > 0 && nCorners == _charucoCorners.getMat(i).total()); //actually nCorners must be > 3 for calibration - allObjPoints[i].reserve(nCorners); - - for(unsigned int j = 0; j < nCorners; j++) { - int pointId = _charucoIds.getMat(i).ptr< int >(0)[j]; - CV_Assert(pointId >= 0 && pointId < (int)_board->chessboardCorners.size()); - allObjPoints[i].push_back(_board->chessboardCorners[pointId]); - } - } - - return cvfork::calibrateCamera(allObjPoints, _charucoCorners, imageSize, _cameraMatrix, _distCoeffs, - _rvecs, _tvecs, _stdDeviations, _perViewErrors, flags, criteria); -} - - -static void subMatrix(const cv::Mat& src, cv::Mat& dst, const std::vector& cols, - const std::vector& rows) { - int nonzeros_cols = cv::countNonZero(cols); - cv::Mat tmp(src.rows, nonzeros_cols, CV_64FC1); - - for (int i = 0, j = 0; i < (int)cols.size(); i++) - { - if (cols[i]) - { - src.col(i).copyTo(tmp.col(j++)); - } - } - - int nonzeros_rows = cv::countNonZero(rows); - dst.create(nonzeros_rows, nonzeros_cols, CV_64FC1); - for (int i = 0, j = 0; i < (int)rows.size(); i++) - { - if (rows[i]) - { - tmp.row(i).copyTo(dst.row(j++)); - } - } -} - -void cvfork::CvLevMarqFork::step() -{ - using namespace cv; - const double LOG10 = log(10.); - double lambda = exp(lambdaLg10*LOG10); - int nparams = param->rows; - - Mat _JtJ = cvarrToMat(JtJ); - Mat _mask = cvarrToMat(mask); - - int nparams_nz = countNonZero(_mask); - if(!JtJN || JtJN->rows != nparams_nz) { - // prevent re-allocation in every step - JtJN.reset(cvCreateMat( nparams_nz, nparams_nz, CV_64F )); - JtJV.reset(cvCreateMat( nparams_nz, 1, CV_64F )); - JtJW.reset(cvCreateMat( nparams_nz, 1, CV_64F )); - } - - Mat _JtJN = cvarrToMat(JtJN); - Mat _JtErr = cvarrToMat(JtJV); - Mat_ nonzero_param = cvarrToMat(JtJW); - - subMatrix(cvarrToMat(JtErr), _JtErr, std::vector(1, 1), _mask); - subMatrix(_JtJ, _JtJN, _mask, _mask); - - if( !err ) - completeSymm( _JtJN, completeSymmFlag ); -#if 1 - _JtJN.diag() *= 1. + lambda; -#else - _JtJN.diag() += lambda; -#endif -#ifndef USE_LAPACK - cv::solve(_JtJN, _JtErr, nonzero_param, solveMethod); -#else - cvfork::solve(_JtJN, _JtErr, nonzero_param, solveMethod); -#endif - - int j = 0; - for( int i = 0; i < nparams; i++ ) - param->data.db[i] = prevParam->data.db[i] - (mask->data.ptr[i] ? nonzero_param(j++) : 0); -} - -cvfork::CvLevMarqFork::CvLevMarqFork(int nparams, int nerrs, CvTermCriteria criteria0, bool _completeSymmFlag) -{ - init(nparams, nerrs, criteria0, _completeSymmFlag); -} - -cvfork::CvLevMarqFork::~CvLevMarqFork() -{ - clear(); -} - -bool cvfork::CvLevMarqFork::updateAlt( const CvMat*& _param, CvMat*& _JtJ, CvMat*& _JtErr, double*& _errNorm ) -{ - CV_Assert( !err ); - if( state == DONE ) - { - _param = param; - return false; - } - - if( state == STARTED ) - { - _param = param; - cvZero( JtJ ); - cvZero( JtErr ); - errNorm = 0; - _JtJ = JtJ; - _JtErr = JtErr; - _errNorm = &errNorm; - state = CALC_J; - return true; - } - - if( state == CALC_J ) - { - cvCopy( param, prevParam ); - step(); - _param = param; - prevErrNorm = errNorm; - errNorm = 0; - _errNorm = &errNorm; - state = CHECK_ERR; - return true; - } - - assert( state == CHECK_ERR ); - if( errNorm > prevErrNorm ) - { - if( ++lambdaLg10 <= 16 ) - { - step(); - _param = param; - errNorm = 0; - _errNorm = &errNorm; - state = CHECK_ERR; - return true; - } - } - - lambdaLg10 = MAX(lambdaLg10-1, -16); - if( ++iters >= criteria.max_iter || - cvNorm(param, prevParam, CV_RELATIVE_L2) < criteria.epsilon ) - { - //printf("iters %i\n", iters); - _param = param; - state = DONE; - return false; - } - - prevErrNorm = errNorm; - cvZero( JtJ ); - cvZero( JtErr ); - _param = param; - _JtJ = JtJ; - _JtErr = JtErr; - state = CALC_J; - return true; -} diff --git a/apps/interactive-calibration/cvCalibrationFork.hpp b/apps/interactive-calibration/cvCalibrationFork.hpp deleted file mode 100644 index 075f251ef5..0000000000 --- a/apps/interactive-calibration/cvCalibrationFork.hpp +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef CV_CALIBRATION_FORK_HPP -#define CV_CALIBRATION_FORK_HPP - -#include -#include -#include -#include - -namespace cvfork -{ -using namespace cv; - -#define CV_CALIB_NINTRINSIC 18 -#define CALIB_USE_QR (1 << 18) - -double calibrateCamera(InputArrayOfArrays objectPoints, - InputArrayOfArrays imagePoints, Size imageSize, - InputOutputArray cameraMatrix, InputOutputArray distCoeffs, - OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, OutputArray stdDeviations, - OutputArray perViewErrors, int flags = 0, TermCriteria criteria = TermCriteria( - TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON) ); - -double cvCalibrateCamera2( const CvMat* object_points, - const CvMat* image_points, - const CvMat* point_counts, - CvSize image_size, - CvMat* camera_matrix, - CvMat* distortion_coeffs, - CvMat* rotation_vectors CV_DEFAULT(NULL), - CvMat* translation_vectors CV_DEFAULT(NULL), - CvMat* stdDeviations_vector CV_DEFAULT(NULL), - CvMat* perViewErrors_vector CV_DEFAULT(NULL), - int flags CV_DEFAULT(0), - CvTermCriteria term_crit CV_DEFAULT(cvTermCriteria( - CV_TERMCRIT_ITER+CV_TERMCRIT_EPS,30,DBL_EPSILON)) ); - -double calibrateCameraCharuco(InputArrayOfArrays _charucoCorners, InputArrayOfArrays _charucoIds, - Ptr &_board, Size imageSize, - InputOutputArray _cameraMatrix, InputOutputArray _distCoeffs, - OutputArrayOfArrays _rvecs, OutputArrayOfArrays _tvecs, OutputArray _stdDeviations, OutputArray _perViewErrors, - int flags = 0, TermCriteria criteria = TermCriteria( - TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON) ); - -class CvLevMarqFork : public CvLevMarq -{ -public: - CvLevMarqFork( int nparams, int nerrs, CvTermCriteria criteria= - cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER,30,DBL_EPSILON), - bool completeSymmFlag=false ); - bool updateAlt( const CvMat*& _param, CvMat*& _JtJ, CvMat*& _JtErr, double*& _errNorm ); - void step(); - ~CvLevMarqFork(); -}; -} - -#endif diff --git a/apps/interactive-calibration/frameProcessor.cpp b/apps/interactive-calibration/frameProcessor.cpp index bef130ef3b..1e672b0c45 100644 --- a/apps/interactive-calibration/frameProcessor.cpp +++ b/apps/interactive-calibration/frameProcessor.cpp @@ -1,3 +1,7 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + #include "frameProcessor.hpp" #include "rotationConverters.hpp" @@ -5,6 +9,7 @@ #include #include #include + #include #include #include @@ -253,8 +258,8 @@ CalibProcessor::CalibProcessor(cv::Ptr data, captureParameters mCapuredFrames = 0; mNeededFramesNum = capParams.calibrationStep; mDelayBetweenCaptures = static_cast(capParams.captureDelay * capParams.fps); - mMaxTemplateOffset = std::sqrt(std::pow(mCalibData->imageSize.height, 2) + - std::pow(mCalibData->imageSize.width, 2)) / 20.0; + mMaxTemplateOffset = std::sqrt(static_cast(mCalibData->imageSize.height * mCalibData->imageSize.height) + + static_cast(mCalibData->imageSize.width * mCalibData->imageSize.width)) / 20.0; mSquareSize = capParams.squareSize; mTemplDist = capParams.templDst; diff --git a/apps/interactive-calibration/frameProcessor.hpp b/apps/interactive-calibration/frameProcessor.hpp index 119910ad46..4dbb8ab314 100644 --- a/apps/interactive-calibration/frameProcessor.hpp +++ b/apps/interactive-calibration/frameProcessor.hpp @@ -1,9 +1,14 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + #ifndef FRAME_PROCESSOR_HPP #define FRAME_PROCESSOR_HPP #include #include #include + #include "calibCommon.hpp" #include "calibController.hpp" diff --git a/apps/interactive-calibration/linalg.cpp b/apps/interactive-calibration/linalg.cpp deleted file mode 100644 index e75b4d2d93..0000000000 --- a/apps/interactive-calibration/linalg.cpp +++ /dev/null @@ -1,491 +0,0 @@ -#include "linalg.hpp" - -#ifdef USE_LAPACK - -typedef int integer; -#include - -#include -using namespace cv; - -bool cvfork::solve(InputArray _src, const InputArray _src2arg, OutputArray _dst, int method ) - { - bool result = true; - Mat src = _src.getMat(), _src2 = _src2arg.getMat(); - int type = src.type(); - bool is_normal = (method & DECOMP_NORMAL) != 0; - - CV_Assert( type == _src2.type() && (type == CV_32F || type == CV_64F) ); - - method &= ~DECOMP_NORMAL; - CV_Assert( (method != DECOMP_LU && method != DECOMP_CHOLESKY) || - is_normal || src.rows == src.cols ); - - double rcond=-1, s1=0, work1=0, *work=0, *s=0; - float frcond=-1, fs1=0, fwork1=0, *fwork=0, *fs=0; - integer m = src.rows, m_ = m, n = src.cols, mn = std::max(m,n), - nm = std::min(m, n), nb = _src2.cols, lwork=-1, liwork=0, iwork1=0, - lda = m, ldx = mn, info=0, rank=0, *iwork=0; - int elem_size = CV_ELEM_SIZE(type); - bool copy_rhs=false; - int buf_size=0; - AutoBuffer buffer; - uchar* ptr; - char N[] = {'N', '\0'}, L[] = {'L', '\0'}; - - Mat src2 = _src2; - _dst.create( src.cols, src2.cols, src.type() ); - Mat dst = _dst.getMat(); - - if( m <= n ) - is_normal = false; - else if( is_normal ) - m_ = n; - - buf_size += (is_normal ? n*n : m*n)*elem_size; - - if( m_ != n || nb > 1 || !dst.isContinuous() ) - { - copy_rhs = true; - if( is_normal ) - buf_size += n*nb*elem_size; - else - buf_size += mn*nb*elem_size; - } - - if( method == DECOMP_SVD || method == DECOMP_EIG ) - { - integer nlvl = cvRound(std::log(std::max(std::min(m_,n)/25., 1.))/CV_LOG2) + 1; - liwork = std::min(m_,n)*(3*std::max(nlvl,(integer)0) + 11); - - if( type == CV_32F ) - sgelsd_(&m_, &n, &nb, (float*)src.data, &lda, (float*)dst.data, &ldx, - &fs1, &frcond, &rank, &fwork1, &lwork, &iwork1, &info); - else - dgelsd_(&m_, &n, &nb, (double*)src.data, &lda, (double*)dst.data, &ldx, - &s1, &rcond, &rank, &work1, &lwork, &iwork1, &info ); - buf_size += nm*elem_size + (liwork + 1)*sizeof(integer); - } - else if( method == DECOMP_QR ) - { - if( type == CV_32F ) - sgels_(N, &m_, &n, &nb, (float*)src.data, &lda, - (float*)dst.data, &ldx, &fwork1, &lwork, &info ); - else - dgels_(N, &m_, &n, &nb, (double*)src.data, &lda, - (double*)dst.data, &ldx, &work1, &lwork, &info ); - } - else if( method == DECOMP_LU ) - { - buf_size += (n+1)*sizeof(integer); - } - else if( method == DECOMP_CHOLESKY ) - ; - else - CV_Error( Error::StsBadArg, "Unknown method" ); - assert(info == 0); - - lwork = cvRound(type == CV_32F ? (double)fwork1 : work1); - buf_size += lwork*elem_size; - buffer.allocate(buf_size); - ptr = (uchar*)buffer; - - Mat at(n, m_, type, ptr); - ptr += n*m_*elem_size; - - if( method == DECOMP_CHOLESKY || method == DECOMP_EIG ) - src.copyTo(at); - else if( !is_normal ) - transpose(src, at); - else - mulTransposed(src, at, true); - - Mat xt; - if( !is_normal ) - { - if( copy_rhs ) - { - Mat temp(nb, mn, type, ptr); - ptr += nb*mn*elem_size; - Mat bt = temp.colRange(0, m); - xt = temp.colRange(0, n); - transpose(src2, bt); - } - else - { - src2.copyTo(dst); - xt = Mat(1, n, type, dst.data); - } - } - else - { - if( copy_rhs ) - { - xt = Mat(nb, n, type, ptr); - ptr += nb*n*elem_size; - } - else - xt = Mat(1, n, type, dst.data); - // (a'*b)' = b'*a - gemm( src2, src, 1, Mat(), 0, xt, GEMM_1_T ); - } - - lda = (int)(at.step ? at.step/elem_size : at.cols); - ldx = (int)(xt.step ? xt.step/elem_size : (!is_normal && copy_rhs ? mn : n)); - - if( method == DECOMP_SVD || method == DECOMP_EIG ) - { - if( type == CV_32F ) - { - fs = (float*)ptr; - ptr += nm*elem_size; - fwork = (float*)ptr; - ptr += lwork*elem_size; - iwork = (integer*)alignPtr(ptr, sizeof(integer)); - - sgelsd_(&m_, &n, &nb, (float*)at.data, &lda, (float*)xt.data, &ldx, - fs, &frcond, &rank, fwork, &lwork, iwork, &info); - } - else - { - s = (double*)ptr; - ptr += nm*elem_size; - work = (double*)ptr; - ptr += lwork*elem_size; - iwork = (integer*)alignPtr(ptr, sizeof(integer)); - - dgelsd_(&m_, &n, &nb, (double*)at.data, &lda, (double*)xt.data, &ldx, - s, &rcond, &rank, work, &lwork, iwork, &info); - } - } - else if( method == DECOMP_QR ) - { - if( type == CV_32F ) - { - fwork = (float*)ptr; - sgels_(N, &m_, &n, &nb, (float*)at.data, &lda, - (float*)xt.data, &ldx, fwork, &lwork, &info); - } - else - { - work = (double*)ptr; - dgels_(N, &m_, &n, &nb, (double*)at.data, &lda, - (double*)xt.data, &ldx, work, &lwork, &info); - } - } - else if( method == DECOMP_CHOLESKY || (method == DECOMP_LU && is_normal) ) - { - if( type == CV_32F ) - { - spotrf_(L, &n, (float*)at.data, &lda, &info); - if(info==0) - spotrs_(L, &n, &nb, (float*)at.data, &lda, (float*)xt.data, &ldx, &info); - } - else - { - dpotrf_(L, &n, (double*)at.data, &lda, &info); - if(info==0) - dpotrs_(L, &n, &nb, (double*)at.data, &lda, (double*)xt.data, &ldx, &info); - } - } - else if( method == DECOMP_LU ) - { - iwork = (integer*)alignPtr(ptr, sizeof(integer)); - if( type == CV_32F ) - sgesv_(&n, &nb, (float*)at.data, &lda, iwork, (float*)xt.data, &ldx, &info ); - else - dgesv_(&n, &nb, (double*)at.data, &lda, iwork, (double*)xt.data, &ldx, &info ); - } - else - assert(0); - result = info == 0; - - if( !result ) - dst = Scalar(0); - else if( xt.data != dst.data ) - transpose( xt, dst ); - - return result; - } - -static void _SVDcompute( const InputArray _aarr, OutputArray _w, - OutputArray _u, OutputArray _vt, int flags = 0) -{ - Mat a = _aarr.getMat(), u, vt; - integer m = a.rows, n = a.cols, mn = std::max(m, n), nm = std::min(m, n); - int type = a.type(), elem_size = (int)a.elemSize(); - bool compute_uv = _u.needed() || _vt.needed(); - - if( flags & SVD::NO_UV ) - { - _u.release(); - _vt.release(); - compute_uv = false; - } - - if( compute_uv ) - { - _u.create( (int)m, (int)((flags & SVD::FULL_UV) ? m : nm), type ); - _vt.create( (int)((flags & SVD::FULL_UV) ? n : nm), n, type ); - u = _u.getMat(); - vt = _vt.getMat(); - } - - _w.create(nm, 1, type, -1, true); - - Mat _a = a, w = _w.getMat(); - CV_Assert( w.isContinuous() ); - int work_ofs=0, iwork_ofs=0, buf_size = 0; - bool temp_a = false; - double u1=0, v1=0, work1=0; - float uf1=0, vf1=0, workf1=0; - integer lda, ldu, ldv, lwork=-1, iwork1=0, info=0; - char mode[] = {compute_uv ? 'S' : 'N', '\0'}; - - if( m != n && compute_uv && (flags & SVD::FULL_UV) ) - mode[0] = 'A'; - - if( !(flags & SVD::MODIFY_A) ) - { - if( mode[0] == 'N' || mode[0] == 'A' ) - temp_a = true; - else if( compute_uv && (a.size() == vt.size() || a.size() == u.size()) && mode[0] == 'S' ) - mode[0] = 'O'; - } - - lda = a.cols; - ldv = ldu = mn; - - if( type == CV_32F ) - { - sgesdd_(mode, &n, &m, (float*)a.data, &lda, (float*)w.data, - &vf1, &ldv, &uf1, &ldu, &workf1, &lwork, &iwork1, &info ); - lwork = cvRound(workf1); - } - else - { - dgesdd_(mode, &n, &m, (double*)a.data, &lda, (double*)w.data, - &v1, &ldv, &u1, &ldu, &work1, &lwork, &iwork1, &info ); - lwork = cvRound(work1); - } - - assert(info == 0); - if( temp_a ) - { - buf_size += n*m*elem_size; - } - work_ofs = buf_size; - buf_size += lwork*elem_size; - buf_size = alignSize(buf_size, sizeof(integer)); - iwork_ofs = buf_size; - buf_size += 8*nm*sizeof(integer); - - AutoBuffer buf(buf_size); - uchar* buffer = (uchar*)buf; - - if( temp_a ) - { - _a = Mat(a.rows, a.cols, type, buffer ); - a.copyTo(_a); - } - - if( !(flags & SVD::MODIFY_A) && !temp_a ) - { - if( compute_uv && a.size() == vt.size() ) - { - a.copyTo(vt); - _a = vt; - } - else if( compute_uv && a.size() == u.size() ) - { - a.copyTo(u); - _a = u; - } - } - - if( compute_uv ) - { - ldv = (int)(vt.step ? vt.step/elem_size : vt.cols); - ldu = (int)(u.step ? u.step/elem_size : u.cols); - } - - lda = (int)(_a.step ? _a.step/elem_size : _a.cols); - if( type == CV_32F ) - { - sgesdd_(mode, &n, &m, _a.ptr(), &lda, w.ptr(), - vt.data ? vt.ptr() : (float*)&v1, &ldv, - u.data ? u.ptr() : (float*)&u1, &ldu, - (float*)(buffer + work_ofs), &lwork, - (integer*)(buffer + iwork_ofs), &info ); - } - else - { - dgesdd_(mode, &n, &m, _a.ptr(), &lda, w.ptr(), - vt.data ? vt.ptr() : &v1, &ldv, - u.data ? u.ptr() : &u1, &ldu, - (double*)(buffer + work_ofs), &lwork, - (integer*)(buffer + iwork_ofs), &info ); - } - CV_Assert(info >= 0); - if(info != 0) - { - if( u.data ) - u = Scalar(0.); - if( vt.data ) - vt = Scalar(0.); - w = Scalar(0.); - } -} -////////////////////////////////////////////////////////// -template static void -MatrAXPY( int m, int n, const T1* x, int dx, - const T2* a, int inca, T3* y, int dy ) -{ - int i, j; - for( i = 0; i < m; i++, x += dx, y += dy ) - { - T2 s = a[i*inca]; - for( j = 0; j <= n - 4; j += 4 ) - { - T3 t0 = (T3)(y[j] + s*x[j]); - T3 t1 = (T3)(y[j+1] + s*x[j+1]); - y[j] = t0; - y[j+1] = t1; - t0 = (T3)(y[j+2] + s*x[j+2]); - t1 = (T3)(y[j+3] + s*x[j+3]); - y[j+2] = t0; - y[j+3] = t1; - } - - for( ; j < n; j++ ) - y[j] = (T3)(y[j] + s*x[j]); - } -} -template static void -SVBkSb( int m, int n, const T* w, int incw, - const T* u, int ldu, int uT, - const T* v, int ldv, int vT, - const T* b, int ldb, int nb, - T* x, int ldx, double* buffer, T eps ) -{ - double threshold = 0; - int udelta0 = uT ? ldu : 1, udelta1 = uT ? 1 : ldu; - int vdelta0 = vT ? ldv : 1, vdelta1 = vT ? 1 : ldv; - int i, j, nm = std::min(m, n); - - if( !b ) - nb = m; - - for( i = 0; i < n; i++ ) - for( j = 0; j < nb; j++ ) - x[i*ldx + j] = 0; - - for( i = 0; i < nm; i++ ) - threshold += w[i*incw]; - threshold *= eps; - - // v * inv(w) * uT * b - for( i = 0; i < nm; i++, u += udelta0, v += vdelta0 ) - { - double wi = w[i*incw]; - if( wi <= threshold ) - continue; - wi = 1/wi; - - if( nb == 1 ) - { - double s = 0; - if( b ) - for( j = 0; j < m; j++ ) - s += u[j*udelta1]*b[j*ldb]; - else - s = u[0]; - s *= wi; - - for( j = 0; j < n; j++ ) - x[j*ldx] = (T)(x[j*ldx] + s*v[j*vdelta1]); - } - else - { - if( b ) - { - for( j = 0; j < nb; j++ ) - buffer[j] = 0; - MatrAXPY( m, nb, b, ldb, u, udelta1, buffer, 0 ); - for( j = 0; j < nb; j++ ) - buffer[j] *= wi; - } - else - { - for( j = 0; j < nb; j++ ) - buffer[j] = u[j*udelta1]*wi; - } - MatrAXPY( n, nb, buffer, 0, v, vdelta1, x, ldx ); - } - } -} - -static void _backSubst( const InputArray _w, const InputArray _u, const InputArray _vt, - const InputArray _rhs, OutputArray _dst ) -{ - Mat w = _w.getMat(), u = _u.getMat(), vt = _vt.getMat(), rhs = _rhs.getMat(); - int type = w.type(), esz = (int)w.elemSize(); - int m = u.rows, n = vt.cols, nb = rhs.data ? rhs.cols : m; - AutoBuffer buffer(nb); - CV_Assert( u.data && vt.data && w.data ); - - CV_Assert( rhs.data == 0 || (rhs.type() == type && rhs.rows == m) ); - - _dst.create( n, nb, type ); - Mat dst = _dst.getMat(); - if( type == CV_32F ) - SVBkSb(m, n, (float*)w.data, 1, (float*)u.data, (int)(u.step/esz), false, - (float*)vt.data, (int)(vt.step/esz), true, (float*)rhs.data, (int)(rhs.step/esz), - nb, (float*)dst.data, (int)(dst.step/esz), buffer, 10*FLT_EPSILON ); - else if( type == CV_64F ) - SVBkSb(m, n, (double*)w.data, 1, (double*)u.data, (int)(u.step/esz), false, - (double*)vt.data, (int)(vt.step/esz), true, (double*)rhs.data, (int)(rhs.step/esz), - nb, (double*)dst.data, (int)(dst.step/esz), buffer, 2*DBL_EPSILON ); - else - CV_Error( Error::StsUnsupportedFormat, "" ); -} -/////////////////////////////////////////// - -#define Sf( y, x ) ((float*)(srcdata + y*srcstep))[x] -#define Sd( y, x ) ((double*)(srcdata + y*srcstep))[x] -#define Df( y, x ) ((float*)(dstdata + y*dststep))[x] -#define Dd( y, x ) ((double*)(dstdata + y*dststep))[x] - -double cvfork::invert( InputArray _src, OutputArray _dst, int method ) -{ - Mat src = _src.getMat(); - int type = src.type(); - - CV_Assert(type == CV_32F || type == CV_64F); - - size_t esz = CV_ELEM_SIZE(type); - int m = src.rows, n = src.cols; - - if( method == DECOMP_SVD ) - { - int nm = std::min(m, n); - - AutoBuffer _buf((m*nm + nm + nm*n)*esz + sizeof(double)); - uchar* buf = alignPtr((uchar*)_buf, (int)esz); - Mat u(m, nm, type, buf); - Mat w(nm, 1, type, u.ptr() + m*nm*esz); - Mat vt(nm, n, type, w.ptr() + nm*esz); - - _SVDcompute(src, w, u, vt); - _backSubst(w, u, vt, Mat(), _dst); - - return type == CV_32F ? - (w.ptr()[0] >= FLT_EPSILON ? - w.ptr()[n-1]/w.ptr()[0] : 0) : - (w.ptr()[0] >= DBL_EPSILON ? - w.ptr()[n-1]/w.ptr()[0] : 0); - } - return 0; -} - -#endif //USE_LAPACK diff --git a/apps/interactive-calibration/linalg.hpp b/apps/interactive-calibration/linalg.hpp deleted file mode 100644 index 4a4d2b053b..0000000000 --- a/apps/interactive-calibration/linalg.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef LINALG_HPP -#define LINALG_HPP - -#include - -namespace cvfork { - -double invert( cv::InputArray _src, cv::OutputArray _dst, int method ); -bool solve(cv::InputArray _src, cv::InputArray _src2arg, cv::OutputArray _dst, int method ); - -} - -#endif diff --git a/apps/interactive-calibration/main.cpp b/apps/interactive-calibration/main.cpp index 06521593f8..af62d4ea40 100644 --- a/apps/interactive-calibration/main.cpp +++ b/apps/interactive-calibration/main.cpp @@ -1,8 +1,13 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + #include #include #include #include #include + #include #include #include @@ -12,7 +17,6 @@ #include "calibCommon.hpp" #include "calibPipeline.hpp" #include "frameProcessor.hpp" -#include "cvCalibrationFork.hpp" #include "calibController.hpp" #include "parametersController.hpp" #include "rotationConverters.hpp" @@ -23,7 +27,7 @@ const std::string keys = "{v | | Input from video file }" "{ci | 0 | Default camera id }" "{flip | false | Vertical flip of input frames }" - "{t | circles | Template for calibration (circles, chessboard, dualCircles, chAruco) }" + "{t | circles | Template for calibration (circles, chessboard, dualCircles, charuco) }" "{sz | 16.3 | Distance between two nearest centers of circles or squares on calibration board}" "{dst | 295 | Distance between white and black parts of daulCircles template}" "{w | | Width of template (in corners or circles)}" @@ -106,7 +110,7 @@ int main(int argc, char** argv) if(!parser.has("v")) globalData->imageSize = capParams.cameraResolution; int calibrationFlags = 0; - if(intParams.fastSolving) calibrationFlags |= CALIB_USE_QR; + if(intParams.fastSolving) calibrationFlags |= cv::CALIB_USE_QR; cv::Ptr controller(new calibController(globalData, calibrationFlags, parser.get("ft"), capParams.minFramesNum)); cv::Ptr dataController(new calibDataController(globalData, capParams.maxFramesNum, @@ -131,11 +135,16 @@ int main(int argc, char** argv) cv::namedWindow(mainWindowName); cv::moveWindow(mainWindowName, 10, 10); #ifdef HAVE_QT - cv::createButton("Delete last frame", deleteButton, &dataController, cv::QT_PUSH_BUTTON); - cv::createButton("Delete all frames", deleteAllButton, &dataController, cv::QT_PUSH_BUTTON); - cv::createButton("Undistort", undistortButton, &showProcessor, cv::QT_CHECKBOX, false); - cv::createButton("Save current parameters", saveCurrentParamsButton, &dataController, cv::QT_PUSH_BUTTON); - cv::createButton("Switch visualisation mode", switchVisualizationModeButton, &showProcessor, cv::QT_PUSH_BUTTON); + cv::createButton("Delete last frame", deleteButton, &dataController, + cv::QT_PUSH_BUTTON | cv::QT_NEW_BUTTONBAR); + cv::createButton("Delete all frames", deleteAllButton, &dataController, + cv::QT_PUSH_BUTTON | cv::QT_NEW_BUTTONBAR); + cv::createButton("Undistort", undistortButton, &showProcessor, + cv::QT_CHECKBOX | cv::QT_NEW_BUTTONBAR, false); + cv::createButton("Save current parameters", saveCurrentParamsButton, &dataController, + cv::QT_PUSH_BUTTON | cv::QT_NEW_BUTTONBAR); + cv::createButton("Switch visualisation mode", switchVisualizationModeButton, &showProcessor, + cv::QT_PUSH_BUTTON | cv::QT_NEW_BUTTONBAR); #endif //HAVE_QT try { bool pipelineFinished = false; @@ -156,10 +165,10 @@ int main(int argc, char** argv) if(capParams.board != chAruco) { globalData->totalAvgErr = - cvfork::calibrateCamera(globalData->objectPoints, globalData->imagePoints, + cv::calibrateCamera(globalData->objectPoints, globalData->imagePoints, globalData->imageSize, globalData->cameraMatrix, globalData->distCoeffs, cv::noArray(), cv::noArray(), - globalData->stdDeviations, globalData->perViewErrors, + globalData->stdDeviations, cv::noArray(), globalData->perViewErrors, calibrationFlags, solverTermCrit); } else { @@ -169,10 +178,10 @@ int main(int argc, char** argv) cv::aruco::CharucoBoard::create(capParams.boardSize.width, capParams.boardSize.height, capParams.charucoSquareLenght, capParams.charucoMarkerSize, dictionary); globalData->totalAvgErr = - cvfork::calibrateCameraCharuco(globalData->allCharucoCorners, globalData->allCharucoIds, + cv::aruco::calibrateCameraCharuco(globalData->allCharucoCorners, globalData->allCharucoIds, charucoboard, globalData->imageSize, globalData->cameraMatrix, globalData->distCoeffs, - cv::noArray(), cv::noArray(), globalData->stdDeviations, + cv::noArray(), cv::noArray(), globalData->stdDeviations, cv::noArray(), globalData->perViewErrors, calibrationFlags, solverTermCrit); } dataController->updateUndistortMap(); diff --git a/apps/interactive-calibration/parametersController.cpp b/apps/interactive-calibration/parametersController.cpp index c9356902da..d581582cb6 100644 --- a/apps/interactive-calibration/parametersController.cpp +++ b/apps/interactive-calibration/parametersController.cpp @@ -1,4 +1,9 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + #include "parametersController.hpp" + #include template diff --git a/apps/interactive-calibration/parametersController.hpp b/apps/interactive-calibration/parametersController.hpp index 6477901990..616f4e7799 100644 --- a/apps/interactive-calibration/parametersController.hpp +++ b/apps/interactive-calibration/parametersController.hpp @@ -1,8 +1,14 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + #ifndef PARAMETERS_CONTROLLER_HPP #define PARAMETERS_CONTROLLER_HPP #include + #include + #include "calibCommon.hpp" namespace calib { diff --git a/apps/interactive-calibration/rotationConverters.cpp b/apps/interactive-calibration/rotationConverters.cpp index dee3b531d6..ff31c9e380 100644 --- a/apps/interactive-calibration/rotationConverters.cpp +++ b/apps/interactive-calibration/rotationConverters.cpp @@ -1,6 +1,11 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + #include "rotationConverters.hpp" #include + #include #include diff --git a/apps/interactive-calibration/rotationConverters.hpp b/apps/interactive-calibration/rotationConverters.hpp index bddce3eb30..fcb5bcc59c 100644 --- a/apps/interactive-calibration/rotationConverters.hpp +++ b/apps/interactive-calibration/rotationConverters.hpp @@ -1,5 +1,9 @@ -#ifndef RAOTATION_CONVERTERS_HPP -#define RAOTATION_CONVERTERS_HPP +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#ifndef ROTATION_CONVERTERS_HPP +#define ROTATION_CONVERTERS_HPP #include diff --git a/apps/traincascade/imagestorage.cpp b/apps/traincascade/imagestorage.cpp index 4055350c2e..420d997ee6 100644 --- a/apps/traincascade/imagestorage.cpp +++ b/apps/traincascade/imagestorage.cpp @@ -36,6 +36,7 @@ bool CvCascadeImageReader::NegReader::create( const string _filename, Size _winS while( !file.eof() ) { std::getline(file, str); + str.erase(str.find_last_not_of(" \n\r\t")+1); if (str.empty()) break; if (str.at(0) == '#' ) continue; /* comment */ imgFilenames.push_back(str); diff --git a/apps/version/CMakeLists.txt b/apps/version/CMakeLists.txt new file mode 100644 index 0000000000..6ced527181 --- /dev/null +++ b/apps/version/CMakeLists.txt @@ -0,0 +1,32 @@ +SET(OPENCV_APPLICATION_DEPS opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs opencv_videoio) +ocv_check_dependencies(${OPENCV_APPLICATION_DEPS}) + +if(NOT OCV_DEPENDENCIES_FOUND) + return() +endif() + +project(opencv_version) +set(the_target opencv_version) + +ocv_target_include_directories(${the_target} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv") +ocv_target_include_modules_recurse(${the_target} ${OPENCV_APPLICATION_DEPS}) + +file(GLOB SRCS *.cpp) + +ocv_add_executable(${the_target} ${SRCS}) +ocv_target_link_libraries(${the_target} ${OPENCV_APPLICATION_DEPS}) + +set_target_properties(${the_target} PROPERTIES + DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" + RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} + OUTPUT_NAME "opencv_version") + +set_target_properties(${the_target} PROPERTIES FOLDER "applications") + +if(INSTALL_CREATE_DISTRIB) + if(BUILD_SHARED_LIBS) + install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT libs) + endif() +else() + install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT libs) +endif() diff --git a/apps/version/opencv_version.cpp b/apps/version/opencv_version.cpp new file mode 100644 index 0000000000..78f28108ed --- /dev/null +++ b/apps/version/opencv_version.cpp @@ -0,0 +1,28 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#include + +#include + +int main(int argc, const char** argv) +{ + cv::CommandLineParser parser(argc, argv, + "{ help h usage ? | | show this help message }" + "{ verbose v | | show build configuration log }" + ); + if (parser.has("help")) + { + parser.printMessage(); + } + else if (parser.has("verbose")) + { + std::cout << cv::getBuildInformation().c_str() << std::endl; + } + else + { + std::cout << CV_VERSION << std::endl; + } + return 0; +} diff --git a/cmake/FindOpenVX.cmake b/cmake/FindOpenVX.cmake new file mode 100644 index 0000000000..dc1f7617bd --- /dev/null +++ b/cmake/FindOpenVX.cmake @@ -0,0 +1,20 @@ +ocv_clear_vars(HAVE_OPENVX OPENVX_LIBS) + +set(OPENVX_ROOT "" CACHE PATH "OpenVX install directory") + +if(OPENVX_ROOT) + find_path(OPENVX_INCLUDE_DIR "VX/vx.h" PATHS "${OPENVX_ROOT}/include" DOC "OpenVX include path") + find_library(OPENVX_openvx_LIB "openvx" PATHS "${OPENVX_ROOT}/lib") + find_library(OPENVX_vxu_LIB "vxu" PATHS "${OPENVX_ROOT}/lib") + set(OPENVX_LIBRARIES "${OPENVX_openvx_LIB}" "${OPENVX_vxu_LIB}" CACHE STRING "OpenVX libraries") + if (OPENVX_INCLUDE_DIR AND OPENVX_LIBRARIES) + set(HAVE_OPENVX TRUE) + endif() +endif() + +if(NOT HAVE_OPENVX) + unset(OPENVX_LIBRARIES CACHE) + unset(OPENVX_INCLUDE_DIR CACHE) + unset(HAVE_OPENVX) + message(STATUS "OpenVX: OFF") +endif() diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake index a2c118db43..686b0b885e 100644 --- a/cmake/OpenCVCompilerOptions.cmake +++ b/cmake/OpenCVCompilerOptions.cmake @@ -97,6 +97,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) add_extra_compiler_option(-Wno-narrowing) add_extra_compiler_option(-Wno-delete-non-virtual-dtor) add_extra_compiler_option(-Wno-unnamed-type-template-args) + add_extra_compiler_option(-Wno-comment) endif() add_extra_compiler_option(-fdiagnostics-show-option) @@ -150,7 +151,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) add_extra_compiler_option("-mfp16-format=ieee") endif(ARM) if(ENABLE_NEON) - add_extra_compiler_option("-mfpu=neon-fp16") + add_extra_compiler_option("-mfpu=neon") endif() if(ENABLE_VFPV3 AND NOT ENABLE_NEON) add_extra_compiler_option("-mfpu=vfpv3") @@ -232,6 +233,11 @@ if(CMAKE_COMPILER_IS_GNUCXX) set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} --coverage") endif() + if(ENABLE_INSTRUMENTATION) + set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} --std=c++11") + set(WITH_VTK OFF) # There are issues with VTK 6.0 + endif() + set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} -DNDEBUG") set(OPENCV_EXTRA_FLAGS_DEBUG "${OPENCV_EXTRA_FLAGS_DEBUG} -O0 -DDEBUG -D_DEBUG") endif() @@ -330,6 +336,34 @@ if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_OPENCV_GCC_VERSION_NUM GREATER 399) add_extra_compiler_option(-fvisibility-inlines-hidden) endif() +if(NOT OPENCV_FP16_DISABLE) + if(ARM AND ENABLE_NEON) + set(FP16_OPTION "-mfpu=neon-fp16") + elseif((X86 OR X86_64) AND NOT MSVC AND ENABLE_AVX) + set(FP16_OPTION "-mf16c") + endif() + try_compile(__VALID_FP16 + "${OpenCV_BINARY_DIR}" + "${OpenCV_SOURCE_DIR}/cmake/checks/fp16.cpp" + COMPILE_DEFINITIONS "-DCHECK_FP16" "${FP16_OPTION}" + OUTPUT_VARIABLE TRY_OUT + ) + if(NOT __VALID_FP16) + if((X86 OR X86_64) AND NOT MSVC AND NOT ENABLE_AVX) + # GCC enables AVX when mf16c is passed + message(STATUS "FP16: Feature disabled") + else() + message(STATUS "FP16: Compiler support is not available") + endif() + else() + message(STATUS "FP16: Compiler support is available") + set(HAVE_FP16 1) + if(NOT ${FP16_OPTION} STREQUAL "") + add_extra_compiler_option(${FP16_OPTION}) + endif() + endif() +endif() + #combine all "extra" options set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OPENCV_EXTRA_FLAGS} ${OPENCV_EXTRA_C_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPENCV_EXTRA_FLAGS} ${OPENCV_EXTRA_CXX_FLAGS}") @@ -370,17 +404,6 @@ if(MSVC) endif() endif() -if(NOT OPENCV_FP16_DISABLE) - try_compile(__VALID_FP16 - "${OpenCV_BINARY_DIR}" - "${OpenCV_SOURCE_DIR}/cmake/checks/fp16.cpp" - COMPILE_DEFINITIONS "-DCHECK_FP16" - OUTPUT_VARIABLE TRY_OUT - ) - if(NOT __VALID_FP16) - message(STATUS "FP16: Compiler support is not available") - else() - message(STATUS "FP16: Compiler support is available") - set(HAVE_FP16 1) - endif() +if(APPLE AND NOT CMAKE_CROSSCOMPILING AND NOT DEFINED ENV{LDFLAGS} AND EXISTS "/usr/local/lib") + link_directories("/usr/local/lib") endif() diff --git a/cmake/OpenCVDetectCUDA.cmake b/cmake/OpenCVDetectCUDA.cmake index de17cee30c..70b11eb532 100644 --- a/cmake/OpenCVDetectCUDA.cmake +++ b/cmake/OpenCVDetectCUDA.cmake @@ -65,7 +65,7 @@ if(CUDA_FOUND) if(CUDA_GENERATION STREQUAL "Fermi") set(__cuda_arch_bin "2.0") elseif(CUDA_GENERATION STREQUAL "Kepler") - set(__cuda_arch_bin "3.0 3.5") + set(__cuda_arch_bin "3.0 3.5 3.7") elseif(CUDA_GENERATION STREQUAL "Maxwell") set(__cuda_arch_bin "5.0") elseif(CUDA_GENERATION STREQUAL "Pascal") @@ -92,9 +92,9 @@ if(CUDA_FOUND) set(__cuda_arch_ptx "") else() if(${CUDA_VERSION} VERSION_LESS "8.0") - set(__cuda_arch_bin "2.0 3.0 3.5 5.0") + set(__cuda_arch_bin "2.0 3.0 3.5 3.7 5.0") else() - set(__cuda_arch_bin "2.0 3.0 3.5 5.0 6.0") + set(__cuda_arch_bin "2.0 3.0 3.5 3.7 5.0 6.0") endif() set(__cuda_arch_ptx "") endif() diff --git a/cmake/OpenCVDetectPython.cmake b/cmake/OpenCVDetectPython.cmake index f304a50a42..f6452eb1e5 100644 --- a/cmake/OpenCVDetectPython.cmake +++ b/cmake/OpenCVDetectPython.cmake @@ -47,19 +47,24 @@ if(NOT ${found}) endforeach() endif() + string(REGEX MATCH "^[0-9]+" _preferred_version_major ${preferred_version}) + find_host_package(PythonInterp "${preferred_version}") if(NOT PYTHONINTERP_FOUND) find_host_package(PythonInterp "${min_version}") endif() if(PYTHONINTERP_FOUND) - # Copy outputs - set(_found ${PYTHONINTERP_FOUND}) - set(_executable ${PYTHON_EXECUTABLE}) - set(_version_string ${PYTHON_VERSION_STRING}) - set(_version_major ${PYTHON_VERSION_MAJOR}) - set(_version_minor ${PYTHON_VERSION_MINOR}) - set(_version_patch ${PYTHON_VERSION_PATCH}) + # Check if python major version is correct + if(${_preferred_version_major} EQUAL ${PYTHON_VERSION_MAJOR}) + # Copy outputs + set(_found ${PYTHONINTERP_FOUND}) + set(_executable ${PYTHON_EXECUTABLE}) + set(_version_string ${PYTHON_VERSION_STRING}) + set(_version_major ${PYTHON_VERSION_MAJOR}) + set(_version_minor ${PYTHON_VERSION_MINOR}) + set(_version_patch ${PYTHON_VERSION_PATCH}) + endif() # Clear find_host_package side effects unset(PYTHONINTERP_FOUND) diff --git a/cmake/OpenCVFindLibsPerf.cmake b/cmake/OpenCVFindLibsPerf.cmake index c679102d37..82afd390ae 100644 --- a/cmake/OpenCVFindLibsPerf.cmake +++ b/cmake/OpenCVFindLibsPerf.cmake @@ -4,14 +4,27 @@ # --- Lapack --- if(WITH_LAPACK) + if(WIN32) + set(BLA_STATIC 1) + endif() find_package(LAPACK) if(LAPACK_FOUND) find_path(LAPACKE_INCLUDE_DIR "lapacke.h") - if(LAPACKE_INCLUDE_DIR) + find_path(MKL_LAPACKE_INCLUDE_DIR "mkl_lapack.h") + if(LAPACKE_INCLUDE_DIR OR MKL_LAPACKE_INCLUDE_DIR) find_path(CBLAS_INCLUDE_DIR "cblas.h") - if(CBLAS_INCLUDE_DIR) + find_path(MKL_CBLAS_INCLUDE_DIR "mkl_cblas.h") + + if(CBLAS_INCLUDE_DIR OR MKL_CBLAS_INCLUDE_DIR) set(HAVE_LAPACK 1) + + if(CBLAS_INCLUDE_DIR) ocv_include_directories(${LAPACKE_INCLUDE_DIR} ${CBLAS_INCLUDE_DIR}) + set(HAVE_LAPACK_GENERIC 1) + elseif(MKL_CBLAS_INCLUDE_DIR) + ocv_include_directories(${MKL_LAPACKE_INCLUDE_DIR} ${MKL_CBLAS_INCLUDE_DIR}) + set(HAVE_LAPACK_MKL 1) + endif() list(APPEND OPENCV_LINKER_LIBS ${LAPACK_LIBRARIES}) endif() endif() diff --git a/cmake/OpenCVFindLibsVideo.cmake b/cmake/OpenCVFindLibsVideo.cmake index 20e31518a4..0c4072cb3b 100644 --- a/cmake/OpenCVFindLibsVideo.cmake +++ b/cmake/OpenCVFindLibsVideo.cmake @@ -302,19 +302,18 @@ if(WIN32) endif() endif(WIN32) -# --- Apple AV Foundation --- -if(WITH_AVFOUNDATION) - set(HAVE_AVFOUNDATION YES) -endif() - -# --- QuickTime --- -if (NOT IOS) - if(WITH_QUICKTIME) - set(HAVE_QUICKTIME YES) - elseif(APPLE AND CMAKE_COMPILER_IS_CLANGCXX) - set(HAVE_QTKIT YES) +if(APPLE) + if(WITH_AVFOUNDATION) + set(HAVE_AVFOUNDATION YES) endif() -endif() + if(NOT IOS) + if(WITH_QUICKTIME) + set(HAVE_QUICKTIME YES) + elseif(WITH_QTKIT) + set(HAVE_QTKIT YES) + endif() + endif() +endif(APPLE) # --- Intel Perceptual Computing SDK --- if(WITH_INTELPERC) diff --git a/cmake/OpenCVFindMatlab.cmake b/cmake/OpenCVFindMatlab.cmake index 65ad965c3d..ffe8857fec 100644 --- a/cmake/OpenCVFindMatlab.cmake +++ b/cmake/OpenCVFindMatlab.cmake @@ -62,7 +62,7 @@ function(locate_matlab_root) # possible root locations, in order of likelihood set(SEARCH_DIRS_ /Applications /usr/local /opt/local /usr /opt) foreach (DIR_ ${SEARCH_DIRS_}) - file(GLOB MATLAB_ROOT_DIR_ ${DIR_}/MATLAB/R*) + file(GLOB MATLAB_ROOT_DIR_ ${DIR_}/MATLAB/R* ${DIR_}/MATLAB_R*) if (MATLAB_ROOT_DIR_) # sort in order from highest to lowest # normally it's in the format MATLAB_R[20XX][A/B] diff --git a/cmake/OpenCVGenABI.cmake b/cmake/OpenCVGenABI.cmake index 35cc10d8ed..86aa78b17b 100644 --- a/cmake/OpenCVGenABI.cmake +++ b/cmake/OpenCVGenABI.cmake @@ -43,7 +43,7 @@ string(REPLACE ";" "\n " OPENCV_ABI_SKIP_HEADERS "${OPENCV_ABI_SKIP_HEADERS}" string(REPLACE ";" "\n " OPENCV_ABI_SKIP_LIBRARIES "${OPENCV_ABI_SKIP_LIBRARIES}") # Options -set(OPENCV_ABI_GCC_OPTIONS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}") +set(OPENCV_ABI_GCC_OPTIONS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} -DOPENCV_ABI_CHECK=1") string(REGEX REPLACE "([^ ]) +([^ ])" "\\1\\n \\2" OPENCV_ABI_GCC_OPTIONS "${OPENCV_ABI_GCC_OPTIONS}") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_abi.xml.in" "${path1}") diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index 197aead0d2..742a287ec9 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -779,6 +779,8 @@ macro(_ocv_create_module) endforeach() endif() + source_group("Include" FILES "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp") + source_group("Src" FILES "${${the_module}_pch}") ocv_add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES} "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp" ${${the_module}_pch} ${sub_objs}) @@ -1015,6 +1017,7 @@ function(ocv_add_perf_tests) get_native_precompiled_header(${the_target} perf_precomp.hpp) endif() + source_group("Src" FILES "${${the_target}_pch}") ocv_add_executable(${the_target} ${OPENCV_PERF_${the_module}_SOURCES} ${${the_target}_pch}) ocv_target_include_modules(${the_target} ${perf_deps} "${perf_path}") ocv_target_link_libraries(${the_target} ${perf_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS}) @@ -1091,6 +1094,7 @@ function(ocv_add_accuracy_tests) get_native_precompiled_header(${the_target} test_precomp.hpp) endif() + source_group("Src" FILES "${${the_target}_pch}") ocv_add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch}) ocv_target_include_modules(${the_target} ${test_deps} "${test_path}") ocv_target_link_libraries(${the_target} ${test_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS}) diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake index b1a099e695..8d7c98b3e5 100644 --- a/cmake/OpenCVUtils.cmake +++ b/cmake/OpenCVUtils.cmake @@ -815,7 +815,7 @@ function(ocv_add_library target) add_library(${target} ${ARGN} ${cuda_objs}) # Add OBJECT library (added in cmake 2.8.8) to use in compound modules - if (NOT CMAKE_VERSION VERSION_LESS "2.8.8" + if (NOT CMAKE_VERSION VERSION_LESS "2.8.8" AND OPENCV_ENABLE_OBJECT_TARGETS AND NOT OPENCV_MODULE_${target}_CHILDREN AND NOT OPENCV_MODULE_${target}_CLASS STREQUAL "BINDINGS" AND NOT ${target} STREQUAL "opencv_ts" diff --git a/cmake/templates/cvconfig.h.in b/cmake/templates/cvconfig.h.in index 8dac1ed618..56d415b400 100644 --- a/cmake/templates/cvconfig.h.in +++ b/cmake/templates/cvconfig.h.in @@ -204,5 +204,14 @@ /* Lapack */ #cmakedefine HAVE_LAPACK +/* Lapack Generic */ +#cmakedefine HAVE_LAPACK_GENERIC + +/* Lapack MKL */ +#cmakedefine HAVE_LAPACK_MKL + /* FP16 */ #cmakedefine HAVE_FP16 + +/* Library was compiled with functions instrumentation */ +#cmakedefine ENABLE_INSTRUMENTATION diff --git a/cmake/templates/opencv_modules.hpp.in b/cmake/templates/opencv_modules.hpp.in index 1498715028..6696bb4926 100644 --- a/cmake/templates/opencv_modules.hpp.in +++ b/cmake/templates/opencv_modules.hpp.in @@ -6,4 +6,8 @@ * */ +// This definition means that OpenCV is built with enabled non-free code. +// For example, patented algorithms for non-profit/non-commercial use only. +#cmakedefine OPENCV_ENABLE_NONFREE + @OPENCV_MODULE_DEFINITIONS_CONFIGMAKE@ diff --git a/data/haarcascades/haarcascade_frontalcatface.xml b/data/haarcascades/haarcascade_frontalcatface.xml old mode 100644 new mode 100755 index 0ec79f6ad9..67893dcc07 --- a/data/haarcascades/haarcascade_frontalcatface.xml +++ b/data/haarcascades/haarcascade_frontalcatface.xml @@ -22,15 +22,20 @@ KNOWN LIMITATIONS: - Sometimes, the detector mistakenly thinks that a human face is a cat face. In - situations where either a human or a cat might be encountered, use both a - human face detector and a cat face detector. Then, if a detected human face - and a detected cat face intersect, reject the cat face. - An upright subject is assumed. In situations where the cat's face might be sideways or upside down (e.g. the cat is rolling over), try various rotations of the input image. + CHANGELOG: + + 2016-08-06: Re-trained with more negative samples and more stages. False + positives are much rarer now. If you tailored your code for the cascade's + previous version, now you should re-adjust the arguments of + CascadeClassifier::detectMultiScale. For example, decrease the value of the + minNeighbors argument. You do not need to use a human face detector to + cross-check the positives anymore. + 2014-04-25: First release (at https://bitbucket.org/Joe_Howse/angora-blue) + ////////////////////////////////////////////////////////////////////////// | Contributors License Agreement | IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. @@ -39,7 +44,7 @@ | If you do not agree to this license, do not download, install, | copy or use the software. | - | Copyright (c) 2014, Joseph Howse (Nummist Media Corporation Limited, + | Copyright (c) 2014-2016, Joseph Howse (Nummist Media Corporation Limited, | Halifax, Nova Scotia, Canada). All rights reserved. | | Redistribution and use in source and binary forms, with or without @@ -77,7 +82,7 @@ 24 GAB - 9.9900001287460327e-01 + 9.9500000476837158e-01 5.0000000000000000e-01 9.4999999999999996e-01 1 @@ -86,5887 +91,6499 @@ 0 1 BASIC - 15 + 20 <_> - 25 - -1.7760953903198242e+00 + 16 + -1.4806525707244873e+00 <_> - 0 -1 445 -1.4772760681807995e-02 + 0 -1 472 -1.5126220881938934e-02 - 8.4035199880599976e-01 -1.2701500952243805e-01 + 7.5887596607208252e-01 -3.4230688214302063e-01 <_> - 0 -1 792 4.5831585302948952e-03 + 0 -1 839 3.9337221533060074e-03 - -2.3791725933551788e-01 6.1978793144226074e-01 + -3.3288389444351196e-01 5.2361363172531128e-01 <_> - 0 -1 813 -1.5044892206788063e-02 + 0 -1 858 -1.5044892206788063e-02 - 5.7160794734954834e-01 -2.0493283867835999e-01 + 5.5565774440765381e-01 -2.2505992650985718e-01 <_> - 0 -1 367 -1.2275323271751404e-02 + 0 -1 387 -1.2927042320370674e-02 - 5.7243120670318604e-01 -1.9821420311927795e-01 + 5.7442700862884521e-01 -1.9708566367626190e-01 <_> - 0 -1 842 8.3929381798952818e-04 + 0 -1 137 5.5960696190595627e-03 - -2.7865329384803772e-01 4.3508478999137878e-01 + -3.0430641770362854e-01 4.0241482853889465e-01 <_> - 0 -1 231 1.5758406370878220e-02 + 0 -1 207 1.5758406370878220e-02 - -2.2696593403816223e-01 4.9478942155838013e-01 + -1.9767063856124878e-01 4.5033392310142517e-01 <_> - 0 -1 581 5.0025805830955505e-02 + 0 -1 678 2.4262722581624985e-02 - -1.5532729029655457e-01 6.8103748559951782e-01 + -1.6931040585041046e-01 5.9707510471343994e-01 <_> - 0 -1 727 1.3194808736443520e-02 + 0 -1 267 -3.5242564976215363e-02 - -1.7704419791698456e-01 5.8701574802398682e-01 + 6.5973556041717529e-01 -1.4519356191158295e-01 <_> - 0 -1 5 2.8080096468329430e-02 + 0 -1 687 2.6568008586764336e-02 - -1.6797901690006256e-01 5.7502186298370361e-01 + -1.3476610183715820e-01 5.4296624660491943e-01 <_> - 0 -1 704 2.1941341459751129e-02 + 0 -1 228 4.7154121100902557e-02 - -1.4689344167709351e-01 5.2395468950271606e-01 + -1.7337851226329803e-01 4.6071702241897583e-01 <_> - 0 -1 279 -4.7663945704698563e-02 + 0 -1 925 -5.3081759251654148e-03 - 6.5710687637329102e-01 -1.1819842457771301e-01 + 5.4976856708526611e-01 -1.1913410574197769e-01 <_> - 0 -1 278 3.5373851656913757e-02 + 0 -1 608 5.3415738046169281e-02 - -9.7323395311832428e-02 7.4618083238601685e-01 + -1.2382411211729050e-01 6.3972741365432739e-01 <_> - 0 -1 254 1.4257467410061508e-04 + 0 -1 671 -3.0798995867371559e-03 - -2.8882622718811035e-01 2.8288537263870239e-01 + -8.2048600912094116e-01 1.0249497741460800e-01 <_> - 0 -1 253 3.8169793784618378e-02 + 0 -1 676 -2.3766520898789167e-03 - -1.4375060796737671e-01 4.9739924073219299e-01 + -7.0665025711059570e-01 6.7025005817413330e-02 <_> - 0 -1 142 6.5595638006925583e-03 + 0 -1 180 1.1965663870796561e-03 - 1.2217019498348236e-01 -6.4208990335464478e-01 + -2.4753804504871368e-01 3.0198124051094055e-01 <_> - 0 -1 753 -7.5260535813868046e-03 + 0 -1 830 -4.2106406763195992e-03 - -7.7927684783935547e-01 8.4750138223171234e-02 - <_> - - 0 -1 754 1.1342750862240791e-02 - - -2.2101284563541412e-01 3.4454554319381714e-01 - <_> - - 0 -1 645 -1.8045576289296150e-03 - - -7.8645682334899902e-01 9.7392335534095764e-02 - <_> - - 0 -1 457 -6.6228499636054039e-03 - - 3.1783181428909302e-01 -2.0665900409221649e-01 - <_> - - 0 -1 50 1.0336233302950859e-02 - - 9.1840714216232300e-02 -7.7336055040359497e-01 - <_> - - 0 -1 552 -2.4216776713728905e-02 - - 3.6742198467254639e-01 -1.9339990615844727e-01 - <_> - - 0 -1 64 1.4514809474349022e-02 - - -1.3652153313159943e-01 4.2311781644821167e-01 - <_> - - 0 -1 645 2.1728668361902237e-03 - - 7.9096116125583649e-02 -7.6427251100540161e-01 - <_> - - 0 -1 467 -3.9529249072074890e-02 - - 5.7755863666534424e-01 -1.0801278799772263e-01 - <_> - - 0 -1 640 1.5566367655992508e-02 - - -1.0259374976158142e-01 4.9773094058036804e-01 + 3.8455343246459961e-01 -1.8334107100963593e-01 <_> - 34 - -1.6417213678359985e+00 + 26 + -1.4618960618972778e+00 <_> - 0 -1 699 8.2648023962974548e-03 + 0 -1 725 1.0133055038750172e-02 - -1.0913594812154770e-01 7.7392864227294922e-01 + -2.8207325935363770e-01 6.2703561782836914e-01 <_> - 0 -1 697 1.4094283804297447e-02 + 0 -1 356 3.8468956947326660e-02 - -1.4461971819400787e-01 7.1108609437942505e-01 + -1.4483113586902618e-01 7.4971008300781250e-01 <_> - 0 -1 4 6.3192001543939114e-03 + 0 -1 2 -3.7523733917623758e-03 - -2.3035119473934174e-01 4.4546401500701904e-01 + 4.2959973216056824e-01 -2.1445912122726440e-01 <_> - 0 -1 227 2.0388111472129822e-02 + 0 -1 844 9.9978316575288773e-04 - -2.6455581188201904e-01 3.6559283733367920e-01 + -1.9259409606456757e-01 4.2325544357299805e-01 <_> - 0 -1 206 1.4826779253780842e-02 + 0 -1 387 -1.6786376014351845e-02 - -2.0881411433219910e-01 4.6142515540122986e-01 + 5.0582861900329590e-01 -1.8607729673385620e-01 <_> - 0 -1 821 2.1515905857086182e-02 + 0 -1 208 3.0330579727888107e-02 - -1.4785310626029968e-01 6.4220702648162842e-01 + -2.1100421249866486e-01 4.2819553613662720e-01 <_> - 0 -1 919 1.4720780309289694e-03 + 0 -1 206 1.5150709077715874e-02 - -2.2546350955963135e-01 3.6676284670829773e-01 + -2.1129198372364044e-01 3.6263525485992432e-01 <_> - 0 -1 814 -2.6044776663184166e-02 + 0 -1 451 -3.6349350120872259e-03 - 4.1465434432029724e-01 -1.5356495976448059e-01 + 3.9500275254249573e-01 -1.8650630116462708e-01 <_> - 0 -1 202 -1.0589402168989182e-02 + 0 -1 270 -7.2061517275869846e-03 - 4.1222676634788513e-01 -1.6899079084396362e-01 + -7.2816300392150879e-01 1.1153221875429153e-01 <_> - 0 -1 203 6.9683273322880268e-03 + 0 -1 866 -2.0212728530168533e-02 - 1.0854535549879074e-01 -7.1554762125015259e-01 + 5.6296736001968384e-01 -1.2056054919958115e-01 <_> - 0 -1 326 1.1014346033334732e-02 + 0 -1 265 2.5640423409640789e-03 - -1.7490877211093903e-01 4.4723153114318848e-01 + -2.3753854632377625e-01 3.5794413089752197e-01 <_> - 0 -1 387 -1.1037060990929604e-02 + 0 -1 230 -6.2726587057113647e-03 - 4.4173675775527954e-01 -1.3834878802299500e-01 + -6.7750877141952515e-01 1.2570948898792267e-01 <_> - 0 -1 581 6.2014400959014893e-02 + 0 -1 126 7.8710336238145828e-03 - -1.1345938593149185e-01 6.1101204156875610e-01 + 6.9211356341838837e-02 -7.6449161767959595e-01 <_> - 0 -1 318 6.0412874445319176e-03 + 0 -1 306 5.9134580194950104e-02 - 1.0154686868190765e-01 -7.2787815332412720e-01 + -1.7324967682361603e-01 3.3361187577247620e-01 <_> - 0 -1 281 -5.8582504279911518e-03 + 0 -1 185 -2.8770491480827332e-03 - -6.0382944345474243e-01 8.4109157323837280e-02 + 3.6101511120796204e-01 -1.6122241318225861e-01 <_> - 0 -1 885 7.3200068436563015e-04 + 0 -1 388 -5.7046953588724136e-03 - -1.6661356389522552e-01 3.7944686412811279e-01 + -6.7659336328506470e-01 8.4153175354003906e-02 <_> - 0 -1 702 1.9083185121417046e-02 + 0 -1 13 -7.8070178627967834e-02 - -1.2449446320533752e-01 4.2328220605850220e-01 + 6.0763663053512573e-01 -1.1037797480821609e-01 <_> - 0 -1 978 6.8236114457249641e-03 + 0 -1 321 6.5858578309416771e-03 - 1.0009460896253586e-01 -5.7412278652191162e-01 + 9.3060031533241272e-02 -7.0068693161010742e-01 <_> - 0 -1 655 -8.0357380211353302e-03 + 0 -1 796 -2.0920131355524063e-03 - 3.5114383697509766e-01 -1.5984705090522766e-01 + 2.8173315525054932e-01 -1.8406434357166290e-01 <_> - 0 -1 476 5.3236715495586395e-02 + 0 -1 578 -2.1252598613500595e-02 - -1.1999151855707169e-01 4.5052844285964966e-01 + 3.9672371745109558e-01 -1.5127600729465485e-01 <_> - 0 -1 380 -2.5083746761083603e-02 + 0 -1 770 -3.2937981188297272e-02 - 4.2925071716308594e-01 -1.3847301900386810e-01 + 3.9487251639366150e-01 -1.3228580355644226e-01 <_> - 0 -1 834 -7.7097099274396896e-03 + 0 -1 1016 4.9491915851831436e-03 - 4.2245966196060181e-01 -1.4710718393325806e-01 + 1.1234261840581894e-01 -4.7414371371269226e-01 <_> - 0 -1 22 1.1426717042922974e-02 + 0 -1 215 3.4271054901182652e-03 - 7.3091737926006317e-02 -7.6901757717132568e-01 + 7.8623600304126740e-02 -5.7828009128570557e-01 <_> - 0 -1 980 -4.7868257388472557e-03 + 0 -1 200 -6.0859560035169125e-03 - -5.4498624801635742e-01 8.9874587953090668e-02 + -5.0091904401779175e-01 9.1926425695419312e-02 <_> - 0 -1 797 9.9204876460134983e-04 + 0 -1 990 1.2116413563489914e-02 - -1.5133780241012573e-01 3.5266080498695374e-01 + -1.7154470086097717e-01 2.6759135723114014e-01 <_> - 0 -1 747 -7.3156114667654037e-03 + 0 -1 456 8.2814376801252365e-03 - -7.7262216806411743e-01 7.4858717620372772e-02 - <_> - - 0 -1 239 5.6915655732154846e-03 - - 5.7124871760606766e-02 -6.7257982492446899e-01 - <_> - - 0 -1 854 -9.5818340778350830e-03 - - 3.5280853509902954e-01 -1.5295246243476868e-01 - <_> - - 0 -1 155 2.3029895499348640e-02 - - 8.0654025077819824e-02 -6.6331261396408081e-01 - <_> - - 0 -1 63 8.3062853664159775e-03 - - -1.8261365592479706e-01 2.9241952300071716e-01 - <_> - - 0 -1 166 1.2940693646669388e-02 - - 6.2763690948486328e-02 -7.9858863353729248e-01 - <_> - - 0 -1 855 4.5793736353516579e-03 - - -1.6761651635169983e-01 2.8498283028602600e-01 - <_> - - 0 -1 639 3.1311963684856892e-03 - - 6.4963281154632568e-02 -7.1869355440139771e-01 - <_> - - 0 -1 438 6.2793528195470572e-04 - - -1.4610730111598969e-01 3.1872764229774475e-01 + -1.2938241660594940e-01 3.5665917396545410e-01 <_> - 47 - -1.8195210695266724e+00 + 26 + -1.4103703498840332e+00 <_> - 0 -1 389 2.8032548725605011e-02 + 0 -1 532 -1.0988018475472927e-02 - 3.9794921875000000e-02 7.6527571678161621e-01 + 6.4358645677566528e-01 -2.3149165511131287e-01 <_> - 0 -1 512 -1.3777698390185833e-02 + 0 -1 750 -7.8163212165236473e-03 - 4.8011425137519836e-01 -2.0891545712947845e-01 + 5.4850798845291138e-01 -1.7881108820438385e-01 <_> - 0 -1 768 -1.5191626735031605e-03 + 0 -1 289 7.1337133646011353e-02 - 4.3561527132987976e-01 -1.9825626909732819e-01 + -1.7631703615188599e-01 4.5873588323593140e-01 <_> - 0 -1 234 5.4982006549835205e-02 + 0 -1 549 5.2656695246696472e-02 - -1.9595552980899811e-01 5.1033991575241089e-01 + -1.3836050033569336e-01 5.6253266334533691e-01 <_> - 0 -1 2 -3.8968096487224102e-03 + 0 -1 8 1.5166129916906357e-02 - 3.6698764562606812e-01 -2.1704223752021790e-01 + -2.0990008115768433e-01 4.0483391284942627e-01 <_> - 0 -1 875 -1.0689822956919670e-02 + 0 -1 970 -1.4538960531353951e-03 - 5.7506144046783447e-01 -1.2323237210512161e-01 + 3.3692672848701477e-01 -2.1745139360427856e-01 <_> - 0 -1 423 -3.6211537662893534e-03 + 0 -1 875 1.1136244982481003e-02 - 3.9189809560775757e-01 -2.0496053993701935e-01 + -1.5003634989261627e-01 5.2208083868026733e-01 <_> - 0 -1 368 -5.6232484057545662e-03 + 0 -1 925 -3.3187635708600283e-03 - -7.0911335945129395e-01 8.9780956506729126e-02 + 3.9145255088806152e-01 -1.9418042898178101e-01 <_> - 0 -1 311 7.6950237154960632e-02 + 0 -1 485 4.9791105091571808e-02 - -1.6086885333061218e-01 3.9858064055442810e-01 + -1.0192432254552841e-01 5.4612094163894653e-01 <_> - 0 -1 211 -9.4812046736478806e-03 + 0 -1 828 4.3476112186908722e-02 - 4.4439849257469177e-01 -1.4388205111026764e-01 + -1.2768918275833130e-01 5.0825607776641846e-01 <_> - 0 -1 637 4.8636407591402531e-03 + 0 -1 719 -2.8149634599685669e-03 - 8.3068624138832092e-02 -7.4362516403198242e-01 + -7.0453292131423950e-01 1.2536850571632385e-01 <_> - 0 -1 616 -2.9443078674376011e-03 + 0 -1 846 1.6101204091683030e-03 - -6.1576569080352783e-01 8.1917040050029755e-02 + -2.6965174078941345e-01 2.2737979888916016e-01 <_> - 0 -1 573 -2.0938962697982788e-03 + 0 -1 715 -1.5866891480982304e-03 - -5.7727062702178955e-01 9.1147974133491516e-02 + -6.6891485452651978e-01 1.1686278134584427e-01 <_> - 0 -1 796 2.7704227250069380e-03 + 0 -1 677 -3.2338392920792103e-03 - -1.9285553693771362e-01 3.1007087230682373e-01 + -6.7284232378005981e-01 6.6228114068508148e-02 <_> - 0 -1 386 1.2979362159967422e-02 + 0 -1 479 -9.9909156560897827e-03 - -1.4128974080085754e-01 3.8875201344490051e-01 + 3.6961549520492554e-01 -1.5993835031986237e-01 <_> - 0 -1 61 -1.1832339689135551e-02 + 0 -1 350 4.8409838229417801e-02 - -7.8204095363616943e-01 7.2949714958667755e-02 + -1.0068884491920471e-01 5.0648134946823120e-01 <_> - 0 -1 265 3.3956445753574371e-02 + 0 -1 273 8.0585200339555740e-03 - -1.3892538845539093e-01 3.9772579073905945e-01 + -1.6782654821872711e-01 3.5382467508316040e-01 <_> - 0 -1 650 4.9063982442021370e-03 + 0 -1 338 -1.1718695983290672e-02 - 8.1131778657436371e-02 -7.2757917642593384e-01 + 4.3832498788833618e-01 -1.2780784070491791e-01 <_> - 0 -1 649 -2.3896694183349609e-03 + 0 -1 594 5.7147610932588577e-03 - -6.3438212871551514e-01 7.6958425343036652e-02 + 7.5814604759216309e-02 -7.2597140073776245e-01 <_> - 0 -1 27 2.7626976370811462e-02 + 0 -1 603 -2.0917234942317009e-03 - -1.7219249904155731e-01 3.7336668372154236e-01 + -6.0916984081268311e-01 8.4811411798000336e-02 <_> - 0 -1 539 3.9899977855384350e-03 + 0 -1 855 5.7651996612548828e-03 - 7.0482976734638214e-02 -6.6334074735641479e-01 + -1.9243443012237549e-01 2.8976503014564514e-01 <_> - 0 -1 503 -1.3984958641231060e-03 + 0 -1 565 -2.8093710541725159e-02 - 4.2500507831573486e-01 -1.2214981764554977e-01 + 5.4229170083999634e-01 -1.0005526244640350e-01 <_> - 0 -1 878 1.3496846659108996e-03 + 0 -1 136 8.9291334152221680e-03 - -1.1209741979837418e-01 4.0830954909324646e-01 + 8.3808921277523041e-02 -6.3219338655471802e-01 <_> - 0 -1 709 -3.9141997694969177e-03 + 0 -1 268 -5.1958961412310600e-03 - -5.3290998935699463e-01 9.4373866915702820e-02 + -5.4964137077331543e-01 7.9588212072849274e-02 <_> - 0 -1 153 4.9622595310211182e-02 + 0 -1 95 9.2318728566169739e-03 - -9.4219848513603210e-02 4.9830704927444458e-01 + -1.2818163633346558e-01 4.2056322097778320e-01 <_> - 0 -1 89 -6.2201134860515594e-02 + 0 -1 964 -2.0556427538394928e-02 - 5.1749163866043091e-01 -9.4065755605697632e-02 - <_> - - 0 -1 100 -9.0873138979077339e-03 - - -6.6816878318786621e-01 7.1877375245094299e-02 - <_> - - 0 -1 142 7.8745372593402863e-03 - - 6.2571905553340912e-02 -6.6562908887863159e-01 - <_> - - 0 -1 489 6.6907280124723911e-03 - - -1.0588129609823227e-01 4.0728682279586792e-01 - <_> - - 0 -1 811 8.9093092828989029e-03 - - -1.3461567461490631e-01 3.1837779283523560e-01 - <_> - - 0 -1 908 3.9681773632764816e-03 - - 7.1942776441574097e-02 -6.0182863473892212e-01 - <_> - - 0 -1 547 1.1530296877026558e-02 - - -1.2775546312332153e-01 3.0782708525657654e-01 - <_> - - 0 -1 497 -3.0327122658491135e-02 - - 3.6777910590171814e-01 -1.4219322800636292e-01 - <_> - - 0 -1 765 -8.5609289817512035e-04 - - 2.3868902027606964e-01 -1.7458973824977875e-01 - <_> - - 0 -1 30 -8.7312739342451096e-03 - - -5.7229250669479370e-01 6.7568361759185791e-02 - <_> - - 0 -1 515 3.6238119006156921e-02 - - -9.3856818974018097e-02 4.3806123733520508e-01 - <_> - - 0 -1 859 -1.7243899405002594e-02 - - 3.2672104239463806e-01 -1.2465524673461914e-01 - <_> - - 0 -1 571 3.0146117787808180e-03 - - 8.4438301622867584e-02 -4.7965818643569946e-01 - <_> - - 0 -1 390 -6.5812864340841770e-03 - - -6.5075701475143433e-01 5.2506592124700546e-02 - <_> - - 0 -1 379 -2.6519154198467731e-03 - - 3.9998021721839905e-01 -1.2199153006076813e-01 - <_> - - 0 -1 336 2.2568926215171814e-03 - - -1.1875165253877640e-01 3.6033150553703308e-01 - <_> - - 0 -1 342 7.8723561018705368e-03 - - 6.2930762767791748e-02 -7.2076427936553955e-01 - <_> - - 0 -1 826 5.7557085528969765e-04 - - -1.9064085185527802e-01 1.9888252019882202e-01 - <_> - - 0 -1 197 -4.9874491989612579e-02 - - 3.3844900131225586e-01 -1.0514739900827408e-01 - <_> - - 0 -1 934 -5.1496019586920738e-03 - - 2.3594251275062561e-01 -1.7097522318363190e-01 - <_> - - 0 -1 800 -4.2706914246082306e-03 - - 3.9194715023040771e-01 -9.3349114060401917e-02 - <_> - - 0 -1 493 -1.0737263411283493e-01 - - 5.6014204025268555e-01 -6.5082974731922150e-02 + 3.2048463821411133e-01 -1.3858842849731445e-01 <_> - 54 - -1.6577893495559692e+00 + 35 + -1.4265209436416626e+00 <_> - 0 -1 508 -9.3684419989585876e-03 + 0 -1 683 1.8821602687239647e-02 - 7.2173911333084106e-01 -1.8106427043676376e-02 + -1.7807419598102570e-01 5.9040957689285278e-01 <_> - 0 -1 255 1.2989062815904617e-03 + 0 -1 471 -9.5066539943218231e-03 - -2.0532198250293732e-01 4.2473095655441284e-01 + 5.0587177276611328e-01 -1.7767964303493500e-01 <_> - 0 -1 795 3.6645986139774323e-02 + 0 -1 884 1.3296608813107014e-03 - -1.6229844093322754e-01 5.1024991273880005e-01 + -1.6886346042156219e-01 3.6326614022254944e-01 <_> - 0 -1 163 7.4745947495102882e-03 + 0 -1 473 3.5266026854515076e-02 - -2.5622242689132690e-01 3.1706622242927551e-01 + -1.1824090778827667e-01 5.8951085805892944e-01 <_> - 0 -1 812 -6.4315330237150192e-03 + 0 -1 340 1.7804209142923355e-02 - 3.1292220950126648e-01 -2.2839428484439850e-01 + -1.4211210608482361e-01 5.1762068271636963e-01 <_> - 0 -1 341 3.9290782064199448e-02 + 0 -1 1001 4.7029324923641980e-04 - -1.3426035642623901e-01 5.8237910270690918e-01 + -2.4296821653842926e-01 2.5087893009185791e-01 <_> - 0 -1 459 7.8858569264411926e-02 + 0 -1 182 7.1838246658444405e-03 - -1.5872669219970703e-01 4.5478171110153198e-01 + 9.2609666287899017e-02 -6.7694115638732910e-01 <_> - 0 -1 528 -2.8797138482332230e-02 + 0 -1 390 -5.7565318420529366e-03 - 5.3397864103317261e-01 -1.1107259988784790e-01 + -7.3053181171417236e-01 8.2794629037380219e-02 <_> - 0 -1 376 -1.0816241614520550e-02 + 0 -1 203 2.0850602537393570e-02 - 4.7242766618728638e-01 -9.8347179591655731e-02 + -1.7353208363056183e-01 3.3287450671195984e-01 <_> - 0 -1 5 2.8447926044464111e-02 + 0 -1 805 3.1848326325416565e-03 - -1.5696190297603607e-01 3.9995491504669189e-01 + -2.0941653847694397e-01 2.6059800386428833e-01 <_> - 0 -1 594 -4.1472744196653366e-03 + 0 -1 234 -7.5752258300781250e-02 - -6.5492427349090576e-01 8.9378200471401215e-02 + 5.1588213443756104e-01 -1.0057342052459717e-01 <_> - 0 -1 780 3.7436613347381353e-03 + 0 -1 5 2.8725115582346916e-02 - -1.6716095805168152e-01 2.9251593351364136e-01 + -1.5012685954570770e-01 4.1436919569969177e-01 <_> - 0 -1 958 6.8116746842861176e-03 + 0 -1 175 -1.7325732856988907e-02 - 8.5507057607173920e-02 -6.0906678438186646e-01 + 3.8678762316703796e-01 -1.3586300611495972e-01 <_> - 0 -1 128 4.9823587760329247e-03 + 0 -1 47 -3.2187681645154953e-03 - 6.6678501665592194e-02 -5.8637374639511108e-01 + -5.1590150594711304e-01 1.1511231958866119e-01 <_> - 0 -1 401 4.1811540722846985e-03 + 0 -1 1020 -6.1595086008310318e-03 - -1.0231449455022812e-01 4.5615595579147339e-01 + -7.0271849632263184e-01 5.5648274719715118e-02 <_> - 0 -1 162 -1.0445066727697849e-02 + 0 -1 768 -8.7264683097600937e-03 - -7.6294642686843872e-01 5.7752605527639389e-02 + 2.6393634080886841e-01 -1.8446569144725800e-01 <_> - 0 -1 315 -6.1920420266687870e-03 + 0 -1 57 8.1868227571249008e-03 - -6.6523051261901855e-01 5.2041802555322647e-02 + 8.0838531255722046e-02 -5.5512112379074097e-01 <_> - 0 -1 925 -2.3358925245702267e-03 + 0 -1 139 -7.8468751162290573e-03 - 3.2779076695442200e-01 -1.3041152060031891e-01 + -5.7306796312332153e-01 8.3454042673110962e-02 <_> - 0 -1 314 -5.6658107787370682e-03 + 0 -1 665 2.9962153639644384e-03 - -6.8133842945098877e-01 5.6511644273996353e-02 + 6.2645487487316132e-02 -5.8123600482940674e-01 <_> - 0 -1 819 -1.0911209508776665e-02 + 0 -1 414 -4.3795984238386154e-03 - 3.3160626888275146e-01 -1.2574554979801178e-01 + 2.2211562097072601e-01 -1.9649308919906616e-01 <_> - 0 -1 765 -1.7958178650587797e-03 + 0 -1 908 -6.3172029331326485e-03 - 3.0492588877677917e-01 -1.5025834739208221e-01 + -6.6067039966583252e-01 6.4884319901466370e-02 <_> - 0 -1 961 -4.0859095752239227e-03 + 0 -1 465 1.3302030274644494e-03 - -5.3059929609298706e-01 7.3518328368663788e-02 + -1.0496762394905090e-01 4.2326071858406067e-01 <_> - 0 -1 232 -2.0980034023523331e-02 + 0 -1 951 -4.3333107605576515e-03 - 3.0610927939414978e-01 -1.2851184606552124e-01 + -4.9972066283226013e-01 8.7225496768951416e-02 <_> - 0 -1 452 -7.3018344119191170e-03 + 0 -1 244 -3.5346355289220810e-03 - 3.7514328956604004e-01 -1.2826474010944366e-01 + 3.0818134546279907e-01 -1.4765550196170807e-01 <_> - 0 -1 465 -2.9183469712734222e-02 + 0 -1 256 -8.7353587150573730e-03 - 4.8722788691520691e-01 -8.4734588861465454e-02 + -6.5214675664901733e-01 7.1881487965583801e-02 <_> - 0 -1 609 4.1865529492497444e-03 + 0 -1 491 -1.5620354562997818e-02 - 7.4395999312400818e-02 -5.8252948522567749e-01 + 3.5721915960311890e-01 -1.1427627503871918e-01 <_> - 0 -1 662 -1.3149678707122803e-02 + 0 -1 778 -3.9745438843965530e-03 - 2.9923921823501587e-01 -1.3687820732593536e-01 + -6.6090464591979980e-01 6.2067609280347824e-02 <_> - 0 -1 209 2.3594651371240616e-02 + 0 -1 689 -6.7040426656603813e-03 - 6.2197674065828323e-02 -6.3622504472732544e-01 + 2.7337384223937988e-01 -1.4059108495712280e-01 <_> - 0 -1 630 -1.7678245902061462e-02 + 0 -1 125 3.5359347239136696e-03 - 3.3281046152114868e-01 -1.2175620347261429e-01 + 6.1201948672533035e-02 -6.0017114877700806e-01 <_> - 0 -1 544 -1.0656865313649178e-02 + 0 -1 118 6.0818484053015709e-03 - 3.7733754515647888e-01 -1.0491474717855453e-01 + -1.5247075259685516e-01 2.4383027851581573e-01 <_> - 0 -1 710 5.6399200111627579e-03 + 0 -1 880 -7.2771648410707712e-04 - 5.4276369512081146e-02 -7.2659504413604736e-01 + 3.0065426230430603e-01 -1.2037902325391769e-01 <_> - 0 -1 536 5.9759367257356644e-02 + 0 -1 643 4.6168416738510132e-03 - -9.3571089208126068e-02 4.3768402934074402e-01 + 5.5311698466539383e-02 -7.5343269109725952e-01 <_> - 0 -1 836 1.5957858413457870e-03 + 0 -1 676 2.5280299596488476e-03 - -7.4856951832771301e-02 4.6114641427993774e-01 + 5.7204965502023697e-02 -5.3993463516235352e-01 <_> - 0 -1 331 -3.4797050058841705e-02 + 0 -1 878 1.5074670314788818e-02 - 4.3322169780731201e-01 -1.0314103215932846e-01 + -9.6106290817260742e-02 3.9084190130233765e-01 <_> - 0 -1 357 7.0810377597808838e-02 + 0 -1 831 -8.4932018071413040e-03 - -1.3931407034397125e-01 2.7839028835296631e-01 - <_> - - 0 -1 688 1.0995890479534864e-03 - - 8.2519724965095520e-02 -4.6114745736122131e-01 - <_> - - 0 -1 271 1.1323073413223028e-03 - - -1.1879909038543701e-01 3.1659367680549622e-01 - <_> - - 0 -1 59 2.5819817557930946e-02 - - -1.0563226789236069e-01 3.3343997597694397e-01 - <_> - - 0 -1 127 -3.0109258368611336e-03 - - -4.3363004922866821e-01 9.0100899338722229e-02 - <_> - - 0 -1 738 6.4696911722421646e-03 - - 4.3469883501529694e-02 -6.7987263202667236e-01 - <_> - - 0 -1 659 1.6815876588225365e-02 - - -9.4611480832099915e-02 3.5600626468658447e-01 - <_> - - 0 -1 642 -1.0637525469064713e-02 - - 1.9808849692344666e-01 -1.5571328997612000e-01 - <_> - - 0 -1 433 -4.1952659375965595e-03 - - -5.3476226329803467e-01 6.5039873123168945e-02 - <_> - - 0 -1 442 -1.5134566929191351e-03 - - 4.2552566528320312e-01 -8.3483003079891205e-02 - <_> - - 0 -1 375 -1.1657587019726634e-03 - - 2.4901403486728668e-01 -1.2862072885036469e-01 - <_> - - 0 -1 495 5.2369404584169388e-03 - - 5.4264735430479050e-02 -6.5448409318923950e-01 - <_> - - 0 -1 325 3.1857702415436506e-03 - - -1.0423248261213303e-01 3.4729331731796265e-01 - <_> - - 0 -1 468 3.2315873540937901e-03 - - 7.3592320084571838e-02 -4.5663174986839294e-01 - <_> - - 0 -1 61 8.1546325236558914e-03 - - 5.8343004435300827e-02 -4.7462043166160583e-01 - <_> - - 0 -1 261 1.2796278111636639e-02 - - -1.0276926308870316e-01 3.4186348319053650e-01 - <_> - - 0 -1 321 -2.3663226515054703e-02 - - 2.8974771499633789e-01 -1.2335656583309174e-01 - <_> - - 0 -1 648 -1.9080806523561478e-03 - - -7.0497012138366699e-01 5.8831237256526947e-02 - <_> - - 0 -1 633 3.0501103028655052e-03 - - 5.1351051777601242e-02 -5.2438431978225708e-01 - <_> - - 0 -1 204 -4.1300453245639801e-02 - - -4.2261663079261780e-01 6.5464369952678680e-02 + 3.4130987524986267e-01 -1.4117397367954254e-01 <_> - 66 - -1.6743642091751099e+00 + 37 + -1.3977209329605103e+00 <_> - 0 -1 699 1.3901394791901112e-02 + 0 -1 794 -2.5338861159980297e-03 - 4.2875479906797409e-02 7.1057194471359253e-01 + 5.7321399450302124e-01 -2.0396080613136292e-01 <_> - 0 -1 444 -1.0640731081366539e-02 + 0 -1 588 -6.5112011507153511e-03 - 5.9900563955307007e-01 -1.4475977420806885e-01 + 3.7378740310668945e-01 -2.5049039721488953e-01 <_> - 0 -1 763 -4.2351996526122093e-03 + 0 -1 238 1.6318978741765022e-03 - 4.9660456180572510e-01 -1.1618923395872116e-01 + -2.1858637034893036e-01 3.5027471184730530e-01 <_> - 0 -1 834 1.3073073700070381e-02 + 0 -1 189 3.3452022820711136e-02 - -1.6428959369659424e-01 5.0240677595138550e-01 + -1.4827065169811249e-01 4.7324529290199280e-01 <_> - 0 -1 879 -5.0384560599923134e-03 + 0 -1 192 -1.1114047840237617e-02 - 4.1822317242622375e-01 -1.4690572023391724e-01 + 4.1662359237670898e-01 -2.1660456061363220e-01 <_> - 0 -1 443 1.2402677675709128e-03 + 0 -1 527 -1.2996498262509704e-03 - -2.0295573770999908e-01 2.7518931031227112e-01 + 4.7613915801048279e-01 -1.6742442548274994e-01 <_> - 0 -1 688 -1.8025336321443319e-03 + 0 -1 648 -3.2986078877002001e-03 - -7.3610079288482666e-01 7.6008267700672150e-02 + -6.7662662267684937e-01 8.6653761565685272e-02 <_> - 0 -1 282 9.2999219894409180e-02 + 0 -1 4 6.6831205040216446e-03 - -1.4368277788162231e-01 3.3687326312065125e-01 + -2.0158858597278595e-01 2.6189696788787842e-01 <_> - 0 -1 293 2.1399226039648056e-02 + 0 -1 482 2.1282089874148369e-03 - -1.6605213284492493e-01 3.0147713422775269e-01 + -1.1156299710273743e-01 4.0097075700759888e-01 <_> - 0 -1 703 9.3348361551761627e-03 + 0 -1 682 -9.0472139418125153e-03 - -1.6568347811698914e-01 3.0875685811042786e-01 + 3.2078295946121216e-01 -1.6775439679622650e-01 <_> - 0 -1 382 -5.8921691961586475e-03 + 0 -1 226 -5.3160609677433968e-03 - -5.6214910745620728e-01 8.5347160696983337e-02 + -5.5567348003387451e-01 1.2950280308723450e-01 <_> - 0 -1 260 -1.4118023682385683e-03 + 0 -1 205 7.9724024981260300e-03 - 2.6530963182449341e-01 -1.8439114093780518e-01 + -2.1466700732707977e-01 2.2514854371547699e-01 <_> - 0 -1 360 -1.1060921475291252e-02 + 0 -1 920 -2.1980279125273228e-03 - 2.5005301833152771e-01 -1.7930330336093903e-01 + 2.8711742162704468e-01 -1.6561916470527649e-01 <_> - 0 -1 751 -3.8227883633226156e-03 + 0 -1 312 5.3897619247436523e-02 - -6.9963920116424561e-01 6.4229309558868408e-02 + -1.4823001623153687e-01 3.4951418638229370e-01 <_> - 0 -1 900 -8.4845684468746185e-03 + 0 -1 13 -7.6241128146648407e-02 - -6.6004335880279541e-01 5.2848633378744125e-02 + 6.0101884603500366e-01 -8.8328786194324493e-02 <_> - 0 -1 21 6.9843865931034088e-03 + 0 -1 129 -8.3202747628092766e-03 - 5.5426578968763351e-02 -6.1068946123123169e-01 + -7.2828358411788940e-01 8.7956465780735016e-02 <_> - 0 -1 952 4.8600544687360525e-04 + 0 -1 401 5.3778752684593201e-02 - -1.8981190025806427e-01 2.1059055626392365e-01 + -1.0316975414752960e-01 5.0247919559478760e-01 <_> - 0 -1 111 3.5324528813362122e-02 + 0 -1 416 -1.2401826679706573e-02 - -8.3993434906005859e-02 5.1941823959350586e-01 + 2.7538898587226868e-01 -1.5569972991943359e-01 <_> - 0 -1 97 3.9002462290227413e-03 + 0 -1 986 1.3729928061366081e-02 - 7.6367795467376709e-02 -5.7813030481338501e-01 + -1.3373774290084839e-01 3.0739122629165649e-01 <_> - 0 -1 374 -4.5398771762847900e-03 + 0 -1 905 -2.2788168862462044e-03 - 3.3430457115173340e-01 -1.2331557273864746e-01 + 2.2555501759052277e-01 -1.9497908651828766e-01 <_> - 0 -1 652 -3.1904221978038549e-03 + 0 -1 667 3.6288173869252205e-03 - -5.5545800924301147e-01 7.3627986013889313e-02 + 4.8981692641973495e-02 -7.9248648881912231e-01 <_> - 0 -1 14 -7.7975630760192871e-02 + 0 -1 85 5.2453137934207916e-02 - 4.8881098628044128e-01 -8.1377774477005005e-02 + -1.3389803469181061e-01 3.2700663805007935e-01 <_> - 0 -1 7 -1.1978685855865479e-02 + 0 -1 821 3.1685843132436275e-03 - 2.7509516477584839e-01 -1.6613669693470001e-01 + -1.4415425062179565e-01 2.8044179081916809e-01 <_> - 0 -1 29 -8.3151785656809807e-03 + 0 -1 193 8.9051481336355209e-03 - -5.9314393997192383e-01 7.2014525532722473e-02 + 6.1227656900882721e-02 -7.0277702808380127e-01 <_> - 0 -1 466 1.3827871531248093e-02 + 0 -1 837 -1.3966157566756010e-03 - -1.2803319096565247e-01 2.9465702176094055e-01 + 4.2409667372703552e-01 -1.0888981819152832e-01 <_> - 0 -1 356 2.0103808492422104e-02 + 0 -1 271 -6.7695947363972664e-03 - 6.9175720214843750e-02 -5.6205666065216064e-01 + -5.1588076353073120e-01 8.3254821598529816e-02 <_> - 0 -1 530 -4.7183044254779816e-02 + 0 -1 404 2.2157761268317699e-03 - 3.6449643969535828e-01 -1.0480687767267227e-01 + -1.3696527481079102e-01 2.8638482093811035e-01 <_> - 0 -1 613 9.7303036600351334e-03 + 0 -1 619 2.7808796148747206e-03 - -9.7578004002571106e-02 3.6821505427360535e-01 + 7.1316704154014587e-02 -6.0322999954223633e-01 <_> - 0 -1 667 -3.9133569225668907e-03 + 0 -1 515 4.5836241915822029e-03 - -5.1443296670913696e-01 7.2868466377258301e-02 + -1.2486589699983597e-01 3.2929363846778870e-01 <_> - 0 -1 666 3.0236630700528622e-03 + 0 -1 1042 -5.1459800451993942e-03 - 5.5799212306737900e-02 -5.3572463989257812e-01 + -5.3781992197036743e-01 7.6631128787994385e-02 <_> - 0 -1 304 4.3436158448457718e-03 + 0 -1 1043 2.4449056945741177e-03 - -1.5579865872859955e-01 2.0468661189079285e-01 + 8.5920669138431549e-02 -4.0670683979988098e-01 <_> - 0 -1 51 1.4063127338886261e-02 + 0 -1 71 -2.7756379917263985e-02 - 3.6827385425567627e-02 -8.5656464099884033e-01 + 3.7449231743812561e-01 -1.0538945347070694e-01 <_> - 0 -1 842 1.3388927327468991e-03 + 0 -1 809 -1.8243372440338135e-02 - -1.2769578397274017e-01 2.8884974122047424e-01 + 3.4281516075134277e-01 -9.9502928555011749e-02 <_> - 0 -1 791 -1.0684424778446555e-03 + 0 -1 372 3.8416781462728977e-03 - 3.4348404407501221e-01 -9.6543140709400177e-02 + 7.3987491428852081e-02 -4.8903524875640869e-01 <_> - 0 -1 779 -2.3754546418786049e-03 + 0 -1 376 -1.2322908267378807e-02 - -5.2730453014373779e-01 6.6801987588405609e-02 + 2.1036790311336517e-01 -1.5852701663970947e-01 <_> - 0 -1 549 -4.5106699690222740e-03 + 0 -1 391 -4.1760304011404514e-03 - -5.4066735506057739e-01 5.1074951887130737e-02 + 3.1288132071495056e-01 -1.1697492748498917e-01 <_> - 0 -1 487 5.6549627333879471e-03 + 0 -1 859 -2.8026863932609558e-02 - -9.0248994529247284e-02 3.5249757766723633e-01 - <_> - - 0 -1 494 -3.3719413913786411e-03 - - 2.8907671570777893e-01 -1.1475016921758652e-01 - <_> - - 0 -1 135 1.2221395969390869e-02 - - -1.0579165816307068e-01 3.0012521147727966e-01 - <_> - - 0 -1 79 3.2931473106145859e-03 - - 7.7675424516201019e-02 -4.1641706228256226e-01 - <_> - - 0 -1 79 -3.7331613712012768e-03 - - -4.6958047151565552e-01 7.6012723147869110e-02 - <_> - - 0 -1 15 -3.0090190470218658e-02 - - -6.2376546859741211e-01 4.4617597013711929e-02 - <_> - - 0 -1 538 -1.1998139321804047e-02 - - 3.4000751376152039e-01 -9.7472421824932098e-02 - <_> - - 0 -1 592 2.5055123493075371e-02 - - -7.5190685689449310e-02 4.1993573307991028e-01 - <_> - - 0 -1 233 9.7161782905459404e-03 - - 5.5982969701290131e-02 -6.0615026950836182e-01 - <_> - - 0 -1 198 -8.3486355841159821e-02 - - 3.7426739931106567e-01 -8.7825424969196320e-02 - <_> - - 0 -1 110 3.8952599279582500e-03 - - -1.3330259919166565e-01 2.6031884551048279e-01 - <_> - - 0 -1 648 -9.8262424580752850e-04 - - -3.9980980753898621e-01 8.2922257483005524e-02 - <_> - - 0 -1 58 8.4215197712182999e-03 - - -1.3371372222900391e-01 2.4220858514308929e-01 - <_> - - 0 -1 287 1.2292047031223774e-03 - - -7.7718295156955719e-02 3.8342806696891785e-01 - <_> - - 0 -1 682 -1.2375478632748127e-02 - - 2.3885957896709442e-01 -1.2220640480518341e-01 - <_> - - 0 -1 292 5.4268687963485718e-03 - - 5.5337987840175629e-02 -5.6287312507629395e-01 - <_> - - 0 -1 418 -5.5062575265765190e-03 - - -5.7845181226730347e-01 4.2599424719810486e-02 - <_> - - 0 -1 614 1.0439271107316017e-02 - - -8.1215575337409973e-02 3.8115817308425903e-01 - <_> - - 0 -1 296 -2.6399283669888973e-03 - - -4.5001742243766785e-01 6.7338116466999054e-02 - <_> - - 0 -1 898 2.6166734751313925e-03 - - 5.5316500365734100e-02 -4.4958963990211487e-01 - <_> - - 0 -1 759 5.4496107622981071e-03 - - -8.1449449062347412e-02 3.8300925493240356e-01 - <_> - - 0 -1 762 3.4203347750008106e-03 - - -8.8027402758598328e-02 3.0551746487617493e-01 - <_> - - 0 -1 19 9.3909027054905891e-03 - - 5.8738458901643753e-02 -4.9437648057937622e-01 - <_> - - 0 -1 276 9.6318572759628296e-03 - - -1.0816254466772079e-01 2.7723982930183411e-01 - <_> - - 0 -1 87 1.9004285335540771e-02 - - -8.2863554358482361e-02 3.1288793683052063e-01 - <_> - - 0 -1 580 -8.5283098742365837e-03 - - 2.9951119422912598e-01 -8.9406743645668030e-02 - <_> - - 0 -1 242 6.2621399760246277e-02 - - -1.0106554627418518e-01 2.6782277226448059e-01 - <_> - - 0 -1 372 1.5604515559971333e-02 - - -1.0081429034471512e-01 2.9597061872482300e-01 - <_> - - 0 -1 351 1.3034233450889587e-01 - - -8.0539934337139130e-02 3.4444472193717957e-01 - <_> - - 0 -1 53 4.5186877250671387e-02 - - 5.8131664991378784e-02 -5.4693692922592163e-01 + 3.3711743354797363e-01 -1.2294299900531769e-01 <_> - 72 - -1.6700928211212158e+00 + 42 + -1.3775455951690674e+00 <_> - 0 -1 763 -2.0017849747091532e-03 + 0 -1 725 1.3382414355874062e-02 - 6.7056620121002197e-01 1.8883759155869484e-02 + -1.7922241985797882e-01 5.0368404388427734e-01 <_> - 0 -1 508 -1.5712467953562737e-02 + 0 -1 967 1.9935802556574345e-03 - 5.8154827356338501e-01 -1.4273743331432343e-01 + -2.5249919295310974e-01 3.5295018553733826e-01 <_> - 0 -1 146 2.4972280953079462e-03 + 0 -1 891 -1.3569685397669673e-03 - -1.8454430997371674e-01 3.4281551837921143e-01 + 4.1222429275512695e-01 -1.8140394985675812e-01 <_> - 0 -1 824 5.7405559346079826e-03 + 0 -1 911 2.5418698787689209e-03 - -1.7856663465499878e-01 5.1571351289749146e-01 + -2.3195247352123260e-01 2.5945317745208740e-01 <_> - 0 -1 869 8.1182969734072685e-04 + 0 -1 362 1.1867792345583439e-03 - -2.6075574755668640e-01 2.2161382436752319e-01 + -1.1509010195732117e-01 4.0095508098602295e-01 <_> - 0 -1 889 1.9957972690463066e-03 + 0 -1 280 -4.0491363033652306e-03 - -1.6690193116664886e-01 3.1083983182907104e-01 + -7.6275551319122314e-01 8.0663219094276428e-02 <_> - 0 -1 943 7.9797822982072830e-03 + 0 -1 264 2.4698153138160706e-02 - -1.7903617024421692e-01 2.7573335170745850e-01 + -9.9053405225276947e-02 4.6469488739967346e-01 <_> - 0 -1 733 1.0206390172243118e-02 + 0 -1 832 1.3041709549725056e-02 - -9.3843363225460052e-02 5.3358590602874756e-01 + -1.3049817085266113e-01 4.7066822648048401e-01 <_> - 0 -1 388 3.4904260188341141e-02 + 0 -1 257 -2.0927201956510544e-02 - -8.6874812841415405e-02 5.0340282917022705e-01 + -7.2363191843032837e-01 7.5520738959312439e-02 <_> - 0 -1 564 -3.8090778980404139e-03 + 0 -1 41 1.6108792275190353e-02 - 2.3382174968719482e-01 -1.7857478559017181e-01 + 8.9385204017162323e-02 -5.0678378343582153e-01 <_> - 0 -1 160 2.0690055098384619e-03 + 0 -1 872 -8.6308103054761887e-03 - -1.8347945809364319e-01 2.1276330947875977e-01 + 3.1878158450126648e-01 -1.3526505231857300e-01 <_> - 0 -1 367 -1.3203858397901058e-02 + 0 -1 347 1.2651814613491297e-03 - 3.0799895524978638e-01 -1.0921970754861832e-01 + -1.2344279885292053e-01 4.0271109342575073e-01 <_> - 0 -1 91 1.6044422984123230e-02 + 0 -1 735 -3.0170590616762638e-03 - -1.2722490727901459e-01 3.5042104125022888e-01 + -5.6960099935531616e-01 7.0437252521514893e-02 <_> - 0 -1 52 -2.8435707092285156e-02 + 0 -1 538 -3.5529488231986761e-03 - -6.9257086515426636e-01 6.0832630842924118e-02 + 2.0624065399169922e-01 -1.8426756560802460e-01 <_> - 0 -1 593 -3.5719089210033417e-03 + 0 -1 735 2.8021419420838356e-03 - -6.1009460687637329e-01 5.5150210857391357e-02 + 7.2748780250549316e-02 -5.3796368837356567e-01 <_> - 0 -1 526 -3.3032532781362534e-02 + 0 -1 447 -9.9331419914960861e-04 - 3.9706656336784363e-01 -1.0905303061008453e-01 + 2.4827398359775543e-01 -1.5866567194461823e-01 <_> - 0 -1 863 -3.4918042365461588e-03 + 0 -1 440 -7.1950745768845081e-03 - 2.2872641682624817e-01 -1.6809244453907013e-01 + -5.0943744182586670e-01 7.3041573166847229e-02 <_> - 0 -1 449 -1.2281725648790598e-03 + 0 -1 906 -8.7737981230020523e-03 - 2.8336051106452942e-01 -1.2107009440660477e-01 + 2.4838714301586151e-01 -1.5162147581577301e-01 <_> - 0 -1 268 1.5130165964365005e-02 + 0 -1 608 5.6750684976577759e-02 - 7.4081726372241974e-02 -5.0906944274902344e-01 + -8.4416143596172333e-02 4.4269657135009766e-01 <_> - 0 -1 342 -5.2624624222517014e-03 + 0 -1 772 1.8110256642103195e-03 - -5.1471787691116333e-01 5.6423079222440720e-02 + -1.7787678539752960e-01 2.2753682732582092e-01 <_> - 0 -1 438 1.3198424130678177e-03 + 0 -1 117 6.1733853071928024e-02 - -9.7633212804794312e-02 3.6938476562500000e-01 + -1.4452947676181793e-01 2.6785543560981750e-01 <_> - 0 -1 194 -3.9102118462324142e-03 + 0 -1 718 1.7999792471528053e-03 - -7.5149536132812500e-01 5.1220502704381943e-02 + 5.3869031369686127e-02 -7.0216673612594604e-01 <_> - 0 -1 235 7.7746850438416004e-03 + 0 -1 718 -1.7839821521192789e-03 - -1.6232925653457642e-01 2.0670217275619507e-01 + -7.3474282026290894e-01 4.3809492141008377e-02 <_> - 0 -1 555 -1.9946731626987457e-02 + 0 -1 795 -2.2269869223237038e-03 - 3.0092230439186096e-01 -9.9984362721443176e-02 + 2.5256577134132385e-01 -1.4765015244483948e-01 <_> - 0 -1 457 -4.9132145941257477e-03 + 0 -1 845 7.7408831566572189e-04 - 2.1954736113548279e-01 -1.6271042823791504e-01 + -1.6781617701053619e-01 2.5267890095710754e-01 <_> - 0 -1 970 -6.4505757763981819e-03 + 0 -1 710 9.6316616982221603e-03 - -4.9815052747726440e-01 6.7167595028877258e-02 + 5.8525908738374710e-02 -6.3684886693954468e-01 <_> - 0 -1 581 -6.7926600575447083e-02 + 0 -1 181 -1.1892126873135567e-02 - 4.3458208441734314e-01 -7.7230423688888550e-02 + 2.6363542675971985e-01 -1.4106634259223938e-01 <_> - 0 -1 789 -3.7927636876702309e-03 + 0 -1 326 4.8407237976789474e-02 - 2.6469963788986206e-01 -1.2098944932222366e-01 + -1.0837136209011078e-01 3.6018091440200806e-01 <_> - 0 -1 38 -2.7826299890875816e-02 + 0 -1 572 -1.0315750539302826e-01 - 2.9173719882965088e-01 -1.0972167551517487e-01 + -7.3309695720672607e-01 6.4976803958415985e-02 <_> - 0 -1 332 6.0029705055058002e-03 + 0 -1 415 -2.6544972788542509e-03 - -1.0543220490217209e-01 3.6175185441970825e-01 + 2.7709859609603882e-01 -1.3764445483684540e-01 <_> - 0 -1 972 1.4797106850892305e-03 + 0 -1 1033 -4.8850756138563156e-03 - 6.5247461199760437e-02 -5.3303873538970947e-01 + -5.0026285648345947e-01 6.8797707557678223e-02 <_> - 0 -1 102 9.7709074616432190e-03 + 0 -1 299 -1.1310833506286144e-02 - 3.5595752298831940e-02 -6.8972426652908325e-01 + 2.5653550028800964e-01 -1.3755545020103455e-01 <_> - 0 -1 874 4.5413424959406257e-04 + 0 -1 152 -3.8394361734390259e-02 - -1.7233507335186005e-01 1.6001893579959869e-01 + 2.6404461264610291e-01 -1.3614650070667267e-01 <_> - 0 -1 687 -1.4395804610103369e-03 + 0 -1 486 5.8298893272876740e-03 - -5.1606172323226929e-01 5.5443800985813141e-02 + 6.0382172465324402e-02 -5.9578329324722290e-01 <_> - 0 -1 25 -2.4502794444561005e-01 + 0 -1 393 2.2631133906543255e-03 - -8.0270200967788696e-01 2.9995493590831757e-02 + -1.0302778333425522e-01 3.4782779216766357e-01 <_> - 0 -1 410 4.2062443681061268e-03 + 0 -1 629 -1.8709234893321991e-02 - 5.0134483724832535e-02 -4.9082162976264954e-01 + -7.6758313179016113e-01 4.6181913465261459e-02 <_> - 0 -1 46 1.4561998657882214e-02 + 0 -1 67 3.7359733134508133e-02 - -1.2065179646015167e-01 2.4143299460411072e-01 + -1.3407541811466217e-01 2.5607112050056458e-01 <_> - 0 -1 74 -3.3104062080383301e-02 + 0 -1 504 -5.3099328652024269e-03 - 3.6770820617675781e-01 -7.8033976256847382e-02 + -6.9016355276107788e-01 4.7683756798505783e-02 <_> - 0 -1 463 3.2625906169414520e-02 + 0 -1 527 -1.5396323287859559e-03 - -8.5231229662895203e-02 3.3994022011756897e-01 + 3.7874689698219299e-01 -9.2663109302520752e-02 <_> - 0 -1 411 -1.1897137388586998e-02 + 0 -1 470 -2.6333518326282501e-03 - 2.6476562023162842e-01 -1.0443684458732605e-01 + 2.9358446598052979e-01 -1.2460695207118988e-01 <_> - 0 -1 816 5.7352259755134583e-03 + 0 -1 171 1.6515964642167091e-02 - 5.5395182222127914e-02 -5.1973640918731689e-01 + -1.4082725346088409e-01 2.3664724826812744e-01 <_> - 0 -1 170 -1.5062794089317322e-02 + 0 -1 681 -4.4658156111836433e-03 - -7.5300645828247070e-01 3.0149688944220543e-02 - <_> - - 0 -1 661 -7.9075228422880173e-03 - - 2.8287026286125183e-01 -1.0227695107460022e-01 - <_> - - 0 -1 394 3.2159998081624508e-03 - - -6.5929308533668518e-02 3.6590230464935303e-01 - <_> - - 0 -1 987 -2.5269058533012867e-03 - - -4.7419819235801697e-01 5.8165557682514191e-02 - <_> - - 0 -1 845 -1.8206760287284851e-03 - - 2.5627982616424561e-01 -1.1308469623327255e-01 - <_> - - 0 -1 66 1.4899271540343761e-02 - - 3.6266356706619263e-02 -7.6167815923690796e-01 - <_> - - 0 -1 965 3.8532419130206108e-03 - - 2.6696149259805679e-02 -7.5058454275131226e-01 - <_> - - 0 -1 723 -6.1673661693930626e-03 - - 3.5572922229766846e-01 -8.2323268055915833e-02 - <_> - - 0 -1 822 -7.0832269266247749e-03 - - 2.1490900218486786e-01 -1.3906964659690857e-01 - <_> - - 0 -1 724 3.5079419612884521e-03 - - 4.7017443925142288e-02 -6.3156962394714355e-01 - <_> - - 0 -1 878 1.2706735869869590e-03 - - -1.0659208893775940e-01 3.1986060738563538e-01 - <_> - - 0 -1 362 -3.0069730710238218e-03 - - -7.9292476177215576e-01 3.8936499506235123e-02 - <_> - - 0 -1 3 2.5489944964647293e-03 - - -1.4662979543209076e-01 2.0257341861724854e-01 - <_> - - 0 -1 151 2.7439245022833347e-03 - - -9.1609120368957520e-02 3.0721578001976013e-01 - <_> - - 0 -1 608 -2.5972947478294373e-03 - - -4.2591169476509094e-01 6.7926779389381409e-02 - <_> - - 0 -1 717 1.4116591773927212e-03 - - -1.2321621179580688e-01 2.4072754383087158e-01 - <_> - - 0 -1 603 -2.5579232722520828e-02 - - 5.7537192106246948e-01 -4.9050308763980865e-02 - <_> - - 0 -1 407 -5.6264195591211319e-03 - - -5.2892494201660156e-01 6.0454059392213821e-02 - <_> - - 0 -1 413 -1.8926127813756466e-03 - - 2.4074989557266235e-01 -1.2150175124406815e-01 - <_> - - 0 -1 96 -1.0207362473011017e-02 - - -6.7782247066497803e-01 4.3572813272476196e-02 - <_> - - 0 -1 157 -3.1391347292810678e-03 - - 1.9982162117958069e-01 -1.3408482074737549e-01 - <_> - - 0 -1 218 -3.1065782532095909e-03 - - 2.2946853935718536e-01 -1.2754726409912109e-01 - <_> - - 0 -1 866 -5.2223210223019123e-03 - - -5.0463259220123291e-01 4.9872294068336487e-02 - <_> - - 0 -1 428 -3.4163258969783783e-03 - - 2.1628817915916443e-01 -1.1369658261537552e-01 - <_> - - 0 -1 901 5.1404302939772606e-03 - - -9.6477277576923370e-02 2.4602085351943970e-01 - <_> - - 0 -1 425 5.8603808283805847e-03 - - 4.0628310292959213e-02 -6.3314515352249146e-01 - <_> - - 0 -1 936 -1.1338826734572649e-03 - - 3.4083816409111023e-01 -7.9400509595870972e-02 - <_> - - 0 -1 936 8.0572068691253662e-04 - - -9.5763482153415680e-02 3.2283502817153931e-01 - <_> - - 0 -1 431 -4.8957285471260548e-03 - - -5.3353887796401978e-01 4.9622885882854462e-02 - <_> - - 0 -1 675 7.1027994155883789e-02 - - -6.2327813357114792e-02 4.5151355862617493e-01 - <_> - - 0 -1 911 -1.5200550667941570e-02 - - 2.5859493017196655e-01 -1.0548926889896393e-01 + -5.9253305196762085e-01 5.5994171649217606e-02 <_> - 81 - -1.5793150663375854e+00 + 50 + -1.3835698366165161e+00 <_> - 0 -1 562 -5.8624427765607834e-03 + 0 -1 898 1.5156399458646774e-03 - 6.2237185239791870e-01 -1.5120165422558784e-02 + -1.0024535655975342e-01 5.8807808160781860e-01 <_> - 0 -1 507 4.7948276624083519e-03 + 0 -1 802 -3.5168868489563465e-03 - -1.8684723973274231e-01 4.3783110380172729e-01 + 4.0972998738288879e-01 -1.6088742017745972e-01 <_> - 0 -1 870 2.4864529259502888e-03 + 0 -1 180 2.3035616613924503e-03 - -1.9763210415840149e-01 3.4098726511001587e-01 + -1.8985269963741302e-01 2.9883998632431030e-01 <_> - 0 -1 210 -7.7013596892356873e-03 + 0 -1 254 4.5840561389923096e-02 - 3.4580937027931213e-01 -2.2749660909175873e-01 + -1.4383240044116974e-01 4.7528687119483948e-01 <_> - 0 -1 768 -1.8182904459536076e-03 + 0 -1 405 5.5156396701931953e-03 - 3.7125843763351440e-01 -1.4019212126731873e-01 + -1.7356806993484497e-01 3.4583050012588501e-01 <_> - 0 -1 791 -1.4325398951768875e-03 + 0 -1 436 3.9731184951961040e-03 - 4.4040992856025696e-01 -1.0599569976329803e-01 + 7.8886620700359344e-02 -5.6442558765411377e-01 <_> - 0 -1 161 5.4927580058574677e-03 + 0 -1 412 -5.6995991617441177e-03 - 8.4835931658744812e-02 -5.3435057401657104e-01 + -4.7576662898063660e-01 9.4875656068325043e-02 <_> - 0 -1 837 -7.0448440965265036e-04 + 0 -1 539 -9.6501735970377922e-03 - 2.8704917430877686e-01 -1.4405579864978790e-01 + 2.3381656408309937e-01 -1.8310526013374329e-01 <_> - 0 -1 220 -5.7945270091295242e-03 + 0 -1 209 6.1656545847654343e-02 - -5.1373738050460815e-01 8.3974525332450867e-02 + -1.4697165787220001e-01 3.6247691512107849e-01 <_> - 0 -1 376 -1.1944295838475227e-02 + 0 -1 398 1.1418928205966949e-01 - 3.5980853438377380e-01 -1.0862441360950470e-01 + -8.8033527135848999e-02 4.4633501768112183e-01 <_> - 0 -1 385 3.4179994836449623e-03 + 0 -1 3 -1.1903396807610989e-02 - -1.2899027764797211e-01 3.3064863085746765e-01 + 3.3496665954589844e-01 -1.2121009081602097e-01 <_> - 0 -1 805 -7.2756269946694374e-03 + 0 -1 546 -4.1371315717697144e-02 - 2.3903866112232208e-01 -1.6133096814155579e-01 + 4.1400006413459778e-01 -9.7229279577732086e-02 <_> - 0 -1 647 -8.5910838097333908e-03 + 0 -1 380 7.8342631459236145e-03 - -8.4211397171020508e-01 4.1614245623350143e-02 + -1.6631671786308289e-01 2.5738984346389771e-01 <_> - 0 -1 283 -3.7941135466098785e-02 + 0 -1 304 -4.5139621943235397e-03 - 2.4674071371555328e-01 -1.4177341759204865e-01 + -4.6883803606033325e-01 8.7662570178508759e-02 <_> - 0 -1 149 -3.6782763898372650e-02 + 0 -1 929 1.5914421528577805e-03 - 3.1695553660392761e-01 -1.1061279475688934e-01 + -1.1636006087064743e-01 3.2739594578742981e-01 <_> - 0 -1 31 -1.1086702346801758e-01 + 0 -1 942 -5.2607608959078789e-03 - -7.7248167991638184e-01 4.9090590327978134e-02 + -6.7755740880966187e-01 5.1752120256423950e-02 <_> - 0 -1 23 -4.3419219553470612e-02 + 0 -1 941 3.1824512407183647e-03 - -6.3905894756317139e-01 4.7248683869838715e-02 + 5.2379645407199860e-02 -6.0918039083480835e-01 <_> - 0 -1 229 7.1155801415443420e-03 + 0 -1 939 -3.6813789047300816e-03 - 5.5369954556226730e-02 -5.6675219535827637e-01 + 4.8251116275787354e-01 -9.2318780720233917e-02 <_> - 0 -1 9 2.9427852481603622e-02 + 0 -1 622 -4.3226117268204689e-03 - -1.0744783282279968e-01 3.1137129664421082e-01 + -5.7561415433883667e-01 5.9672243893146515e-02 <_> - 0 -1 13 -5.6870315223932266e-02 + 0 -1 250 -7.1843853220343590e-03 - 4.8549285531044006e-01 -8.4140487015247345e-02 + 2.6631006598472595e-01 -1.4015418291091919e-01 <_> - 0 -1 845 -2.1800836548209190e-03 + 0 -1 871 2.1028071641921997e-03 - 3.0136430263519287e-01 -1.0869345813989639e-01 + -1.1286304146051407e-01 3.5946926474571228e-01 <_> - 0 -1 345 1.2336489744484425e-03 + 0 -1 22 8.5248583927750587e-03 - -8.9073576033115387e-02 3.3233630657196045e-01 + 6.9424033164978027e-02 -5.2462881803512573e-01 <_> - 0 -1 737 2.7930366341024637e-03 + 0 -1 147 6.9785099476575851e-03 - -1.1784177273511887e-01 2.3968270421028137e-01 + 5.6668873876333237e-02 -5.6192052364349365e-01 <_> - 0 -1 300 -1.4338749647140503e-01 + 0 -1 474 -5.2639590576291084e-03 - 4.7303047776222229e-01 -5.1608867943286896e-02 + -5.8648955821990967e-01 5.0352573394775391e-02 <_> - 0 -1 113 7.9552028328180313e-03 + 0 -1 406 2.8417459689080715e-03 - 6.0302641242742538e-02 -4.7011384367942810e-01 + -1.3425759971141815e-01 2.7325555682182312e-01 <_> - 0 -1 397 -4.6112807467579842e-03 + 0 -1 394 -1.3187457807362080e-02 - -4.2084765434265137e-01 7.6558656990528107e-02 + 4.0453648567199707e-01 -9.1843754053115845e-02 <_> - 0 -1 361 7.8915785998106003e-03 + 0 -1 722 -6.7344801500439644e-03 - -1.3884299993515015e-01 2.0495900511741638e-01 + -7.5647395849227905e-01 5.0157479941844940e-02 <_> - 0 -1 196 -2.9021099209785461e-02 + 0 -1 187 2.1363141015172005e-02 - 3.3683353662490845e-01 -8.6431317031383514e-02 + 4.7982390969991684e-02 -5.5388218164443970e-01 <_> - 0 -1 32 8.7932050228118896e-03 + 0 -1 623 1.6145884292200208e-03 - -1.2117365747690201e-01 2.3939569294452667e-01 + 7.9808227717876434e-02 -3.7233716249465942e-01 <_> - 0 -1 692 -4.3326904997229576e-03 + 0 -1 525 -2.2595757618546486e-03 - -6.3044422864913940e-01 4.8393115401268005e-02 + 2.8343635797500610e-01 -1.1216876655817032e-01 <_> - 0 -1 729 -1.6151482705026865e-03 + 0 -1 214 1.4407988637685776e-02 - 3.0203807353973389e-01 -9.2361047863960266e-02 + -1.0392460227012634e-01 3.1299999356269836e-01 <_> - 0 -1 239 -3.6242920905351639e-03 + 0 -1 476 -1.4912552433088422e-03 - -4.0946927666664124e-01 7.3978066444396973e-02 + 2.8538599610328674e-01 -1.0644508898258209e-01 <_> - 0 -1 142 -8.0828834325075150e-03 + 0 -1 195 9.8895151168107986e-03 - -6.1597609519958496e-01 4.0132850408554077e-02 + 5.0090074539184570e-02 -6.2053185701370239e-01 <_> - 0 -1 427 -1.8987425137311220e-03 + 0 -1 115 4.2754956521093845e-03 - 2.5910443067550659e-01 -1.0553860664367676e-01 + 6.5051443874835968e-02 -4.2582303285598755e-01 <_> - 0 -1 776 3.4845639020204544e-03 + 0 -1 754 -2.5489409454166889e-03 - 4.1376896202564240e-02 -6.4275610446929932e-01 + 3.1278640031814575e-01 -9.9601686000823975e-02 <_> - 0 -1 728 -1.3704899698495865e-02 + 0 -1 717 -6.0358326882123947e-03 - 2.7235555648803711e-01 -1.0047114640474319e-01 + 2.2685267031192780e-01 -1.3849361240863800e-01 <_> - 0 -1 88 -9.5059927552938461e-03 + 0 -1 875 1.1879121884703636e-02 - 2.3305405676364899e-01 -1.2722322344779968e-01 + -8.9687183499336243e-02 3.7642294168472290e-01 <_> - 0 -1 424 -1.7753308638930321e-02 + 0 -1 111 1.2982923537492752e-02 - 2.7121108770370483e-01 -9.8972275853157043e-02 + 4.3990727514028549e-02 -7.3371982574462891e-01 <_> - 0 -1 60 4.1816420853137970e-02 + 0 -1 993 -2.8599319048225880e-03 - -8.6314909160137177e-02 2.9308396577835083e-01 + -4.3102917075157166e-01 5.9561621397733688e-02 <_> - 0 -1 470 -5.2781165577471256e-03 + 0 -1 737 -3.5829999251291156e-04 - -4.3240407109260559e-01 6.6678449511528015e-02 + 1.7152757942676544e-01 -1.6511310636997223e-01 <_> - 0 -1 947 -3.5982416011393070e-03 + 0 -1 27 2.5972571223974228e-02 - -4.0664613246917725e-01 5.9939380735158920e-02 + -1.2855969369411469e-01 2.2820757329463959e-01 <_> - 0 -1 350 -3.3817887306213379e-03 + 0 -1 516 4.2565623298287392e-03 - 2.1198178827762604e-01 -1.2401402741670609e-01 + 5.7662181556224823e-02 -5.3734982013702393e-01 <_> - 0 -1 148 -8.4468610584735870e-03 + 0 -1 50 -2.9159568250179291e-02 - -5.0658410787582397e-01 5.6176334619522095e-02 + -6.3020753860473633e-01 4.0746636688709259e-02 <_> - 0 -1 522 -1.5873050317168236e-02 + 0 -1 413 3.1341956928372383e-03 - 3.0237907171249390e-01 -8.9766949415206909e-02 + -8.1374719738960266e-02 4.1371321678161621e-01 <_> - 0 -1 948 5.2925320342183113e-03 + 0 -1 935 -1.3592604082077742e-03 - 4.7194946557283401e-02 -5.8447927236557007e-01 + 3.2382342219352722e-01 -9.7880341112613678e-02 <_> - 0 -1 514 -1.4822685159742832e-02 + 0 -1 758 -6.9904811680316925e-03 - 2.7581340074539185e-01 -1.0343603044748306e-01 + -6.8850576877593994e-01 4.2428225278854370e-02 <_> - 0 -1 678 -1.2328238226473331e-02 + 0 -1 93 -8.7879784405231476e-03 - 1.9257421791553497e-01 -1.3730424642562866e-01 + -5.8945190906524658e-01 3.7613209336996078e-02 <_> - 0 -1 887 5.4736144840717316e-02 + 0 -1 491 -1.7947785556316376e-02 - -1.0764957219362259e-01 2.4070124328136444e-01 + 3.1659606099128723e-01 -8.7437197566032410e-02 <_> - 0 -1 484 -2.0030699670314789e-03 + 0 -1 490 8.0379713326692581e-03 - 2.8992170095443726e-01 -8.6155213415622711e-02 + -1.1311284452676773e-01 3.0860018730163574e-01 <_> - 0 -1 347 4.9616778269410133e-03 + 0 -1 716 3.0642822384834290e-03 - 3.7793070077896118e-02 -6.8241751194000244e-01 - <_> - - 0 -1 171 2.1582433953881264e-02 - - -9.2316769063472748e-02 2.6424714922904968e-01 - <_> - - 0 -1 131 -9.5060802996158600e-03 - - 2.0518042147159576e-01 -1.1375468224287033e-01 - <_> - - 0 -1 238 7.4238084256649017e-02 - - -7.0650860667228699e-02 3.3061835169792175e-01 - <_> - - 0 -1 567 5.8014206588268280e-03 - - 3.9557952433824539e-02 -6.0553658008575439e-01 - <_> - - 0 -1 489 8.3722146227955818e-03 - - -6.6242359578609467e-02 3.5559263825416565e-01 - <_> - - 0 -1 115 5.9322156012058258e-03 - - 5.1374353468418121e-02 -4.4348692893981934e-01 - <_> - - 0 -1 503 -1.5613199211657047e-03 - - 3.3984366059303284e-01 -7.1964941918849945e-02 - <_> - - 0 -1 201 -1.6189547255635262e-02 - - 2.0777270197868347e-01 -1.2065915018320084e-01 - <_> - - 0 -1 589 3.7794266827404499e-03 - - 4.0290340781211853e-02 -5.5574357509613037e-01 - <_> - - 0 -1 213 -9.3125496059656143e-03 - - 2.5648719072341919e-01 -9.4139434397220612e-02 - <_> - - 0 -1 927 8.9797464897856116e-04 - - -1.0596609860658646e-01 3.0083754658699036e-01 - <_> - - 0 -1 593 4.1124280542135239e-03 - - 4.3452557176351547e-02 -5.6017982959747314e-01 - <_> - - 0 -1 447 -5.7592550292611122e-03 - - -5.5715996026992798e-01 3.6530554294586182e-02 - <_> - - 0 -1 956 -1.7109992913901806e-03 - - 2.4350115656852722e-01 -9.9780716001987457e-02 - <_> - - 0 -1 975 -1.9408876076340675e-02 - - -7.3736822605133057e-01 3.4421972930431366e-02 - <_> - - 0 -1 269 -1.8505988642573357e-02 - - 2.3959811031818390e-01 -1.0179302841424942e-01 - <_> - - 0 -1 974 -3.4968159161508083e-03 - - -4.5450085401535034e-01 5.2533198148012161e-02 - <_> - - 0 -1 722 3.2340791076421738e-03 - - -9.7867593169212341e-02 2.5210717320442200e-01 - <_> - - 0 -1 853 -2.1103646140545607e-03 - - 2.7718135714530945e-01 -8.3934187889099121e-02 - <_> - - 0 -1 310 -6.0913376510143280e-03 - - -5.0269359350204468e-01 4.7654323279857635e-02 - <_> - - 0 -1 316 -1.4657910168170929e-01 - - -5.8180803060531616e-01 3.7255339324474335e-02 - <_> - - 0 -1 721 -5.7285130023956299e-02 - - -8.1681364774703979e-01 2.3416126146912575e-02 - <_> - - 0 -1 560 -1.0855928063392639e-02 - - 1.6488714516162872e-01 -1.3668881356716156e-01 - <_> - - 0 -1 511 1.4742083847522736e-02 - - 3.0842842534184456e-02 -7.8335261344909668e-01 - <_> - - 0 -1 701 -1.8798124045133591e-02 - - 3.1507465243339539e-01 -7.6406344771385193e-02 - <_> - - 0 -1 458 1.8614485859870911e-02 - - -8.0178938806056976e-02 3.0463775992393494e-01 - <_> - - 0 -1 803 -4.1011158376932144e-02 - - -6.7428815364837646e-01 3.5076040774583817e-02 - <_> - - 0 -1 260 -1.5514190308749676e-03 - - 1.9351305067539215e-01 -1.0952673852443695e-01 - <_> - - 0 -1 83 7.6966043561697006e-03 - - 3.2414216548204422e-02 -6.0751897096633911e-01 - <_> - - 0 -1 154 -1.7850721254944801e-02 - - 2.0461367070674896e-01 -1.0080502927303314e-01 - <_> - - 0 -1 298 2.3059733211994171e-03 - - -1.3565167784690857e-01 1.7179486155509949e-01 + 4.8351831734180450e-02 -6.0563534498214722e-01 <_> - 88 - -1.6158927679061890e+00 + 54 + -1.3756012916564941e+00 <_> - 0 -1 877 3.6321599036455154e-03 + 0 -1 798 -1.7431776504963636e-03 - 8.3464950323104858e-02 7.0313382148742676e-01 + 5.5538344383239746e-01 -1.0357239097356796e-01 <_> - 0 -1 450 -2.8561335057020187e-03 + 0 -1 425 4.4551412574946880e-03 - 5.3444284200668335e-01 -1.4426039159297943e-01 + -1.2460361421108246e-01 5.1942145824432373e-01 <_> - 0 -1 767 -1.6910845879465342e-03 + 0 -1 843 3.5308140795677900e-03 - 4.5417416095733643e-01 -1.4539502561092377e-01 + -2.2974169254302979e-01 2.7043044567108154e-01 <_> - 0 -1 330 2.4872912093997002e-02 + 0 -1 532 -1.5887852758169174e-02 - -1.5180622041225433e-01 4.7290563583374023e-01 + 4.1745069622993469e-01 -1.1281611770391464e-01 <_> - 0 -1 326 -1.3844612985849380e-02 + 0 -1 7 1.1611310765147209e-02 - 4.3979367613792419e-01 -1.9149754941463470e-01 + -1.9416445493698120e-01 2.5554594397544861e-01 <_> - 0 -1 223 -2.0526167005300522e-02 + 0 -1 935 1.5740045346319675e-03 - 3.5583654046058655e-01 -1.7526121437549591e-01 + -1.2263108044862747e-01 3.8852572441101074e-01 <_> - 0 -1 513 -1.0601939633488655e-02 + 0 -1 547 5.1882643252611160e-02 - 2.1787860989570618e-01 -1.8377628922462463e-01 + -7.5461924076080322e-02 5.0257563591003418e-01 <_> - 0 -1 43 1.5976445749402046e-02 + 0 -1 251 -3.8624972105026245e-02 - 8.6497880518436432e-02 -4.3799200654029846e-01 + 4.0001305937767029e-01 -9.6231088042259216e-02 <_> - 0 -1 698 -4.9493601545691490e-03 + 0 -1 272 -3.9408572018146515e-02 - 2.3401068150997162e-01 -1.5603557229042053e-01 + 3.0533725023269653e-01 -1.6677139699459076e-01 <_> - 0 -1 182 2.8549194335937500e-02 + 0 -1 29 7.5884531252086163e-03 - -1.4324828982353210e-01 2.4674744904041290e-01 + 9.8107770085334778e-02 -5.8249044418334961e-01 <_> - 0 -1 125 5.9233225882053375e-02 + 0 -1 218 7.2114326059818268e-02 - -1.0831536352634430e-01 3.3649173378944397e-01 + -1.4419755339622498e-01 2.8208708763122559e-01 <_> - 0 -1 436 9.5888428390026093e-02 + 0 -1 268 5.5582458153367043e-03 - -1.0589215904474258e-01 3.7052422761917114e-01 + 7.2843901813030243e-02 -5.5255079269409180e-01 <_> - 0 -1 453 -7.5694853439927101e-03 + 0 -1 877 -4.7345291823148727e-03 - 2.3113159835338593e-01 -1.4907826483249664e-01 + 3.3209753036499023e-01 -1.2499606609344482e-01 <_> - 0 -1 496 4.7857249155640602e-03 + 0 -1 577 5.1413839682936668e-03 - 5.1639214158058167e-02 -6.2650465965270996e-01 + 6.4787313342094421e-02 -6.4880597591400146e-01 <_> - 0 -1 145 5.4310320410877466e-04 + 0 -1 999 5.4608630016446114e-03 - -1.8886238336563110e-01 1.5287129580974579e-01 + 3.7491828203201294e-02 -7.5315922498703003e-01 <_> - 0 -1 941 2.6117763482034206e-03 + 0 -1 542 -8.6404485045932233e-05 - 6.6002741456031799e-02 -4.4275501370429993e-01 + 1.7464619874954224e-01 -1.8258170783519745e-01 <_> - 0 -1 940 -8.0328416079282761e-03 + 0 -1 442 6.1132330447435379e-03 - -5.1598960161209106e-01 5.6888539344072342e-02 + 7.5624085962772369e-02 -4.3711006641387939e-01 <_> - 0 -1 842 1.2324389535933733e-03 + 0 -1 889 -7.0670098066329956e-03 - -1.2387900799512863e-01 2.6769712567329407e-01 + 2.1796958148479462e-01 -1.4547325670719147e-01 <_> - 0 -1 830 -9.7260549664497375e-03 + 0 -1 347 9.4080460257828236e-04 - 3.5000637173652649e-01 -1.0784699767827988e-01 + -1.2536728382110596e-01 2.8143358230590820e-01 <_> - 0 -1 334 8.6696096695959568e-04 + 0 -1 580 -2.6800869964063168e-03 - -1.1435680836439133e-01 2.5563576817512512e-01 + -4.2977494001388550e-01 8.2963027060031891e-02 <_> - 0 -1 258 -3.4542869776487350e-02 + 0 -1 297 5.8945640921592712e-03 - -5.8313912153244019e-01 5.1875289529561996e-02 + 4.2834181338548660e-02 -6.0937494039535522e-01 <_> - 0 -1 342 7.5529976747930050e-03 + 0 -1 465 1.0121082887053490e-03 - 3.6179721355438232e-02 -6.9380182027816772e-01 + -1.1036285758018494e-01 2.9971688985824585e-01 <_> - 0 -1 550 4.0939049795269966e-03 + 0 -1 56 3.1157936900854111e-03 - 4.1062511503696442e-02 -5.9848028421401978e-01 + 7.3115289211273193e-02 -4.3226471543312073e-01 <_> - 0 -1 354 2.8113774023950100e-03 + 0 -1 411 -3.3052214421331882e-03 - 5.5211704224348068e-02 -4.7554171085357666e-01 + -4.9826300144195557e-01 5.1225960254669189e-02 <_> - 0 -1 353 -3.5045309923589230e-03 + 0 -1 109 8.3188470453023911e-03 - -3.9402753114700317e-01 6.9415092468261719e-02 + 5.0362452864646912e-02 -4.8688000440597534e-01 <_> - 0 -1 373 1.7898422665894032e-03 + 0 -1 393 -2.5094528682529926e-03 - -7.6636046171188354e-02 4.0437600016593933e-01 + 2.6902040839195251e-01 -1.0433372855186462e-01 <_> - 0 -1 486 4.0369415655732155e-03 + 0 -1 924 1.1217880528420210e-03 - -9.7471550107002258e-02 2.7784994244575500e-01 + -1.1188100278377533e-01 3.1254816055297852e-01 <_> - 0 -1 430 -8.5533969104290009e-03 + 0 -1 716 -2.9259414877742529e-03 - 3.3252051472663879e-01 -1.0098887234926224e-01 + -5.7495939731597900e-01 5.3564101457595825e-02 <_> - 0 -1 69 2.6041156053543091e-01 + 0 -1 733 -1.1687271296977997e-02 - -4.3942935764789581e-02 5.0610113143920898e-01 + 2.5880128145217896e-01 -1.0639669001102448e-01 <_> - 0 -1 892 1.4894269406795502e-03 + 0 -1 763 3.5054073669016361e-03 - -7.6404698193073273e-02 3.0335766077041626e-01 + 5.4045904427766800e-02 -5.5625277757644653e-01 <_> - 0 -1 101 -4.8547232151031494e-01 + 0 -1 552 1.9068794324994087e-02 - 6.1892670392990112e-01 -3.9150018244981766e-02 + -1.1246301978826523e-01 2.5745245814323425e-01 <_> - 0 -1 895 -7.6227495446801186e-04 + 0 -1 230 4.6145436353981495e-03 - 1.9151827692985535e-01 -1.2709514796733856e-01 + 6.7216314375400543e-02 -4.1385611891746521e-01 <_> - 0 -1 553 -4.8853931948542595e-03 + 0 -1 857 -8.2267355173826218e-03 - -5.6353646516799927e-01 4.4611949473619461e-02 + 2.1265375614166260e-01 -1.3443692028522491e-01 <_> - 0 -1 649 1.8246687250211835e-03 + 0 -1 149 -1.4355888590216637e-02 - 6.3832193613052368e-02 -3.6079093813896179e-01 + 2.5618723034858704e-01 -1.0785522311925888e-01 <_> - 0 -1 2 -3.7001366727054119e-03 + 0 -1 61 8.0431215465068817e-03 - 1.9149990379810333e-01 -1.3052800297737122e-01 + -1.4258129894733429e-01 2.2692860662937164e-01 <_> - 0 -1 324 -5.1008379086852074e-03 + 0 -1 170 -5.6914249435067177e-03 - 4.0633511543273926e-01 -6.6167853772640228e-02 + -4.8886317014694214e-01 6.0331270098686218e-02 <_> - 0 -1 15 -1.7046853899955750e-02 + 0 -1 133 -2.5912215933203697e-03 - -3.5266619920730591e-01 7.1908973157405853e-02 + 2.1062785387039185e-01 -1.4967896044254303e-01 <_> - 0 -1 415 7.4824336916208267e-03 + 0 -1 461 5.5204275995492935e-03 - 5.7628002017736435e-02 -4.6899631619453430e-01 + -8.1333734095096588e-02 3.8316065073013306e-01 <_> - 0 -1 955 -1.0255416855216026e-02 + 0 -1 515 5.3790090605616570e-03 - -5.3142738342285156e-01 4.1362568736076355e-02 + -9.3129634857177734e-02 3.2883483171463013e-01 <_> - 0 -1 500 2.2401358000934124e-03 + 0 -1 199 -7.2196200489997864e-03 - -7.4236951768398285e-02 3.2401573657989502e-01 + -6.6427856683731079e-01 4.4702950865030289e-02 <_> - 0 -1 893 -1.1338146403431892e-02 + 0 -1 94 -8.3873540163040161e-02 - -5.8281844854354858e-01 4.3767549097537994e-02 + -7.9910254478454590e-01 2.7107261121273041e-02 <_> - 0 -1 532 8.4229296771809459e-04 + 0 -1 513 -3.4268260933458805e-03 - -1.2624698877334595e-01 1.8474358320236206e-01 + 2.5298807024955750e-01 -1.0898132622241974e-01 <_> - 0 -1 117 2.7594935148954391e-02 + 0 -1 763 -3.7466005887836218e-03 - 4.2021647095680237e-02 -5.0711041688919067e-01 + -5.5346089601516724e-01 5.2094604820013046e-02 <_> - 0 -1 828 3.0329828150570393e-03 + 0 -1 276 1.2452949304133654e-03 - -7.0778228342533112e-02 3.3471760153770447e-01 + -8.2017965614795685e-02 3.5483068227767944e-01 <_> - 0 -1 984 -8.9767086319625378e-04 + 0 -1 1013 -6.2445802614092827e-03 - -2.8313115239143372e-01 8.4212802350521088e-02 + -5.0969594717025757e-01 5.4533429443836212e-02 <_> - 0 -1 912 -4.3688914738595486e-03 + 0 -1 276 -1.1970927007496357e-03 - -4.8104682564735413e-01 4.6536806970834732e-02 + 3.6470764875411987e-01 -7.7394872903823853e-02 <_> - 0 -1 817 -6.5738772973418236e-03 + 0 -1 757 3.0796977225691080e-03 - 1.8955506384372711e-01 -1.1803213506937027e-01 + 5.3208738565444946e-02 -5.0689512491226196e-01 <_> - 0 -1 768 1.6207897569984198e-03 + 0 -1 33 -3.9015077054500580e-02 - -6.5827853977680206e-02 3.2122904062271118e-01 + 1.9598089158535004e-01 -1.3218660652637482e-01 <_> - 0 -1 641 4.8786089755594730e-03 + 0 -1 680 -7.7085788361728191e-03 - 3.4384466707706451e-02 -7.0796263217926025e-01 + 2.2754703462123871e-01 -1.2544488906860352e-01 <_> - 0 -1 118 -7.3928516358137131e-03 + 0 -1 655 3.2509677112102509e-02 - -4.5154401659965515e-01 4.3622057884931564e-02 + -6.7099742591381073e-02 4.1469818353652954e-01 <_> - 0 -1 287 2.2087101824581623e-03 + 0 -1 569 3.0232844874262810e-03 - -4.4949851930141449e-02 4.9991622567176819e-01 + 6.6373795270919800e-02 -4.2127549648284912e-01 <_> - 0 -1 187 2.9001948423683643e-03 + 0 -1 54 2.5392756797373295e-03 - 5.1781963557004929e-02 -4.2971140146255493e-01 + -1.1576391756534576e-01 2.3464009165763855e-01 <_> - 0 -1 287 -9.9636090453714132e-04 + 0 -1 1013 6.8497275933623314e-03 - 3.0347472429275513e-01 -7.4883252382278442e-02 + 4.5596633106470108e-02 -5.8435302972793579e-01 <_> - 0 -1 121 6.3986405730247498e-03 + 0 -1 231 -4.4358119368553162e-02 - 3.8914524018764496e-02 -5.6881076097488403e-01 - <_> - - 0 -1 433 -5.2966945804655552e-03 - - -5.5442500114440918e-01 3.3734291791915894e-02 - <_> - - 0 -1 540 9.2505104839801788e-03 - - -9.5525965094566345e-02 2.2353705763816833e-01 - <_> - - 0 -1 942 3.2701031304895878e-03 - - -8.7515957653522491e-02 2.7356430888175964e-01 - <_> - - 0 -1 938 -9.0824589133262634e-03 - - 2.2333034873008728e-01 -9.6923373639583588e-02 - <_> - - 0 -1 981 -3.0515873804688454e-03 - - -4.0757030248641968e-01 5.0947520881891251e-02 - <_> - - 0 -1 518 6.3385991379618645e-03 - - -6.0888923704624176e-02 3.5273307561874390e-01 - <_> - - 0 -1 568 -3.4346987958997488e-03 - - 2.9356080293655396e-01 -8.1172131001949310e-02 - <_> - - 0 -1 141 -3.9428919553756714e-03 - - -4.9512249231338501e-01 4.4033303856849670e-02 - <_> - - 0 -1 363 -9.1780513525009155e-02 - - -3.9046007394790649e-01 5.0150144845247269e-02 - <_> - - 0 -1 259 -6.6375046968460083e-02 - - -6.0851734876632690e-01 3.0974121764302254e-02 - <_> - - 0 -1 621 -6.9266660138964653e-03 - - -7.3090195655822754e-01 2.3663638159632683e-02 - <_> - - 0 -1 105 -3.5928614437580109e-02 - - 1.8060323596000671e-01 -1.1467467248439789e-01 - <_> - - 0 -1 848 -4.6623144298791885e-03 - - 2.3666681349277496e-01 -1.0607369244098663e-01 - <_> - - 0 -1 597 6.3546001911163330e-02 - - 3.3510908484458923e-02 -6.6823011636734009e-01 - <_> - - 0 -1 303 1.0070858988910913e-03 - - -1.1336669325828552e-01 1.9138091802597046e-01 - <_> - - 0 -1 297 2.0964080467820168e-03 - - -1.3783766329288483e-01 1.6943521797657013e-01 - <_> - - 0 -1 278 -3.7955917418003082e-02 - - 4.2277663946151733e-01 -5.3925208747386932e-02 - <_> - - 0 -1 915 1.5981765463948250e-03 - - 7.2201833128929138e-02 -2.9906082153320312e-01 - <_> - - 0 -1 266 -1.0036448948085308e-03 - - 3.0661484599113464e-01 -7.1594037115573883e-02 - <_> - - 0 -1 167 -8.7398784235119820e-03 - - -4.0562248229980469e-01 5.0554409623146057e-02 - <_> - - 0 -1 132 3.8445743266493082e-03 - - 3.0860245227813721e-02 -5.6328177452087402e-01 - <_> - - 0 -1 559 2.9180462006479502e-03 - - -9.4123579561710358e-02 2.1829530596733093e-01 - <_> - - 0 -1 705 -4.4532963074743748e-03 - - 2.2356307506561279e-01 -1.0032130777835846e-01 - <_> - - 0 -1 979 2.8718812391161919e-03 - - 5.8825947344303131e-02 -3.5275349020957947e-01 - <_> - - 0 -1 392 -9.6740125445649028e-04 - - 2.2895433008670807e-01 -8.8445298373699188e-02 - <_> - - 0 -1 384 6.3862642273306847e-03 - - -7.9845495522022247e-02 2.6533949375152588e-01 - <_> - - 0 -1 739 -1.8584533827379346e-03 - - -3.5019376873970032e-01 5.8831077069044113e-02 - <_> - - 0 -1 47 -4.1777163743972778e-02 - - -7.5915527343750000e-01 2.5032732635736465e-02 - <_> - - 0 -1 798 1.7466493882238865e-03 - - -7.8535526990890503e-02 2.5856694579124451e-01 - <_> - - 0 -1 873 -1.7557941377162933e-02 - - 1.5769363939762115e-01 -1.2735258042812347e-01 - <_> - - 0 -1 622 -2.0210664719343185e-02 - - 2.4479819834232330e-01 -8.0905362963676453e-02 - <_> - - 0 -1 623 -1.2817385140806437e-03 - - 2.0145194232463837e-01 -1.1555081605911255e-01 - <_> - - 0 -1 173 -4.6622417867183685e-03 - - -5.7475388050079346e-01 3.5327285528182983e-02 - <_> - - 0 -1 624 7.2181676514446735e-03 - - -6.5562173724174500e-02 2.9846385121345520e-01 + -3.9718165993690491e-01 6.2707424163818359e-02 <_> - 91 - -1.4331817626953125e+00 + 63 + -1.4057025909423828e+00 <_> - 0 -1 508 -1.0981839150190353e-02 + 0 -1 804 5.0806580111384392e-03 - 6.4476418495178223e-01 5.4893907159566879e-02 + -7.9617008566856384e-02 5.6362086534500122e-01 <_> - 0 -1 256 4.4120610691606998e-03 + 0 -1 965 2.0602284930646420e-03 - -1.1835748702287674e-01 5.0045996904373169e-01 + -1.8717131018638611e-01 3.4062680602073669e-01 <_> - 0 -1 735 2.8575016185641289e-03 + 0 -1 495 6.1347078531980515e-02 - -1.3248406350612640e-01 4.2942702770233154e-01 + -1.3253036141395569e-01 4.0938606858253479e-01 <_> - 0 -1 326 2.0933073014020920e-02 + 0 -1 13 -6.0383215546607971e-02 - -1.2826231122016907e-01 5.0430470705032349e-01 + 4.1172346472740173e-01 -1.4447186887264252e-01 <_> - 0 -1 742 -1.4590121805667877e-02 + 0 -1 478 -3.0238348990678787e-03 - 3.1983098387718201e-01 -1.6088847815990448e-01 + 3.4262558817863464e-01 -1.0982885956764221e-01 <_> - 0 -1 581 6.0559157282114029e-02 + 0 -1 458 4.0474245324730873e-03 - -7.2834797203540802e-02 4.6935465931892395e-01 + 7.1186766028404236e-02 -5.0650447607040405e-01 <_> - 0 -1 537 3.3241603523492813e-02 + 0 -1 633 -2.0359824411571026e-03 - -1.2657077610492706e-01 3.8025194406509399e-01 + 2.2166600823402405e-01 -1.6060648858547211e-01 <_> - 0 -1 377 -1.5009621158242226e-02 + 0 -1 887 2.7303429305902682e-05 - 3.6463224887847900e-01 -9.8299026489257812e-02 + -2.6211214065551758e-01 1.2801185250282288e-01 <_> - 0 -1 888 1.5744348056614399e-03 + 0 -1 352 1.2323079630732536e-02 - -1.1195008456707001e-01 3.1572943925857544e-01 + 8.2502633333206177e-02 -4.5231887698173523e-01 <_> - 0 -1 574 -2.3936885409057140e-03 + 0 -1 878 2.2477287799119949e-02 - -4.7027668356895447e-01 7.1979902684688568e-02 + -7.7229477465152740e-02 4.5144733786582947e-01 <_> - 0 -1 263 4.7012902796268463e-03 + 0 -1 395 -1.4673802070319653e-02 - 9.1855168342590332e-02 -3.6548766493797302e-01 + 3.5660189390182495e-01 -1.1584777384996414e-01 <_> - 0 -1 899 3.9329114370048046e-03 + 0 -1 141 9.9029816687107086e-02 - 4.4214393943548203e-02 -5.6691557168960571e-01 + -1.6957059502601624e-01 2.2625257074832916e-01 <_> - 0 -1 898 -2.8009498491883278e-03 + 0 -1 144 -1.0632930323481560e-02 - -4.8461133241653442e-01 5.4654970765113831e-02 + -5.6829780340194702e-01 7.1929946541786194e-02 <_> - 0 -1 134 -4.2012645862996578e-03 + 0 -1 808 2.5341216474771500e-02 - 1.9422210752964020e-01 -1.4497868716716766e-01 + -1.2931844592094421e-01 2.6161769032478333e-01 <_> - 0 -1 61 -8.7564159184694290e-03 + 0 -1 816 5.8172484859824181e-03 - -4.9580562114715576e-01 5.6972313672304153e-02 + -1.5375703573226929e-01 2.0636843144893646e-01 <_> - 0 -1 843 3.0297664925456047e-03 + 0 -1 68 -2.0786169171333313e-01 - -1.4587514102458954e-01 2.3592919111251831e-01 + 3.9931070804595947e-01 -7.7051497995853424e-02 <_> - 0 -1 882 -1.1956840753555298e-02 + 0 -1 140 2.2137831151485443e-01 - 3.6318615078926086e-01 -8.9037798345088959e-02 + -7.2486869990825653e-02 3.9756566286087036e-01 <_> - 0 -1 267 -9.4736125320196152e-03 + 0 -1 554 3.4148676786571741e-04 - -6.6952317953109741e-01 5.2261870354413986e-02 + -1.5928100049495697e-01 1.8005076050758362e-01 <_> - 0 -1 147 -7.3966579511761665e-03 + 0 -1 307 -6.7202709615230560e-03 - -5.5038225650787354e-01 4.5135255903005600e-02 + -6.7838191986083984e-01 4.5886330306529999e-02 <_> - 0 -1 909 5.1108570769429207e-03 + 0 -1 392 1.4110710471868515e-03 - 4.1587084531784058e-02 -5.5355554819107056e-01 + -9.7257830202579498e-02 3.2224002480506897e-01 <_> - 0 -1 178 2.1153174340724945e-02 + 0 -1 266 4.2120069265365601e-02 - -9.0628616511821747e-02 2.9272273182868958e-01 + -8.8405482470989227e-02 3.2538983225822449e-01 <_> - 0 -1 690 -4.0524005889892578e-03 + 0 -1 242 -1.3846142683178186e-03 - -5.5750316381454468e-01 4.8259153962135315e-02 + 2.0695628225803375e-01 -1.5275791287422180e-01 <_> - 0 -1 208 -4.5195231214165688e-03 + 0 -1 817 3.5425978712737560e-03 - 2.4507603049278259e-01 -1.1037164181470871e-01 + -1.2709444761276245e-01 2.1816165745258331e-01 <_> - 0 -1 802 2.9709473252296448e-02 + 0 -1 959 3.3351695165038109e-03 - -9.0624623000621796e-02 3.0535447597503662e-01 + 4.8398405313491821e-02 -6.0871434211730957e-01 <_> - 0 -1 596 -2.4458598345518112e-02 + 0 -1 958 -3.3201207406818867e-03 - 3.8106867671012878e-01 -6.5381005406379700e-02 + -4.8987022042274475e-01 5.5623263120651245e-02 <_> - 0 -1 833 2.3627276532351971e-03 + 0 -1 915 1.0103111853823066e-03 - -8.9016206562519073e-02 2.7661785483360291e-01 + -1.5765775740146637e-01 1.6940611600875854e-01 <_> - 0 -1 576 2.5604534894227982e-03 + 0 -1 151 4.9717966467142105e-03 - 4.9425628036260605e-02 -5.4407423734664917e-01 + 5.1272217184305191e-02 -5.4395431280136108e-01 <_> - 0 -1 164 1.1583864688873291e-02 + 0 -1 799 1.7913591582328081e-03 - 3.7279289215803146e-02 -6.2233042716979980e-01 + -7.2745941579341888e-02 4.0087917447090149e-01 <_> - 0 -1 745 -6.5262932330369949e-03 + 0 -1 102 -1.3228422030806541e-02 - 2.2733294963836670e-01 -1.1270135641098022e-01 + -3.5441592335700989e-01 7.9325266182422638e-02 <_> - 0 -1 747 -5.5729500018060207e-03 + 0 -1 276 2.0421743392944336e-03 - -5.2463114261627197e-01 4.3969567865133286e-02 + -5.9137169271707535e-02 4.6143886446952820e-01 <_> - 0 -1 892 2.7682324871420860e-03 + 0 -1 276 -5.9784355107694864e-04 - -5.6408800184726715e-02 4.5612502098083496e-01 + 2.5433012843132019e-01 -1.0601133853197098e-01 <_> - 0 -1 683 5.3484998643398285e-03 + 0 -1 396 -5.1422840915620327e-03 - 5.1867362111806870e-02 -4.8760178685188293e-01 + -4.4627833366394043e-01 6.1951976269483566e-02 <_> - 0 -1 165 5.3632212802767754e-03 + 0 -1 86 6.4243013039231300e-03 - 4.4008553028106689e-02 -4.8531344532966614e-01 + 3.1528502702713013e-02 -7.2403544187545776e-01 <_> - 0 -1 168 -4.5866379514336586e-03 + 0 -1 1035 3.4636156633496284e-03 - -4.7415995597839355e-01 4.6904686838388443e-02 + 3.7317775189876556e-02 -5.4165351390838623e-01 <_> - 0 -1 448 -2.4732598103582859e-03 + 0 -1 14 3.2000489532947540e-02 - 3.5594299435615540e-01 -6.6797487437725067e-02 + 3.0169567093253136e-02 -7.1302002668380737e-01 <_> - 0 -1 504 -1.3544519897550344e-03 + 0 -1 498 -5.8225672692060471e-03 - 2.5692245364189148e-01 -1.0549759119749069e-01 + -4.4310861825942993e-01 4.7724053263664246e-02 <_> - 0 -1 226 2.0623015239834785e-02 + 0 -1 24 -8.4763765335083008e-03 - -1.2213230878114700e-01 1.8851162493228912e-01 + -6.0832363367080688e-01 3.6428902298212051e-02 <_> - 0 -1 106 -2.5555126368999481e-02 + 0 -1 598 2.7582058683037758e-03 - 2.1115033328533173e-01 -1.1155050992965698e-01 + -1.0180406272411346e-01 2.4450653791427612e-01 <_> - 0 -1 650 -2.6123304851353168e-03 + 0 -1 695 -3.0314538162201643e-03 - -4.3362092971801758e-01 5.9404496103525162e-02 + -5.6130182743072510e-01 4.1730970144271851e-02 <_> - 0 -1 454 -2.0256865769624710e-02 + 0 -1 691 3.8132141344249249e-03 - 2.3865076899528503e-01 -1.1111994832754135e-01 + 4.3826375156641006e-02 -4.8639413714408875e-01 <_> - 0 -1 636 -1.3834737241268158e-02 + 0 -1 799 -1.1944114230573177e-03 - 2.4716469645500183e-01 -9.9341392517089844e-02 + 1.9191412627696991e-01 -1.2599647045135498e-01 <_> - 0 -1 438 1.0408030357211828e-03 + 0 -1 751 -3.2212696969509125e-02 - -8.5192345082759857e-02 2.8685340285301208e-01 + -7.3205161094665527e-01 3.3331435173749924e-02 <_> - 0 -1 693 -7.8561680857092142e-04 + 0 -1 521 -1.0144908446818590e-03 - -3.1685733795166016e-01 7.3741830885410309e-02 + 3.0479896068572998e-01 -8.2489714026451111e-02 <_> - 0 -1 845 -3.1890799291431904e-03 + 0 -1 836 -1.4355147257447243e-02 - 2.8838813304901123e-01 -7.9454399645328522e-02 + 2.1706604957580566e-01 -1.0914804041385651e-01 <_> - 0 -1 556 -1.8864404410123825e-02 + 0 -1 574 -4.8122168518602848e-03 - -6.1039513349533081e-01 3.4549634903669357e-02 + -6.7199075222015381e-01 4.0943562984466553e-02 <_> - 0 -1 930 1.9871932454407215e-03 + 0 -1 236 3.3706519752740860e-04 - -6.4915224909782410e-02 3.3199799060821533e-01 + -1.4588885009288788e-01 1.6099508106708527e-01 <_> - 0 -1 307 -4.4487272389233112e-03 + 0 -1 43 -1.8943618983030319e-02 - -4.8411524295806885e-01 4.3471843004226685e-02 + -5.9796541929244995e-01 3.7877634167671204e-02 <_> - 0 -1 124 1.1506278999149799e-02 + 0 -1 69 1.5444982796907425e-02 - 3.4361593425273895e-02 -5.1601499319076538e-01 + 2.6846721768379211e-02 -7.2375786304473877e-01 <_> - 0 -1 299 -4.9164015799760818e-03 + 0 -1 303 1.0463559068739414e-02 - 2.8029051423072815e-01 -7.6438650488853455e-02 + 3.2184243202209473e-02 -6.0756552219390869e-01 <_> - 0 -1 937 6.8624541163444519e-03 + 0 -1 292 2.5047133676707745e-03 - -1.3434819877147675e-01 1.7164944112300873e-01 + -1.1925315856933594e-01 1.9379882514476776e-01 <_> - 0 -1 788 1.2513504363596439e-02 + 0 -1 797 -1.4791900292038918e-02 - -8.2097627222537994e-02 2.6367199420928955e-01 + 1.9981779158115387e-01 -1.2553811073303223e-01 <_> - 0 -1 144 2.5324244052171707e-02 + 0 -1 146 -6.1217732727527618e-03 - -9.8793335258960724e-02 2.1438889205455780e-01 + -4.2455345392227173e-01 5.5959124118089676e-02 <_> - 0 -1 491 4.2827110737562180e-03 + 0 -1 563 -3.5850135609507561e-03 - 4.8010587692260742e-02 -5.3329360485076904e-01 + 3.2560044527053833e-01 -7.1894593536853790e-02 <_> - 0 -1 172 -1.0588562116026878e-02 + 0 -1 1048 -3.2580485567450523e-03 - 2.0557209849357605e-01 -1.1096615344285965e-01 + -5.4515779018402100e-01 4.5138467103242874e-02 <_> - 0 -1 195 7.3749665170907974e-03 + 0 -1 367 8.5870809853076935e-03 - 4.2330745607614517e-02 -4.9726718664169312e-01 + -9.2699222266674042e-02 2.7361676096916199e-01 <_> - 0 -1 477 -1.0184315964579582e-02 + 0 -1 384 -3.5999938845634460e-03 - 2.2020325064659119e-01 -1.0080294311046600e-01 + 1.7715592682361603e-01 -1.3859097659587860e-01 <_> - 0 -1 305 -3.1706739682704210e-03 + 0 -1 650 1.5299995429813862e-03 - -4.1845852136611938e-01 5.4482847452163696e-02 + -1.0419535636901855e-01 2.1118766069412231e-01 <_> - 0 -1 670 2.5342048611491919e-03 + 0 -1 413 2.7578026056289673e-03 - -6.9553844630718231e-02 3.2299628853797913e-01 + -7.0944413542747498e-02 2.9870492219924927e-01 <_> - 0 -1 521 -8.4150061011314392e-03 + 0 -1 283 -6.1489176005125046e-03 - 2.6279926300048828e-01 -9.3804508447647095e-02 + -5.1581281423568726e-01 4.6433247625827789e-02 <_> - 0 -1 76 4.0150225162506104e-02 + 0 -1 979 8.3175086183473468e-04 - 2.9147522523999214e-02 -7.8112679719924927e-01 + -8.4185592830181122e-02 2.8132751584053040e-01 <_> - 0 -1 177 -4.3324208818376064e-03 + 0 -1 979 -6.7444925662130117e-04 - -5.2339142560958862e-01 3.6419976502656937e-02 + 2.6548036932945251e-01 -9.7815677523612976e-02 <_> - 0 -1 39 -4.0873344987630844e-02 + 0 -1 555 -5.6643221527338028e-02 - 3.7220278382301331e-01 -6.1695497483015060e-02 + 3.8170987367630005e-01 -6.2833912670612335e-02 <_> - 0 -1 13 5.9101730585098267e-02 + 0 -1 602 -7.5360340997576714e-03 - -5.1950857043266296e-02 4.1701674461364746e-01 - <_> - - 0 -1 628 -3.1048480886965990e-03 - - 2.1874889731407166e-01 -9.0781040489673615e-02 - <_> - - 0 -1 627 3.5321055911481380e-03 - - -8.2859635353088379e-02 2.9276433587074280e-01 - <_> - - 0 -1 668 -1.2976058060303330e-03 - - -4.3279412388801575e-01 4.9447599798440933e-02 - <_> - - 0 -1 176 1.1339010670781136e-02 - - 2.6531336829066277e-02 -6.9358879327774048e-01 - <_> - - 0 -1 969 8.8861025869846344e-03 - - 2.6764476671814919e-02 -6.1700969934463501e-01 - <_> - - 0 -1 659 1.1916678398847580e-02 - - -9.7341567277908325e-02 2.0659063756465912e-01 - <_> - - 0 -1 804 1.2824826873838902e-02 - - -8.5851043462753296e-02 2.6430803537368774e-01 - <_> - - 0 -1 820 -4.0587522089481354e-03 - - 1.8127168715000153e-01 -1.1241084337234497e-01 - <_> - - 0 -1 931 5.4964423179626465e-04 - - -9.1979973018169403e-02 2.1896743774414062e-01 - <_> - - 0 -1 324 1.5558412997052073e-03 - - -7.7465757727622986e-02 2.5980666279792786e-01 - <_> - - 0 -1 587 4.3281335383653641e-03 - - 3.4584067761898041e-02 -6.2342578172683716e-01 - <_> - - 0 -1 34 -1.4533417299389839e-02 - - 2.0229732990264893e-01 -1.0071664303541183e-01 - <_> - - 0 -1 644 5.6288111954927444e-03 - - 3.9174310863018036e-02 -5.0741255283355713e-01 - <_> - - 0 -1 936 7.9474167432636023e-04 - - -8.0158397555351257e-02 2.3534512519836426e-01 - <_> - - 0 -1 585 -1.0926688089966774e-02 - - -5.9471416473388672e-01 3.1198443844914436e-02 - <_> - - 0 -1 677 -8.2422709092497826e-03 - - 2.0226760208606720e-01 -1.1066834628582001e-01 - <_> - - 0 -1 923 -3.6351364105939865e-03 - - -6.4762312173843384e-01 2.9601249843835831e-02 - <_> - - 0 -1 784 -2.7860058471560478e-03 - - 4.2289113998413086e-01 -4.8328761011362076e-02 - <_> - - 0 -1 56 1.4032858889549971e-03 - - 7.7722996473312378e-02 -2.5018605589866638e-01 - <_> - - 0 -1 56 -4.9225967377424240e-03 - - -5.3430163860321045e-01 3.4801222383975983e-02 - <_> - - 0 -1 566 -1.2032099068164825e-02 - - 2.3754563927650452e-01 -8.4349773824214935e-02 - <_> - - 0 -1 464 5.9743728488683701e-03 - - -9.6527986228466034e-02 2.0883874595165253e-01 - <_> - - 0 -1 288 9.0228002518415451e-03 - - 2.6527268812060356e-02 -7.1255648136138916e-01 - <_> - - 0 -1 94 -4.3231204152107239e-02 - - -4.5857131481170654e-01 3.5763122141361237e-02 - <_> - - 0 -1 262 1.9863661378622055e-02 - - 3.8993570953607559e-02 -4.7274601459503174e-01 - <_> - - 0 -1 364 1.7278429004363716e-04 - - -1.2378288805484772e-01 1.5123386681079865e-01 - <_> - - 0 -1 81 8.4997266530990601e-03 - - 3.8503456860780716e-02 -4.7635042667388916e-01 - <_> - - 0 -1 434 -1.3840992469340563e-03 - - 2.4361917376518250e-01 -7.7643536031246185e-02 + 2.2137185931205750e-01 -1.0336405038833618e-01 <_> - 100 - -1.4933127164840698e+00 + 54 + -1.3439358472824097e+00 <_> - 0 -1 769 -2.4473592638969421e-03 + 0 -1 526 -4.8420722596347332e-03 - 6.4225250482559204e-01 1.1617031693458557e-01 + 5.7400572299957275e-01 -9.5008336007595062e-02 <_> - 0 -1 918 2.5613610632717609e-03 + 0 -1 786 -5.9993756003677845e-03 - -1.4125512540340424e-01 4.1756254434585571e-01 + 4.5479923486709595e-01 -1.5483228862285614e-01 <_> - 0 -1 450 -3.6349727306514978e-03 + 0 -1 531 -3.1531709246337414e-03 - 4.2445364594459534e-01 -1.2421201914548874e-01 + 4.2504432797431946e-01 -1.2935030460357666e-01 <_> - 0 -1 243 7.6568350195884705e-02 + 0 -1 884 1.2363551650196314e-03 - -2.0400929450988770e-01 2.4128499627113342e-01 + -1.5872104465961456e-01 3.1463247537612915e-01 <_> - 0 -1 455 4.6866592019796371e-03 + 0 -1 925 -6.7780278623104095e-03 - 7.2638466954231262e-02 -5.3155571222305298e-01 + 4.1302111744880676e-01 -1.7017546296119690e-01 <_> - 0 -1 319 -3.9937674999237061e-02 + 0 -1 259 1.3960017822682858e-03 - 4.3441477417945862e-01 -8.1894725561141968e-02 + -1.3419999182224274e-01 3.3868113160133362e-01 <_> - 0 -1 376 -1.7270710319280624e-02 + 0 -1 564 -3.5894233733415604e-03 - 4.9218431115150452e-01 -8.1687144935131073e-02 + 3.3102113008499146e-01 -1.1498286575078964e-01 <_> - 0 -1 67 1.0907177627086639e-01 + 0 -1 551 5.4187951609492302e-03 - -1.3829828798770905e-01 3.0388528108596802e-01 + -1.2790408730506897e-01 3.1275641918182373e-01 <_> - 0 -1 563 -8.6617004126310349e-03 + 0 -1 934 -3.3248444087803364e-03 - 2.4966995418071747e-01 -1.4650684595108032e-01 + -5.1654219627380371e-01 7.1216024458408356e-02 <_> - 0 -1 257 5.3433720022439957e-03 + 0 -1 49 7.9970825463533401e-03 - 5.6382026523351669e-02 -4.7699481248855591e-01 + 6.3098005950450897e-02 -5.8896148204803467e-01 <_> - 0 -1 359 -7.3083816096186638e-03 + 0 -1 124 6.0347835533320904e-03 - 1.6508759558200836e-01 -1.8176083266735077e-01 + 6.4018696546554565e-02 -4.7639665007591248e-01 <_> - 0 -1 322 -1.2855050154030323e-03 + 0 -1 124 -6.9478121586143970e-03 - 2.5566878914833069e-01 -1.1560125648975372e-01 + -6.0485291481018066e-01 7.2506561875343323e-02 <_> - 0 -1 799 1.6045335214585066e-03 + 0 -1 30 1.9063859945163131e-03 - -1.5024451911449432e-01 1.8980197608470917e-01 + -1.8492227792739868e-01 1.9994279742240906e-01 <_> - 0 -1 711 -3.2996428199112415e-03 + 0 -1 752 2.1343495696783066e-02 - -5.4483765363693237e-01 5.2060887217521667e-02 + -8.6192794144153595e-02 4.8719888925552368e-01 <_> - 0 -1 646 -2.1930811926722527e-03 + 0 -1 261 -2.2514071315526962e-03 - -5.0953930616378784e-01 4.9616143107414246e-02 + 3.5809755325317383e-01 -7.6123438775539398e-02 <_> - 0 -1 830 -1.3328871689736843e-02 + 0 -1 480 -4.4778124429285526e-03 - 3.2616052031517029e-01 -8.1101849675178528e-02 + -4.5578238368034363e-01 7.3516018688678741e-02 <_> - 0 -1 333 3.5710524767637253e-02 + 0 -1 533 3.9280336350202560e-03 - -9.0930387377738953e-02 3.1067803502082825e-01 + 6.2599055469036102e-02 -5.2695369720458984e-01 <_> - 0 -1 488 6.7417006939649582e-03 + 0 -1 365 -4.5666974037885666e-03 - -7.7294938266277313e-02 3.2216030359268188e-01 + -6.1827522516250610e-01 4.1984613984823227e-02 <_> - 0 -1 11 -8.1952005624771118e-02 + 0 -1 743 -6.1424830928444862e-03 - 5.3666585683822632e-01 -5.9473395347595215e-02 + 3.0607789754867554e-01 -9.1138295829296112e-02 <_> - 0 -1 8 9.2416517436504364e-03 + 0 -1 1019 3.4258943051099777e-03 - -1.2617717683315277e-01 2.0812577009201050e-01 + 5.5657953023910522e-02 -5.3350126743316650e-01 <_> - 0 -1 619 -2.0654057152569294e-03 + 0 -1 731 3.3122287131845951e-03 - -4.8568764328956604e-01 5.2649311721324921e-02 + -1.5935245156288147e-01 1.7000633478164673e-01 <_> - 0 -1 66 -1.3702171854674816e-02 + 0 -1 135 7.4128687381744385e-02 - -6.6060936450958252e-01 3.5181287676095963e-02 + 3.3975400030612946e-02 -6.4646822214126587e-01 <_> - 0 -1 393 -3.0807605944573879e-03 + 0 -1 496 -6.0862921178340912e-02 - -4.4769099354743958e-01 4.8634912818670273e-02 + 3.1012952327728271e-01 -9.1380268335342407e-02 <_> - 0 -1 57 -1.2945728376507759e-02 + 0 -1 575 -4.3243117630481720e-02 - -5.4323107004165649e-01 4.0633078664541245e-02 + -4.5051410794258118e-01 6.6722445189952850e-02 <_> - 0 -1 240 -1.3134386390447617e-02 + 0 -1 322 -5.4576778784394264e-03 - -4.7699347138404846e-01 4.5706178992986679e-02 + -4.8368638753890991e-01 5.5113438516855240e-02 <_> - 0 -1 434 1.6984546091407537e-03 + 0 -1 196 -2.1073617972433567e-03 - -7.0986136794090271e-02 3.2597315311431885e-01 + 2.3326623439788818e-01 -1.2007984519004822e-01 <_> - 0 -1 599 3.8461894728243351e-03 + 0 -1 252 -1.1282963678240776e-02 - 4.0658432990312576e-02 -5.7832121849060059e-01 + 2.9159554839134216e-01 -1.0025029629468918e-01 <_> - 0 -1 189 -1.7426438629627228e-02 + 0 -1 339 2.9302681796252728e-03 - -4.3611589074134827e-01 4.5463379472494125e-02 + -8.5840485990047455e-02 3.3159431815147400e-01 <_> - 0 -1 730 -2.6193801313638687e-03 + 0 -1 53 -2.8825225308537483e-03 - 2.5506833195686340e-01 -8.7045751512050629e-02 + -5.3361582756042480e-01 5.7994876056909561e-02 <_> - 0 -1 150 -1.0474737733602524e-02 + 0 -1 76 6.2230005860328674e-03 - 2.3522177338600159e-01 -9.5193855464458466e-02 + 4.4393569231033325e-02 -5.3072142601013184e-01 <_> - 0 -1 776 -2.0476649515330791e-03 + 0 -1 971 1.1437942739576101e-03 - -4.0278571844100952e-01 5.3846791386604309e-02 + -9.5763660967350006e-02 2.8212538361549377e-01 <_> - 0 -1 492 5.0511634908616543e-03 + 0 -1 1052 1.2469270732253790e-03 - 3.5829022526741028e-02 -5.8457142114639282e-01 + 6.5446242690086365e-02 -4.1902217268943787e-01 <_> - 0 -1 400 -2.6015858165919781e-03 + 0 -1 612 -1.1369751766324043e-02 - 2.8992271423339844e-01 -7.7776394784450531e-02 + -7.0747911930084229e-01 3.4916084259748459e-02 <_> - 0 -1 191 1.4678405132144690e-03 + 0 -1 35 1.0013033449649811e-01 - 4.2822040617465973e-02 -5.0615262985229492e-01 + -6.7160040140151978e-02 4.2184004187583923e-01 <_> - 0 -1 119 3.4870039671659470e-03 + 0 -1 653 -2.6742245536297560e-03 - -8.2636579871177673e-02 2.5724917650222778e-01 + 1.7217047512531281e-01 -1.6229687631130219e-01 <_> - 0 -1 104 -1.9308419525623322e-01 + 0 -1 713 -3.4254738129675388e-03 - 3.6281177401542664e-01 -6.3503719866275787e-02 + 2.9603767395019531e-01 -8.9177258312702179e-02 <_> - 0 -1 545 1.9733399152755737e-02 + 0 -1 669 1.5813322970643640e-03 - -8.6004406213760376e-02 2.5530698895454407e-01 + 4.8733744770288467e-02 -5.6422549486160278e-01 <_> - 0 -1 37 -3.2536339014768600e-02 + 0 -1 917 2.7555555789149366e-05 - -5.8808100223541260e-01 3.7802245467901230e-02 + -1.7079097032546997e-01 1.4066468179225922e-01 <_> - 0 -1 382 8.8406521826982498e-03 + 0 -1 466 -8.2116597332060337e-04 - 2.5931548327207565e-02 -6.5399199724197388e-01 + 1.8260034918785095e-01 -1.3242910802364349e-01 <_> - 0 -1 844 -1.0922113433480263e-03 + 0 -1 353 -1.0168720036745071e-02 - 2.0415900647640228e-01 -1.0292074084281921e-01 + -4.1390055418014526e-01 6.5349683165550232e-02 <_> - 0 -1 892 1.5520181041210890e-03 + 0 -1 96 2.5848036631941795e-02 - -8.4858812391757965e-02 3.0234101414680481e-01 + 4.6910341829061508e-02 -4.7531116008758545e-01 <_> - 0 -1 601 3.6752538289874792e-03 + 0 -1 75 5.9797330759465694e-03 - 3.9351969957351685e-02 -5.4435199499130249e-01 + 4.5450355857610703e-02 -4.5701387524604797e-01 <_> - 0 -1 825 -1.7198601737618446e-02 + 0 -1 81 -2.4257015902549028e-03 - -6.8883073329925537e-01 2.4503545835614204e-02 + 1.8431460857391357e-01 -1.1879430711269379e-01 <_> - 0 -1 783 -4.8199836164712906e-03 + 0 -1 346 -4.1334740817546844e-02 - 3.3481866121292114e-01 -6.0483735054731369e-02 + 3.0460721254348755e-01 -9.4910860061645508e-02 <_> - 0 -1 838 8.6327344179153442e-03 + 0 -1 537 7.5982198119163513e-02 - 2.9317237436771393e-02 -7.1339315176010132e-01 + -6.5890170633792877e-02 3.3325287699699402e-01 <_> - 0 -1 761 5.9000156819820404e-02 + 0 -1 318 -2.7852014682139270e-05 - 2.5574376806616783e-02 -6.3106632232666016e-01 + 1.4771287143230438e-01 -1.4524473249912262e-01 <_> - 0 -1 782 1.0106523986905813e-03 + 0 -1 669 -1.4885163400322199e-03 - -1.0588756203651428e-01 1.9086131453514099e-01 + -4.6987643837928772e-01 4.7233786433935165e-02 <_> - 0 -1 880 1.1946363374590874e-03 + 0 -1 897 -3.3519542776048183e-03 - -8.1224068999290466e-02 2.6191043853759766e-01 + 2.4128976464271545e-01 -9.3788638710975647e-02 <_> - 0 -1 348 8.8360151275992393e-03 + 0 -1 935 1.3348343782126904e-03 - -7.4570186436176300e-02 2.7295246720314026e-01 + -9.9509775638580322e-02 2.9368522763252258e-01 <_> - 0 -1 80 -3.8921819068491459e-03 + 0 -1 704 3.2456549815833569e-03 - -4.6577858924865723e-01 4.1507720947265625e-02 + -9.8895303905010223e-02 2.3363485932350159e-01 <_> - 0 -1 75 2.6258802972733974e-03 + 0 -1 611 4.2385179549455643e-03 - 6.9952867925167084e-02 -2.7727422118186951e-01 + 5.9986904263496399e-02 -4.5745995640754700e-01 <_> - 0 -1 600 4.6104520559310913e-02 + 0 -1 170 8.4751443937420845e-03 - 2.8723197057843208e-02 -6.4130103588104248e-01 + 3.0937874689698219e-02 -6.7139619588851929e-01 <_> - 0 -1 152 -2.3556766100227833e-03 + 0 -1 995 3.0964510515332222e-03 - 1.6910773515701294e-01 -1.2073179334402084e-01 + 3.0879957601428032e-02 -6.2686437368392944e-01 <_> - 0 -1 271 2.0879062358289957e-03 + 0 -1 212 2.3455230984836817e-03 - -6.1540558934211731e-02 3.1166607141494751e-01 - <_> - - 0 -1 726 -2.7457359246909618e-03 - - -4.3359285593032837e-01 4.4867228716611862e-02 - <_> - - 0 -1 643 -5.7035693898797035e-03 - - -6.3301932811737061e-01 2.7553720399737358e-02 - <_> - - 0 -1 272 -2.3487601429224014e-03 - - 2.7741125226020813e-01 -7.1828551590442657e-02 - <_> - - 0 -1 312 -1.2618269771337509e-02 - - -6.0198032855987549e-01 3.3369537442922592e-02 - <_> - - 0 -1 73 -1.2911427766084671e-02 - - 1.9097310304641724e-01 -9.6765249967575073e-02 - <_> - - 0 -1 241 2.5069573894143105e-02 - - 2.9379865154623985e-02 -6.2714409828186035e-01 - <_> - - 0 -1 676 7.4739558622241020e-03 - - -6.2408778816461563e-02 3.2309064269065857e-01 - <_> - - 0 -1 960 -5.5288206785917282e-03 - - -4.4652014970779419e-01 4.4482827186584473e-02 - <_> - - 0 -1 707 5.1614809781312943e-03 - - -1.0451946407556534e-01 1.8219007551670074e-01 - <_> - - 0 -1 306 -4.6268366277217865e-03 - - 2.4900399148464203e-01 -7.5879700481891632e-02 - <_> - - 0 -1 280 -5.0914911553263664e-03 - - -3.8135659694671631e-01 4.8699565231800079e-02 - <_> - - 0 -1 338 1.3252631761133671e-03 - - -8.2675725221633911e-02 2.3466596007347107e-01 - <_> - - 0 -1 989 -2.9426435939967632e-03 - - -3.2485908269882202e-01 5.8781418949365616e-02 - <_> - - 0 -1 352 7.1004321798682213e-03 - - -1.0710758715867996e-01 1.6876961290836334e-01 - <_> - - 0 -1 448 1.6454465221613646e-03 - - -6.8138562142848969e-02 2.6411062479019165e-01 - <_> - - 0 -1 335 -4.4519053772091866e-03 - - -6.5162777900695801e-01 3.1989157199859619e-02 - <_> - - 0 -1 422 -5.6191058829426765e-03 - - 2.2833730280399323e-01 -8.4053449332714081e-02 - <_> - - 0 -1 225 -5.4375766776502132e-03 - - -4.2135429382324219e-01 4.7153089195489883e-02 - <_> - - 0 -1 427 1.4303867937996984e-03 - - -8.1828169524669647e-02 2.2752483189105988e-01 - <_> - - 0 -1 579 5.3636888042092323e-03 - - 4.6839229762554169e-02 -4.3641954660415649e-01 - <_> - - 0 -1 471 6.7459633573889732e-03 - - 4.8482794314622879e-02 -3.7357741594314575e-01 - <_> - - 0 -1 888 1.8225495005026460e-03 - - -7.2007156908512115e-02 2.6155912876129150e-01 - <_> - - 0 -1 107 -6.8536788225173950e-02 - - 2.3726168274879456e-01 -8.8266216218471527e-02 - <_> - - 0 -1 806 8.4726633504033089e-03 - - 3.0765017494559288e-02 -6.1803394556045532e-01 - <_> - - 0 -1 129 1.6150671988725662e-02 - - -6.9989733397960663e-02 2.7056843042373657e-01 - <_> - - 0 -1 414 7.6075509190559387e-02 - - -6.6986277699470520e-02 2.6545816659927368e-01 - <_> - - 0 -1 713 -2.4037770926952362e-03 - - 2.0211938023567200e-01 -1.1674832552671432e-01 - <_> - - 0 -1 78 1.8187157809734344e-02 - - 3.7632372230291367e-02 -5.2273052930831909e-01 - <_> - - 0 -1 569 -1.3952046632766724e-02 - - 3.2746854424476624e-01 -6.3546165823936462e-02 - <_> - - 0 -1 18 -2.6383304595947266e-01 - - -4.4734519720077515e-01 4.3956480920314789e-02 - <_> - - 0 -1 84 3.7522446364164352e-03 - - 3.8990244269371033e-02 -4.2726546525955200e-01 - <_> - - 0 -1 287 1.4125283341854811e-03 - - -5.6341815739870071e-02 3.3222517371177673e-01 - <_> - - 0 -1 582 4.1739037260413170e-03 - - -8.1689253449440002e-02 2.1681067347526550e-01 - <_> - - 0 -1 982 -6.1572249978780746e-03 - - -4.6595495939254761e-01 4.0940407663583755e-02 - <_> - - 0 -1 482 -4.0140310302376747e-03 - - -4.4917678833007812e-01 3.6913067102432251e-02 - <_> - - 0 -1 315 5.7834591716527939e-03 - - 3.7202619016170502e-02 -4.4926682114601135e-01 - <_> - - 0 -1 375 -2.7866717427968979e-03 - - 2.3668289184570312e-01 -7.8896284103393555e-02 - <_> - - 0 -1 740 -2.0863343961536884e-03 - - -3.1535735726356506e-01 5.4699663072824478e-02 - <_> - - 0 -1 16 -3.5249911248683929e-02 - - 2.3871497809886932e-01 -7.4336178600788116e-02 - <_> - - 0 -1 12 1.9735466688871384e-02 - - -6.9253593683242798e-02 2.7050065994262695e-01 - <_> - - 0 -1 977 6.9166612811386585e-03 - - 3.9671208709478378e-02 -4.5562696456909180e-01 - <_> - - 0 -1 180 1.2886511161923409e-02 - - -5.7705853134393692e-02 3.0492311716079712e-01 - <_> - - 0 -1 680 -4.3238401412963867e-02 - - -6.9368255138397217e-01 2.5768887251615524e-02 - <_> - - 0 -1 858 5.2338346838951111e-02 - - -4.1087090969085693e-02 4.6693238615989685e-01 - <_> - - 0 -1 903 -3.8494272157549858e-03 - - 1.6975462436676025e-01 -1.2150127440690994e-01 - <_> - - 0 -1 897 1.1914474889636040e-02 - - -7.7901296317577362e-02 2.2727672755718231e-01 + -1.3303077220916748e-01 1.6908498108386993e-01 <_> - 100 - -1.5521451234817505e+00 + 72 + -1.4052674770355225e+00 <_> - 0 -1 700 1.0511254891753197e-02 + 0 -1 534 -8.4834604058414698e-04 - 7.8954458236694336e-02 6.2691432237625122e-01 + 4.6746683120727539e-01 -1.2498743087053299e-01 <_> - 0 -1 501 -4.5915953814983368e-03 + 0 -1 838 1.1534148361533880e-03 - 4.8032283782958984e-01 -1.2750500440597534e-01 + -2.1341361105442047e-01 3.0533915758132935e-01 <_> - 0 -1 920 1.5926066553220153e-03 + 0 -1 728 1.3660041615366936e-02 - -2.2285957634449005e-01 2.5022059679031372e-01 + -1.5390963852405548e-01 3.2113197445869446e-01 <_> - 0 -1 265 4.7702826559543610e-02 + 0 -1 528 -1.3363182079046965e-03 - -1.6401256620883942e-01 4.6663716435432434e-01 + 2.4346974492073059e-01 -1.8074017763137817e-01 <_> - 0 -1 801 3.6355913616716862e-03 + 0 -1 1002 5.5064354091882706e-04 - -9.0887933969497681e-02 4.3753233551979065e-01 + -1.9600959122180939e-01 2.1903340518474579e-01 <_> - 0 -1 505 -2.9029550496488810e-03 + 0 -1 340 2.8026416897773743e-02 - 3.1178581714630127e-01 -1.4401906728744507e-01 + -9.9956467747688293e-02 5.1314896345138550e-01 <_> - 0 -1 811 6.0793287120759487e-03 + 0 -1 930 -9.8200759384781122e-04 - -1.6874884068965912e-01 2.2609569132328033e-01 + 2.0671010017395020e-01 -1.9585600495338440e-01 <_> - 0 -1 200 4.1879736818373203e-04 + 0 -1 249 -1.9661948084831238e-02 - -1.9620604813098907e-01 1.5544828772544861e-01 + -5.1859843730926514e-01 7.9988524317741394e-02 <_> - 0 -1 886 2.2689576144330204e-04 + 0 -1 514 5.7550622150301933e-03 - -1.9928123056888580e-01 1.4717149734497070e-01 + -1.0230549424886703e-01 2.9102912545204163e-01 <_> - 0 -1 138 -8.1100836396217346e-02 + 0 -1 854 4.8226406797766685e-03 - -5.1434135437011719e-01 5.8547608554363251e-02 + -1.2503834068775177e-01 2.2606587409973145e-01 <_> - 0 -1 108 2.7355052530765533e-02 + 0 -1 1025 -3.5137422382831573e-03 - 6.0101613402366638e-02 -4.1557094454765320e-01 + -6.8291509151458740e-01 4.6296034008264542e-02 <_> - 0 -1 967 -2.4958662688732147e-03 + 0 -1 468 2.7717142074834555e-05 - -5.0487858057022095e-01 5.1647525280714035e-02 + -2.1390475332736969e-01 1.3291628658771515e-01 <_> - 0 -1 420 -1.5961761819198728e-03 + 0 -1 875 -2.2634968161582947e-02 - 2.1670737862586975e-01 -1.2691333889961243e-01 + 4.0156257152557373e-01 -9.0922117233276367e-02 <_> - 0 -1 369 2.1885756403207779e-02 + 0 -1 890 -2.6544253341853619e-04 - -8.3462193608283997e-02 3.1052881479263306e-01 + 2.1944612264633179e-01 -1.5686984360218048e-01 <_> - 0 -1 760 -1.3334145769476891e-02 + 0 -1 45 1.7469950020313263e-02 - 3.0464804172515869e-01 -8.8519357144832611e-02 + 5.9605021029710770e-02 -5.4529672861099243e-01 <_> - 0 -1 688 -1.9117443589493632e-03 + 0 -1 812 3.6130528897047043e-03 - -6.8484777212142944e-01 4.3931856751441956e-02 + 5.2721742540597916e-02 -4.4890201091766357e-01 <_> - 0 -1 689 2.2813947871327400e-03 + 0 -1 813 -3.8260491564869881e-03 - 4.6766888350248337e-02 -4.8588466644287109e-01 + -5.1076781749725342e-01 4.7858215868473053e-02 <_> - 0 -1 164 -8.7422672659158707e-03 + 0 -1 348 -4.6305969590321183e-04 - -4.9902194738388062e-01 4.8665110021829605e-02 + 2.0340332388877869e-01 -1.3007256388664246e-01 <_> - 0 -1 758 -4.0188119746744633e-03 + 0 -1 685 -7.3791583999991417e-03 - 2.2568543255329132e-01 -1.1153879016637802e-01 + -5.4855078458786011e-01 5.1355980336666107e-02 <_> - 0 -1 966 1.3594499323517084e-03 + 0 -1 397 -4.1331160813570023e-02 - 4.2799551039934158e-02 -5.6778526306152344e-01 + -3.7914556264877319e-01 6.2432620674371719e-02 <_> - 0 -1 718 -6.5033760620281100e-04 + 0 -1 720 -1.4983891742303967e-03 - 2.0394213497638702e-01 -1.1888848990201950e-01 + -5.2967226505279541e-01 4.2461462318897247e-02 <_> - 0 -1 473 -3.1412184238433838e-02 + 0 -1 785 -2.5054097641259432e-03 - 2.5797879695892334e-01 -9.3766883015632629e-02 + 2.0288434624671936e-01 -1.2341590225696564e-01 <_> - 0 -1 139 -9.2636439949274063e-03 + 0 -1 259 -7.1871257387101650e-04 - -5.6845456361770630e-01 4.3344158679246902e-02 + 2.4784520268440247e-01 -9.8167583346366882e-02 <_> - 0 -1 383 -4.1950333863496780e-02 + 0 -1 260 -6.8983237724751234e-04 - -3.3588516712188721e-01 6.3371837139129639e-02 + 2.7780577540397644e-01 -9.7512029111385345e-02 <_> - 0 -1 881 2.9165907762944698e-03 + 0 -1 274 4.8434769269078970e-04 - -6.9124616682529449e-02 3.5223892331123352e-01 + -1.1704409867525101e-01 2.4324342608451843e-01 <_> - 0 -1 904 -1.0271451901644468e-03 + 0 -1 508 -3.6378027871251106e-03 - 1.8418928980827332e-01 -1.1801387369632721e-01 + -5.7295501232147217e-01 4.9037151038646698e-02 <_> - 0 -1 663 2.6636901311576366e-03 + 0 -1 709 -2.6648804545402527e-02 - -1.0614035278558731e-01 2.1366043388843536e-01 + -6.0253041982650757e-01 3.6413222551345825e-02 <_> - 0 -1 629 -1.8712934106588364e-02 + 0 -1 825 -4.3416651897132397e-03 - 2.4622038006782532e-01 -9.3236625194549561e-02 + 4.7109794616699219e-01 -5.9058945626020432e-02 <_> - 0 -1 33 -4.8551969230175018e-03 + 0 -1 60 -2.7588163502514362e-03 - 3.0577266216278076e-01 -7.4214689433574677e-02 + -4.9160134792327881e-01 5.4663125425577164e-02 <_> - 0 -1 156 2.4788705632090569e-03 + 0 -1 987 4.7046472318470478e-03 - -8.6660243570804596e-02 2.9340657591819763e-01 + 3.7025094032287598e-02 -5.6842529773712158e-01 <_> - 0 -1 291 -4.3734526261687279e-03 + 0 -1 77 4.9029560759663582e-03 - -5.0270831584930420e-01 4.9233034253120422e-02 + 4.8207473009824753e-02 -4.2965477705001831e-01 <_> - 0 -1 318 -4.9623926170170307e-03 + 0 -1 837 -7.0135248824954033e-04 - -4.4072946906089783e-01 4.5711714774370193e-02 + 2.2556030750274658e-01 -9.9117368459701538e-02 <_> - 0 -1 82 3.0696424655616283e-03 + 0 -1 332 2.7165210340172052e-03 - 5.5255725979804993e-02 -3.7899428606033325e-01 + 4.3833449482917786e-02 -5.5271440744400024e-01 <_> - 0 -1 157 -8.1601645797491074e-03 + 0 -1 837 8.9941755868494511e-04 - 2.6425153017044067e-01 -8.2545064389705658e-02 + -8.9474648237228394e-02 2.6415902376174927e-01 <_> - 0 -1 137 -1.4500592369586229e-03 + 0 -1 723 -1.7575379461050034e-03 - 1.8156392872333527e-01 -1.2637530267238617e-01 + -5.7822185754776001e-01 4.4655490666627884e-02 <_> - 0 -1 339 -3.7104606162756681e-03 + 0 -1 323 2.2079560905694962e-02 - 1.9824002683162689e-01 -1.0828326642513275e-01 + -9.1862626373767853e-02 2.6927500963211060e-01 <_> - 0 -1 673 -8.7567782029509544e-03 + 0 -1 247 -2.4989219382405281e-03 - 2.8610706329345703e-01 -7.3251776397228241e-02 + 1.9282613694667816e-01 -1.4004705846309662e-01 <_> - 0 -1 317 -1.8970356322824955e-03 + 0 -1 388 4.4558709487318993e-03 - -6.0897153615951538e-01 3.7743657827377319e-02 + 5.2965965121984482e-02 -4.6530798077583313e-01 <_> - 0 -1 20 3.8996827602386475e-01 + 0 -1 345 8.9809950441122055e-03 - -5.8310892432928085e-02 3.6127504706382751e-01 + -6.9099865853786469e-02 3.5005539655685425e-01 <_> - 0 -1 396 -4.9336552619934082e-03 + 0 -1 589 -4.6078087761998177e-03 - 3.0048343539237976e-01 -6.4242139458656311e-02 + 1.5373907983303070e-01 -1.5948937833309174e-01 <_> - 0 -1 54 2.5108925998210907e-02 + 0 -1 10 -8.9063167572021484e-02 - 2.5090903043746948e-02 -8.1637203693389893e-01 + 4.8500600457191467e-01 -5.1386959850788116e-02 <_> - 0 -1 429 4.2880335822701454e-03 + 0 -1 540 4.8636873252689838e-03 - -8.1443257629871368e-02 2.6617726683616638e-01 + 5.1732856780290604e-02 -4.9787709116935730e-01 <_> - 0 -1 456 -5.6165808928199112e-05 + 0 -1 992 -5.4465518333017826e-03 - 1.4481364190578461e-01 -1.6212667524814606e-01 + 1.5584819018840790e-01 -1.4326727390289307e-01 <_> - 0 -1 406 3.0591385439038277e-03 + 0 -1 788 6.4384475350379944e-02 - 2.8733581304550171e-02 -7.0054715871810913e-01 + 3.1540591269731522e-02 -7.1331930160522461e-01 <_> - 0 -1 185 -3.0338061042129993e-03 + 0 -1 25 -9.3528348952531815e-03 - -8.2671564817428589e-01 1.9727285951375961e-02 + -5.8800560235977173e-01 3.2534934580326080e-02 <_> - 0 -1 787 -2.1344989072531462e-03 + 0 -1 374 6.5686285961419344e-04 - 1.6036525368690491e-01 -1.2014801055192947e-01 + -1.6972899436950684e-01 1.4208021759986877e-01 <_> - 0 -1 246 2.4434458464384079e-02 + 0 -1 744 -6.5707243047654629e-03 - -1.0801825672388077e-01 2.0232307910919189e-01 + 3.1901842355728149e-01 -7.0233277976512909e-02 <_> - 0 -1 214 -6.6356086172163486e-03 + 0 -1 370 7.0676081813871861e-03 - 1.9015397131443024e-01 -1.0796815156936646e-01 + 3.0735086649656296e-02 -7.6451587677001953e-01 <_> - 0 -1 781 -8.2725454121828079e-03 + 0 -1 875 -1.1614331044256687e-02 - 3.1057110428810120e-01 -8.6532585322856903e-02 + 2.0416912436485291e-01 -1.0650242120027542e-01 <_> - 0 -1 95 -7.1973735466599464e-03 + 0 -1 227 -3.0933439731597900e-02 - -5.8514142036437988e-01 3.6453813314437866e-02 + -3.5186296701431274e-01 6.3158944249153137e-02 <_> - 0 -1 461 -1.3809885131195188e-03 + 0 -1 31 8.9404191821813583e-03 - 1.6234619915485382e-01 -1.2079101055860519e-01 + 4.1301336139440536e-02 -5.2171415090560913e-01 <_> - 0 -1 408 1.2584345415234566e-02 + 0 -1 542 -3.0004943255335093e-04 - -8.4917336702346802e-02 2.3094473779201508e-01 + 1.8332102894783020e-01 -1.1965552717447281e-01 <_> - 0 -1 907 8.0425739288330078e-03 + 0 -1 753 -4.2704585939645767e-03 - 4.0869396179914474e-02 -5.2088880538940430e-01 + -4.1220253705978394e-01 5.2136015146970749e-02 <_> - 0 -1 446 4.0921196341514587e-02 + 0 -1 979 9.1349193826317787e-04 - -5.4803006350994110e-02 3.5920065641403198e-01 + -8.2035504281520844e-02 2.7817621827125549e-01 <_> - 0 -1 635 -3.6556557752192020e-03 + 0 -1 97 2.8089310973882675e-02 - 3.0303934216499329e-01 -6.9975942373275757e-02 + 6.0909613966941833e-02 -3.7705209851264954e-01 <_> - 0 -1 275 -2.6071248576045036e-03 + 0 -1 979 -1.1489203898236156e-03 - 1.7682927846908569e-01 -1.1164762824773788e-01 + 2.9547268152236938e-01 -7.8550107777118683e-02 <_> - 0 -1 289 -5.8146800845861435e-02 + 0 -1 766 -8.5876882076263428e-04 - -3.7277954816818237e-01 5.6890588253736496e-02 + 1.6158875823020935e-01 -1.3613829016685486e-01 <_> - 0 -1 120 -2.2651627659797668e-01 + 0 -1 862 3.3645064104348421e-03 - 4.0828245878219604e-01 -5.9184983372688293e-02 + 3.6055568605661392e-02 -5.5788111686706543e-01 <_> - 0 -1 738 5.7799168862402439e-03 + 0 -1 1034 -1.2699423357844353e-02 - 4.0102362632751465e-02 -5.5016636848449707e-01 + -4.2199519276618958e-01 4.3876208364963531e-02 <_> - 0 -1 302 1.6304963501170278e-03 + 0 -1 158 -1.3306856155395508e-01 - -1.2154985219240189e-01 1.5898743271827698e-01 + -7.5723612308502197e-01 2.4755204096436501e-02 <_> - 0 -1 672 2.0045600831508636e-03 + 0 -1 822 4.9831219017505646e-02 - 2.9790198430418968e-02 -5.8250021934509277e-01 + 2.5250671431422234e-02 -6.3122928142547607e-01 <_> - 0 -1 371 -2.0879322662949562e-02 + 0 -1 569 5.8193420991301537e-03 - 2.1142369508743286e-01 -8.7382547557353973e-02 + 2.2189516574144363e-02 -7.2821933031082153e-01 <_> - 0 -1 954 -7.2442064993083477e-04 + 0 -1 422 -6.3158385455608368e-03 - 2.3263402283191681e-01 -8.1574723124504089e-02 + 1.9480472803115845e-01 -1.0275462269783020e-01 <_> - 0 -1 971 -7.4541047215461731e-03 + 0 -1 58 -2.6879269629716873e-02 - -4.5152980089187622e-01 4.5829907059669495e-02 + -4.3909311294555664e-01 4.5222271233797073e-02 <_> - 0 -1 930 -8.5284758824855089e-04 + 0 -1 900 -1.6478844918310642e-03 - 2.1253970265388489e-01 -9.1697148978710175e-02 + 2.7425831556320190e-01 -7.7650256454944611e-02 <_> - 0 -1 193 2.0642249728552997e-04 + 0 -1 947 4.4362144544720650e-03 - -1.3943105936050415e-01 1.3452273607254028e-01 + 3.2876692712306976e-02 -6.0907542705535889e-01 <_> - 0 -1 922 3.2144919969141483e-03 + 0 -1 760 -1.5154483262449503e-03 - 2.8089782223105431e-02 -6.4253503084182739e-01 + 2.2985421121120453e-01 -8.5810013115406036e-02 <_> - 0 -1 964 -4.6502160839736462e-03 + 0 -1 157 7.0627350360155106e-03 - 2.4156840145587921e-01 -7.5992465019226074e-02 + 3.4827440977096558e-02 -5.9273594617843628e-01 <_> - 0 -1 391 -7.9781133681535721e-03 + 0 -1 393 4.5482232235372066e-03 - -6.4584964513778687e-01 2.7661839500069618e-02 + -5.2113339304924011e-02 4.0603092312812805e-01 <_> - 0 -1 535 5.7130996137857437e-03 + 0 -1 183 -3.9095789194107056e-02 - 3.4437701106071472e-02 -4.5668947696685791e-01 + 2.5562492012977600e-01 -8.1410482525825500e-02 <_> - 0 -1 625 5.4299971088767052e-03 + 0 -1 718 -1.9122204976156354e-03 - -8.4557615220546722e-02 2.4553726613521576e-01 + -6.5523076057434082e-01 3.1964879482984543e-02 <_> - 0 -1 949 2.3061740212142467e-03 + 0 -1 622 5.1604928448796272e-03 - 3.6576978862285614e-02 -5.1891702413558960e-01 - <_> - - 0 -1 815 5.0157017540186644e-04 - - -1.1976727843284607e-01 1.6033935546875000e-01 - <_> - - 0 -1 525 -1.9801128655672073e-04 - - 1.5492685139179230e-01 -1.1399404704570770e-01 - <_> - - 0 -1 840 2.1493299864232540e-03 - - -8.7143458425998688e-02 2.1080201864242554e-01 - <_> - - 0 -1 45 -1.0518108028918505e-03 - - 1.7875078320503235e-01 -9.7399607300758362e-02 - <_> - - 0 -1 590 9.2383408918976784e-03 - - 3.2961033284664154e-02 -5.5265057086944580e-01 - <_> - - 0 -1 41 3.6674018949270248e-02 - - -5.6394163519144058e-02 3.2619351148605347e-01 - <_> - - 0 -1 725 1.8489698413759470e-03 - - -7.7260658144950867e-02 2.3810040950775146e-01 - <_> - - 0 -1 723 -3.9793262258172035e-03 - - 2.3499612510204315e-01 -8.8490329682826996e-02 - <_> - - 0 -1 619 3.7299278192222118e-03 - - 3.1517989933490753e-02 -6.3558888435363770e-01 - <_> - - 0 -1 916 4.9755964428186417e-03 - - 2.8343016281723976e-02 -5.1388341188430786e-01 - <_> - - 0 -1 77 2.8308688197284937e-03 - - -1.1687427759170532e-01 1.4075778424739838e-01 - <_> - - 0 -1 72 -4.3399848043918610e-02 - - 3.3840376138687134e-01 -6.5363220870494843e-02 - <_> - - 0 -1 174 4.4767763465642929e-03 - - 5.3890492767095566e-02 -3.8843661546707153e-01 - <_> - - 0 -1 443 1.4579682610929012e-03 - - -9.5170073211193085e-02 1.7093485593795776e-01 - <_> - - 0 -1 217 4.3643731623888016e-03 - - -1.0353569686412811e-01 1.9202291965484619e-01 - <_> - - 0 -1 416 -6.4208358526229858e-03 - - -5.2469170093536377e-01 3.1174579635262489e-02 - <_> - - 0 -1 399 -1.0310811921954155e-03 - - 2.1713955700397491e-01 -8.0816701054573059e-02 - <_> - - 0 -1 924 -4.0359990671277046e-03 - - -5.2423858642578125e-01 3.4388832747936249e-02 - <_> - - 0 -1 750 -5.9410361573100090e-03 - - 2.1114565432071686e-01 -8.0375924706459045e-02 - <_> - - 0 -1 720 -4.7730140388011932e-02 - - -6.6018968820571899e-01 2.6816543191671371e-02 - <_> - - 0 -1 777 -6.1359764076769352e-03 - - 2.6270267367362976e-01 -7.4918255209922791e-02 - <_> - - 0 -1 370 -3.2268161885440350e-03 - - -3.3210110664367676e-01 5.3716354072093964e-02 - <_> - - 0 -1 872 2.7645970694720745e-03 - - 2.4829804897308350e-02 -6.3309198617935181e-01 - <_> - - 0 -1 460 6.1914063990116119e-03 - - -7.9355642199516296e-02 2.0996589958667755e-01 - <_> - - 0 -1 890 -6.0850339941680431e-03 - - 1.8700407445430756e-01 -9.2255704104900360e-02 - <_> - - 0 -1 847 3.8954569026827812e-03 - - -6.2000993639230728e-02 2.9947289824485779e-01 - <_> - - 0 -1 559 7.9390443861484528e-03 - - -4.7935441136360168e-02 3.3055123686790466e-01 - <_> - - 0 -1 136 -7.4474988505244255e-03 - - -2.7902829647064209e-01 5.9020437300205231e-02 + 2.8228869661688805e-02 -6.0336226224899292e-01 <_> - 100 - -1.5058170557022095e+00 + 63 + -1.2550007104873657e+00 <_> - 0 -1 764 6.6398456692695618e-03 + 0 -1 532 -1.3708438724279404e-02 - 1.5219502151012421e-01 7.0482629537582397e-01 + 4.5314663648605347e-01 -1.2558805942535400e-01 <_> - 0 -1 451 -7.4103027582168579e-03 + 0 -1 32 1.2687301263213158e-02 - 4.4995731115341187e-01 -1.0949239879846573e-01 + -1.5584127604961395e-01 3.8753288984298706e-01 <_> - 0 -1 509 -1.2679899111390114e-02 + 0 -1 254 3.3966779708862305e-02 - 3.1908708810806274e-01 -1.3895240426063538e-01 + -1.1772038787603378e-01 4.0628942847251892e-01 <_> - 0 -1 221 1.0303283110260963e-02 + 0 -1 756 8.0258902162313461e-03 - -1.7546384036540985e-01 2.9695376753807068e-01 + -1.4661933481693268e-01 4.0369525551795959e-01 <_> - 0 -1 331 -4.7976471483707428e-02 + 0 -1 2 -4.2836386710405350e-03 - 4.4112482666969299e-01 -1.1231642961502075e-01 + 2.2167153656482697e-01 -1.9662868976593018e-01 <_> - 0 -1 810 3.2145732548087835e-03 + 0 -1 164 -2.7807329315692186e-03 - -1.8380118906497955e-01 2.3316045105457306e-01 + -4.6929144859313965e-01 6.9577261805534363e-02 <_> - 0 -1 793 2.4557339493185282e-03 + 0 -1 172 1.9090694840997458e-03 - -1.4323309063911438e-01 2.3558256030082703e-01 + 5.9488739818334579e-02 -6.3101488351821899e-01 <_> - 0 -1 595 -5.2055031061172485e-02 + 0 -1 426 3.1442400068044662e-03 - -4.4221264123916626e-01 7.0444636046886444e-02 + -1.1149841547012329e-01 3.0095639824867249e-01 <_> - 0 -1 51 7.7533419243991375e-03 + 0 -1 324 -2.8418585658073425e-02 - 5.6696638464927673e-02 -5.1518803834915161e-01 + 3.6157062649726868e-01 -9.6387691795825958e-02 <_> - 0 -1 534 4.7272985102608800e-04 + 0 -1 449 -4.4032465666532516e-03 - -1.5081474184989929e-01 1.8353472650051117e-01 + 3.2977014780044556e-01 -9.8187342286109924e-02 <_> - 0 -1 43 -1.7044700682163239e-02 + 0 -1 400 -2.6041134260594845e-03 - -4.3840527534484863e-01 6.8837635219097137e-02 + 2.8221642971038818e-01 -1.0142992436885834e-01 <_> - 0 -1 883 -3.5762921907007694e-03 + 0 -1 357 -5.8917067945003510e-03 - 2.4851283431053162e-01 -1.0779865086078644e-01 + -5.8254349231719971e-01 6.0040380805730820e-02 <_> - 0 -1 839 -2.4369158782064915e-03 + 0 -1 998 1.3956660404801369e-03 - 3.0688673257827759e-01 -8.9006565511226654e-02 + -1.6574928164482117e-01 1.7746162414550781e-01 <_> - 0 -1 933 -3.6047215107828379e-03 + 0 -1 1022 -1.7630932852625847e-03 - 2.7542102336883545e-01 -1.0634675621986389e-01 + -5.7597070932388306e-01 6.2388133257627487e-02 <_> - 0 -1 36 -1.1534212157130241e-02 + 0 -1 697 -1.3517161132767797e-03 - -5.5281609296798706e-01 4.9770243465900421e-02 + -5.1934504508972168e-01 4.7232870012521744e-02 <_> - 0 -1 405 2.7643658686429262e-03 + 0 -1 507 -3.8743610493838787e-03 - 2.9803691431879997e-02 -7.3425543308258057e-01 + 2.9165247082710266e-01 -9.9355563521385193e-02 <_> - 0 -1 849 -2.6033269241452217e-03 + 0 -1 765 1.0973589494824409e-02 - -4.4093501567840576e-01 5.0419628620147705e-02 + -7.7571205794811249e-02 3.4312543272972107e-01 <_> - 0 -1 245 4.8673897981643677e-02 + 0 -1 128 -3.5274624824523926e-03 - 5.8146391063928604e-02 -3.7859597802162170e-01 + -6.7513287067413330e-01 3.6897819489240646e-02 <_> - 0 -1 898 -4.4065229594707489e-03 + 0 -1 605 -2.4239125195890665e-03 - -6.9404369592666626e-01 3.1734105199575424e-02 + 2.5701349973678589e-01 -1.0465545207262039e-01 <_> - 0 -1 973 1.6997805796563625e-03 + 0 -1 727 -8.3098262548446655e-03 - 3.6800261586904526e-02 -5.4090088605880737e-01 + 2.6842510700225830e-01 -9.9635124206542969e-02 <_> - 0 -1 484 1.8069827929139137e-03 + 0 -1 269 -2.7831714600324631e-02 - -8.9325174689292908e-02 2.5629612803459167e-01 + -3.9901316165924072e-01 6.5086022019386292e-02 <_> - 0 -1 487 -4.4371248222887516e-03 + 0 -1 399 8.1690559163689613e-03 - 2.3971243202686310e-01 -1.0280106216669083e-01 + -1.1402101069688797e-01 2.2761905193328857e-01 <_> - 0 -1 973 -2.2968063130974770e-03 + 0 -1 368 2.8635351918637753e-03 - -5.8439761400222778e-01 4.1789893060922623e-02 + -1.4034478366374969e-01 1.8733198940753937e-01 <_> - 0 -1 950 1.4388319104909897e-03 + 0 -1 286 -2.1204156801104546e-03 - -1.2928913533687592e-01 1.6424950957298279e-01 + -5.9949654340744019e-01 4.9501683562994003e-02 <_> - 0 -1 685 -6.5411212854087353e-03 + 0 -1 669 -9.4446074217557907e-04 - 1.7306149005889893e-01 -1.3702909648418427e-01 + -3.8145086169242859e-01 5.9254929423332214e-02 <_> - 0 -1 414 -9.8783060908317566e-02 + 0 -1 686 2.1901372820138931e-03 - 4.2455860972404480e-01 -5.3996428847312927e-02 + 3.6901079118251801e-02 -5.6260800361633301e-01 <_> - 0 -1 533 -1.5466672182083130e-01 + 0 -1 103 4.2550573125481606e-03 - -4.6163687109947205e-01 5.4335389286279678e-02 + -9.8831087350845337e-02 2.3313422501087189e-01 <_> - 0 -1 626 -2.3389626294374466e-03 + 0 -1 281 4.2771790176630020e-03 - -6.5777504444122314e-01 2.6686858385801315e-02 + 4.2207289487123489e-02 -5.6859022378921509e-01 <_> - 0 -1 397 5.0454838201403618e-03 + 0 -1 422 -7.8792609274387360e-03 - 4.9083609133958817e-02 -3.7508815526962280e-01 + 2.2428077459335327e-01 -9.9518932402133942e-02 <_> - 0 -1 326 2.5655250996351242e-02 + 0 -1 561 -3.5514549817889929e-03 - -5.0410125404596329e-02 4.6358433365821838e-01 + -5.6150603294372559e-01 3.9242122322320938e-02 <_> - 0 -1 402 2.6888975407928228e-03 + 0 -1 738 -6.8606354761868715e-04 - -8.7988443672657013e-02 2.4659486114978790e-01 + 2.1056549251079559e-01 -1.2413132935762405e-01 <_> - 0 -1 455 -3.9576226845383644e-03 + 0 -1 433 5.2483025938272476e-03 - -3.4467720985412598e-01 6.0443773865699768e-02 + 3.4256864339113235e-02 -7.2566890716552734e-01 <_> - 0 -1 396 3.9240214973688126e-03 + 0 -1 658 -3.6910744383931160e-03 - -7.2165921330451965e-02 3.6404970288276672e-01 + 2.6440864801406860e-01 -8.9745096862316132e-02 <_> - 0 -1 988 1.3846965739503503e-03 + 0 -1 127 2.0369128324091434e-03 - 5.7182963937520981e-02 -3.8552245497703552e-01 + 4.6990364789962769e-02 -5.3132331371307373e-01 <_> - 0 -1 945 -8.4817763417959213e-03 + 0 -1 662 3.8735207635909319e-03 - 1.8708378076553345e-01 -1.1441195011138916e-01 + -9.1540865600109100e-02 2.7486115694046021e-01 <_> - 0 -1 944 2.6850812137126923e-03 + 0 -1 126 6.0556940734386444e-03 - 3.1117379665374756e-02 -6.2151008844375610e-01 + 5.3909529000520706e-02 -4.6437451243400574e-01 <_> - 0 -1 688 1.8728687427937984e-03 + 0 -1 912 4.8301572678610682e-04 - 2.9517510905861855e-02 -5.8275890350341797e-01 + -1.6165176033973694e-01 1.3917934894561768e-01 <_> - 0 -1 448 -1.4214152470231056e-03 + 0 -1 101 -1.4880476519465446e-02 - 2.1085265278816223e-01 -8.4942653775215149e-02 + -5.9634107351303101e-01 3.9811171591281891e-02 <_> - 0 -1 186 -1.4164925087243319e-03 + 0 -1 609 2.9731846880167723e-03 - -5.0255894660949707e-01 3.4562669694423676e-02 + 3.0903076753020287e-02 -6.2935864925384521e-01 <_> - 0 -1 572 2.7755820192396641e-03 + 0 -1 90 -1.1181155219674110e-02 - -8.5956700146198273e-02 2.1839313209056854e-01 + 3.5473996400833130e-01 -6.4499482512474060e-02 <_> - 0 -1 517 6.0641965828835964e-03 + 0 -1 1009 -9.8370900377631187e-04 - 3.4184314310550690e-02 -5.6067311763763428e-01 + 2.9858112335205078e-01 -8.4500424563884735e-02 <_> - 0 -1 773 -2.9663506429642439e-03 + 0 -1 975 -1.0228222236037254e-03 - 2.6388403773307800e-01 -7.4524797499179840e-02 + 2.7100124955177307e-01 -1.0033085197210312e-01 <_> - 0 -1 986 -1.7851786687970161e-02 + 0 -1 913 2.0134919323027134e-03 - -3.5538297891616821e-01 5.5470395833253860e-02 + 4.3533660471439362e-02 -5.4969471693038940e-01 <_> - 0 -1 62 -7.7814348042011261e-03 + 0 -1 881 -3.1473359558731318e-03 - 2.5654977560043335e-01 -7.7634811401367188e-02 + 3.1102818250656128e-01 -8.0141142010688782e-02 <_> - 0 -1 140 6.2794378027319908e-04 + 0 -1 991 -2.9232497327029705e-03 - -1.1543263494968414e-01 1.7257589101791382e-01 + -6.7808300256729126e-01 3.5025410354137421e-02 <_> - 0 -1 845 -2.0482162944972515e-03 + 0 -1 494 -3.8992143236100674e-03 - 2.0133562386035919e-01 -9.2291958630084991e-02 + 2.5711989402770996e-01 -8.4509201347827911e-02 <_> - 0 -1 852 -2.0528757013380527e-03 + 0 -1 547 -3.8403570652008057e-02 - 2.4054610729217529e-01 -9.5314949750900269e-02 + 2.8463324904441833e-01 -7.5673028826713562e-02 <_> - 0 -1 894 1.9264804432168603e-03 + 0 -1 700 -2.2210094612091780e-03 - -8.8165275752544403e-02 2.1321870386600494e-01 + -5.6876182556152344e-01 4.0759250521659851e-02 <_> - 0 -1 116 1.0841939598321915e-02 + 0 -1 989 6.9615743122994900e-03 - 3.4955434501171112e-02 -5.3944343328475952e-01 + -7.8118488192558289e-02 2.8128826618194580e-01 <_> - 0 -1 224 -7.5648901984095573e-03 + 0 -1 948 -1.8219950143247843e-03 - -7.1435016393661499e-01 2.2735377773642540e-02 + 1.8647159636020660e-01 -1.3465921580791473e-01 <_> - 0 -1 503 -7.4579543434083462e-04 + 0 -1 697 1.0106971021741629e-03 - 2.0245671272277832e-01 -9.3201741576194763e-02 + 5.7168632745742798e-02 -4.1419604420661926e-01 <_> - 0 -1 274 -1.2499685399234295e-03 + 0 -1 945 -3.3746981061995029e-03 - 1.4646218717098236e-01 -1.3543428480625153e-01 + -5.2892911434173584e-01 4.0065344423055649e-02 <_> - 0 -1 270 5.8323808480054140e-04 + 0 -1 1030 -8.5245687514543533e-03 - -9.3358881771564484e-02 2.0619191229343414e-01 + -5.0935691595077515e-01 3.8823168724775314e-02 <_> - 0 -1 439 1.9810695201158524e-02 + 0 -1 1012 -2.2426969371736050e-03 - 2.7015892788767815e-02 -7.5727492570877075e-01 + 2.5891116261482239e-01 -8.8167145848274231e-02 <_> - 0 -1 175 5.9376070275902748e-03 + 0 -1 402 -5.9730862267315388e-03 - -1.2178353220224380e-01 1.6173928976058960e-01 + -4.3465223908424377e-01 4.9864508211612701e-02 <_> - 0 -1 914 1.5689490828663111e-03 + 0 -1 452 -5.5482299067080021e-03 - 3.1975947320461273e-02 -6.0493367910385132e-01 + 2.5288850069046021e-01 -9.3322932720184326e-02 <_> - 0 -1 575 2.5749076157808304e-03 + 0 -1 51 3.7344563007354736e-01 - -9.0526103973388672e-02 2.2666496038436890e-01 + -4.9019347876310349e-02 4.3872711062431335e-01 <_> - 0 -1 90 7.9413484781980515e-03 + 0 -1 615 -4.0881419554352760e-03 - 5.1273416727781296e-02 -3.9284336566925049e-01 + 3.1952694058418274e-01 -7.7735908329486847e-02 <_> - 0 -1 15 3.2074376940727234e-02 + 0 -1 202 3.1661842949688435e-03 - 2.7649452909827232e-02 -6.5098905563354492e-01 + -1.0995075106620789e-01 1.7701222002506256e-01 <_> - 0 -1 891 -4.8892917111515999e-03 + 0 -1 17 -2.1666671335697174e-01 - -4.7998306155204773e-01 3.3806797116994858e-02 + -4.5134860277175903e-01 4.9127347767353058e-02 <_> - 0 -1 475 -5.4039997048676014e-03 + 0 -1 241 -3.1139418482780457e-02 - 2.8928443789482117e-01 -6.7743733525276184e-02 + 2.5138390064239502e-01 -9.4933450222015381e-02 <_> - 0 -1 531 6.3710450194776058e-03 + 0 -1 459 9.1597874416038394e-04 - -9.2935405671596527e-02 1.9695936143398285e-01 + -7.4231699109077454e-02 3.1368830800056458e-01 <_> - 0 -1 578 -1.8336625071242452e-03 + 0 -1 747 -6.1164153739809990e-03 - -3.5492643713951111e-01 5.1711678504943848e-02 - <_> - - 0 -1 917 2.1252036094665527e-03 - - 2.0353749394416809e-02 -7.2820025682449341e-01 - <_> - - 0 -1 233 1.1279534548521042e-02 - - 2.5639204308390617e-02 -5.8714842796325684e-01 - <_> - - 0 -1 679 -1.1507571488618851e-01 - - -7.1453052759170532e-01 2.0069327205419540e-02 - <_> - - 0 -1 757 -1.9626193679869175e-03 - - 1.6723833978176117e-01 -1.0802425444126129e-01 - <_> - - 0 -1 756 4.7044735401868820e-03 - - -5.0709329545497894e-02 3.6821383237838745e-01 - <_> - - 0 -1 951 1.8476420082151890e-03 - - 2.8631281107664108e-02 -6.8395125865936279e-01 - <_> - - 0 -1 546 -5.4538771510124207e-03 - - -6.8269199132919312e-01 2.0947692915797234e-02 - <_> - - 0 -1 130 -1.0074324905872345e-02 - - -5.0528079271316528e-01 2.8627410531044006e-02 - <_> - - 0 -1 207 -3.2069636508822441e-03 - - 1.8038518726825714e-01 -9.3303814530372620e-02 - <_> - - 0 -1 327 3.5637444816529751e-03 - - -6.5284818410873413e-02 3.2510238885879517e-01 - <_> - - 0 -1 247 2.1060477010905743e-03 - - 3.0474457889795303e-02 -5.9379291534423828e-01 - <_> - - 0 -1 568 4.2934687808156013e-03 - - -7.1521542966365814e-02 2.4279323220252991e-01 - <_> - - 0 -1 809 8.2498760893940926e-03 - - 3.7760157138109207e-02 -4.5278856158256531e-01 - <_> - - 0 -1 606 2.5047136005014181e-03 - - -7.9689919948577881e-02 2.0523649454116821e-01 - <_> - - 0 -1 651 -1.7786353128030896e-03 - - -6.7214471101760864e-01 2.7108855545520782e-02 - <_> - - 0 -1 93 5.6851857900619507e-01 - - -2.9719989746809006e-02 6.2848883867263794e-01 - <_> - - 0 -1 1 -3.9951098151504993e-03 - - 1.6902630031108856e-01 -9.6066430211067200e-02 - <_> - - 0 -1 790 -1.1912260204553604e-02 - - 1.8001109361648560e-01 -1.0152278095483780e-01 - <_> - - 0 -1 13 -3.2837040722370148e-02 - - 2.2790163755416870e-01 -7.5773715972900391e-02 - <_> - - 0 -1 714 -9.5821768045425415e-03 - - 2.8319683670997620e-01 -6.0501150786876678e-02 - <_> - - 0 -1 584 -7.0154434069991112e-03 - - 3.7711927294731140e-01 -4.5414235442876816e-02 - <_> - - 0 -1 598 2.2930791601538658e-03 - - -9.7957342863082886e-02 1.8666461110115051e-01 - <_> - - 0 -1 409 3.6181495524942875e-03 - - -8.5584357380867004e-02 2.1272744238376617e-01 - <_> - - 0 -1 169 -3.5851418506354094e-03 - - -3.2166537642478943e-01 5.0518564879894257e-02 - <_> - - 0 -1 736 2.0358990877866745e-03 - - -9.0195730328559875e-02 1.7850238084793091e-01 - <_> - - 0 -1 328 3.0855672433972359e-02 - - 7.0852726697921753e-02 -2.3407098650932312e-01 - <_> - - 0 -1 543 -2.8650071471929550e-03 - - 2.5149047374725342e-01 -7.0797137916088104e-02 - <_> - - 0 -1 658 6.9189509376883507e-03 - - -7.6844424009323120e-02 2.2756692767143250e-01 - <_> - - 0 -1 831 3.2940365374088287e-02 - - -6.0664962977170944e-02 2.7875399589538574e-01 - <_> - - 0 -1 835 8.9268945157527924e-03 - - -8.5170723497867584e-02 2.3205895721912384e-01 - <_> - - 0 -1 645 -7.8886147821322083e-04 - - -2.9130771756172180e-01 6.2974251806735992e-02 - <_> - - 0 -1 71 -5.6759864091873169e-03 - - -4.1244068741798401e-01 3.6539580672979355e-02 - <_> - - 0 -1 273 1.2777841184288263e-03 - - -8.5783556103706360e-02 1.8866100907325745e-01 - <_> - - 0 -1 887 3.7156887352466583e-02 - - -1.0894140601158142e-01 1.4975252747535706e-01 - <_> - - 0 -1 92 -5.7424330711364746e-01 - - 7.2750979661941528e-01 -2.4812746793031693e-02 - <_> - - 0 -1 222 -1.3634916394948959e-03 - - 2.2405619919300079e-01 -6.9666981697082520e-02 - <_> - - 0 -1 814 3.3075414597988129e-02 - - -5.6832231581211090e-02 3.0118697881698608e-01 + -7.0417582988739014e-01 3.4018490463495255e-02 <_> - 100 - -1.5318367481231689e+00 + 77 + -1.3230814933776855e+00 <_> - 0 -1 770 -2.2907990496605635e-03 + 0 -1 522 -3.3400340471416712e-03 - 5.9861046075820923e-01 8.8971912860870361e-02 + 4.2352598905563354e-01 -1.2572944164276123e-01 <_> - 0 -1 256 3.1865492928773165e-03 + 0 -1 799 -2.3890279699116945e-03 - -1.5604956448078156e-01 3.8612595200538635e-01 + 3.8169610500335693e-01 -1.4501731097698212e-01 <_> - 0 -1 561 -8.0397585406899452e-03 + 0 -1 448 -2.4045775644481182e-03 - 2.8996115922927856e-01 -1.8175528943538666e-01 + 3.4690696001052856e-01 -1.2821178138256073e-01 <_> - 0 -1 850 4.3595694005489349e-03 + 0 -1 524 1.2546034995466471e-03 - -8.0427564680576324e-02 5.0874835252761841e-01 + -1.4823316037654877e-01 2.9894015192985535e-01 <_> - 0 -1 264 2.8643116354942322e-02 + 0 -1 752 -1.8236635252833366e-02 - -1.7203453183174133e-01 3.2913634181022644e-01 + 3.0641126632690430e-01 -1.2427721172571182e-01 <_> - 0 -1 896 -3.1282915733754635e-03 + 0 -1 229 4.1921215597540140e-04 - 3.7550333142280579e-01 -9.1347120702266693e-02 + -1.8449674546718597e-01 1.7403297126293182e-01 <_> - 0 -1 778 1.4058926608413458e-03 + 0 -1 914 -3.0837533995509148e-03 - -1.9007267057895660e-01 1.6663856804370880e-01 + -6.2562137842178345e-01 3.4162398427724838e-02 <_> - 0 -1 230 1.0209476575255394e-02 + 0 -1 587 -3.4897932782769203e-03 - -1.2146373838186264e-01 2.3719595372676849e-01 + 2.0127655565738678e-01 -1.4677318930625916e-01 <_> - 0 -1 313 6.0191084630787373e-03 + 0 -1 882 -3.4818234853446484e-03 - 5.1051452755928040e-02 -5.5820345878601074e-01 + 2.9465374350547791e-01 -1.0961814969778061e-01 <_> - 0 -1 395 -4.7453744336962700e-03 + 0 -1 13 6.2356598675251007e-02 - 1.6992042958736420e-01 -1.6199907660484314e-01 + -9.8056003451347351e-02 3.1733244657516479e-01 <_> - 0 -1 771 1.5875545796006918e-03 + 0 -1 607 -1.8334560096263885e-02 - -1.0143589228391647e-01 2.6255446672439575e-01 + 3.1992998719215393e-01 -7.8213296830654144e-02 <_> - 0 -1 183 -2.7861427515745163e-03 + 0 -1 885 3.7803263403475285e-03 - -4.0354993939399719e-01 6.7644119262695312e-02 + 5.3678415715694427e-02 -5.0315982103347778e-01 <_> - 0 -1 56 4.0722191333770752e-03 + 0 -1 1027 -3.6906298249959946e-02 - 4.1441403329372406e-02 -5.5184590816497803e-01 + -6.3056147098541260e-01 3.8218058645725250e-02 <_> - 0 -1 953 1.0626179864630103e-03 + 0 -1 923 4.6968068927526474e-03 - -1.4222721755504608e-01 1.7192882299423218e-01 + -1.1338837444782257e-01 2.6388064026832581e-01 <_> - 0 -1 280 4.7259610146284103e-03 + 0 -1 708 -1.1566210538148880e-02 - 5.1823709160089493e-02 -3.9256933331489563e-01 + 1.6388712823390961e-01 -1.6043519973754883e-01 <_> - 0 -1 766 -2.6500346139073372e-03 + 0 -1 489 3.1895786523818970e-03 - -3.5642188787460327e-01 6.6784784197807312e-02 + 6.0215596109628677e-02 -4.7157511115074158e-01 <_> - 0 -1 375 3.9345081895589828e-03 + 0 -1 50 -2.5480750948190689e-02 - -6.1840496957302094e-02 3.9278426766395569e-01 + -5.5096846818923950e-01 3.9257630705833435e-02 <_> - 0 -1 334 8.9293124619871378e-04 + 0 -1 480 3.9267786778509617e-03 - -1.0518563538789749e-01 2.3271512985229492e-01 + 6.1174295842647552e-02 -4.1686600446701050e-01 <_> - 0 -1 381 5.7920545339584351e-02 + 0 -1 874 4.2923549190163612e-03 - -6.8776324391365051e-02 3.3801963925361633e-01 + -6.9901801645755768e-02 3.6233785748481750e-01 <_> - 0 -1 529 -6.6577367484569550e-02 + 0 -1 929 1.5720827504992485e-03 - 4.2277967929840088e-01 -6.3239939510822296e-02 + -9.2891335487365723e-02 2.6970732212066650e-01 <_> - 0 -1 184 -5.5271089076995850e-03 + 0 -1 937 4.2968937195837498e-03 - -4.1861197352409363e-01 6.0344558209180832e-02 + 4.5402236282825470e-02 -6.1771476268768311e-01 <_> - 0 -1 355 3.3537389244884253e-03 + 0 -1 223 5.8442405425012112e-03 - -1.5910768508911133e-01 1.7853063344955444e-01 + 3.4459017217159271e-02 -6.2251347303390503e-01 <_> - 0 -1 427 -2.3959013633430004e-03 + 0 -1 663 2.6888614520430565e-03 - 2.5072932243347168e-01 -8.5364922881126404e-02 + 3.6230482161045074e-02 -5.7353609800338745e-01 <_> - 0 -1 244 -2.1867034956812859e-03 + 0 -1 424 4.4175283983349800e-03 - -5.6374865770339966e-01 3.5474341362714767e-02 + -6.4959764480590820e-02 3.7311050295829773e-01 <_> - 0 -1 602 2.4597872979938984e-03 + 0 -1 138 1.4900951646268368e-03 - 3.1019955873489380e-02 -5.5415368080139160e-01 + -1.0781793296337128e-01 2.0226408541202545e-01 <_> - 0 -1 577 -2.9149088077247143e-03 + 0 -1 373 2.4665119126439095e-03 - -4.6299308538436890e-01 3.7638399749994278e-02 + 5.7804334908723831e-02 -4.1689205169677734e-01 <_> - 0 -1 905 -1.5585927758365870e-03 + 0 -1 441 9.3985523562878370e-04 - 1.4355151355266571e-01 -1.3060651719570160e-01 + -1.4865192770957947e-01 1.3861793279647827e-01 <_> - 0 -1 70 -3.1853761523962021e-02 + 0 -1 132 -5.3606871515512466e-03 - -4.6954944729804993e-01 3.7520393729209900e-02 + 1.8524695932865143e-01 -1.1567704379558563e-01 <_> - 0 -1 472 -5.1449546590447426e-03 + 0 -1 636 -4.6638157218694687e-03 - 2.7591976523399353e-01 -6.6930308938026428e-02 + 1.6163532435894012e-01 -1.3586524128913879e-01 <_> - 0 -1 55 -1.7139092087745667e-03 + 0 -1 120 3.7256032228469849e-03 - -3.8028663396835327e-01 4.9521040171384811e-02 + 5.2170656621456146e-02 -4.2538973689079285e-01 <_> - 0 -1 98 -1.0931883752346039e-01 + 0 -1 106 -8.9184641838073730e-03 - -4.1068795323371887e-01 4.0003888309001923e-02 + -5.0052535533905029e-01 4.7540370374917984e-02 <_> - 0 -1 158 -2.5099035352468491e-02 + 0 -1 474 5.6020710617303848e-03 - 4.3478006124496460e-01 -5.5282033979892731e-02 + 3.4621786326169968e-02 -5.4071390628814697e-01 <_> - 0 -1 435 8.1472359597682953e-03 + 0 -1 475 -3.7551699206233025e-03 - -4.5095365494489670e-02 3.9842218160629272e-01 + -3.9268767833709717e-01 5.2867397665977478e-02 <_> - 0 -1 765 -1.9677784293889999e-03 + 0 -1 567 4.0759481489658356e-03 - 1.8696348369121552e-01 -1.1214685440063477e-01 + 3.7209436297416687e-02 -4.7708320617675781e-01 <_> - 0 -1 656 -2.6076552458107471e-03 + 0 -1 413 4.1836635209619999e-03 - 2.2791831195354462e-01 -8.7665997445583344e-02 + -5.8815345168113708e-02 3.6573976278305054e-01 <_> - 0 -1 490 -4.1761510074138641e-03 + 0 -1 477 -9.3902507796883583e-04 - -6.8348854780197144e-01 2.8925698250532150e-02 + 1.9424098730087280e-01 -1.1125016957521439e-01 <_> - 0 -1 774 1.3159511610865593e-02 + 0 -1 985 -9.9178254604339600e-03 - 2.1792927756905556e-02 -7.0727092027664185e-01 + -5.9317117929458618e-01 3.3418238162994385e-02 <_> - 0 -1 548 -5.1895831711590290e-03 + 0 -1 646 3.3355036284774542e-03 - -6.6959971189498901e-01 2.1171124652028084e-02 + -8.7399490177631378e-02 2.4422888457775116e-01 <_> - 0 -1 323 -1.5662111341953278e-02 + 0 -1 646 -3.4440397284924984e-03 - -3.6895245313644409e-01 4.1785925626754761e-02 + 2.9363137483596802e-01 -7.5259201228618622e-02 <_> - 0 -1 0 -2.4020818527787924e-03 + 0 -1 42 2.1378418896347284e-03 - 1.7773237824440002e-01 -1.0461435467004776e-01 + 5.6551665067672729e-02 -3.9630606770515442e-01 <_> - 0 -1 631 1.9489541649818420e-02 + 0 -1 1005 -4.5215697027742863e-03 - 3.1142184510827065e-02 -5.4499447345733643e-01 + 1.6443158686161041e-01 -1.1997994035482407e-01 <_> - 0 -1 143 4.9672335386276245e-01 + 0 -1 47 -1.2263706885278225e-03 - -2.4833207949995995e-02 7.6724356412887573e-01 + -2.6839572191238403e-01 7.8797832131385803e-02 <_> - 0 -1 403 3.2806373201310635e-03 + 0 -1 926 -7.3856199160218239e-03 - -6.8504363298416138e-02 2.2050221264362335e-01 + -7.5282222032546997e-01 2.3323338478803635e-02 <_> - 0 -1 638 2.1590515971183777e-03 + 0 -1 1044 1.1934632435441017e-02 - 2.5587400421500206e-02 -6.2128585577011108e-01 + 3.9068166166543961e-02 -4.3301787972450256e-01 <_> - 0 -1 604 5.2638887427747250e-04 + 0 -1 826 -4.2066089808940887e-03 - -9.3414209783077240e-02 1.7369781434535980e-01 + 3.1933805346488953e-01 -6.1786398291587830e-02 <_> - 0 -1 510 -2.1490573417395353e-03 + 0 -1 779 -1.5679887728765607e-03 - -4.4394543766975403e-01 3.9975218474864960e-02 + 2.1744215488433838e-01 -9.4651907682418823e-02 <_> - 0 -1 605 1.9845911301672459e-03 + 0 -1 78 2.5083343498408794e-03 - -8.5414819419384003e-02 2.0132684707641602e-01 + 5.7137917727231979e-02 -3.3361336588859558e-01 <_> - 0 -1 565 -3.2773464918136597e-03 + 0 -1 660 3.6224797368049622e-03 - 2.4408425390720367e-01 -7.3116399347782135e-02 + 3.1345754861831665e-02 -5.7247912883758545e-01 <_> - 0 -1 523 2.1245577372610569e-03 + 0 -1 870 -7.7814143151044846e-03 - 2.9403384774923325e-02 -5.7607394456863403e-01 + 2.9652404785156250e-01 -6.6501826047897339e-02 <_> - 0 -1 286 1.4500851975753903e-03 + 0 -1 800 -4.1631370550021529e-04 - -6.6218085587024689e-02 2.4264883995056152e-01 + 2.2159980237483978e-01 -1.0610108822584152e-01 <_> - 0 -1 939 -4.5542549341917038e-03 + 0 -1 596 4.7841453924775124e-03 - -5.8058720827102661e-01 2.8668973594903946e-02 + 3.3327136188745499e-02 -5.7043993473052979e-01 <_> - 0 -1 343 4.7045715153217316e-02 + 0 -1 347 1.2740758247673512e-03 - 3.6376014351844788e-02 -4.1573047637939453e-01 + -7.9592645168304443e-02 2.4728350341320038e-01 <_> - 0 -1 349 7.7028926461935043e-03 + 0 -1 59 -2.0162630826234818e-02 - -7.7403679490089417e-02 2.1597269177436829e-01 + -7.0677626132965088e-01 2.7118822559714317e-02 <_> - 0 -1 53 -4.1527286171913147e-02 + 0 -1 165 -2.5762226432561874e-02 - -3.4835410118103027e-01 4.8530772328376770e-02 + -5.9367066621780396e-01 2.7015525847673416e-02 <_> - 0 -1 748 -9.1361545491963625e-04 + 0 -1 255 -1.1241633910685778e-03 - 1.8357329070568085e-01 -9.0061083436012268e-02 + 2.9121127724647522e-01 -6.5690472722053528e-02 <_> - 0 -1 674 -5.0414498895406723e-02 + 0 -1 818 2.9669383540749550e-02 - 2.5009948015213013e-01 -6.4314760267734528e-02 + 3.4585461020469666e-02 -5.4837781190872192e-01 <_> - 0 -1 398 7.4737053364515305e-03 + 0 -1 501 -6.3295168802142143e-03 - -5.7431813329458237e-02 2.8318390250205994e-01 + 2.3453639447689056e-01 -8.5172846913337708e-02 <_> - 0 -1 654 2.3173280060291290e-03 + 0 -1 1046 4.0143523365259171e-03 - 3.7970397621393204e-02 -5.6861978769302368e-01 + 3.5306803882122040e-02 -5.4817456007003784e-01 <_> - 0 -1 874 4.5855477219447494e-04 + 0 -1 949 -2.4633856955915689e-03 - -1.3554716110229492e-01 1.1426483094692230e-01 + 1.6164709627628326e-01 -1.1111633479595184e-01 <_> - 0 -1 103 1.8236173782497644e-03 + 0 -1 38 -2.6468174532055855e-02 - 2.6509260758757591e-02 -5.5975830554962158e-01 + 2.5775042176246643e-01 -7.2721429169178009e-02 <_> - 0 -1 732 -1.3565555214881897e-02 + 0 -1 1047 -2.5992670562118292e-03 - 3.5292169451713562e-01 -4.7534435987472534e-02 + -3.1405648589134216e-01 5.9779226779937744e-02 <_> - 0 -1 285 -1.2756066862493753e-03 + 0 -1 809 -2.2960878908634186e-02 - 2.5920400023460388e-01 -5.7072717696428299e-02 + 2.8405818343162537e-01 -6.8080194294452667e-02 <_> - 0 -1 746 6.7418040707707405e-03 + 0 -1 437 -1.6940593719482422e-02 - 3.2604463398456573e-02 -4.5861816406250000e-01 + 3.0056476593017578e-01 -6.7668616771697998e-02 <_> - 0 -1 827 6.5548229031264782e-04 + 0 -1 528 1.7171052750200033e-03 - -8.4788605570793152e-02 1.8131427466869354e-01 + -6.5253980457782745e-02 2.9430890083312988e-01 <_> - 0 -1 929 2.1027602255344391e-02 + 0 -1 142 -5.2873874083161354e-03 - -6.9927647709846497e-02 2.4611653387546539e-01 + -4.5413893461227417e-01 4.3044254183769226e-02 <_> - 0 -1 695 1.8613610416650772e-02 + 0 -1 14 -1.8073642626404762e-02 - -3.6128688603639603e-02 4.4170859456062317e-01 + -3.4945023059844971e-01 5.2509855479001999e-02 <_> - 0 -1 99 -4.9805632233619690e-01 + 0 -1 627 -2.0803229417651892e-03 - 5.9478044509887695e-01 -2.6719097048044205e-02 + -4.0171647071838379e-01 4.5229051262140274e-02 <_> - 0 -1 620 -3.2723334152251482e-03 + 0 -1 918 -1.1218651343369856e-04 - 2.2165246307849884e-01 -6.8788610398769379e-02 + 1.2830497324466705e-01 -1.4649079740047455e-01 <_> - 0 -1 583 -3.5375617444515228e-03 + 0 -1 84 -6.6526420414447784e-03 - -6.1987191438674927e-01 2.6597078889608383e-02 + -3.4429419040679932e-01 5.4524090141057968e-02 <_> - 0 -1 632 3.9524696767330170e-03 + 0 -1 162 -4.1576132178306580e-02 - -7.5478851795196533e-02 2.1777774393558502e-01 + -5.5132204294204712e-01 3.2239176332950592e-02 <_> - 0 -1 681 -9.3436334282159805e-03 + 0 -1 659 -3.2582432031631470e-03 - -8.0256491899490356e-01 2.2864339873194695e-02 + 2.1904261410236359e-01 -9.0739406645298004e-02 <_> - 0 -1 671 -1.0151248425245285e-03 + 0 -1 711 -4.4706808403134346e-03 - -3.1884235143661499e-01 4.3938383460044861e-02 + 2.2556288540363312e-01 -9.5258384943008423e-02 <_> - 0 -1 516 -7.0278989151120186e-03 + 0 -1 177 -6.5750535577535629e-03 - 1.4721503853797913e-01 -1.1400235444307327e-01 + -4.8511472344398499e-01 4.1734144091606140e-02 <_> - 0 -1 611 -9.1165518388152122e-03 + 0 -1 251 -3.7532784044742584e-02 - 2.6830977201461792e-01 -6.4460486173629761e-02 + 2.0968079566955566e-01 -8.8354945182800293e-02 <_> - 0 -1 35 3.3993504941463470e-02 + 0 -1 530 -1.2600638438016176e-03 - 2.7748649939894676e-02 -5.5171352624893188e-01 + 2.2111406922340393e-01 -9.0988010168075562e-02 <_> - 0 -1 557 -2.6347138918936253e-03 + 0 -1 28 -2.3967802524566650e-02 - 1.7853704094886780e-01 -8.4178321063518524e-02 + -6.2524855136871338e-01 3.0603738501667976e-02 <_> - 0 -1 712 -1.3291095383465290e-03 + 0 -1 225 -3.1747903674840927e-02 - -2.8526228666305542e-01 5.6452732533216476e-02 - <_> - - 0 -1 719 1.2167419772595167e-03 - - -7.7132880687713623e-02 1.9538262486457825e-01 - <_> - - 0 -1 856 1.9806078635156155e-03 - - 2.6976436376571655e-02 -5.4301941394805908e-01 - <_> - - 0 -1 617 5.0783145707100630e-04 - - -9.5295064151287079e-02 1.5398529171943665e-01 - <_> - - 0 -1 440 -5.0868269056081772e-02 - - -6.3152486085891724e-01 2.3585954681038857e-02 - <_> - - 0 -1 503 -1.4806092949584126e-03 - - 2.6132494211196899e-01 -6.3322558999061584e-02 - <_> - - 0 -1 28 -1.8584117293357849e-02 - - 1.6097819805145264e-01 -1.1777820438146591e-01 - <_> - - 0 -1 250 2.7171591296792030e-02 - - -8.3719044923782349e-02 1.9814659655094147e-01 - <_> - - 0 -1 390 -6.8197408691048622e-03 - - -5.4431658983230591e-01 2.8722483664751053e-02 - <_> - - 0 -1 696 -9.1905370354652405e-03 - - 1.5037034451961517e-01 -1.0166583955287933e-01 - <_> - - 0 -1 192 -9.7952038049697876e-04 - - -2.9014238715171814e-01 4.9301091581583023e-02 - <_> - - 0 -1 884 -2.1513784304261208e-03 - - 2.4622270464897156e-01 -6.0794923454523087e-02 - <_> - - 0 -1 881 -2.0869732834398746e-03 - - 2.0386496186256409e-01 -8.8516488671302795e-02 - <_> - - 0 -1 42 -1.2946429662406445e-02 - - -5.2757191658020020e-01 2.9759777709841728e-02 - <_> - - 0 -1 985 -3.5145760048180819e-03 - - -4.7929930686950684e-01 2.8995612636208534e-02 - <_> - - 0 -1 212 2.4212854914367199e-03 - - -6.4840331673622131e-02 2.4126507341861725e-01 - <_> - - 0 -1 199 2.1736249327659607e-03 - - 2.2003039717674255e-02 -7.0873755216598511e-01 - <_> - - 0 -1 365 -3.5567809827625751e-03 - - 2.9770645499229431e-01 -5.5486857891082764e-02 - <_> - - 0 -1 249 -1.9639974460005760e-02 - - -7.8722274303436279e-01 2.1807981655001640e-02 - <_> - - 0 -1 653 8.1145912408828735e-03 - - 2.0471598953008652e-02 -5.9867942333221436e-01 - <_> - - 0 -1 706 1.2241180054843426e-02 - - 1.6892330721020699e-02 -7.4894833564758301e-01 - <_> - - 0 -1 794 3.2565161585807800e-02 - - 1.8086636438965797e-02 -6.3382810354232788e-01 - <_> - - 0 -1 498 1.2451345100998878e-02 - - -6.6715493798255920e-02 2.1516454219818115e-01 - <_> - - 0 -1 284 -2.9989825561642647e-02 - - 2.0229698717594147e-01 -6.8314045667648315e-02 + -6.2007570266723633e-01 2.5801742449402809e-02 <_> - 100 - -1.6178516149520874e+00 + 84 + -1.3265128135681152e+00 <_> - 0 -1 499 -3.4503117203712463e-03 + 0 -1 801 -2.4247136898338795e-03 - 6.1788332462310791e-01 1.1437324434518814e-01 + 4.3507692217826843e-01 -1.1363404244184494e-01 <_> - 0 -1 876 4.8226695507764816e-03 + 0 -1 239 3.6287805996835232e-03 - -1.0551112145185471e-01 4.8962607979774475e-01 + -1.5781879425048828e-01 3.3899685740470886e-01 <_> - 0 -1 772 5.1433052867650986e-03 + 0 -1 591 -4.2556263506412506e-03 - -1.1823723465204239e-01 4.1509538888931274e-01 + 2.2901295125484467e-01 -2.0403152704238892e-01 <_> - 0 -1 786 1.8649311736226082e-02 + 0 -1 847 1.6322638839483261e-03 - -1.4054079353809357e-01 4.4154295325279236e-01 + -1.9230945408344269e-01 2.0004445314407349e-01 <_> - 0 -1 133 -2.9543964192271233e-03 + 0 -1 338 1.4746835455298424e-02 - 2.5874784588813782e-01 -1.4265626668930054e-01 + -1.2184409052133560e-01 3.9130899310112000e-01 <_> - 0 -1 851 3.1133145093917847e-03 + 0 -1 192 -1.5139304101467133e-02 - -8.1695765256881714e-02 3.6735343933105469e-01 + 2.6918080449104309e-01 -1.4086124300956726e-01 <_> - 0 -1 49 -3.0071800574660301e-03 + 0 -1 21 -7.4753491207957268e-03 - -3.8455182313919067e-01 7.1067951619625092e-02 + 2.1792158484458923e-01 -1.6056208312511444e-01 <_> - 0 -1 219 -1.9453115761280060e-02 + 0 -1 287 2.3232740350067616e-03 - 2.1075683832168579e-01 -1.2884819507598877e-01 + -1.6489887237548828e-01 1.7108000814914703e-01 <_> - 0 -1 462 -4.8584998585283756e-03 + 0 -1 899 -2.7532558888196945e-03 - 1.6113398969173431e-01 -1.7580857872962952e-01 + -5.3275841474533081e-01 5.2368167787790298e-02 <_> - 0 -1 474 8.2634367048740387e-02 + 0 -1 896 -3.9793960750102997e-03 - -5.9177018702030182e-02 4.0204021334648132e-01 + 3.4057796001434326e-01 -8.0085732042789459e-02 <_> - 0 -1 340 4.5589236542582512e-03 + 0 -1 608 7.1728855371475220e-02 - -1.5169224143028259e-01 2.1497711539268494e-01 + -7.2147607803344727e-02 4.0667375922203064e-01 <_> - 0 -1 810 5.7522351853549480e-03 + 0 -1 883 -5.3792679682374001e-04 - -1.0400034487247467e-01 2.3692265152931213e-01 + 1.7865169048309326e-01 -1.4902706444263458e-01 <_> - 0 -1 30 1.0916464030742645e-02 + 0 -1 248 6.0019297525286674e-03 - 3.2482013106346130e-02 -6.6799944639205933e-01 + 7.1029536426067352e-02 -3.9921376109123230e-01 <_> - 0 -1 334 1.2513624969869852e-03 + 0 -1 369 6.9427289068698883e-02 - -9.2966683208942413e-02 2.5203207135200500e-01 + -9.5279395580291748e-02 2.6865223050117493e-01 <_> - 0 -1 24 8.5552372038364410e-03 + 0 -1 130 -8.8401548564434052e-03 - 4.2838018387556076e-02 -5.4950177669525146e-01 + -5.3491175174713135e-01 5.0447739660739899e-02 <_> - 0 -1 365 1.9793706014752388e-03 + 0 -1 699 -1.4551014639437199e-02 - -1.0328737646341324e-01 2.2137698531150818e-01 + 1.9883459806442261e-01 -1.1586152762174606e-01 <_> - 0 -1 308 -2.3129612207412720e-02 + 0 -1 754 -1.7498439410701394e-03 - -5.9918802976608276e-01 3.7120997905731201e-02 + 2.2214990854263306e-01 -9.8238572478294373e-02 <_> - 0 -1 347 -2.5169795844703913e-03 + 0 -1 246 -2.1636944264173508e-02 - -4.0429180860519409e-01 4.7458905726671219e-02 + 2.8814041614532471e-01 -8.2750618457794189e-02 <_> - 0 -1 290 -2.7680140919983387e-03 + 0 -1 833 1.2786949053406715e-02 - -4.1959136724472046e-01 4.7375876456499100e-02 + -8.7337315082550049e-02 2.6530647277832031e-01 <_> - 0 -1 394 4.4881463982164860e-03 + 0 -1 57 -8.7271071970462799e-03 - -5.3955338895320892e-02 4.0468615293502808e-01 + -5.3538525104522705e-01 5.0595279783010483e-02 <_> - 0 -1 648 1.1571742361411452e-03 + 0 -1 1039 3.3185956999659538e-03 - 6.1304513365030289e-02 -3.6215540766716003e-01 + 4.5733701437711716e-02 -4.4758048653602600e-01 <_> - 0 -1 731 3.6775614134967327e-03 + 0 -1 795 -1.2216938193887472e-03 - 3.5641182214021683e-02 -5.1911950111389160e-01 + 1.5257745981216431e-01 -1.4963941276073456e-01 <_> - 0 -1 828 2.4001342244446278e-03 + 0 -1 562 3.9857804775238037e-02 - -8.0022528767585754e-02 2.6706510782241821e-01 + -8.5655666887760162e-02 2.6823255419731140e-01 <_> - 0 -1 823 -1.4416232006624341e-03 + 0 -1 764 2.4454984813928604e-03 - 2.5601235032081604e-01 -8.7470635771751404e-02 + 4.6102020889520645e-02 -5.0574064254760742e-01 <_> - 0 -1 382 5.0148535519838333e-03 + 0 -1 98 -4.2114150524139404e-01 - 5.7711403816938400e-02 -3.5666841268539429e-01 + 6.9476419687271118e-01 -3.2907195389270782e-02 <_> - 0 -1 399 2.9201959259808064e-03 + 0 -1 558 2.3470625281333923e-02 - -7.3214575648307800e-02 2.7563962340354919e-01 + -8.6790844798088074e-02 2.2723633050918579e-01 <_> - 0 -1 741 -2.8012858820147812e-05 + 0 -1 253 -1.1454307474195957e-02 - 1.3044390082359314e-01 -1.5220497548580170e-01 + 2.5413584709167480e-01 -8.8991768658161163e-02 <_> - 0 -1 962 2.6261559687554836e-03 + 0 -1 624 5.0260839052498341e-03 - 6.3371658325195312e-02 -2.9989096522331238e-01 + 3.8961157202720642e-02 -5.9463697671890259e-01 <_> - 0 -1 114 -1.9985539838671684e-02 + 0 -1 873 1.6196466749534011e-03 - -7.0204716920852661e-01 2.5756308808922768e-02 + -9.0231269598007202e-02 2.6204809546470642e-01 <_> - 0 -1 277 4.0448461659252644e-03 + 0 -1 408 8.1676244735717773e-02 - -9.9051415920257568e-02 2.0554924011230469e-01 + -8.0785289406776428e-02 2.5112318992614746e-01 <_> - 0 -1 294 7.6400241814553738e-03 + 0 -1 483 -5.4313270375132561e-03 - 4.8610400408506393e-02 -4.0662041306495667e-01 + 1.6463221609592438e-01 -1.3186016678810120e-01 <_> - 0 -1 252 1.5262419357895851e-02 + 0 -1 291 5.7006161659955978e-03 - -9.2194251716136932e-02 2.0623819530010223e-01 + -1.3998855650424957e-01 1.4326113462448120e-01 <_> - 0 -1 752 -6.1596641317009926e-03 + 0 -1 221 -7.5926873832941055e-03 - -5.0260418653488159e-01 3.7245232611894608e-02 + -5.5559343099594116e-01 3.7072587758302689e-02 <_> - 0 -1 785 -2.5804866105318069e-02 + 0 -1 618 7.5261802412569523e-03 - -5.2190864086151123e-01 3.0063979327678680e-02 + 2.8434989973902702e-02 -5.8689045906066895e-01 <_> - 0 -1 368 -4.6107484959065914e-03 + 0 -1 869 -6.3516031950712204e-03 - -4.2041480541229248e-01 3.7473026663064957e-02 + 1.4447389543056488e-01 -1.4542055130004883e-01 <_> - 0 -1 936 -1.6811741515994072e-03 + 0 -1 980 -7.6800247188657522e-04 - 3.3520191907882690e-01 -5.3664822131395340e-02 + 1.8556322157382965e-01 -1.0404425859451294e-01 <_> - 0 -1 936 1.0210975306108594e-03 + 0 -1 941 -4.4167470186948776e-03 - -7.0165649056434631e-02 2.7230393886566162e-01 + -7.0306748151779175e-01 3.0874395743012428e-02 <_> - 0 -1 519 -2.7257478795945644e-03 + 0 -1 1010 3.3405693247914314e-03 - -3.7600108981132507e-01 4.8897936940193176e-02 + -6.6534630954265594e-02 3.4018290042877197e-01 <_> - 0 -1 645 1.7022072570398450e-03 + 0 -1 114 1.1457607150077820e-02 - 3.2578211277723312e-02 -4.8195156455039978e-01 + 3.3658623695373535e-02 -6.1056423187255859e-01 <_> - 0 -1 237 2.0580790005624294e-03 + 0 -1 1000 -1.8547235522419214e-03 - -1.1316970735788345e-01 1.4754198491573334e-01 + -7.4722522497177124e-01 2.2372998297214508e-02 <_> - 0 -1 520 1.9031974952667952e-03 + 0 -1 9 -1.9720013439655304e-01 - 6.1289772391319275e-02 -2.7776253223419189e-01 + -5.9932583570480347e-01 2.9283462092280388e-02 <_> - 0 -1 65 -4.5437026768922806e-02 + 0 -1 544 -2.6251156814396381e-03 - 2.8187385201454163e-01 -6.1310045421123505e-02 + -3.0683135986328125e-01 5.5391944944858551e-02 <_> - 0 -1 10 -2.0433391630649567e-01 + 0 -1 17 -2.7104711532592773e-01 - -4.8491853475570679e-01 3.7197910249233246e-02 + -6.4121168851852417e-01 2.6428909972310066e-02 <_> - 0 -1 902 -2.2007026709616184e-03 + 0 -1 349 1.0233232751488686e-02 - -4.8433649539947510e-01 2.8523173183202744e-02 + 4.5153360813856125e-02 -3.6883556842803955e-01 <_> - 0 -1 506 2.4706670083105564e-03 + 0 -1 363 4.0971953421831131e-03 - -8.0774910748004913e-02 2.0636586844921112e-01 + 4.1385501623153687e-02 -4.3035930395126343e-01 <_> - 0 -1 337 -1.1496900115162134e-03 + 0 -1 464 -8.8650803081691265e-04 - 2.0466096699237823e-01 -7.8325189650058746e-02 + 1.6314724087715149e-01 -1.1271495372056961e-01 <_> - 0 -1 390 -4.3232389725744724e-03 + 0 -1 721 -4.1144760325551033e-03 - -3.4593367576599121e-01 4.9537312239408493e-02 + -5.5176359415054321e-01 3.3540870994329453e-02 <_> - 0 -1 112 -9.3772150576114655e-03 + 0 -1 940 -9.8663510289043188e-04 - -5.5802655220031738e-01 2.5828598067164421e-02 + 2.1676342189311981e-01 -8.5408315062522888e-02 <_> - 0 -1 755 -1.6863006167113781e-03 + 0 -1 428 6.0831783339381218e-03 - 1.9700750708580017e-01 -8.0926463007926941e-02 + -8.7310679256916046e-02 2.3208071291446686e-01 <_> - 0 -1 759 5.5908015929162502e-03 + 0 -1 789 -1.4624604955315590e-02 - -5.8355998247861862e-02 3.0854061245918274e-01 + -5.9713214635848999e-01 3.0128041282296181e-02 <_> - 0 -1 483 -4.9319159006699920e-04 + 0 -1 787 1.3654056005179882e-02 - 1.3386693596839905e-01 -1.1287388950586319e-01 + 2.4816744029521942e-02 -6.2301605939865112e-01 <_> - 0 -1 551 -5.3560961037874222e-02 + 0 -1 820 4.2229411192238331e-03 - 3.3912947773933411e-01 -4.4598836451768875e-02 + -7.3886208236217499e-02 2.4938605725765228e-01 <_> - 0 -1 542 -2.4220649152994156e-02 + 0 -1 168 1.3268929906189442e-03 - -4.5232787728309631e-01 4.1364260017871857e-02 + 4.0760166943073273e-02 -4.3510803580284119e-01 <_> - 0 -1 798 1.2709838338196278e-03 + 0 -1 275 -9.6903974190354347e-04 - -8.8080756366252899e-02 1.8180713057518005e-01 + 2.2486831247806549e-01 -7.8642837703227997e-02 <_> - 0 -1 236 -4.4361655600368977e-03 + 0 -1 274 1.0329007636755705e-03 - -4.2694598436355591e-01 3.6063931882381439e-02 + -7.3648050427436829e-02 2.6808246970176697e-01 <_> - 0 -1 791 -6.5719988197088242e-04 + 0 -1 474 -4.2711962014436722e-03 - 1.8804629147052765e-01 -8.5146181285381317e-02 + -4.0931078791618347e-01 4.7851666808128357e-02 <_> - 0 -1 715 1.8579278141260147e-02 + 0 -1 983 -3.7627927958965302e-03 - 4.4604945927858353e-02 -3.7216106057167053e-01 + -5.0520634651184082e-01 3.0405685305595398e-02 <_> - 0 -1 857 3.0188630335032940e-03 + 0 -1 979 -1.7928264569491148e-03 - -9.7823068499565125e-02 1.5584464371204376e-01 + 3.3886525034904480e-01 -5.3929597139358521e-02 <_> - 0 -1 868 1.6309421043843031e-03 + 0 -1 148 3.9475625380873680e-03 - 3.5910408943891525e-02 -4.3541318178176880e-01 + 3.4511350095272064e-02 -5.2250456809997559e-01 <_> - 0 -1 139 1.3791467994451523e-02 + 0 -1 827 -4.4537894427776337e-03 - 1.7177715897560120e-02 -7.7653616666793823e-01 + 2.2575919330120087e-01 -7.4650920927524567e-02 <_> - 0 -1 248 1.0393885895609856e-03 + 0 -1 774 -2.9974281787872314e-02 - -1.2292464822530746e-01 1.1997509002685547e-01 + -6.0629475116729736e-01 3.4456655383110046e-02 <_> - 0 -1 417 -1.8992213299497962e-03 + 0 -1 123 2.6775486767292023e-02 - -5.8449220657348633e-01 2.3935828357934952e-02 + -8.8883727788925171e-02 2.0147153735160828e-01 <_> - 0 -1 366 -4.4655447709374130e-04 + 0 -1 302 -4.4971965253353119e-03 - 1.8246568739414215e-01 -8.1576324999332428e-02 + -5.3158396482467651e-01 3.3491309732198715e-02 <_> - 0 -1 85 1.1696915607899427e-03 + 0 -1 620 -1.5196309424936771e-02 - 4.1298836469650269e-02 -3.7100258469581604e-01 + 2.8140705823898315e-01 -6.4074374735355377e-02 <_> - 0 -1 906 -8.9874223340302706e-04 + 0 -1 560 -2.1833679638803005e-03 - 1.3932932913303375e-01 -1.0641934722661972e-01 + 2.1953551471233368e-01 -8.5029341280460358e-02 <_> - 0 -1 862 5.9534879401326180e-03 + 0 -1 317 -5.4325433447957039e-03 - 2.6781413704156876e-02 -6.1212611198425293e-01 + -4.8182886838912964e-01 3.8184959441423416e-02 <_> - 0 -1 861 -8.0954860895872116e-03 + 0 -1 463 -3.9055421948432922e-03 - 2.6603493094444275e-01 -5.9750139713287354e-02 + -3.5678783059120178e-01 4.5511916279792786e-02 <_> - 0 -1 287 -8.2374701742082834e-04 + 0 -1 1017 -5.0043486990034580e-03 - 2.1638387441635132e-01 -6.4249947667121887e-02 + -3.5324424505233765e-01 4.9539435654878616e-02 <_> - 0 -1 271 -7.6250307029113173e-04 + 0 -1 595 4.2052613571286201e-03 - 2.0882584154605865e-01 -8.5345618426799774e-02 + -7.6765090227127075e-02 2.4410718679428101e-01 <_> - 0 -1 959 2.3917213547974825e-03 + 0 -1 642 -2.9198043048381805e-03 - 2.9081748798489571e-02 -5.5320137739181519e-01 + 2.8657916188240051e-01 -9.1479435563087463e-02 <_> - 0 -1 957 -5.6062731891870499e-03 + 0 -1 116 1.4442477375268936e-02 - -3.1231331825256348e-01 4.6577330678701401e-02 + 2.2604020312428474e-02 -7.7516084909439087e-01 <_> - 0 -1 807 1.2068089097738266e-02 + 0 -1 956 1.0879908688366413e-02 - -6.9983117282390594e-02 2.1360129117965698e-01 + -8.9434660971164703e-02 1.8898591399192810e-01 <_> - 0 -1 664 -6.1361752450466156e-03 + 0 -1 707 1.2304648756980896e-01 - 1.5866123139858246e-01 -8.9951172471046448e-02 + 2.9145279899239540e-02 -5.6789475679397583e-01 <_> - 0 -1 686 2.7342736721038818e-03 + 0 -1 301 5.4486069828271866e-02 - 4.6424146741628647e-02 -3.2302507758140564e-01 + -8.0465197563171387e-02 2.1073351800441742e-01 <_> - 0 -1 190 2.5015277788043022e-02 + 0 -1 37 -1.0112209245562553e-02 - -9.2339992523193359e-02 1.6995115578174591e-01 + 2.5688818097114563e-01 -7.3113977909088135e-02 <_> - 0 -1 6 3.6676183342933655e-02 + 0 -1 145 -4.3551158159971237e-03 - -8.1868082284927368e-02 2.0542381703853607e-01 + -4.0537205338478088e-01 5.1149621605873108e-02 <_> - 0 -1 641 2.9560746625065804e-03 + 0 -1 377 2.8712721541523933e-03 - 4.2714115232229233e-02 -3.9473703503608704e-01 + -8.9186541736125946e-02 2.0391693711280823e-01 <_> - 0 -1 478 -5.4626376368105412e-04 + 0 -1 220 2.4744076654314995e-02 - 1.7010760307312012e-01 -9.1078221797943115e-02 + 3.1359996646642685e-02 -5.9586691856384277e-01 <_> - 0 -1 479 3.5485455300658941e-03 + 0 -1 19 6.0209888033568859e-03 - -7.2080396115779877e-02 2.2900597751140594e-01 + -8.2612000405788422e-02 2.1787849068641663e-01 <_> - 0 -1 485 -3.1973507720977068e-03 + 0 -1 852 6.0595902614295483e-03 - 2.0531810820102692e-01 -8.5912480950355530e-02 + 4.7610606998205185e-02 -3.5010379552841187e-01 <_> - 0 -1 867 -2.5095739401876926e-03 + 0 -1 324 -2.1957855671644211e-02 - -3.3782237768173218e-01 5.3629480302333832e-02 + 2.2477181255817413e-01 -7.5377546250820160e-02 <_> - 0 -1 312 1.2365024536848068e-02 + 0 -1 385 -3.9967135526239872e-03 - 2.7145428583025932e-02 -5.5763113498687744e-01 + 4.3043723702430725e-01 -3.9885677397251129e-02 <_> - 0 -1 910 2.0736612379550934e-02 + 0 -1 745 -2.0381226204335690e-03 - -6.0063906013965607e-02 2.5700190663337708e-01 + -5.8131587505340576e-01 3.2071832567453384e-02 <_> - 0 -1 15 2.6504596695303917e-02 + 0 -1 337 3.8902673404663801e-03 - 3.4878112375736237e-02 -4.7980275750160217e-01 - <_> - - 0 -1 976 -9.5798689872026443e-03 - - -6.1055964231491089e-01 2.1064205095171928e-02 - <_> - - 0 -1 615 1.9744917750358582e-02 - - -4.9393177032470703e-02 3.0676594376564026e-01 - <_> - - 0 -1 865 3.0523580498993397e-03 - - 4.1798073798418045e-02 -3.5442468523979187e-01 - <_> - - 0 -1 612 -4.3955976143479347e-03 - - 2.5482681393623352e-01 -5.6209251284599304e-02 - <_> - - 0 -1 469 2.2425290662795305e-03 - - -9.7824580967426300e-02 1.7274166643619537e-01 - <_> - - 0 -1 541 7.1967259049415588e-02 - - -3.9488561451435089e-02 3.6034339666366577e-01 - <_> - - 0 -1 181 8.4581580013036728e-03 - - 3.5755772143602371e-02 -4.4762039184570312e-01 - <_> - - 0 -1 665 3.3080112189054489e-03 - - 2.2785754874348640e-02 -5.3823727369308472e-01 - <_> - - 0 -1 437 -1.1890231398865581e-03 - - 1.7143265902996063e-01 -8.1015840172767639e-02 - <_> - - 0 -1 434 -1.7523975111544132e-03 - - 2.5996673107147217e-01 -6.9269210100173950e-02 - <_> - - 0 -1 921 5.4229743545874953e-04 - - -7.4078343808650970e-02 2.0903676748275757e-01 - <_> - - 0 -1 963 3.9791758172214031e-03 - - 4.0985044091939926e-02 -3.6837655305862427e-01 - <_> - - 0 -1 829 -6.9316523149609566e-03 - - -4.1581609845161438e-01 3.2475329935550690e-02 - <_> - - 0 -1 17 4.1018679738044739e-02 - - -6.6409081220626831e-02 2.3296032845973969e-01 - <_> - - 0 -1 86 3.3051387872546911e-03 - - -8.2739837467670441e-02 1.9939082860946655e-01 - <_> - - 0 -1 179 -1.3641032390296459e-02 - - 1.6623613238334656e-01 -8.6717613041400909e-02 + -6.0279250144958496e-02 2.9424437880516052e-01 <_> - 100 - -1.6119387149810791e+00 + 82 + -1.2607949972152710e+00 <_> - 0 -1 508 -1.0795817710459232e-02 + 0 -1 798 -1.9003680208697915e-03 - 5.7589554786682129e-01 9.1795757412910461e-02 + 4.8600798845291138e-01 -7.5834542512893677e-02 <_> - 0 -1 844 -1.4518407406285405e-03 + 0 -1 238 1.5605278313159943e-03 - 3.8668358325958252e-01 -1.4567533135414124e-01 + -1.9763922691345215e-01 2.5329649448394775e-01 <_> - 0 -1 205 1.2619893066585064e-02 + 0 -1 584 -4.8138713464140892e-03 - -1.3285328447818756e-01 3.8423144817352295e-01 + 3.5302931070327759e-01 -1.2585695087909698e-01 <_> - 0 -1 812 -8.6567001417279243e-03 + 0 -1 870 5.7447804138064384e-03 - 2.0455244183540344e-01 -1.9482232630252838e-01 + -1.5453046560287476e-01 3.5572248697280884e-01 <_> - 0 -1 329 8.7269591167569160e-03 + 0 -1 806 3.2787662930786610e-03 - -9.0128563344478607e-02 4.0668380260467529e-01 + -1.8419209122657776e-01 1.6216333210468292e-01 <_> - 0 -1 846 -4.8108389601111412e-03 + 0 -1 423 2.8142044320702553e-03 - 4.0858918428421021e-01 -7.6686508953571320e-02 + -9.4009101390838623e-02 2.7667456865310669e-01 <_> - 0 -1 441 2.7277414119453169e-05 + 0 -1 259 1.8096582498401403e-03 - -2.1661256253719330e-01 1.3865883648395538e-01 + -8.9050479233264923e-02 2.9622453451156616e-01 <_> - 0 -1 426 -9.6549151930958033e-04 + 0 -1 988 7.2106244042515755e-03 - 1.9036890566349030e-01 -1.3512735068798065e-01 + -1.0854976624250412e-01 2.2157947719097137e-01 <_> - 0 -1 215 -1.1629101354628801e-03 + 0 -1 342 1.3368867337703705e-02 - 2.7597144246101379e-01 -8.5875771939754486e-02 + 5.8126326650381088e-02 -3.8564166426658630e-01 <_> - 0 -1 708 3.2347193919122219e-03 + 0 -1 276 1.6755410470068455e-03 - -1.4792887866497040e-01 1.6230462491512299e-01 + -6.9541916251182556e-02 3.6275833845138550e-01 <_> - 0 -1 344 -6.0261571779847145e-03 + 0 -1 198 -4.5782830566167831e-03 - -5.2146345376968384e-01 3.9669245481491089e-02 + -5.6317430734634399e-01 3.9351724088191986e-02 <_> - 0 -1 502 3.7499368190765381e-03 + 0 -1 729 3.6364984698593616e-03 - 4.7719169408082962e-02 -4.2560356855392456e-01 + -1.5140864253044128e-01 1.4790520071983337e-01 <_> - 0 -1 432 -2.2638911381363869e-02 + 0 -1 928 -1.1279541999101639e-02 - 2.7776387333869934e-01 -8.2894414663314819e-02 + -4.8907181620597839e-01 5.1109701395034790e-02 <_> - 0 -1 375 2.8850757516920567e-03 + 0 -1 867 -1.2224027886986732e-02 - -7.3187254369258881e-02 3.4045669436454773e-01 + -6.0496371984481812e-01 3.5609807819128036e-02 <_> - 0 -1 743 9.2617822811007500e-03 + 0 -1 769 -2.8662174940109253e-02 - -6.1159532517194748e-02 3.4422287344932556e-01 + 2.4556699395179749e-01 -9.9369116127490997e-02 <_> - 0 -1 419 4.7564059495925903e-03 + 0 -1 496 6.7924216389656067e-02 - 4.2927626520395279e-02 -5.0712525844573975e-01 + -7.8038521111011505e-02 3.3691942691802979e-01 <_> - 0 -1 588 1.0375332832336426e-01 + 0 -1 962 2.2719642147421837e-03 - 3.7820540368556976e-02 -5.4858410358428955e-01 + 5.8022607117891312e-02 -4.7124773263931274e-01 <_> - 0 -1 527 -1.1948650702834129e-02 + 0 -1 210 8.5627539083361626e-03 - 3.0298843979835510e-01 -7.0214085280895233e-02 + 3.4671626985073090e-02 -4.6883812546730042e-01 <_> - 0 -1 346 1.7851736396551132e-02 + 0 -1 362 1.1866856366395950e-03 - -8.9291095733642578e-02 2.2659333050251007e-01 + -8.0339640378952026e-02 2.5030750036239624e-01 <_> - 0 -1 928 1.7700281459838152e-03 + 0 -1 979 8.1023329403251410e-04 - -9.0894356369972229e-02 2.3938187956809998e-01 + -8.0605715513229370e-02 2.5741192698478699e-01 <_> - 0 -1 42 1.0000608861446381e-02 + 0 -1 281 -4.0647285059094429e-03 - 5.4091196507215500e-02 -4.5715424418449402e-01 + -5.0938653945922852e-01 4.0403041988611221e-02 <_> - 0 -1 554 5.1841903477907181e-03 + 0 -1 309 -1.9617568701505661e-02 - 4.4081535190343857e-02 -4.0113139152526855e-01 + -5.4703706502914429e-01 3.5078343003988266e-02 <_> - 0 -1 216 1.9869320094585419e-03 + 0 -1 233 6.9989012554287910e-03 - -8.6456976830959320e-02 2.3278492689132690e-01 + 2.6246270164847374e-02 -6.0453557968139648e-01 <_> - 0 -1 29 7.3318472132086754e-03 + 0 -1 450 -6.2460554763674736e-03 - 4.4677142053842545e-02 -4.3628835678100586e-01 + 2.3062629997730255e-01 -8.3763726055622101e-02 <_> - 0 -1 224 5.3855171427130699e-03 + 0 -1 529 7.5731135439127684e-04 - 3.1241770833730698e-02 -5.7641702890396118e-01 + -9.5188923180103302e-02 2.3367822170257568e-01 <_> - 0 -1 287 -5.8841239660978317e-04 + 0 -1 462 -3.2256892882287502e-03 - 2.1748071908950806e-01 -9.8720036447048187e-02 + 2.1003848314285278e-01 -1.2173316627740860e-01 <_> - 0 -1 48 -4.6296482905745506e-03 + 0 -1 941 -2.8797222767025232e-03 - -5.0439667701721191e-01 3.9307218044996262e-02 + -4.8621371388435364e-01 4.3998546898365021e-02 <_> - 0 -1 159 1.0425396263599396e-02 + 0 -1 740 5.9399371966719627e-03 - -6.9303810596466064e-02 2.8114342689514160e-01 + 2.7645273134112358e-02 -6.2591820955276489e-01 <_> - 0 -1 821 3.4709304571151733e-02 + 0 -1 742 -5.4768389090895653e-03 - -4.4065892696380615e-02 4.7260922193527222e-01 + 2.5695452094078064e-01 -8.1276804208755493e-02 <_> - 0 -1 913 -1.9787646830081940e-02 + 0 -1 107 -2.2785080596804619e-02 - -6.3054060935974121e-01 3.7138473242521286e-02 + -6.7479509115219116e-01 2.9845010489225388e-02 <_> - 0 -1 832 -1.0857213288545609e-02 + 0 -1 240 -6.0453559271991253e-03 - -3.4433662891387939e-01 4.5778658241033554e-02 + -4.5132589340209961e-01 4.0413774549961090e-02 <_> - 0 -1 228 -3.3750114962458611e-03 + 0 -1 216 5.9022027999162674e-03 - -4.4760662317276001e-01 3.7368919700384140e-02 + 4.6321801841259003e-02 -3.9377251267433167e-01 <_> - 0 -1 799 7.1516213938593864e-04 + 0 -1 775 -1.1740738991647959e-03 - -1.4026457071304321e-01 1.2475384026765823e-01 + 2.2063454985618591e-01 -8.9038714766502380e-02 <_> - 0 -1 694 -3.0070471111685038e-03 + 0 -1 835 -3.7963264621794224e-03 - -5.2588617801666260e-01 3.0897416174411774e-02 + 1.7901860177516937e-01 -1.0518371313810349e-01 <_> - 0 -1 634 -3.0869825277477503e-03 + 0 -1 871 2.4132090620696545e-03 - 2.8596574068069458e-01 -6.7343741655349731e-02 + -9.3182116746902466e-02 2.9489630460739136e-01 <_> - 0 -1 358 -4.3112646788358688e-02 + 0 -1 543 4.5318575575947762e-04 - -7.0135027170181274e-01 2.6632267981767654e-02 + -1.4386458694934845e-01 1.3717848062515259e-01 <_> - 0 -1 672 -1.2020026333630085e-03 + 0 -1 1029 1.8930386751890182e-02 - -3.8874247670173645e-01 4.1288472712039948e-02 + 3.3168405294418335e-02 -5.5337232351303101e-01 <_> - 0 -1 716 -3.8164458237588406e-04 + 0 -1 652 -2.6878318749368191e-03 - 1.3130629062652588e-01 -1.3220198452472687e-01 + -5.4439735412597656e-01 3.1048862263560295e-02 <_> - 0 -1 412 -4.4994866475462914e-03 + 0 -1 672 -3.9407592266798019e-03 - -2.8277575969696045e-01 6.8065464496612549e-02 + -6.5507227182388306e-01 2.4424355477094650e-02 <_> - 0 -1 586 -4.2400006204843521e-03 + 0 -1 599 2.1629813127219677e-03 - -5.7234168052673340e-01 2.4768881499767303e-02 + -1.0160741209983826e-01 1.8277852237224579e-01 <_> - 0 -1 610 3.3328742720186710e-03 + 0 -1 222 -2.9370808042585850e-03 - -6.9700233638286591e-02 2.3259970545768738e-01 + -4.7847637534141541e-01 3.8538910448551178e-02 <_> - 0 -1 26 -1.4152936637401581e-02 + 0 -1 6 3.8221649825572968e-02 - -6.5485191345214844e-01 2.5028359144926071e-02 + -7.6206430792808533e-02 2.3375664651393890e-01 <_> - 0 -1 331 -3.3239413052797318e-02 + 0 -1 393 -3.1483019702136517e-03 - 2.1122130751609802e-01 -8.0384172499179840e-02 + 2.5192636251449585e-01 -7.3695883154869080e-02 <_> - 0 -1 40 3.9529884234070778e-03 + 0 -1 613 -4.5907422900199890e-03 - -7.4974447488784790e-02 2.7394378185272217e-01 + -6.2766075134277344e-01 2.8896089643239975e-02 <_> - 0 -1 657 2.0498572848737240e-03 + 0 -1 26 -9.5378428697586060e-02 - 3.5124473273754120e-02 -5.0805884599685669e-01 + -7.4559724330902100e-01 2.1207747980952263e-02 <_> - 0 -1 670 1.3978367205709219e-03 + 0 -1 639 2.0872952882200480e-03 - -8.5583955049514771e-02 1.9296622276306152e-01 + -8.7810918688774109e-02 2.0629811286926270e-01 <_> - 0 -1 983 3.1700683757662773e-03 + 0 -1 635 -6.9244997575879097e-03 - 4.6254437416791916e-02 -3.5503390431404114e-01 + 1.8590562045574188e-01 -9.8790608346462250e-02 <_> - 0 -1 946 -1.0263657895848155e-03 + 0 -1 590 2.4594084825366735e-03 - 1.3199952244758606e-01 -1.2064760923385620e-01 + -1.0049589723348618e-01 2.2963477671146393e-01 <_> - 0 -1 109 -4.1109144687652588e-02 + 0 -1 1021 -5.2931695245206356e-03 - 1.7420990765094757e-01 -9.8242506384849548e-02 + -4.5924744009971619e-01 4.3104480952024460e-02 <_> - 0 -1 618 1.5759501606225967e-02 + 0 -1 994 4.8847724683582783e-03 - -7.5842045247554779e-02 2.3157498240470886e-01 + 4.6008609235286713e-02 -4.4277390837669373e-01 <_> - 0 -1 449 -9.5934671116992831e-04 + 0 -1 454 1.4400177169591188e-03 - 1.8444137275218964e-01 -9.2052407562732697e-02 + -5.9334080666303635e-02 3.0132320523262024e-01 <_> - 0 -1 864 5.4162740707397461e-03 + 0 -1 156 -8.6052305996417999e-03 - 3.1357165426015854e-02 -5.3519624471664429e-01 + 1.9737368822097778e-01 -8.9747570455074310e-02 <_> - 0 -1 866 3.4875022247433662e-03 + 0 -1 193 -6.1248587444424629e-03 - 4.8432532697916031e-02 -3.3630362153053284e-01 + -4.5141929388046265e-01 3.8760874420404434e-02 <_> - 0 -1 660 1.3441047631204128e-03 + 0 -1 464 -1.8148655071854591e-03 - -8.3214677870273590e-02 2.0162117481231689e-01 + 2.2768247127532959e-01 -8.2637414336204529e-02 <_> - 0 -1 684 -2.3109107278287411e-03 + 0 -1 330 -8.5119507275521755e-04 - 1.8354012072086334e-01 -8.8427804410457611e-02 + 1.9616322219371796e-01 -1.0013028979301453e-01 <_> - 0 -1 481 5.1613273099064827e-03 + 0 -1 417 1.4472046867012978e-02 - -6.8671047687530518e-02 2.2440080344676971e-01 + -8.8336527347564697e-02 1.9660694897174835e-01 <_> - 0 -1 251 -2.3844663053750992e-02 + 0 -1 628 1.4135142788290977e-02 - -6.2796258926391602e-01 2.7813719585537910e-02 + -6.4112767577171326e-02 3.1887489557266235e-01 <_> - 0 -1 421 3.7013965193182230e-03 + 0 -1 390 4.8004039563238621e-03 - -6.7407652735710144e-02 2.7093955874443054e-01 + 4.8681098967790604e-02 -4.6234726905822754e-01 <_> - 0 -1 633 3.9885155856609344e-03 + 0 -1 279 -3.3503584563732147e-02 - 3.4067343920469284e-02 -5.4420226812362671e-01 + 2.5094386935234070e-01 -8.0808885395526886e-02 <_> - 0 -1 309 1.8910076469182968e-02 + 0 -1 943 2.4153569247573614e-03 - 4.2769759893417358e-02 -3.3686736226081848e-01 + -7.2777584195137024e-02 2.6076248288154602e-01 <_> - 0 -1 808 1.2143498286604881e-02 + 0 -1 34 -1.3153228908777237e-02 - 1.9569551572203636e-02 -7.1214914321899414e-01 + 2.3979008197784424e-01 -7.6283767819404602e-02 <_> - 0 -1 188 -5.6570172309875488e-03 + 0 -1 718 -8.5048296023160219e-04 - -3.6661344766616821e-01 3.4494820982217789e-02 + -3.2108953595161438e-01 5.7150222361087799e-02 <_> - 0 -1 570 2.1571468096226454e-03 + 0 -1 511 2.0031477324664593e-03 - -8.9639738202095032e-02 1.5742646157741547e-01 + -7.5618073344230652e-02 2.3024985194206238e-01 <_> - 0 -1 565 1.8860616255551577e-03 + 0 -1 505 -3.9609652012586594e-03 - -8.5441410541534424e-02 1.7696820199489594e-01 + -4.3856775760650635e-01 3.7756573408842087e-02 <_> - 0 -1 669 1.0152467293664813e-03 + 0 -1 311 5.9846425428986549e-03 - 3.8969900459051132e-02 -3.7170857191085815e-01 + 3.5378426313400269e-02 -4.7760033607482910e-01 <_> - 0 -1 775 -7.2436146438121796e-03 + 0 -1 83 2.0205255597829819e-02 - 1.7777322232723236e-01 -8.3921253681182861e-02 + -8.0130979418754578e-02 2.2919151186943054e-01 <_> - 0 -1 860 -3.7075001746416092e-03 + 0 -1 927 -2.7492402587085962e-03 - 1.8386960029602051e-01 -9.2291206121444702e-02 + 2.1395626664161682e-01 -7.6452419161796570e-02 <_> - 0 -1 607 -1.4369469135999680e-03 + 0 -1 506 -8.3101191557943821e-04 - -2.7023202180862427e-01 5.5822439491748810e-02 + 1.6961804032325745e-01 -9.9106967449188232e-02 <_> - 0 -1 926 -1.7798715271055698e-03 + 0 -1 604 -1.8657972104847431e-03 - 1.4900380373001099e-01 -9.8068036139011383e-02 + -3.8131290674209595e-01 4.6056091785430908e-02 <_> - 0 -1 558 1.9487005192786455e-03 + 0 -1 74 2.0824437960982323e-03 - -7.6331101357936859e-02 1.8935331702232361e-01 + 6.4966239035129547e-02 -2.3824627697467804e-01 <_> - 0 -1 871 2.8823004104197025e-03 + 0 -1 70 -4.4267112389206886e-03 - 4.2902354151010513e-02 -3.5214039683341980e-01 + -3.5809823870658875e-01 4.6749643981456757e-02 <_> - 0 -1 378 -5.6123267859220505e-03 + 0 -1 211 1.3552411692216992e-03 - -4.7632521390914917e-01 2.6048270985484123e-02 + -1.2307690829038620e-01 1.3934792578220367e-01 <_> - 0 -1 301 1.6383089125156403e-02 + 0 -1 213 -4.4114869087934494e-03 - -8.9606925845146179e-02 1.4743074774742126e-01 + 2.6617470383644104e-01 -7.4502207338809967e-02 <_> - 0 -1 44 3.4455281496047974e-01 + 0 -1 432 5.2309304010123014e-04 - -2.0530648529529572e-02 7.2817444801330566e-01 + -1.0876630991697311e-01 1.5687976777553558e-01 <_> - 0 -1 448 2.7680541388690472e-03 + 0 -1 976 6.4505764748901129e-04 - -3.8598377257585526e-02 3.5294523835182190e-01 + -8.0842182040214539e-02 2.0263716578483582e-01 <_> - 0 -1 480 3.8404709193855524e-03 + 0 -1 975 2.0405012182891369e-03 - -8.0346472561359406e-02 1.8624457716941833e-01 + -6.2390543520450592e-02 3.3067914843559265e-01 <_> - 0 -1 11 -4.3602049350738525e-02 + 0 -1 888 1.9838459789752960e-02 - 2.4986675381660461e-01 -7.1408227086067200e-02 + 2.3488542065024376e-02 -8.1695795059204102e-01 <_> - 0 -1 2 -3.6010099574923515e-03 + 0 -1 953 2.3998366668820381e-03 - 1.6942474246025085e-01 -1.0419391095638275e-01 + 4.1017178446054459e-02 -3.7197592854499817e-01 <_> - 0 -1 320 -6.1740418896079063e-03 + 0 -1 664 -1.1092903092503548e-02 - -4.6275594830513000e-01 3.1903993338346481e-02 + -5.5750596523284912e-01 2.9520254582166672e-02 <_> - 0 -1 898 3.4251257311552763e-03 + 0 -1 981 1.4876715838909149e-02 - 2.5748182088136673e-02 -4.8371604084968567e-01 + -6.5797492861747742e-02 2.5957426428794861e-01 <_> - 0 -1 841 -3.9031119085848331e-03 + 0 -1 621 -3.0385032296180725e-02 - 1.6738632321357727e-01 -8.4549814462661743e-02 + 2.2640630602836609e-01 -7.6991938054561615e-02 <_> - 0 -1 935 -7.3322677053511143e-04 + 0 -1 666 1.2216348201036453e-02 - 2.1091395616531372e-01 -7.2518013417720795e-02 + -7.0106968283653259e-02 2.4013392627239227e-01 + + <_> + 94 + -1.2798616886138916e+00 + <_> - 0 -1 932 2.7150693349540234e-03 + 0 -1 801 -3.8322431501001120e-03 - -5.7143334299325943e-02 2.7224695682525635e-01 + 4.8065602779388428e-01 -4.9388073384761810e-02 <_> - 0 -1 937 1.7057932913303375e-02 + 0 -1 966 2.5449637323617935e-03 - -6.3262723386287689e-02 2.4493633210659027e-01 + -1.7564620077610016e-01 2.5865191221237183e-01 <_> - 0 -1 968 2.2439109161496162e-03 + 0 -1 448 -5.4743299260735512e-03 - 6.1605937778949738e-02 -2.5090345740318298e-01 + 4.9321442842483521e-01 -7.0596724748611450e-02 <_> - 0 -1 122 9.2767914757132530e-03 + 0 -1 294 1.5188493765890598e-02 - 3.9061944931745529e-02 -3.7177914381027222e-01 + -1.8555639684200287e-01 1.5278494358062744e-01 <_> - 0 -1 930 -1.3303438900038600e-03 + 0 -1 954 7.5815798481926322e-04 - 2.2685268521308899e-01 -6.3722826540470123e-02 + -1.5043407678604126e-01 1.8612807989120483e-01 <_> - 0 -1 818 -2.8938084840774536e-02 + 0 -1 963 -3.4232349134981632e-03 - -6.6085141897201538e-01 2.1666957065463066e-02 + -4.5882478356361389e-01 4.3279532343149185e-02 <_> - 0 -1 744 -5.0926357507705688e-03 + 0 -1 842 2.4103666655719280e-03 - 1.7695400118827820e-01 -7.9500846564769745e-02 + -8.4217190742492676e-02 2.6687353849411011e-01 <_> - 0 -1 749 5.3870421834290028e-03 + 0 -1 340 -2.3144368082284927e-02 - -5.5856045335531235e-02 2.7346748113632202e-01 + 2.9155749082565308e-01 -9.9449791014194489e-02 <_> - 0 -1 524 -8.0796808470040560e-04 + 0 -1 419 -4.2331898584961891e-03 - -2.2386504709720612e-01 6.8852454423904419e-02 + -3.7696760892868042e-01 8.0511704087257385e-02 <_> - 0 -1 591 3.9214566349983215e-03 + 0 -1 282 4.9294121563434601e-03 - 2.2929171100258827e-02 -5.9076148271560669e-01 + -1.3016121089458466e-01 1.8470372259616852e-01 <_> - 0 -1 691 -6.5161995589733124e-03 + 0 -1 481 -2.7466980100143701e-05 - -5.5175542831420898e-01 2.0790172740817070e-02 + 1.4074377715587616e-01 -1.7928679287433624e-01 <_> - 0 -1 295 -1.6703434521332383e-03 + 0 -1 724 2.2430901881307364e-03 - -3.5234490036964417e-01 3.4917417913675308e-02 + -1.4674974977970123e-01 1.5197925269603729e-01 <_> - 0 -1 126 -3.2307719811797142e-03 + 0 -1 849 7.5493026524782181e-03 - 1.5907490253448486e-01 -7.8541077673435211e-02 + 2.4894557893276215e-02 -6.5740859508514404e-01 <_> - 0 -1 123 5.0736088305711746e-03 + 0 -1 245 -3.3066330943256617e-03 - -7.3796175420284271e-02 1.7231710255146027e-01 + 1.8501703441143036e-01 -1.1837758123874664e-01 <_> - 0 -1 68 -1.9738268107175827e-02 + 0 -1 345 6.9540860131382942e-03 - 2.4731338024139404e-01 -5.3791344165802002e-02 + -7.3770649731159210e-02 2.9017251729965210e-01 <_> - 0 -1 404 6.9891922175884247e-03 + 0 -1 790 -8.6210696026682854e-03 - -6.1806734651327133e-02 2.1923109889030457e-01 + 2.0990766584873199e-01 -1.0644201189279556e-01 <_> - 0 -1 851 -2.6465239934623241e-03 + 0 -1 978 -6.0504255816340446e-04 - 2.8577965497970581e-01 -6.6506840288639069e-02 + 2.2373022139072418e-01 -9.6104651689529419e-02 <_> - 0 -1 734 3.3399839885532856e-03 + 0 -1 46 -4.5433510094881058e-03 - 3.4735739231109619e-02 -3.9448723196983337e-01 + -5.4173427820205688e-01 4.7511249780654907e-02 + <_> + + 0 -1 694 -2.2248399909585714e-03 + + -4.6854707598686218e-01 3.8701556622982025e-02 + <_> + + 0 -1 10 -5.3389102220535278e-02 + + 2.9293462634086609e-01 -7.2517670691013336e-02 + <_> + + 0 -1 13 4.6098522841930389e-02 + + -1.0042577981948853e-01 2.3779328167438507e-01 + <_> + + 0 -1 243 7.7845109626650810e-03 + + 3.7205196917057037e-02 -4.9194374680519104e-01 + <_> + + 0 -1 182 6.0175172984600067e-03 + + 4.4034618884325027e-02 -4.3780878186225891e-01 + <_> + + 0 -1 876 4.8966710455715656e-03 + + -1.0375351458787918e-01 1.9480220973491669e-01 + <_> + + 0 -1 494 -3.1284091528505087e-03 + + 2.3669239878654480e-01 -9.6020378172397614e-02 + <_> + + 0 -1 190 -1.3859109021723270e-03 + + 2.8487151861190796e-01 -7.2190955281257629e-02 + <_> + + 0 -1 191 2.6260318700224161e-03 + + -8.5511997342109680e-02 3.0152606964111328e-01 + <_> + + 0 -1 65 1.7782470583915710e-01 + + -6.4100205898284912e-02 3.3825826644897461e-01 + <_> + + 0 -1 50 1.7538113519549370e-02 + + 5.9994459152221680e-02 -3.5529783368110657e-01 + <_> + + 0 -1 946 -3.2135979272425175e-03 + + 1.3668337464332581e-01 -1.3979049026966095e-01 + <_> + + 0 -1 461 6.1371903866529465e-03 + + -6.2439329922199249e-02 3.0614212155342102e-01 + <_> + + 0 -1 467 -4.6563488431274891e-03 + + -4.3073609471321106e-01 4.9068968743085861e-02 + <_> + + 0 -1 668 -4.0680947713553905e-03 + + -4.6810126304626465e-01 3.7441805005073547e-02 + <_> + + 0 -1 696 1.4199400320649147e-03 + + -8.7975829839706421e-02 2.1591611206531525e-01 + <_> + + 0 -1 851 3.5254685208201408e-03 + + 4.6650484204292297e-02 -4.3687531352043152e-01 + <_> + + 0 -1 487 1.8623860552906990e-02 + + -7.6216101646423340e-02 2.3812168836593628e-01 + <_> + + 0 -1 314 -2.6926528662443161e-02 + + -6.7117422819137573e-01 2.9464269056916237e-02 + <_> + + 0 -1 632 2.2593191824853420e-03 + + 2.8521748259663582e-02 -5.4787307977676392e-01 + <_> + + 0 -1 919 1.7519816174171865e-04 + + -1.6111046075820923e-01 1.0367503762245178e-01 + <_> + + 0 -1 493 1.0614154860377312e-02 + + 4.5461904257535934e-02 -3.8087964057922363e-01 + <_> + + 0 -1 20 -4.4702589511871338e-03 + + 1.4304992556571960e-01 -1.3372300565242767e-01 + <_> + + 0 -1 557 6.2367701902985573e-03 + + -7.7783808112144470e-02 2.1545551717281342e-01 + <_> + + 0 -1 76 4.6502514742314816e-03 + + 4.6132039278745651e-02 -3.7130251526832581e-01 + <_> + + 0 -1 544 -4.3315230868756771e-03 + + -4.1549521684646606e-01 3.8484618067741394e-02 + <_> + + 0 -1 764 -1.6567837446928024e-03 + + -3.4637498855590820e-01 4.6623144298791885e-02 + <_> + + 0 -1 415 4.7653233632445335e-03 + + -5.0808548927307129e-02 3.4609997272491455e-01 + <_> + + 0 -1 413 -3.2579647377133369e-03 + + 2.6948198676109314e-01 -8.5287831723690033e-02 + <_> + + 0 -1 614 2.3307730443775654e-03 + + -7.4774339795112610e-02 2.3053503036499023e-01 + <_> + + 0 -1 176 -2.7928136289119720e-02 + + 1.9429244101047516e-01 -8.7820984423160553e-02 + <_> + + 0 -1 366 -9.8205050453543663e-03 + + -5.9664642810821533e-01 3.1795132905244827e-02 + <_> + + 0 -1 767 4.9811266362667084e-03 + + -1.1911241710186005e-01 1.5268225967884064e-01 + <_> + + 0 -1 508 -2.4869772605597973e-03 + + -3.8041505217552185e-01 4.4293139129877090e-02 + <_> + + 0 -1 780 5.4475376382470131e-03 + + -4.6219147741794586e-02 3.9531415700912476e-01 + <_> + + 0 -1 277 -2.1438062191009521e-02 + + -5.2191144227981567e-01 3.4259662032127380e-02 + <_> + + 0 -1 566 -4.1901203803718090e-03 + + -5.2377271652221680e-01 2.8632357716560364e-02 + <_> + + 0 -1 262 -4.7237933613359928e-03 + + 1.8694585561752319e-01 -8.3333678543567657e-02 + <_> + + 0 -1 845 1.2320578098297119e-03 + + -9.6744544804096222e-02 1.8287587165832520e-01 + <_> + + 0 -1 617 2.0271677523851395e-02 + + -6.4628154039382935e-02 2.7641129493713379e-01 + <_> + + 0 -1 375 -1.0729704797267914e-01 + + 4.3015307188034058e-01 -3.8674801588058472e-02 + <_> + + 0 -1 166 -4.0820333361625671e-01 + + 5.0520670413970947e-01 -3.0450601130723953e-02 + <_> + + 0 -1 305 4.4355981051921844e-02 + + -9.2204704880714417e-02 1.7342080175876617e-01 + <_> + + 0 -1 879 -1.0999260703101754e-03 + + 2.0996508002281189e-01 -7.7222190797328949e-02 + <_> + + 0 -1 325 -3.2928451895713806e-02 + + 2.7598264813423157e-01 -6.4115919172763824e-02 + <_> + + 0 -1 52 2.3981094360351562e-02 + + 2.5229524821043015e-02 -6.9560426473617554e-01 + <_> + + 0 -1 961 4.1703339666128159e-03 + + 2.9712976887822151e-02 -4.8132696747779846e-01 + <_> + + 0 -1 776 -1.4920771354809403e-03 + + 1.6165184974670410e-01 -9.6420668065547943e-02 + <_> + + 0 -1 652 1.8172110430896282e-03 + + 4.2247310280799866e-02 -3.5703054070472717e-01 + <_> + + 0 -1 739 -2.5937356986105442e-03 + + 2.2665317356586456e-01 -6.9081544876098633e-02 + <_> + + 0 -1 706 -2.4995308369398117e-02 + + -6.3855916261672974e-01 2.8458235785365105e-02 + <_> + + 0 -1 909 1.2001263909041882e-02 + + 1.4999576844274998e-02 -7.8175085783004761e-01 + <_> + + 0 -1 640 2.2153530735522509e-03 + + -8.8839285075664520e-02 1.8819671869277954e-01 + <_> + + 0 -1 179 2.7237991162110120e-05 + + -1.4949426054954529e-01 9.8739065229892731e-02 + <_> + + 0 -1 91 -2.6735704392194748e-02 + + -4.5522138476371765e-01 3.2516691833734512e-02 + <_> + + 0 -1 644 -2.3417242337018251e-03 + + -3.1453001499176025e-01 4.7598775476217270e-02 + <_> + + 0 -1 72 4.7831580042839050e-02 + + 2.1954061463475227e-02 -6.1162966489791870e-01 + <_> + + 0 -1 160 -5.7228151708841324e-03 + + -6.3381904363632202e-01 2.0299639552831650e-02 + <_> + + 0 -1 163 3.4780064597725868e-03 + + 3.1021401286125183e-02 -4.2342424392700195e-01 + <_> + + 0 -1 385 -5.4140854626893997e-03 + + 4.7739461064338684e-01 -3.4031655639410019e-02 + <_> + + 0 -1 383 1.5283382963389158e-03 + + -9.6935935318470001e-02 1.9429819285869598e-01 + <_> + + 0 -1 428 -8.6789112538099289e-03 + + 2.4826894700527191e-01 -6.0082063078880310e-02 + <_> + + 0 -1 901 3.0333681497722864e-03 + + -7.4087560176849365e-02 2.6165533065795898e-01 + <_> + + 0 -1 684 6.5222466364502907e-03 + + 3.0176062136888504e-02 -5.5570882558822632e-01 + <_> + + 0 -1 902 5.9719551354646683e-03 + + 2.3057831451296806e-02 -5.7078248262405396e-01 + <_> + + 0 -1 155 -1.3977952767163515e-03 + + 1.5342144668102264e-01 -9.8401337862014771e-02 + <_> + + 0 -1 897 5.9919534251093864e-03 + + -3.9796624332666397e-02 3.5881185531616211e-01 + <_> + + 0 -1 354 2.6286500506103039e-03 + + -9.3140766024589539e-02 1.6334943473339081e-01 + <_> + + 0 -1 296 -4.4777179136872292e-03 + + -4.8081240057945251e-01 3.2935630530118942e-02 + <_> + + 0 -1 333 5.2724601700901985e-03 + + 3.0787551775574684e-02 -4.5133110880851746e-01 + <_> + + 0 -1 1049 -3.2540475949645042e-03 + + -4.7695344686508179e-01 2.8554188087582588e-02 + <_> + + 0 -1 736 1.8083681166172028e-01 + + 2.7366345748305321e-02 -4.9431446194648743e-01 + <_> + + 0 -1 431 2.7535988483577967e-03 + + 1.9968675449490547e-02 -6.4471620321273804e-01 + <_> + + 0 -1 15 -1.4123708009719849e-02 + + -5.2748751640319824e-01 2.4596616625785828e-02 + <_> + + 0 -1 421 -3.2076485455036163e-02 + + -7.2171974182128906e-01 1.6940405592322350e-02 + <_> + + 0 -1 434 -3.2569766044616699e-02 + + 2.2400286793708801e-01 -6.3403561711311340e-02 + + <_> + 100 + -1.2990239858627319e+00 + + <_> + + 0 -1 728 1.1235726065933704e-02 + + -1.2534695863723755e-01 3.9147180318832397e-01 + <_> + + 0 -1 922 5.0947451964020729e-03 + + -1.2666413187980652e-01 4.0618515014648438e-01 + <_> + + 0 -1 891 -1.5323986299335957e-03 + + 2.8940162062644958e-01 -1.4350101351737976e-01 + <_> + + 0 -1 284 3.7766513414680958e-03 + + -1.9189934432506561e-01 1.4756591618061066e-01 + <_> + + 0 -1 514 4.8757870681583881e-03 + + -1.2341982126235962e-01 2.3298588395118713e-01 + <_> + + 0 -1 344 3.1278211623430252e-02 + + -7.6286941766738892e-02 3.4027433395385742e-01 + <_> + + 0 -1 63 6.3753505237400532e-03 + + 7.3992513120174408e-02 -3.2609656453132629e-01 + <_> + + 0 -1 936 -9.8742637783288956e-04 + + 2.4873960018157959e-01 -9.0153135359287262e-02 + <_> + + 0 -1 217 -3.0144110321998596e-02 + + -5.1088541746139526e-01 5.0071869045495987e-02 + <_> + + 0 -1 268 4.7727730125188828e-03 + + 5.1353454589843750e-02 -4.1142973303794861e-01 + <_> + + 0 -1 420 6.4554966986179352e-02 + + 4.5133572071790695e-02 -4.8264691233634949e-01 + <_> + + 0 -1 744 8.0438675358891487e-03 + + -6.3803412020206451e-02 3.0405151844024658e-01 + <_> + + 0 -1 1051 1.0576066561043262e-03 + + 4.9984093755483627e-02 -3.3949175477027893e-01 + <_> + + 0 -1 938 6.8522170186042786e-03 + + 3.5091523081064224e-02 -6.7847234010696411e-01 + <_> + + 0 -1 860 -1.7977621406316757e-02 + + -3.7503832578659058e-01 4.0370170027017593e-02 + <_> + + 0 -1 748 -2.9955487698316574e-02 + + -4.2023807764053345e-01 4.2222321033477783e-02 + <_> + + 0 -1 14 2.0934976637363434e-02 + + 4.3809924274682999e-02 -4.1159108281135559e-01 + <_> + + 0 -1 499 -1.0348223149776459e-03 + + 1.7594149708747864e-01 -1.0171056538820267e-01 + <_> + + 0 -1 15 1.1026043444871902e-02 + + 3.7518307566642761e-02 -4.9795153737068176e-01 + <_> + + 0 -1 201 4.1434396989643574e-03 + + -7.7400334179401398e-02 2.3505100607872009e-01 + <_> + + 0 -1 423 -1.4838734641671181e-03 + + 2.9909220337867737e-01 -9.2648021876811981e-02 + <_> + + 0 -1 1025 4.0641101077198982e-03 + + 3.8187902420759201e-02 -5.9566622972488403e-01 + <_> + + 0 -1 108 -2.6055248454213142e-03 + + 1.4647382497787476e-01 -1.1769902706146240e-01 + <_> + + 0 -1 834 -1.8873009830713272e-02 + + 2.0791313052177429e-01 -9.1127894818782806e-02 + <_> + + 0 -1 960 1.0428125038743019e-02 + + 4.3083548545837402e-02 -4.1407048702239990e-01 + <_> + + 0 -1 460 1.9560819491744041e-03 + + -6.5898597240447998e-02 2.6488196849822998e-01 + <_> + + 0 -1 402 6.1143590137362480e-03 + + 4.7718580812215805e-02 -4.3339842557907104e-01 + <_> + + 0 -1 411 3.9817169308662415e-03 + + 2.8663935139775276e-02 -5.4472506046295166e-01 + <_> + + 0 -1 497 -9.0858177281916142e-04 + + 1.2656490504741669e-01 -1.3804104924201965e-01 + <_> + + 0 -1 548 -5.1833119243383408e-02 + + 2.9838389158248901e-01 -6.4876683056354523e-02 + <_> + + 0 -1 550 -6.1461031436920166e-02 + + 2.2751982510089874e-01 -7.7075794339179993e-02 + <_> + + 0 -1 771 -3.8890805444680154e-04 + + 1.4823918044567108e-01 -1.2443733215332031e-01 + <_> + + 0 -1 819 6.3632195815443993e-03 + + 3.3928975462913513e-02 -5.5825293064117432e-01 + <_> + + 0 -1 929 2.3877150379121304e-03 + + -6.0555700212717056e-02 2.9875907301902771e-01 + <_> + + 0 -1 718 2.1584378555417061e-03 + + 2.6707226410508156e-02 -6.5327596664428711e-01 + <_> + + 0 -1 972 1.3073299778625369e-03 + + -6.5057143568992615e-02 2.8509995341300964e-01 + <_> + + 0 -1 1023 2.7173646230949089e-05 + + -1.4736446738243103e-01 1.1435943096876144e-01 + <_> + + 0 -1 630 2.5558518245816231e-03 + + 2.2957315668463707e-02 -6.1825275421142578e-01 + <_> + + 0 -1 435 4.4789682142436504e-03 + + 3.6877695471048355e-02 -4.1827708482742310e-01 + <_> + + 0 -1 335 -4.0298998355865479e-02 + + -6.8164646625518799e-01 2.1755648776888847e-02 + <_> + + 0 -1 782 -3.2729938626289368e-02 + + -5.4164266586303711e-01 2.6013873517513275e-02 + <_> + + 0 -1 1011 -1.6982981469482183e-03 + + 3.5175332427024841e-01 -4.7216285020112991e-02 + <_> + + 0 -1 331 3.6859638057649136e-03 + + 4.9838334321975708e-02 -3.0565607547760010e-01 + <_> + + 0 -1 235 1.8905990291386843e-03 + + 2.3341298103332520e-02 -6.6700172424316406e-01 + <_> + + 0 -1 714 4.9954187124967575e-03 + + 2.5513354688882828e-02 -5.4635345935821533e-01 + <_> + + 0 -1 336 -5.5998284369707108e-03 + + 2.9532432556152344e-01 -5.9350244700908661e-02 + <_> + + 0 -1 1008 -1.0907559189945459e-03 + + 1.8265166878700256e-01 -9.8137028515338898e-02 + <_> + + 0 -1 975 -7.4323470471426845e-04 + + 1.9020494818687439e-01 -8.7386451661586761e-02 + <_> + + 0 -1 914 2.7787161525338888e-03 + + 3.2241951674222946e-02 -4.8055323958396912e-01 + <_> + + 0 -1 153 2.4344769772142172e-03 + + 4.6477138996124268e-02 -2.9923307895660400e-01 + <_> + + 0 -1 293 2.8132982552051544e-03 + + -9.0026579797267914e-02 1.6738441586494446e-01 + <_> + + 0 -1 73 3.2191604375839233e-02 + + -6.3697919249534607e-02 2.8380525112152100e-01 + <_> + + 0 -1 656 -1.8642821814864874e-03 + + 2.0616722106933594e-01 -7.4722714722156525e-02 + <_> + + 0 -1 657 4.0091956034302711e-03 + + -7.1015752851963043e-02 2.5589218735694885e-01 + <_> + + 0 -1 150 -5.1108514890074730e-03 + + -4.8940917849540710e-01 3.4555420279502869e-02 + <_> + + 0 -1 600 -1.9523575901985168e-02 + + 3.1921747326850891e-01 -5.1439035683870316e-02 + <_> + + 0 -1 298 -1.4431261457502842e-02 + + 1.4213174581527710e-01 -1.1113181710243225e-01 + <_> + + 0 -1 732 4.5302580110728741e-04 + + -1.0926237702369690e-01 1.4363190531730652e-01 + <_> + + 0 -1 78 -5.4108840413391590e-03 + + -4.6926099061965942e-01 3.1095381826162338e-02 + <_> + + 0 -1 259 1.6963672824203968e-03 + + -6.7337587475776672e-02 2.2115154564380646e-01 + <_> + + 0 -1 190 1.8719944637268782e-03 + + -5.8433420956134796e-02 2.7830049395561218e-01 + <_> + + 0 -1 1014 -8.3780642598867416e-03 + + -4.6290600299835205e-01 3.3701810985803604e-02 + <_> + + 0 -1 510 1.0720299184322357e-01 + + 2.6600774377584457e-02 -5.0957643985748291e-01 + <_> + + 0 -1 670 -1.5523867914453149e-03 + + -5.7974040508270264e-01 2.2188233211636543e-02 + <_> + + 0 -1 649 -1.0537400841712952e-02 + + -4.3835061788558960e-01 2.9434528201818466e-02 + <_> + + 0 -1 1038 3.1337797641754150e-02 + + 2.0445786416530609e-02 -6.3010692596435547e-01 + <_> + + 0 -1 1004 -5.1124744117259979e-02 + + -6.7282766103744507e-01 1.8230145797133446e-02 + <_> + + 0 -1 362 -6.0091790510341525e-04 + + 2.0237097144126892e-01 -7.2557553648948669e-02 + <_> + + 0 -1 409 1.6933252336457372e-03 + + -5.9000160545110703e-02 2.4010565876960754e-01 + <_> + + 0 -1 18 5.7134744711220264e-03 + + 2.9386352747678757e-02 -5.1309728622436523e-01 + <_> + + 0 -1 429 -9.6922749653458595e-03 + + -5.4907989501953125e-01 2.3704739287495613e-02 + <_> + + 0 -1 308 -1.2504560872912407e-02 + + -6.1863696575164795e-01 1.9876839593052864e-02 + <_> + + 0 -1 382 -9.1812955215573311e-03 + + -4.7697570919990540e-01 2.5203671306371689e-02 + <_> + + 0 -1 570 2.8069302439689636e-02 + + -5.5565606802701950e-02 2.5318285822868347e-01 + <_> + + 0 -1 573 4.6324366703629494e-03 + + 2.5273589417338371e-02 -5.9603255987167358e-01 + <_> + + 0 -1 784 2.9409723356366158e-03 + + -5.1576137542724609e-02 2.9322555661201477e-01 + <_> + + 0 -1 159 -1.6009721904993057e-02 + + 2.9389014840126038e-01 -4.7874812036752701e-02 + <_> + + 0 -1 355 -2.0468614995479584e-02 + + 1.4383009076118469e-01 -1.0160042345523834e-01 + <_> + + 0 -1 868 2.3338340222835541e-02 + + -5.7301126420497894e-02 2.9121819138526917e-01 + <_> + + 0 -1 921 -2.1875634789466858e-02 + + -6.4106851816177368e-01 2.4203805252909660e-02 + <_> + + 0 -1 427 1.1228370480239391e-02 + + -5.2143514156341553e-02 2.8465506434440613e-01 + <_> + + 0 -1 197 -4.3659657239913940e-03 + + -6.0558545589447021e-01 2.5440702214837074e-02 + <_> + + 0 -1 824 1.1577639961615205e-03 + + -8.9793093502521515e-02 1.6500258445739746e-01 + <_> + + 0 -1 781 1.1090341955423355e-02 + + 2.4472476914525032e-02 -6.1380225419998169e-01 + <_> + + 0 -1 1015 4.7660744749009609e-03 + + 4.1726417839527130e-02 -3.2548862695693970e-01 + <_> + + 0 -1 864 2.4865168597898446e-05 + + -1.2436556816101074e-01 1.1702288687229156e-01 + <_> + + 0 -1 823 -7.6379198580980301e-03 + + -4.9008071422576904e-01 2.9381709173321724e-02 + <_> + + 0 -1 445 -3.2750256359577179e-03 + + 1.7950019240379333e-01 -8.0592408776283264e-02 + <_> + + 0 -1 448 1.3944536913186312e-03 + + -8.0001771450042725e-02 2.2785140573978424e-01 + <_> + + 0 -1 444 1.9776031840592623e-03 + + 3.4109916538000107e-02 -4.8504865169525146e-01 + <_> + + 0 -1 39 -3.9329148828983307e-02 + + -6.8790251016616821e-01 1.7370922490954399e-02 + <_> + + 0 -1 645 -2.8447234071791172e-03 + + 2.3028372228145599e-01 -6.6618286073207855e-02 + <_> + + 0 -1 232 3.2375190407037735e-02 + + -7.5743824243545532e-02 1.7864570021629333e-01 + <_> + + 0 -1 5 5.1314428448677063e-02 + + -5.3142681717872620e-02 2.8643575310707092e-01 + <_> + + 0 -1 79 4.6999715268611908e-03 + + 3.5749543458223343e-02 -4.0437424182891846e-01 + <_> + + 0 -1 173 -2.0850417204201221e-03 + + -3.0815458297729492e-01 4.2763352394104004e-02 + <_> + + 0 -1 455 -9.1223767958581448e-04 + + 2.1245715022087097e-01 -6.7729450762271881e-02 + <_> + + 0 -1 690 -2.2479293693322688e-04 + + 1.3159312307834625e-01 -1.0141336172819138e-01 + <_> + + 0 -1 974 3.1234124675393105e-02 + + -8.9100256562232971e-02 1.5734429657459259e-01 + <_> + + 0 -1 465 -1.5079543227329850e-03 + + 3.2412421703338623e-01 -4.4387526810169220e-02 + + <_> + 100 + -1.2500010728836060e+00 + + <_> + + 0 -1 803 -5.5631361901760101e-03 + + 4.5343571901321411e-01 -5.2330773323774338e-02 + <_> + + 0 -1 426 4.1911248117685318e-03 + + -1.2266161292791367e-01 3.6830583214759827e-01 + <_> + + 0 -1 424 -1.8559540621936321e-03 + + 2.4044598639011383e-01 -1.5207393467426300e-01 + <_> + + 0 -1 532 -1.1846812441945076e-02 + + 2.7016878128051758e-01 -1.1934488266706467e-01 + <_> + + 0 -1 180 1.0401019826531410e-03 + + -2.3527304828166962e-01 9.5964968204498291e-02 + <_> + + 0 -1 462 9.3873767182230949e-03 + + -5.6923847645521164e-02 4.2236638069152832e-01 + <_> + + 0 -1 13 9.0843521058559418e-02 + + -6.3625380396842957e-02 3.8295668363571167e-01 + <_> + + 0 -1 439 -1.6221515834331512e-03 + + 1.8148291110992432e-01 -1.3424767553806305e-01 + <_> + + 0 -1 875 -1.8008962273597717e-02 + + 2.7346464991569519e-01 -7.6283894479274750e-02 + <_> + + 0 -1 278 8.6509017273783684e-03 + + 5.8148156851530075e-02 -5.2620184421539307e-01 + <_> + + 0 -1 726 2.8817038983106613e-03 + + 2.6940831914544106e-02 -4.7911167144775391e-01 + <_> + + 0 -1 263 -6.1017833650112152e-03 + + 1.7878855764865875e-01 -1.2378337979316711e-01 + <_> + + 0 -1 403 -5.9294269885867834e-04 + + -2.7179723978042603e-01 8.0951526761054993e-02 + <_> + + 0 -1 996 3.1696190126240253e-04 + + -1.7311862111091614e-01 1.0296358913183212e-01 + <_> + + 0 -1 519 6.6280784085392952e-03 + + -5.8870136737823486e-02 2.9477587342262268e-01 + <_> + + 0 -1 916 -4.5112203806638718e-03 + + -5.9672296047210693e-01 2.7053238824009895e-02 + <_> + + 0 -1 679 -4.3381296098232269e-02 + + -4.2040801048278809e-01 4.0890187025070190e-02 + <_> + + 0 -1 813 2.0323593635112047e-03 + + 5.5178079754114151e-02 -3.0439695715904236e-01 + <_> + + 0 -1 973 1.8127080984413624e-03 + + -8.2048252224922180e-02 2.1907366812229156e-01 + <_> + + 0 -1 359 -6.6424394026398659e-03 + + -4.7840338945388794e-01 4.4878169894218445e-02 + <_> + + 0 -1 903 -8.5755460895597935e-04 + + 1.3301849365234375e-01 -1.2699788808822632e-01 + <_> + + 0 -1 904 3.4769098274409771e-03 + + -7.1578972041606903e-02 2.5448271632194519e-01 + <_> + + 0 -1 950 -1.8520625308156013e-03 + + 1.5127970278263092e-01 -1.2349219620227814e-01 + <_> + + 0 -1 777 5.4582338780164719e-03 + + 3.5001352429389954e-02 -4.8021456599235535e-01 + <_> + + 0 -1 894 -6.4206691458821297e-03 + + -5.6509351730346680e-01 2.6883032172918320e-02 + <_> + + 0 -1 895 8.2498416304588318e-03 + + 4.3442543596029282e-02 -3.7965279817581177e-01 + <_> + + 0 -1 825 3.0813394114375114e-03 + + -5.6544844061136246e-02 3.2101437449455261e-01 + <_> + + 0 -1 865 2.8121876530349255e-03 + + -7.1444042026996613e-02 2.8035575151443481e-01 + <_> + + 0 -1 418 -1.1791236698627472e-02 + + 2.0067863166332245e-01 -1.0047248005867004e-01 + <_> + + 0 -1 476 1.4931729529052973e-03 + + -6.6428750753402710e-02 2.6187655329704285e-01 + <_> + + 0 -1 364 -2.8772680088877678e-03 + + -4.5838123559951782e-01 4.2477916926145554e-02 + <_> + + 0 -1 592 -4.5857336372137070e-03 + + 1.2718579173088074e-01 -1.3642288744449615e-01 + <_> + + 0 -1 585 -1.3770985417068005e-02 + + -6.4000308513641357e-01 2.7297915890812874e-02 + <_> + + 0 -1 746 -3.6472730338573456e-02 + + -5.1465278863906860e-01 3.1265191733837128e-02 + <_> + + 0 -1 378 1.0626764036715031e-02 + + 2.4199636653065681e-02 -6.3441967964172363e-01 + <_> + + 0 -1 509 -3.6817211657762527e-03 + + -4.4575414061546326e-01 3.1119547784328461e-02 + <_> + + 0 -1 856 -3.4752404317259789e-03 + + 1.4008119702339172e-01 -1.0539831966161728e-01 + <_> + + 0 -1 815 -4.7973562031984329e-03 + + 2.8762820363044739e-01 -6.0662355273962021e-02 + <_> + + 0 -1 773 6.4153699204325676e-03 + + -1.1230263859033585e-01 1.4087037742137909e-01 + <_> + + 0 -1 814 -1.0156400967389345e-03 + + -3.3441004157066345e-01 4.3477565050125122e-02 + <_> + + 0 -1 968 3.3057793043553829e-03 + + 1.9609324634075165e-02 -7.0060092210769653e-01 + <_> + + 0 -1 100 -5.3275022655725479e-03 + + 2.4580952525138855e-01 -6.0118518769741058e-02 + <_> + + 0 -1 469 1.5886269975453615e-03 + + -7.7446170151233673e-02 1.9878011941909790e-01 + <_> + + 0 -1 520 4.7287968918681145e-03 + + 3.0098341405391693e-02 -5.0950014591217041e-01 + <_> + + 0 -1 741 -1.9788878853432834e-04 + + 1.5142950415611267e-01 -9.6688762307167053e-02 + <_> + + 0 -1 389 -4.9208370037376881e-03 + + -4.5343187451362610e-01 3.7627156823873520e-02 + <_> + + 0 -1 361 4.5094583183526993e-02 + + -8.5510566830635071e-02 1.7849470674991608e-01 + <_> + + 0 -1 944 1.4799998607486486e-03 + + -6.4638271927833557e-02 2.3496921360492706e-01 + <_> + + 0 -1 517 1.0061380267143250e-01 + + -3.0139762908220291e-02 4.9012109637260437e-01 + <_> + + 0 -1 688 -5.2844230085611343e-03 + + 1.7104546725749969e-01 -8.7710574269294739e-02 + <_> + + 0 -1 626 -8.3214940968900919e-04 + + -2.6654696464538574e-01 5.3875535726547241e-02 + <_> + + 0 -1 190 -8.8889291509985924e-04 + + 1.8824113905429840e-01 -8.0119885504245758e-02 + <_> + + 0 -1 191 2.2177316714078188e-03 + + -6.9703146815299988e-02 2.0391084253787994e-01 + <_> + + 0 -1 674 -1.1522162239998579e-03 + + -3.6508113145828247e-01 3.9048090577125549e-02 + <_> + + 0 -1 1036 -1.0836161673069000e-02 + + -5.8106678724288940e-01 2.1713526919484138e-02 + <_> + + 0 -1 82 -1.6731536388397217e-01 + + -4.7344669699668884e-01 2.6662701740860939e-02 + <_> + + 0 -1 515 -9.5267388969659805e-03 + + 2.7732986211776733e-01 -5.6512769311666489e-02 + <_> + + 0 -1 329 6.6450019367039204e-03 + + 2.9381312429904938e-02 -5.3565382957458496e-01 + <_> + + 0 -1 104 -2.1554589271545410e-02 + + -6.2839144468307495e-01 1.8782904371619225e-02 + <_> + + 0 -1 892 1.4288825332187116e-04 + + -1.2763719260692596e-01 1.0616952925920486e-01 + <_> + + 0 -1 319 1.8068919889628887e-03 + + 4.2757544666528702e-02 -3.2102146744728088e-01 + <_> + + 0 -1 979 1.2280542869120836e-03 + + -5.7478122413158417e-02 2.5948432087898254e-01 + <_> + + 0 -1 89 2.6250675320625305e-02 + + -9.5928788185119629e-02 1.4502045512199402e-01 + <_> + + 0 -1 336 1.8192850984632969e-03 + + -6.8028703331947327e-02 2.3167446255683899e-01 + <_> + + 0 -1 44 -4.8545510508120060e-03 + + -4.3374514579772949e-01 3.6196250468492508e-02 + <_> + + 0 -1 762 2.8766903560608625e-03 + + 3.8431353867053986e-02 -3.3900904655456543e-01 + <_> + + 0 -1 793 4.4511677697300911e-03 + + -4.8704307526350021e-02 2.9764902591705322e-01 + <_> + + 0 -1 545 -9.9098179489374161e-03 + + 2.5863200426101685e-01 -5.7418409734964371e-02 + <_> + + 0 -1 2 -2.6503708213567734e-03 + + 1.3571591675281525e-01 -1.1608450859785080e-01 + <_> + + 0 -1 1 -3.0543167144060135e-02 + + 2.8910955786705017e-01 -5.1689133048057556e-02 + <_> + + 0 -1 698 -2.6757145300507545e-02 + + 1.8446540832519531e-01 -7.7666454017162323e-02 + <_> + + 0 -1 131 -2.2985447198152542e-02 + + -3.5471677780151367e-01 4.1345477104187012e-02 + <_> + + 0 -1 536 9.5467511564493179e-03 + + -5.5719308555126190e-02 2.4589607119560242e-01 + <_> + + 0 -1 730 2.6181992143392563e-03 + + -1.0256808251142502e-01 1.3319683074951172e-01 + <_> + + 0 -1 1031 -3.5491142421960831e-02 + + -5.9519535303115845e-01 2.2935084998607635e-02 + <_> + + 0 -1 703 1.5474080573767424e-03 + + -8.4649838507175446e-02 1.6198579967021942e-01 + <_> + + 0 -1 861 -3.4878745209425688e-03 + + -5.0121647119522095e-01 2.6359066367149353e-02 + <_> + + 0 -1 601 3.6612942349165678e-03 + + -7.2178244590759277e-02 1.8415448069572449e-01 + <_> + + 0 -1 692 -2.1762652322649956e-03 + + 2.1102276444435120e-01 -6.4692504703998566e-02 + <_> + + 0 -1 66 -6.9864131510257721e-03 + + -4.3104550242424011e-01 3.3448409289121628e-02 + <_> + + 0 -1 64 4.7067347913980484e-03 + + 4.7681909054517746e-02 -3.1132212281227112e-01 + <_> + + 0 -1 1054 -7.0012239739298820e-03 + + -3.4665238857269287e-01 3.6263268440961838e-02 + <_> + + 0 -1 36 1.0144514963030815e-02 + + 3.3140499144792557e-02 -3.7149414420127869e-01 + <_> + + 0 -1 927 2.5893552228808403e-03 + + -5.6186988949775696e-02 2.3859155178070068e-01 + <_> + + 0 -1 877 -3.8091647438704967e-03 + + 1.8803173303604126e-01 -9.0667806565761566e-02 + <_> + + 0 -1 559 -2.5004068017005920e-01 + + -5.7437247037887573e-01 2.3015361279249191e-02 + <_> + + 0 -1 651 -8.5459719412028790e-04 + + -3.0019384622573853e-01 4.1898671537637711e-02 + <_> + + 0 -1 556 -1.5604835003614426e-02 + + -5.8520871400833130e-01 2.1410541608929634e-02 + <_> + + 0 -1 654 -1.9794562458992004e-01 + + -6.7963910102844238e-01 1.6488522291183472e-02 + <_> + + 0 -1 896 -1.9824346527457237e-03 + + 1.4493939280509949e-01 -8.7999224662780762e-02 + <_> + + 0 -1 582 -2.1158650517463684e-02 + + -6.4664304256439209e-01 2.4590896442532539e-02 + <_> + + 0 -1 837 -9.3553803162649274e-04 + + 1.8229192495346069e-01 -7.2682343423366547e-02 + <_> + + 0 -1 610 -1.1120189446955919e-03 + + 1.5188181400299072e-01 -8.6225852370262146e-02 + <_> + + 0 -1 316 1.1543033272027969e-01 + + -4.7091111540794373e-02 3.5574361681938171e-01 + <_> + + 0 -1 568 -5.2959467284381390e-03 + + 2.0496748387813568e-01 -6.1289250850677490e-02 + <_> + + 0 -1 310 -2.6194794103503227e-02 + + 1.7320305109024048e-01 -1.1094193905591965e-01 + <_> + + 0 -1 167 1.4183738268911839e-02 + + -9.7011148929595947e-02 1.4372280240058899e-01 + <_> + + 0 -1 1032 -3.6340979859232903e-03 + + -4.0951785445213318e-01 3.0991807579994202e-02 + <_> + + 0 -1 1028 1.4448106288909912e-02 + + -6.1627220362424850e-02 2.0916682481765747e-01 + <_> + + 0 -1 982 -1.1399465613067150e-02 + + 1.8926219642162323e-01 -8.7004892528057098e-02 + + <_> + 100 + -1.2953979969024658e+00 + + <_> + + 0 -1 725 1.6048721969127655e-02 + + -9.5187164843082428e-02 3.7635341286659241e-01 + <_> + + 0 -1 239 4.1785854846239090e-03 + + -1.4184002578258514e-01 3.1887301802635193e-01 + <_> + + 0 -1 526 -6.7659835331141949e-03 + + 3.7005490064620972e-01 -8.9318118989467621e-02 + <_> + + 0 -1 186 1.4478694647550583e-02 + + -1.3418816030025482e-01 2.8370034694671631e-01 + <_> + + 0 -1 411 -1.8653089646250010e-03 + + -3.5015934705734253e-01 6.9187328219413757e-02 + <_> + + 0 -1 901 3.7634610198438168e-03 + + -7.7612839639186859e-02 3.0384179949760437e-01 + <_> + + 0 -1 353 8.9913085103034973e-03 + + 6.0584690421819687e-02 -4.7271341085433960e-01 + <_> + + 0 -1 121 -3.0867164023220539e-03 + + 1.6870087385177612e-01 -1.3231597840785980e-01 + <_> + + 0 -1 388 -4.0246914140880108e-03 + + -4.1840493679046631e-01 6.4627721905708313e-02 + <_> + + 0 -1 896 4.8679644241929054e-03 + + -5.6233335286378860e-02 4.2156839370727539e-01 + <_> + + 0 -1 480 5.5472417734563351e-03 + + 3.7891130894422531e-02 -5.1408857107162476e-01 + <_> + + 0 -1 1003 6.5884483046829700e-04 + + -1.6457377374172211e-01 1.1204792559146881e-01 + <_> + + 0 -1 1050 -1.0980388615280390e-03 + + -3.3544427156448364e-01 4.6025454998016357e-02 + <_> + + 0 -1 583 -2.8328509069979191e-03 + + 2.3426958918571472e-01 -7.2758100926876068e-02 + <_> + + 0 -1 56 1.5504788607358932e-03 + + 6.2664858996868134e-02 -2.5632002949714661e-01 + <_> + + 0 -1 348 -6.2153179896995425e-04 + + 1.7485393583774567e-01 -9.9982917308807373e-02 + <_> + + 0 -1 675 -1.4540781266987324e-02 + + -4.4969236850738525e-01 3.7324137985706329e-02 + <_> + + 0 -1 792 -1.6624422278255224e-03 + + 1.4047256112098694e-01 -1.1892398446798325e-01 + <_> + + 0 -1 893 1.6246617306023836e-03 + + 6.1172962188720703e-02 -2.7449882030487061e-01 + <_> + + 0 -1 87 -1.1364535987377167e-01 + + -4.3175131082534790e-01 3.8861453533172607e-02 + <_> + + 0 -1 29 6.3355863094329834e-03 + + 4.3615639209747314e-02 -3.7530297040939331e-01 + <_> + + 0 -1 88 -7.9950205981731415e-03 + + -5.6157833337783813e-01 2.7148496359586716e-02 + <_> + + 0 -1 825 -6.0972268693149090e-03 + + 4.7499263286590576e-01 -3.5678520798683167e-02 + <_> + + 0 -1 933 1.3845593202859163e-03 + + -1.1575383692979813e-01 1.3405258953571320e-01 + <_> + + 0 -1 351 8.5432223975658417e-02 + + -5.6930482387542725e-02 3.1373351812362671e-01 + <_> + + 0 -1 661 -1.2029780447483063e-01 + + -4.7989824414253235e-01 3.8594469428062439e-02 + <_> + + 0 -1 829 -8.3766942843794823e-03 + + -2.0806340873241425e-01 7.6934777200222015e-02 + <_> + + 0 -1 673 -4.6590538695454597e-03 + + -5.0349289178848267e-01 3.0419014394283295e-02 + <_> + + 0 -1 453 -3.2761119306087494e-02 + + 3.2354715466499329e-01 -5.6276485323905945e-02 + <_> + + 0 -1 783 8.3009023219347000e-03 + + -8.3831317722797394e-02 2.3335608839988708e-01 + <_> + + 0 -1 848 5.7156109251081944e-03 + + -8.6484365165233612e-02 1.8363620340824127e-01 + <_> + + 0 -1 518 -1.0080671310424805e-01 + + 3.8774350285530090e-01 -4.0828518569469452e-02 + <_> + + 0 -1 14 -2.5552421808242798e-02 + + -5.0166463851928711e-01 3.8269419223070145e-02 + <_> + + 0 -1 23 -6.1748407781124115e-02 + + -3.5811841487884521e-01 4.6544160693883896e-02 + <_> + + 0 -1 702 -1.2269845232367516e-02 + + 2.0786920189857483e-01 -7.8518457710742950e-02 + <_> + + 0 -1 11 2.8048269450664520e-02 + + -5.6248739361763000e-02 2.8977242112159729e-01 + <_> + + 0 -1 523 -7.2269486263394356e-03 + + -7.2842431068420410e-01 2.3379294201731682e-02 + <_> + + 0 -1 952 4.7771912068128586e-03 + + 2.3226773366332054e-02 -5.6412339210510254e-01 + <_> + + 0 -1 276 2.8181755915284157e-03 + + -3.3893339335918427e-02 4.3989458680152893e-01 + <_> + + 0 -1 194 -8.4437360055744648e-04 + + 1.9623728096485138e-01 -7.8485630452632904e-02 + <_> + + 0 -1 407 -4.3037505820393562e-03 + + -3.6311796307563782e-01 4.0526941418647766e-02 + <_> + + 0 -1 105 4.9789976328611374e-03 + + 4.8658054322004318e-02 -3.1162264943122864e-01 + <_> + + 0 -1 1041 -5.0353109836578369e-03 + + -5.5396872758865356e-01 2.3420164361596107e-02 + <_> + + 0 -1 837 -1.3716940302401781e-03 + + 2.2532704472541809e-01 -6.2741614878177643e-02 + <_> + + 0 -1 910 3.3456790260970592e-03 + + 3.8516163825988770e-02 -3.6224716901779175e-01 + <_> + + 0 -1 476 1.9023896893486381e-03 + + -5.4677281528711319e-02 2.5294607877731323e-01 + <_> + + 0 -1 1037 -1.4274399727582932e-03 + + -3.7934723496437073e-01 3.8707002997398376e-02 + <_> + + 0 -1 512 1.1010284069925547e-03 + + -9.5659099519252777e-02 1.4958517253398895e-01 + <_> + + 0 -1 219 -4.4154529459774494e-03 + + -5.1156622171401978e-01 2.5640288367867470e-02 + <_> + + 0 -1 448 3.7023271434009075e-03 + + -4.3221119791269302e-02 3.2581970095634460e-01 + <_> + + 0 -1 237 -5.4480084218084812e-03 + + -4.7611567378044128e-01 3.5773757845163345e-02 + <_> + + 0 -1 313 -3.1974539160728455e-04 + + 1.1916244029998779e-01 -1.1832383275032043e-01 + <_> + + 0 -1 381 -2.8494147583842278e-02 + + -6.5004557371139526e-01 2.0599177107214928e-02 + <_> + + 0 -1 941 -2.7449331246316433e-03 + + -3.9275056123733521e-01 3.3223718404769897e-02 + <_> + + 0 -1 937 4.1362000629305840e-03 + + 2.7191400527954102e-02 -4.7952741384506226e-01 + <_> + + 0 -1 638 3.3568721264600754e-03 + + -6.0983922332525253e-02 2.2964073717594147e-01 + <_> + + 0 -1 571 -5.7129040360450745e-03 + + -5.9052920341491699e-01 2.3388050496578217e-02 + <_> + + 0 -1 477 -1.1567326728254557e-03 + + 1.5093772113323212e-01 -9.1553181409835815e-02 + <_> + + 0 -1 143 -8.9379055425524712e-03 + + -3.5481104254722595e-01 3.6294396966695786e-02 + <_> + + 0 -1 811 3.6097350530326366e-03 + + 3.2780081033706665e-02 -3.8517734408378601e-01 + <_> + + 0 -1 975 2.0727193914353848e-03 + + -5.3627125918865204e-02 2.5666573643684387e-01 + <_> + + 0 -1 977 -1.8177125602960587e-03 + + 2.0363596081733704e-01 -7.0555560290813446e-02 + <_> + + 0 -1 932 -3.3223466016352177e-03 + + -4.8926571011543274e-01 2.8675178065896034e-02 + <_> + + 0 -1 553 -4.4222660362720490e-03 + + -4.0920063853263855e-01 3.0863059684634209e-02 + <_> + + 0 -1 705 -7.8024319373071194e-04 + + 1.2166435271501541e-01 -1.0897941887378693e-01 + <_> + + 0 -1 850 7.9855127260088921e-03 + + 2.5865448638796806e-02 -4.8917418718338013e-01 + <_> + + 0 -1 99 -2.7752606911235489e-05 + + 1.1611134558916092e-01 -1.1225233227014542e-01 + <_> + + 0 -1 641 3.0770362354815006e-03 + + -6.4753420650959015e-02 1.9632078707218170e-01 + <_> + + 0 -1 593 -2.1007210016250610e-03 + + 1.9681814312934875e-01 -9.4167068600654602e-02 + <_> + + 0 -1 112 -6.1383144930005074e-03 + + -3.9225277304649353e-01 3.5275831818580627e-02 + <_> + + 0 -1 119 1.1184177361428738e-02 + + 2.9410628601908684e-02 -4.3673589825630188e-01 + <_> + + 0 -1 1007 1.0432782582938671e-03 + + -6.7393802106380463e-02 1.9237922132015228e-01 + <_> + + 0 -1 931 8.5366604616865516e-04 + + -8.4067851305007935e-02 1.6720806062221527e-01 + <_> + + 0 -1 55 -3.3059090375900269e-02 + + 2.6451063156127930e-01 -5.2662543952465057e-02 + <_> + + 0 -1 161 -8.7435375899076462e-03 + + -3.0780994892120361e-01 4.8419766128063202e-02 + <_> + + 0 -1 907 -1.1587596964091063e-03 + + 1.4863640069961548e-01 -9.4251774251461029e-02 + <_> + + 0 -1 295 -2.2717786952853203e-02 + + -4.2414310574531555e-01 3.5150803625583649e-02 + <_> + + 0 -1 810 -8.4660220891237259e-03 + + 2.5765278935432434e-01 -5.4796367883682251e-02 + <_> + + 0 -1 492 -1.4943551504984498e-03 + + -2.7729934453964233e-01 4.9375709146261215e-02 + <_> + + 0 -1 0 -7.5480109080672264e-04 + + 1.2197802960872650e-01 -1.0845532268285751e-01 + <_> + + 0 -1 853 2.9903287068009377e-03 + + -8.4785357117652893e-02 1.5424512326717377e-01 + <_> + + 0 -1 1040 1.7600806895643473e-03 + + 7.0044547319412231e-02 -1.9795240461826324e-01 + <_> + + 0 -1 154 1.2243577279150486e-02 + + -7.8472696244716644e-02 1.7095038294792175e-01 + <_> + + 0 -1 80 -2.7739753946661949e-02 + + 2.0475350320339203e-01 -6.9862313568592072e-02 + <_> + + 0 -1 300 -6.4486754126846790e-03 + + -3.7651637196540833e-01 3.3540505915880203e-02 + <_> + + 0 -1 341 -1.3427068479359150e-02 + + 1.5320046246051788e-01 -8.3272159099578857e-02 + <_> + + 0 -1 360 8.2654636353254318e-03 + + -8.1395141780376434e-02 1.9696740806102753e-01 + <_> + + 0 -1 616 3.0615129508078098e-03 + + -5.8534789830446243e-02 2.1799990534782410e-01 + <_> + + 0 -1 616 -1.4359520282596350e-03 + + 1.8553669750690460e-01 -7.9428143799304962e-02 + <_> + + 0 -1 488 2.8793164528906345e-03 + + 3.7499722093343735e-02 -3.5483118891716003e-01 + <_> + + 0 -1 631 -9.0899681672453880e-03 + + -5.9031629562377930e-01 2.0012531429529190e-02 + <_> + + 0 -1 896 1.6797243151813745e-03 + + -6.8868115544319153e-02 1.8992543220520020e-01 + <_> + + 0 -1 581 -1.1759581044316292e-02 + + 3.6288693547248840e-01 -3.3578243106603622e-02 + <_> + + 0 -1 749 3.8305222988128662e-03 + + -6.6793553531169891e-02 1.9304293394088745e-01 + <_> + + 0 -1 1018 1.2506111524999142e-03 + + -8.1618689000606537e-02 1.5481384098529816e-01 + <_> + + 0 -1 379 -1.6119323670864105e-02 + + 1.4024992287158966e-01 -9.3965478241443634e-02 + <_> + + 0 -1 576 -7.2789913974702358e-04 + + 1.9554650783538818e-01 -7.2329640388488770e-02 + <_> + + 0 -1 178 1.4888901496306062e-03 + + 3.3372651785612106e-02 -4.0691211819648743e-01 + <_> + + 0 -1 984 -4.9822013825178146e-03 + + -3.3125448226928711e-01 3.6899805068969727e-02 + <_> + + 0 -1 1053 9.4443336129188538e-03 + + 3.1763385981321335e-02 -3.7651473283767700e-01 + + <_> + 100 + -1.3101767301559448e+00 + + <_> + + 0 -1 535 -1.2652185745537281e-02 + + 4.0350878238677979e-01 -8.6829073727130890e-02 + <_> + + 0 -1 386 4.8778904601931572e-03 + + -9.1208808124065399e-02 4.8882400989532471e-01 + <_> + + 0 -1 875 -2.4099014699459076e-02 + + 3.6089360713958740e-01 -1.1495783179998398e-01 + <_> + + 0 -1 955 1.7244052141904831e-03 + + -1.5974776446819305e-01 1.6197346150875092e-01 + <_> + + 0 -1 478 -3.6334272008389235e-03 + + 2.7575418353080750e-01 -9.4314105808734894e-02 + <_> + + 0 -1 874 -3.4076566807925701e-03 + + 2.2806543111801147e-01 -1.1266379803419113e-01 + <_> + + 0 -1 343 8.8951038196682930e-03 + + -6.6720969974994659e-02 3.3090111613273621e-01 + <_> + + 0 -1 886 -2.4365000426769257e-03 + + -4.6264356374740601e-01 5.9559248387813568e-02 + <_> + + 0 -1 134 1.6330357640981674e-02 + + 6.1187297105789185e-02 -4.2252638936042786e-01 + <_> + + 0 -1 92 8.4438512567430735e-04 + + -1.6640183329582214e-01 1.1608948558568954e-01 + <_> + + 0 -1 841 2.9493896290659904e-03 + + -9.1952294111251831e-02 2.0670032501220703e-01 + <_> + + 0 -1 40 3.4696407616138458e-02 + + -8.0334044992923737e-02 2.8779104351997375e-01 + <_> + + 0 -1 893 -3.3343117684125900e-03 + + -5.9474521875381470e-01 3.6547001451253891e-02 + <_> + + 0 -1 761 9.3975086929276586e-04 + + -1.5703736245632172e-01 1.1884722858667374e-01 + <_> + + 0 -1 174 -3.4337402321398258e-03 + + -5.6122291088104248e-01 3.2535579055547714e-02 + <_> + + 0 -1 1010 2.6463428512215614e-03 + + -7.0756055414676666e-02 2.5195503234863281e-01 + <_> + + 0 -1 334 -5.4167490452528000e-04 + + 1.2782673537731171e-01 -1.3642209768295288e-01 + <_> + + 0 -1 219 2.6469756849110126e-03 + + 4.3448049575090408e-02 -4.2012536525726318e-01 + <_> + + 0 -1 467 -3.8945327978581190e-03 + + -3.4613665938377380e-01 4.6863511204719543e-02 + <_> + + 0 -1 258 1.0849055834114552e-03 + + -7.2841711342334747e-02 2.2674085199832916e-01 + <_> + + 0 -1 258 -9.8655023612082005e-04 + + 2.5967630743980408e-01 -8.0196425318717957e-02 + <_> + + 0 -1 204 4.3801497668027878e-03 + + 2.8548270463943481e-02 -6.2486541271209717e-01 + <_> + + 0 -1 554 3.1944573856890202e-04 + + -1.4062304794788361e-01 1.1761485785245895e-01 + <_> + + 0 -1 300 6.6440929658710957e-03 + + 3.2654736191034317e-02 -4.6211913228034973e-01 + <_> + + 0 -1 42 7.0357543881982565e-04 + + 7.5751155614852905e-02 -1.9804775714874268e-01 + <_> + + 0 -1 446 5.4024737328290939e-03 + + -6.1951220035552979e-02 2.4502439796924591e-01 + <_> + + 0 -1 502 7.2796619497239590e-03 + + -5.9379905462265015e-02 2.5588110089302063e-01 + <_> + + 0 -1 169 -1.5059831552207470e-02 + + -6.6548824310302734e-01 2.2492453455924988e-02 + <_> + + 0 -1 270 -4.6248016878962517e-03 + + -3.4483894705772400e-01 4.2247168719768524e-02 + <_> + + 0 -1 290 1.4736279845237732e-03 + + 3.3624436706304550e-02 -4.1066497564315796e-01 + <_> + + 0 -1 110 4.0667224675416946e-03 + + -8.6238399147987366e-02 1.6550070047378540e-01 + <_> + + 0 -1 113 -1.2728295987471938e-03 + + 1.9737298786640167e-01 -9.5425128936767578e-02 + <_> + + 0 -1 957 -1.5297440811991692e-02 + + -5.9287589788436890e-01 2.3890895769000053e-02 + <_> + + 0 -1 969 -2.9415758326649666e-03 + + -4.8744291067123413e-01 2.8945079073309898e-02 + <_> + + 0 -1 840 9.3173712957650423e-04 + + -8.9065223932266235e-02 1.6721877455711365e-01 + <_> + + 0 -1 791 2.1161064505577087e-03 + + -5.8501452207565308e-02 2.7767315506935120e-01 + <_> + + 0 -1 579 -3.7564497906714678e-03 + + 2.6502594351768494e-01 -5.3400754928588867e-02 + <_> + + 0 -1 224 1.9215289503335953e-02 + + 3.6197379231452942e-02 -3.9996260404586792e-01 + <_> + + 0 -1 276 -5.8480387087911367e-04 + + 1.7670612037181854e-01 -8.0434471368789673e-02 + <_> + + 0 -1 62 1.7193648964166641e-02 + + 2.1810308098793030e-02 -6.6349571943283081e-01 + <_> + + 0 -1 394 -1.5182361006736755e-02 + + 2.4825552105903625e-01 -6.3092373311519623e-02 + <_> + + 0 -1 712 3.0793007463216782e-03 + + 2.4977168068289757e-02 -5.3303867578506470e-01 + <_> + + 0 -1 410 -2.4421955458819866e-03 + + -3.6828973889350891e-01 3.3543743193149567e-02 + <_> + + 0 -1 1011 7.0760864764451981e-04 + + -7.0839107036590576e-02 1.9299270212650299e-01 + <_> + + 0 -1 280 -2.9198618140071630e-03 + + -4.2773759365081787e-01 3.4788779914379120e-02 + <_> + + 0 -1 77 4.9937088042497635e-03 + + 3.5642433911561966e-02 -3.7421676516532898e-01 + <_> + + 0 -1 701 3.1980490311980247e-03 + + -6.5103210508823395e-02 2.1381905674934387e-01 + <_> + + 0 -1 320 -1.1253832839429379e-02 + + 1.9790579378604889e-01 -7.1859836578369141e-02 + <_> + + 0 -1 496 -3.6279223859310150e-02 + + 1.7960831522941589e-01 -9.7373597323894501e-02 + <_> + + 0 -1 606 2.5160997174680233e-03 + + 4.7910790890455246e-02 -2.7035105228424072e-01 + <_> + + 0 -1 597 1.2429051566869020e-03 + + -7.8723609447479248e-02 1.7209371924400330e-01 + <_> + + 0 -1 600 -1.6120750457048416e-02 + + 2.6868200302124023e-01 -5.0688084214925766e-02 + <_> + + 0 -1 676 1.9487962126731873e-03 + + 4.2773328721523285e-02 -3.2401460409164429e-01 + <_> + + 0 -1 371 7.1887858211994171e-04 + + -9.3979224562644958e-02 1.4450067281723022e-01 + <_> + + 0 -1 315 2.4896476417779922e-02 + + 3.0655095353722572e-02 -4.5330229401588440e-01 + <_> + + 0 -1 1026 -3.9382722228765488e-02 + + -7.5473642349243164e-01 1.4460344798862934e-02 + <_> + + 0 -1 16 1.6916246712207794e-01 + + 1.8219815567135811e-02 -6.0212779045104980e-01 + <_> + + 0 -1 327 2.6912155590252951e-05 + + -1.3110430538654327e-01 1.0080647468566895e-01 + <_> + + 0 -1 720 -1.1350987479090691e-03 + + -3.5285457968711853e-01 3.5424951463937759e-02 + <_> + + 0 -1 275 -5.3854554425925016e-04 + + 1.6519539058208466e-01 -8.5205554962158203e-02 + <_> + + 0 -1 1006 -7.9703063238412142e-04 + + 1.2170238047838211e-01 -1.1191177368164062e-01 + <_> + + 0 -1 1055 6.4357938244938850e-03 + + 2.3892326280474663e-02 -5.2907115221023560e-01 + <_> + + 0 -1 184 3.5384115763008595e-03 + + 1.5895446762442589e-02 -7.3063355684280396e-01 + <_> + + 0 -1 503 -5.9715351089835167e-03 + + -4.9897637963294983e-01 2.2720154374837875e-02 + <_> + + 0 -1 500 -1.3486531376838684e-01 + + 4.7622504830360413e-01 -3.0212458223104477e-02 + <_> + + 0 -1 824 1.5813487116247416e-03 + + -6.4366899430751801e-02 1.9106543064117432e-01 + <_> + + 0 -1 438 1.2239011703059077e-03 + + 3.5654775798320770e-02 -3.6865225434303284e-01 + <_> + + 0 -1 871 1.5586249064654112e-03 + + -7.6894849538803101e-02 1.7627324163913727e-01 + <_> + + 0 -1 807 8.1224087625741959e-03 + + -9.0349502861499786e-02 1.4695085585117340e-01 + <_> + + 0 -1 693 -1.1717316228896379e-03 + + -4.2172068357467651e-01 3.2626960426568985e-02 + <_> + + 0 -1 863 3.1573872547596693e-03 + + 1.6080003231763840e-02 -7.3708915710449219e-01 + <_> + + 0 -1 328 -6.0417165514081717e-04 + + 1.3188406825065613e-01 -1.0221557319164276e-01 + <_> + + 0 -1 870 5.9989960864186287e-03 + + -5.6194521486759186e-02 2.4262723326683044e-01 + <_> + + 0 -1 285 9.2063043266534805e-03 + + -7.4052155017852783e-02 1.9847218692302704e-01 + <_> + + 0 -1 759 5.9181386604905128e-03 + + 2.7928760275244713e-02 -5.3380137681961060e-01 + <_> + + 0 -1 637 2.2121241781860590e-03 + + -7.4788182973861694e-02 1.9799898564815521e-01 + <_> + + 0 -1 634 1.5453733503818512e-03 + + -8.1615962088108063e-02 1.7845135927200317e-01 + <_> + + 0 -1 48 -2.7309993747621775e-03 + + -2.9415401816368103e-01 4.8099983483552933e-02 + <_> + + 0 -1 288 1.5755122527480125e-02 + + -8.2719191908836365e-02 1.5387716889381409e-01 + <_> + + 0 -1 358 -5.5120363831520081e-02 + + -2.7076271176338196e-01 5.2753895521163940e-02 + <_> + + 0 -1 188 2.9593750834465027e-01 + + -2.5313137099146843e-02 5.3404790163040161e-01 + <_> + + 0 -1 755 -1.1218986473977566e-03 + + 1.1400944739580154e-01 -1.1270149052143097e-01 + <_> + + 0 -1 12 -3.7802509963512421e-02 + + 3.1571185588836670e-01 -4.9672659486532211e-02 + <_> + + 0 -1 122 7.6384171843528748e-03 + + -1.0544487833976746e-01 1.6579298675060272e-01 + <_> + + 0 -1 586 6.8679507821798325e-03 + + -6.0160953551530838e-02 2.2640766203403473e-01 + <_> + + 0 -1 443 5.1510091871023178e-02 + + 2.6919802650809288e-02 -5.1188707351684570e-01 + <_> + + 0 -1 997 -1.7317479476332664e-02 + + 2.8218811750411987e-01 -4.4739942997694016e-02 + <_> + + 0 -1 430 8.3876429125666618e-03 + + -5.7016383856534958e-02 2.2617760300636292e-01 + <_> + + 0 -1 625 9.2909142374992371e-02 + + 3.1283479183912277e-02 -4.9390810728073120e-01 + <_> + + 0 -1 457 4.8232711851596832e-03 + + 2.4896934628486633e-02 -4.5571261644363403e-01 + <_> + + 0 -1 484 2.3969253525137901e-03 + + 2.3365976288914680e-02 -4.8319596052169800e-01 + <_> + + 0 -1 599 -3.8546645082533360e-03 + + 2.0274488627910614e-01 -5.8264043182134628e-02 + <_> + + 0 -1 647 -1.2048919452354312e-03 + + -3.4361392259597778e-01 3.4746967256069183e-02 + <_> + + 0 -1 734 -1.6053356230258942e-02 + + 1.8685258924961090e-01 -6.7979305982589722e-02 + <_> + + 0 -1 1045 -2.1703056991100311e-02 + + -5.0804340839385986e-01 2.5113353505730629e-02 + <_> + + 0 -1 541 -1.9719875417649746e-03 + + -2.7325069904327393e-01 4.3638698756694794e-02 + <_> + + 0 -1 465 -1.3189280871301889e-03 + + 2.5198838114738464e-01 -4.8170279711484909e-02 + <_> + + 0 -1 465 1.3257672544568777e-03 + + -6.6290155053138733e-02 2.6572498679161072e-01 + <_> + + 0 -1 1024 -2.5993511080741882e-03 + + -7.1209841966629028e-01 1.9255550578236580e-02 + <_> + + 0 -1 926 4.0416182018816471e-03 + + 2.4820772930979729e-02 -4.3810126185417175e-01 <_> <_> - 0 0 6 1 -1. + 0 0 2 4 -1. <_> - 3 0 3 1 2. + 0 2 2 2 2. 0 <_> <_> - 0 0 6 2 -1. + 0 0 6 14 -1. <_> - 3 0 3 2 2. + 0 0 3 7 2. + <_> + 3 7 3 7 2. 0 <_> @@ -5978,11 +6595,9 @@ <_> <_> - 0 0 8 4 -1. + 0 0 8 2 -1. <_> - 0 0 4 2 2. - <_> - 4 2 4 2 2. + 4 0 4 2 2. 0 <_> @@ -6005,18 +6620,11 @@ <_> <_> - 0 0 8 16 -1. + 0 0 8 14 -1. <_> - 0 0 4 8 2. + 0 0 4 7 2. <_> - 4 8 4 8 2. - 0 - <_> - - <_> - 0 0 10 3 -1. - <_> - 5 0 5 3 2. + 4 7 4 7 2. 0 <_> @@ -6030,18 +6638,18 @@ <_> <_> - 0 0 10 10 -1. + 0 0 10 8 -1. <_> - 0 0 5 5 2. + 0 0 5 4 2. <_> - 5 5 5 5 2. + 5 4 5 4 2. 0 <_> <_> - 0 0 18 14 -1. + 0 0 18 13 -1. <_> - 6 0 6 14 3. + 6 0 6 13 3. 0 <_> @@ -6062,11 +6670,11 @@ <_> <_> - 0 0 16 8 -1. + 0 0 16 6 -1. <_> - 0 0 8 4 2. + 0 0 8 3 2. <_> - 8 4 8 4 2. + 8 3 8 3 2. 0 <_> @@ -6087,25 +6695,53 @@ <_> <_> - 0 1 24 2 -1. + 0 0 24 2 -1. <_> - 8 1 8 2 3. + 0 0 12 1 2. + <_> + 12 1 12 1 2. 0 <_> <_> - 0 1 16 8 -1. + 0 0 12 12 -1. <_> - 0 1 8 4 2. - <_> - 8 5 8 4 2. + 0 6 12 6 2. 0 <_> <_> - 0 1 16 18 -1. + 0 0 15 18 -1. <_> - 0 7 16 6 3. + 0 6 15 6 3. + 0 + <_> + + <_> + 0 1 1 6 -1. + <_> + 0 3 1 2 3. + 0 + <_> + + <_> + 0 1 4 6 -1. + <_> + 2 1 2 6 2. + 0 + <_> + + <_> + 0 1 15 1 -1. + <_> + 5 1 5 1 3. + 0 + <_> + + <_> + 0 1 10 2 -1. + <_> + 5 1 5 2 2. 0 <_> @@ -6119,16 +6755,18 @@ <_> <_> - 0 2 24 19 -1. + 0 2 24 10 -1. <_> - 12 2 12 19 2. + 0 2 12 5 2. + <_> + 12 7 12 5 2. 0 <_> <_> - 0 3 8 3 -1. + 0 3 7 3 -1. <_> - 0 4 8 1 3. + 0 4 7 1 3. 0 <_> @@ -6142,46 +6780,23 @@ <_> <_> - 0 4 6 9 -1. + 0 4 6 12 -1. <_> - 0 7 6 3 3. + 0 8 6 4 3. 0 <_> <_> - 0 4 24 2 -1. + 0 4 24 6 -1. <_> - 0 4 12 1 2. - <_> - 12 5 12 1 2. + 0 6 24 2 3. 0 <_> <_> - 0 4 13 15 -1. + 0 5 2 9 -1. <_> - 0 9 13 5 3. - 0 - <_> - - <_> - 0 4 14 3 -1. - <_> - 0 5 14 1 3. - 0 - <_> - - <_> - 0 4 23 6 -1. - <_> - 0 6 23 2 3. - 0 - <_> - - <_> - 0 5 9 9 -1. - <_> - 0 8 9 3 3. + 0 8 2 3 3. 0 <_> @@ -6192,6 +6807,13 @@ <_> 12 6 12 1 2. 0 + <_> + + <_> + 0 6 6 3 -1. + <_> + 0 7 6 1 3. + 0 <_> <_> @@ -6204,41 +6826,30 @@ <_> <_> - 0 6 18 8 -1. + 0 6 22 3 -1. <_> - 0 10 18 4 2. + 0 7 22 1 3. 0 <_> <_> - 0 6 24 3 -1. + 0 6 24 9 -1. <_> - 0 7 24 1 3. + 0 9 24 3 3. 0 <_> <_> - 0 7 8 2 -1. + 0 7 16 1 -1. <_> - 0 7 4 1 2. - <_> - 4 8 4 1 2. + 8 7 8 1 2. 0 <_> <_> - 0 7 9 6 -1. + 0 7 24 3 -1. <_> - 0 9 9 2 3. - 0 - <_> - - <_> - 0 7 22 4 -1. - <_> - 0 7 11 2 2. - <_> - 11 9 11 2 2. + 8 7 8 3 3. 0 <_> @@ -6252,34 +6863,23 @@ <_> <_> - 0 7 24 4 -1. + 0 8 4 6 -1. <_> - 0 7 12 2 2. - <_> - 12 9 12 2 2. + 2 8 2 6 2. 0 <_> <_> - 0 7 20 6 -1. + 0 8 6 15 -1. <_> - 0 9 20 2 3. + 3 8 3 15 2. 0 <_> <_> - 0 8 6 14 -1. + 0 8 4 9 -1. <_> - 3 8 3 14 2. - 0 - <_> - - <_> - 0 8 8 2 -1. - <_> - 0 8 4 1 2. - <_> - 4 9 4 1 2. + 0 11 4 3 3. 0 <_> @@ -6288,15 +6888,6 @@ <_> 8 8 8 1 3. 0 - <_> - - <_> - 0 8 24 2 -1. - <_> - 0 8 12 1 2. - <_> - 12 9 12 1 2. - 0 <_> <_> @@ -6309,32 +6900,30 @@ <_> <_> - 0 8 24 9 -1. + 0 9 2 3 -1. <_> - 12 8 12 9 2. + 0 10 2 1 3. 0 <_> <_> - 0 9 4 1 -1. + 0 9 2 9 -1. <_> - 2 9 2 1 2. + 0 12 2 3 3. 0 <_> <_> - 0 9 6 12 -1. + 0 9 5 3 -1. <_> - 0 9 3 6 2. - <_> - 3 15 3 6 2. + 0 10 5 1 3. 0 <_> <_> - 0 9 4 9 -1. + 0 9 5 6 -1. <_> - 0 12 4 3 3. + 0 11 5 2 3. 0 <_> @@ -6346,9 +6935,16 @@ <_> <_> - 0 9 11 2 -1. + 0 9 8 2 -1. <_> - 0 10 11 1 2. + 0 10 8 1 2. + 0 + <_> + + <_> + 0 9 10 2 -1. + <_> + 0 10 10 1 2. 0 <_> @@ -6359,15 +6955,6 @@ <_> 11 10 11 1 2. 0 - <_> - - <_> - 0 9 24 2 -1. - <_> - 0 9 12 1 2. - <_> - 12 10 12 1 2. - 0 <_> <_> @@ -6380,11 +6967,9 @@ <_> <_> - 0 9 24 6 -1. + 0 9 24 15 -1. <_> - 0 9 12 3 2. - <_> - 12 12 12 3 2. + 12 9 12 15 2. 0 <_> @@ -6396,48 +6981,30 @@ <_> <_> - 0 10 2 2 -1. + 0 10 2 3 -1. <_> - 0 11 2 1 2. + 0 11 2 1 3. 0 <_> <_> - 0 10 3 3 -1. + 0 10 6 1 -1. <_> - 0 11 3 1 3. + 3 10 3 1 2. 0 <_> <_> - 0 10 3 6 -1. + 0 10 6 14 -1. <_> - 0 12 3 2 3. + 3 10 3 14 2. 0 <_> <_> - 0 10 6 8 -1. + 0 10 4 3 -1. <_> - 0 10 3 4 2. - <_> - 3 14 3 4 2. - 0 - <_> - - <_> - 0 10 8 10 -1. - <_> - 0 10 4 5 2. - <_> - 4 15 4 5 2. - 0 - <_> - - <_> - 0 10 8 11 -1. - <_> - 4 10 4 11 2. + 0 11 4 1 3. 0 <_> @@ -6451,9 +7018,25 @@ <_> <_> - 0 11 6 2 -1. + 0 10 24 4 -1. <_> - 3 11 3 2 2. + 0 10 12 2 2. + <_> + 12 12 12 2 2. + 0 + <_> + + <_> + 0 10 13 3 -1. + <_> + 0 11 13 1 3. + 0 + <_> + + <_> + 0 11 2 3 -1. + <_> + 0 12 2 1 3. 0 <_> @@ -6467,18 +7050,9 @@ <_> <_> - 0 11 8 8 -1. + 0 11 10 3 -1. <_> - 0 11 4 4 2. - <_> - 4 15 4 4 2. - 0 - <_> - - <_> - 0 11 8 13 -1. - <_> - 4 11 4 13 2. + 0 12 10 1 3. 0 <_> @@ -6492,55 +7066,53 @@ <_> <_> - 0 11 21 10 -1. + 0 12 3 10 -1. <_> - 0 16 21 5 2. + 1 12 1 10 3. 0 <_> <_> - 0 12 8 4 -1. + 0 12 22 10 -1. <_> - 4 12 4 4 2. + 11 12 11 10 2. 0 <_> <_> - 0 12 24 9 -1. + 0 13 3 9 -1. <_> - 12 12 12 9 2. + 1 13 1 9 3. 0 <_> <_> - 0 13 24 4 -1. + 0 13 12 10 -1. <_> - 0 13 12 2 2. - <_> - 12 15 12 2 2. + 6 13 6 10 2. 0 <_> <_> - 0 14 3 7 -1. + 0 13 24 10 -1. <_> - 1 14 1 7 3. + 12 13 12 10 2. 0 <_> <_> - 0 14 10 8 -1. + 0 14 24 2 -1. <_> - 5 14 5 8 2. + 0 14 12 1 2. + <_> + 12 15 12 1 2. 0 <_> <_> - 0 15 8 8 -1. + 0 15 3 8 -1. <_> - 0 15 4 4 2. - <_> - 4 19 4 4 2. + 1 15 1 8 3. 0 <_> @@ -6554,58 +7126,39 @@ <_> <_> - 0 16 3 8 -1. + 0 15 10 6 -1. <_> - 1 16 1 8 3. + 0 17 10 2 3. 0 <_> <_> - 0 16 8 6 -1. + 0 16 12 8 -1. <_> - 0 18 8 2 3. + 0 16 6 4 2. + <_> + 6 20 6 4 2. 0 <_> <_> - 0 17 6 3 -1. + 0 17 3 7 -1. <_> - 3 17 3 3 2. + 1 17 1 7 3. 0 <_> <_> - 0 17 4 6 -1. + 0 18 6 3 -1. <_> - 0 19 4 2 3. + 0 19 6 1 3. 0 <_> <_> - 0 18 3 6 -1. + 0 19 6 3 -1. <_> - 1 18 1 6 3. - 0 - <_> - - <_> - 0 19 3 4 -1. - <_> - 1 19 1 4 3. - 0 - <_> - - <_> - 0 19 9 3 -1. - <_> - 0 20 9 1 3. - 0 - <_> - - <_> - 0 20 4 3 -1. - <_> - 0 21 4 1 3. + 0 20 6 1 3. 0 <_> @@ -6617,23 +7170,37 @@ <_> <_> - 0 21 3 3 -1. + 0 21 4 3 -1. <_> - 0 22 3 1 3. + 0 22 4 1 3. 0 <_> <_> - 0 22 1 2 -1. + 0 21 5 3 -1. <_> - 0 23 1 1 2. + 0 22 5 1 3. 0 <_> <_> - 1 0 10 1 -1. + 0 22 22 2 -1. <_> - 6 0 5 1 2. + 11 22 11 2 2. + 0 + <_> + + <_> + 1 0 6 1 -1. + <_> + 4 0 3 1 2. + 0 + <_> + + <_> + 1 0 15 13 -1. + <_> + 6 0 5 13 3. 0 <_> @@ -6647,156 +7214,103 @@ <_> <_> - 1 0 7 9 -1. + 1 1 22 2 -1. <_> - 1 3 7 3 3. + 1 1 11 1 2. + <_> + 12 2 11 1 2. 0 <_> <_> - 1 0 14 10 -1. + 1 2 23 9 -1. <_> - 1 0 7 5 2. - <_> - 8 5 7 5 2. + 1 5 23 3 3. 0 <_> <_> - 1 0 22 2 -1. + 1 3 4 3 -1. <_> - 1 0 11 1 2. - <_> - 12 1 11 1 2. + 1 4 4 1 3. 0 <_> <_> - 1 2 6 10 -1. + 1 3 12 18 -1. <_> - 1 2 3 5 2. - <_> - 4 7 3 5 2. + 5 3 4 18 3. 0 <_> <_> - 1 2 22 20 -1. + 1 4 8 3 -1. <_> - 12 2 11 20 2. + 1 5 8 1 3. 0 <_> <_> - 1 2 22 21 -1. + 1 4 23 6 -1. <_> - 12 2 11 21 2. + 1 6 23 2 3. 0 <_> <_> - 1 3 15 3 -1. + 1 6 6 4 -1. <_> - 6 3 5 3 3. + 1 6 3 2 2. + <_> + 4 8 3 2 2. 0 <_> <_> - 1 3 6 3 -1. + 1 6 3 9 -1. <_> - 1 4 6 1 3. + 1 9 3 3 3. 0 <_> <_> - 1 3 22 2 -1. + 1 6 4 3 -1. <_> - 1 3 11 1 2. - <_> - 12 4 11 1 2. + 1 7 4 1 3. 0 <_> <_> - 1 4 4 3 -1. + 1 6 22 2 -1. <_> - 1 5 4 1 3. + 1 6 11 1 2. + <_> + 12 7 11 1 2. 0 <_> <_> - 1 4 12 17 -1. + 1 6 12 8 -1. <_> - 5 4 4 17 3. + 1 10 12 4 2. 0 <_> <_> - 1 4 20 20 -1. + 1 7 8 4 -1. <_> - 11 4 10 20 2. + 1 7 4 2 2. + <_> + 5 9 4 2 2. 0 <_> <_> - 1 4 22 2 -1. + 1 7 20 4 -1. <_> - 1 4 11 1 2. + 1 7 10 2 2. <_> - 12 5 11 1 2. - 0 - <_> - - <_> - 1 4 22 19 -1. - <_> - 12 4 11 19 2. - 0 - <_> - - <_> - 1 5 22 2 -1. - <_> - 1 5 11 1 2. - <_> - 12 6 11 1 2. - 0 - <_> - - <_> - 1 6 2 2 -1. - <_> - 1 6 1 1 2. - <_> - 2 7 1 1 2. - 0 - <_> - - <_> - 1 6 16 17 -1. - <_> - 9 6 8 17 2. - 0 - <_> - - <_> - 1 6 21 9 -1. - <_> - 1 9 21 3 3. - 0 - <_> - - <_> - 1 6 22 6 -1. - <_> - 1 8 22 2 3. - 0 - <_> - - <_> - 1 6 23 9 -1. - <_> - 1 9 23 3 3. + 11 9 10 2 2. 0 <_> @@ -6810,30 +7324,85 @@ <_> <_> - 1 8 19 12 -1. + 1 7 22 14 -1. <_> - 1 12 19 4 3. + 12 7 11 14 2. 0 <_> <_> - 1 9 6 2 -1. + 1 8 1 2 -1. <_> - 4 9 3 2 2. + 1 9 1 1 2. 0 <_> <_> - 1 9 12 3 -1. + 1 8 8 2 -1. <_> - 5 9 4 3 3. + 1 8 4 1 2. + <_> + 5 9 4 1 2. 0 <_> <_> - 1 10 3 8 -1. + 1 8 7 4 -1. <_> - 2 10 1 8 3. + 1 10 7 2 2. + 0 + <_> + + <_> + 1 8 22 4 -1. + <_> + 1 8 11 2 2. + <_> + 12 10 11 2 2. + 0 + <_> + + <_> + 1 9 4 3 -1. + <_> + 3 9 2 3 2. + 0 + <_> + + <_> + 1 9 4 6 -1. + <_> + 1 11 4 2 3. + 0 + <_> + + <_> + 1 9 20 2 -1. + <_> + 1 9 10 1 2. + <_> + 11 10 10 1 2. + 0 + <_> + + <_> + 1 10 3 13 -1. + <_> + 2 10 1 13 3. + 0 + <_> + + <_> + 1 10 4 6 -1. + <_> + 1 12 4 2 3. + 0 + <_> + + <_> + 1 10 8 3 -1. + <_> + 1 11 8 1 3. 0 <_> @@ -6847,147 +7416,85 @@ <_> <_> - 1 10 12 3 -1. + 1 11 6 2 -1. <_> - 1 11 12 1 3. + 4 11 3 2 2. 0 <_> <_> - 1 11 3 8 -1. + 1 11 22 2 -1. <_> - 2 11 1 8 3. + 1 11 11 1 2. + <_> + 12 12 11 1 2. 0 <_> <_> - 1 11 20 2 -1. + 1 12 3 8 -1. <_> - 1 11 10 1 2. - <_> - 11 12 10 1 2. + 2 12 1 8 3. 0 <_> <_> - 1 11 22 4 -1. + 1 12 4 1 -1. <_> - 1 11 11 2 2. - <_> - 12 13 11 2 2. + 3 12 2 1 2. 0 <_> <_> - 1 12 3 11 -1. + 1 12 20 2 -1. <_> - 2 12 1 11 3. + 1 12 10 1 2. + <_> + 11 13 10 1 2. 0 <_> <_> - 1 12 6 1 -1. + 1 13 3 8 -1. <_> - 4 12 3 1 2. + 2 13 1 8 3. 0 <_> <_> - 1 12 20 12 -1. + 1 13 9 3 -1. <_> - 11 12 10 12 2. + 1 14 9 1 3. 0 <_> <_> - 1 13 3 5 -1. + 1 13 21 8 -1. <_> - 2 13 1 5 3. + 1 17 21 4 2. 0 <_> <_> - 1 13 22 2 -1. + 1 15 8 2 -1. <_> - 1 13 11 1 2. - <_> - 12 14 11 1 2. + 5 15 4 2 2. 0 <_> <_> - 1 14 4 4 -1. + 1 17 22 2 -1. <_> - 3 14 2 4 2. + 1 17 11 1 2. + <_> + 12 18 11 1 2. 0 <_> <_> - 1 14 22 2 -1. + 1 18 3 6 -1. <_> - 1 14 11 1 2. - <_> - 12 15 11 1 2. - 0 - <_> - - <_> - 1 14 23 6 -1. - <_> - 1 17 23 3 2. - 0 - <_> - - <_> - 1 15 14 2 -1. - <_> - 1 15 7 1 2. - <_> - 8 16 7 1 2. - 0 - <_> - - <_> - 1 17 3 5 -1. - <_> - 2 17 1 5 3. - 0 - <_> - - <_> - 1 17 3 7 -1. - <_> - 2 17 1 7 3. - 0 - <_> - - <_> - 1 18 10 6 -1. - <_> - 1 18 5 3 2. - <_> - 6 21 5 3 2. - 0 - <_> - - <_> - 1 18 9 3 -1. - <_> - 1 19 9 1 3. - 0 - <_> - - <_> - 1 21 12 3 -1. - <_> - 7 21 6 3 2. - 0 - <_> - - <_> - 2 0 3 2 -1. - <_> - 3 0 1 2 3. + 2 18 1 6 3. 0 <_> @@ -6999,55 +7506,27 @@ <_> <_> - 2 0 9 2 -1. + 2 0 8 6 -1. <_> - 5 0 3 2 3. + 2 0 4 3 2. + <_> + 6 3 4 3 2. 0 <_> <_> - 2 0 21 1 -1. + 2 0 12 5 -1. <_> - 9 0 7 1 3. + 8 0 6 5 2. 0 <_> <_> - 2 1 3 23 -1. + 2 3 20 2 -1. <_> - 3 1 1 23 3. - 0 - <_> - + 2 3 10 1 2. <_> - 2 1 4 2 -1. - <_> - 4 1 2 2 2. - 0 - <_> - - <_> - 2 2 22 10 -1. - <_> - 2 2 11 5 2. - <_> - 13 7 11 5 2. - 0 - <_> - - <_> - 2 3 22 2 -1. - <_> - 2 3 11 1 2. - <_> - 13 4 11 1 2. - 0 - <_> - - <_> - 2 4 6 1 -1. - <_> - 5 4 3 1 2. + 12 4 10 1 2. 0 <_> @@ -7068,39 +7547,25 @@ <_> <_> - 2 4 22 16 -1. + 2 5 1 3 -1. <_> - 13 4 11 16 2. + 2 6 1 1 3. 0 <_> <_> - 2 4 18 6 -1. + 2 5 2 3 -1. <_> - 2 6 18 2 3. + 2 6 2 1 3. 0 <_> <_> - 2 6 3 3 -1. + 2 5 20 2 -1. <_> - 2 7 3 1 3. - 0 - <_> - + 2 5 10 1 2. <_> - 2 6 4 3 -1. - <_> - 2 7 4 1 3. - 0 - <_> - - <_> - 2 6 20 2 -1. - <_> - 2 6 10 1 2. - <_> - 12 7 10 1 2. + 12 6 10 1 2. 0 <_> @@ -7114,101 +7579,43 @@ <_> <_> - 2 7 21 6 -1. + 2 6 22 4 -1. <_> - 2 9 21 2 3. + 2 6 11 2 2. + <_> + 13 8 11 2 2. 0 <_> <_> - 2 7 22 2 -1. + 2 7 15 3 -1. <_> - 2 8 22 1 2. + 2 8 15 1 3. 0 <_> <_> - 2 8 6 2 -1. + 2 8 8 3 -1. <_> - 2 8 3 1 2. - <_> - 5 9 3 1 2. + 2 9 8 1 3. 0 <_> <_> - 2 8 6 3 -1. + 2 8 20 4 -1. <_> - 2 9 6 1 3. + 2 8 10 2 2. + <_> + 12 10 10 2 2. 0 <_> <_> - 2 8 21 2 -1. + 2 9 20 8 -1. <_> - 9 8 7 2 3. - 0 - <_> - + 2 9 10 4 2. <_> - 2 8 7 9 -1. - <_> - 2 11 7 3 3. - 0 - <_> - - <_> - 2 8 22 4 -1. - <_> - 2 8 11 2 2. - <_> - 13 10 11 2 2. - 0 - <_> - - <_> - 2 9 4 1 -1. - <_> - 4 9 2 1 2. - 0 - <_> - - <_> - 2 9 9 1 -1. - <_> - 5 9 3 1 3. - 0 - <_> - - <_> - 2 9 9 2 -1. - <_> - 5 9 3 2 3. - 0 - <_> - - <_> - 2 9 6 4 -1. - <_> - 2 9 3 2 2. - <_> - 5 11 3 2 2. - 0 - <_> - - <_> - 2 9 7 3 -1. - <_> - 2 10 7 1 3. - 0 - <_> - - <_> - 2 9 18 2 -1. - <_> - 2 9 9 1 2. - <_> - 11 10 9 1 2. + 12 13 10 4 2. 0 <_> @@ -7222,9 +7629,16 @@ <_> <_> - 2 9 21 3 -1. + 2 9 19 3 -1. <_> - 2 10 21 1 3. + 2 10 19 1 3. + 0 + <_> + + <_> + 2 10 4 1 -1. + <_> + 4 10 2 1 2. 0 <_> @@ -7238,16 +7652,32 @@ <_> <_> - 2 11 3 6 -1. + 2 10 22 14 -1. <_> - 3 11 1 6 3. + 13 10 11 14 2. 0 <_> <_> - 2 11 3 13 -1. + 2 10 20 12 -1. <_> - 3 11 1 13 3. + 2 16 20 6 2. + 0 + <_> + + <_> + 2 11 3 5 -1. + <_> + 3 11 1 5 3. + 0 + <_> + + <_> + 2 11 20 2 -1. + <_> + 2 11 10 1 2. + <_> + 12 12 10 1 2. 0 <_> @@ -7258,13 +7688,6 @@ <_> 13 12 11 1 2. 0 - <_> - - <_> - 2 12 3 4 -1. - <_> - 3 12 1 4 3. - 0 <_> <_> @@ -7275,82 +7698,95 @@ <_> <_> - 2 12 22 2 -1. + 2 12 3 9 -1. <_> - 2 12 11 1 2. - <_> - 13 13 11 1 2. + 3 12 1 9 3. 0 <_> <_> - 2 13 10 10 -1. + 2 12 3 11 -1. <_> - 2 13 5 5 2. - <_> - 7 18 5 5 2. + 3 12 1 11 3. 0 <_> <_> - 2 14 6 10 -1. + 2 14 3 3 -1. <_> - 2 14 3 5 2. - <_> - 5 19 3 5 2. + 3 14 1 3 3. 0 <_> <_> - 2 15 2 6 -1. + 2 14 8 8 -1. <_> - 2 15 1 3 2. + 2 14 4 4 2. <_> - 3 18 1 3 2. + 6 18 4 4 2. 0 <_> <_> - 2 15 3 9 -1. + 2 17 3 5 -1. <_> - 3 15 1 9 3. + 3 17 1 5 3. 0 <_> <_> - 2 15 6 4 -1. + 2 17 3 6 -1. <_> - 5 15 3 4 2. + 3 17 1 6 3. 0 <_> <_> - 2 15 7 3 -1. + 2 17 21 4 -1. <_> - 2 16 7 1 3. + 9 17 7 4 3. 0 <_> <_> - 2 17 3 4 -1. + 2 18 3 5 -1. <_> - 3 17 1 4 3. + 3 18 1 5 3. 0 <_> <_> - 2 17 12 6 -1. + 2 18 10 4 -1. <_> - 2 17 6 3 2. - <_> - 8 20 6 3 2. + 7 18 5 4 2. 0 <_> <_> - 2 21 14 3 -1. + 2 20 6 2 -1. <_> - 9 21 7 3 2. + 5 20 3 2 2. + 0 + <_> + + <_> + 2 21 12 2 -1. + <_> + 8 21 6 2 2. + 0 + <_> + + <_> + 3 0 3 5 -1. + <_> + 4 0 1 5 3. + 0 + <_> + + <_> + 3 0 9 22 -1. + <_> + 6 0 3 22 3. 0 <_> @@ -7364,18 +7800,30 @@ <_> <_> - 3 1 18 2 -1. + 3 1 3 3 -1. <_> - 3 1 9 1 2. - <_> - 12 2 9 1 2. + 4 1 1 3 3. 0 <_> <_> - 3 2 17 6 -1. + 3 1 3 20 -1. <_> - 3 5 17 3 2. + 4 1 1 20 3. + 0 + <_> + + <_> + 3 1 6 20 -1. + <_> + 5 1 2 20 3. + 0 + <_> + + <_> + 3 2 3 3 -1. + <_> + 4 2 1 3 3. 0 <_> @@ -7387,11 +7835,23 @@ <_> <_> - 3 3 18 2 -1. + 3 3 3 9 -1. <_> - 3 3 9 1 2. + 3 6 3 3 3. + 0 + <_> + <_> - 12 4 9 1 2. + 3 3 20 19 -1. + <_> + 13 3 10 19 2. + 0 + <_> + + <_> + 3 3 19 4 -1. + <_> + 3 5 19 2 2. 0 <_> @@ -7403,18 +7863,9 @@ <_> <_> - 3 4 2 2 -1. + 3 4 6 3 -1. <_> - 3 4 1 1 2. - <_> - 4 5 1 1 2. - 0 - <_> - - <_> - 3 4 3 3 -1. - <_> - 3 5 3 1 3. + 5 4 2 3 3. 0 <_> @@ -7428,39 +7879,23 @@ <_> <_> - 3 4 18 4 -1. + 3 4 16 6 -1. <_> - 3 4 9 2 2. - <_> - 12 6 9 2 2. + 3 6 16 2 3. 0 <_> <_> - 3 4 20 6 -1. + 3 5 3 1 -1. <_> - 3 6 20 2 3. + 4 5 1 1 3. 0 <_> <_> - 3 5 2 1 -1. + 3 5 3 2 -1. <_> - 4 5 1 1 2. - 0 - <_> - - <_> - 3 5 1 3 -1. - <_> - 3 6 1 1 3. - 0 - <_> - - <_> - 3 5 2 2 -1. - <_> - 3 6 2 1 2. + 4 5 1 2 3. 0 <_> @@ -7472,62 +7907,53 @@ <_> <_> - 3 5 20 2 -1. + 3 5 10 3 -1. <_> - 3 5 10 1 2. - <_> - 13 6 10 1 2. + 8 5 5 3 2. 0 <_> <_> - 3 5 17 6 -1. + 3 5 18 3 -1. <_> - 3 7 17 2 3. + 9 5 6 3 3. 0 <_> <_> - 3 5 17 9 -1. + 3 5 18 2 -1. <_> - 3 8 17 3 3. + 3 5 9 1 2. + <_> + 12 6 9 1 2. 0 <_> <_> - 3 5 19 9 -1. + 3 6 2 1 -1. <_> - 3 8 19 3 3. + 4 6 1 1 2. 0 <_> <_> - 3 6 2 2 -1. + 3 6 1 3 -1. <_> - 3 6 1 1 2. - <_> - 4 7 1 1 2. + 3 7 1 1 3. 0 <_> <_> - 3 6 2 3 -1. + 3 6 3 3 -1. <_> - 3 7 2 1 3. + 3 7 3 1 3. 0 <_> <_> - 3 6 9 6 -1. + 3 6 6 6 -1. <_> - 6 6 3 6 3. - 0 - <_> - - <_> - 3 6 5 6 -1. - <_> - 3 8 5 2 3. + 3 8 6 2 3. 0 <_> @@ -7541,41 +7967,30 @@ <_> <_> - 3 6 20 8 -1. + 3 6 17 6 -1. <_> - 3 6 10 4 2. - <_> - 13 10 10 4 2. + 3 8 17 2 3. 0 <_> <_> - 3 6 18 3 -1. + 3 7 3 1 -1. <_> - 3 7 18 1 3. + 4 7 1 1 3. 0 <_> <_> - 3 7 6 10 -1. + 3 7 4 2 -1. <_> - 3 7 3 5 2. - <_> - 6 12 3 5 2. + 3 8 4 1 2. 0 <_> <_> - 3 7 5 2 -1. + 3 7 6 6 -1. <_> - 3 8 5 1 2. - 0 - <_> - - <_> - 3 7 6 3 -1. - <_> - 3 8 6 1 3. + 3 9 6 2 3. 0 <_> @@ -7589,37 +8004,16 @@ <_> <_> - 3 7 17 3 -1. + 3 7 20 11 -1. <_> - 3 8 17 1 3. + 13 7 10 11 2. 0 <_> <_> - 3 7 18 2 -1. + 3 7 17 6 -1. <_> - 3 8 18 1 2. - 0 - <_> - - <_> - 3 8 2 3 -1. - <_> - 4 8 1 3 2. - 0 - <_> - - <_> - 3 8 18 3 -1. - <_> - 3 9 18 1 3. - 0 - <_> - - <_> - 3 8 20 3 -1. - <_> - 3 9 20 1 3. + 3 9 17 2 3. 0 <_> @@ -7638,64 +8032,53 @@ <_> <_> - 3 9 4 6 -1. + 3 9 9 2 -1. <_> - 3 9 2 3 2. - <_> - 5 12 2 3 2. + 6 9 3 2 3. 0 <_> <_> - 3 9 6 4 -1. + 3 9 18 2 -1. <_> - 3 11 6 2 2. + 3 9 9 1 2. + <_> + 12 10 9 1 2. 0 <_> <_> - 3 9 8 9 -1. + 3 10 3 1 -1. <_> - 3 12 8 3 3. + 4 10 1 1 3. 0 <_> <_> - 3 9 20 2 -1. + 3 10 3 13 -1. <_> - 3 9 10 1 2. - <_> - 13 10 10 1 2. + 4 10 1 13 3. 0 <_> <_> - 3 9 19 3 -1. + 3 10 6 2 -1. <_> - 3 10 19 1 3. + 3 11 6 1 2. 0 <_> <_> - 3 10 4 2 -1. + 3 11 3 2 -1. <_> - 3 10 2 1 2. - <_> - 5 11 2 1 2. + 4 11 1 2 3. 0 <_> <_> - 3 10 18 6 -1. + 3 11 3 3 -1. <_> - 3 12 18 2 3. - 0 - <_> - - <_> - 3 11 3 4 -1. - <_> - 4 11 1 4 3. + 4 11 1 3 3. 0 <_> @@ -7707,30 +8090,39 @@ <_> <_> - 3 11 4 10 -1. + 3 11 3 13 -1. <_> - 3 16 4 5 2. + 4 11 1 13 3. 0 <_> <_> - 3 11 7 8 -1. + 3 11 6 2 -1. <_> - 3 15 7 4 2. + 3 11 3 1 2. + <_> + 6 12 3 1 2. 0 <_> <_> - 3 12 3 2 -1. + 3 11 3 4 -1. <_> - 4 12 1 2 3. + 3 13 3 2 2. 0 <_> <_> - 3 12 3 10 -1. + 3 11 4 8 -1. <_> - 4 12 1 10 3. + 3 15 4 4 2. + 0 + <_> + + <_> + 3 12 3 3 -1. + <_> + 4 12 1 3 3. 0 <_> @@ -7739,6 +8131,13 @@ <_> 3 15 3 3 2. 0 + <_> + + <_> + 3 12 9 7 -1. + <_> + 6 12 3 7 3. + 0 <_> <_> @@ -7749,169 +8148,230 @@ <_> <_> - 3 12 10 8 -1. + 3 12 8 8 -1. <_> - 3 12 5 4 2. - <_> - 8 16 5 4 2. + 3 16 8 4 2. 0 <_> <_> - 3 12 18 2 -1. + 3 12 19 6 -1. <_> - 3 12 9 1 2. - <_> - 12 13 9 1 2. + 3 15 19 3 2. 0 <_> <_> - 3 13 19 6 -1. + 3 13 18 2 -1. <_> - 3 16 19 3 2. + 3 13 9 1 2. + <_> + 12 14 9 1 2. 0 <_> <_> - 3 14 4 9 -1. + 3 15 4 2 -1. <_> - 3 17 4 3 3. + 5 15 2 2 2. 0 <_> <_> - 3 16 3 4 -1. + 3 15 4 3 -1. <_> - 4 16 1 4 3. + 5 15 2 3 2. 0 <_> <_> - 3 16 4 3 -1. + 3 15 6 2 -1. <_> - 5 16 2 3 2. + 6 15 3 2 2. 0 <_> <_> - 3 16 21 7 -1. + 3 16 8 8 -1. <_> - 10 16 7 7 3. + 3 16 4 4 2. + <_> + 7 20 4 4 2. 0 <_> <_> - 3 18 3 6 -1. + 3 20 3 4 -1. <_> - 4 18 1 6 3. + 4 20 1 4 3. 0 <_> <_> - 4 0 3 23 -1. + 4 1 3 8 -1. <_> - 5 0 1 23 3. + 5 1 1 8 3. 0 <_> <_> - 4 0 6 5 -1. + 4 1 3 12 -1. <_> - 6 0 2 5 3. + 4 5 3 4 3. 0 <_> <_> - 4 0 17 12 -1. + 4 1 15 10 -1. <_> - 4 4 17 4 3. + 4 6 15 5 2. 0 <_> <_> - 4 1 16 12 -1. + 4 2 3 3 -1. <_> - 4 7 16 6 2. + 5 2 1 3 3. 0 <_> <_> - 4 3 3 1 -1. + 4 2 6 5 -1. <_> - 5 3 1 1 3. + 6 2 2 5 3. 0 <_> <_> - 4 3 16 10 -1. + 4 2 16 2 -1. <_> - 4 3 8 5 2. + 4 2 8 1 2. <_> - 12 8 8 5 2. + 12 3 8 1 2. 0 <_> <_> - 4 3 14 6 -1. + 4 3 3 2 -1. <_> - 4 6 14 3 2. + 5 3 1 2 3. 0 <_> <_> - 4 4 1 3 -1. + 4 3 6 1 -1. <_> - 4 5 1 1 3. + 6 3 2 1 3. 0 <_> <_> - 4 4 2 4 -1. + 4 3 6 5 -1. <_> - 4 6 2 2 2. + 6 3 2 5 3. 0 <_> <_> - 4 4 6 2 -1. + 4 3 9 3 -1. <_> - 7 4 3 2 2. + 7 3 3 3 3. 0 <_> <_> - 4 4 13 6 -1. + 4 3 16 2 -1. <_> - 4 7 13 3 2. + 4 3 8 1 2. + <_> + 12 4 8 1 2. 0 <_> <_> - 4 5 6 4 -1. + 4 3 16 8 -1. <_> - 6 5 2 4 3. + 4 3 8 4 2. + <_> + 12 7 8 4 2. 0 <_> <_> - 4 5 14 6 -1. + 4 3 17 8 -1. <_> - 4 7 14 2 3. + 4 7 17 4 2. 0 <_> <_> - 4 5 16 6 -1. + 4 4 1 4 -1. <_> - 4 8 16 3 2. + 4 6 1 2 2. 0 <_> <_> - 4 6 1 3 -1. + 4 4 16 2 -1. <_> - 4 7 1 1 3. + 4 4 8 1 2. + <_> + 12 5 8 1 2. + 0 + <_> + + <_> + 4 4 16 10 -1. + <_> + 4 4 8 5 2. + <_> + 12 9 8 5 2. + 0 + <_> + + <_> + 4 4 20 6 -1. + <_> + 4 6 20 2 3. + 0 + <_> + + <_> + 4 5 16 2 -1. + <_> + 4 5 8 1 2. + <_> + 12 6 8 1 2. + 0 + <_> + + <_> + 4 5 16 9 -1. + <_> + 4 8 16 3 3. + 0 + <_> + + <_> + 4 6 2 2 -1. + <_> + 4 6 1 1 2. + <_> + 5 7 1 1 2. + 0 + <_> + + <_> + 4 6 2 2 -1. + <_> + 4 7 2 1 2. + 0 + <_> + + <_> + 4 6 6 1 -1. + <_> + 6 6 2 1 3. 0 <_> @@ -7939,18 +8399,9 @@ <_> <_> - 4 6 16 6 -1. + 4 6 15 6 -1. <_> - 4 6 8 3 2. - <_> - 12 9 8 3 2. - 0 - <_> - - <_> - 4 6 10 8 -1. - <_> - 4 10 10 4 2. + 4 8 15 2 3. 0 <_> @@ -7959,6 +8410,27 @@ <_> 4 8 2 1 3. 0 + <_> + + <_> + 4 7 4 3 -1. + <_> + 6 7 2 3 2. + 0 + <_> + + <_> + 4 7 4 3 -1. + <_> + 4 8 4 1 3. + 0 + <_> + + <_> + 4 7 5 3 -1. + <_> + 4 8 5 1 3. + 0 <_> <_> @@ -7969,11 +8441,9 @@ <_> <_> - 4 7 16 4 -1. + 4 7 7 3 -1. <_> - 4 7 8 2 2. - <_> - 12 9 8 2 2. + 4 8 7 1 3. 0 <_> @@ -7984,6 +8454,22 @@ <_> 13 8 9 1 2. 0 + <_> + + <_> + 4 7 18 4 -1. + <_> + 4 7 9 2 2. + <_> + 13 9 9 2 2. + 0 + <_> + + <_> + 4 7 16 3 -1. + <_> + 4 8 16 1 3. + 0 <_> <_> @@ -7991,6 +8477,20 @@ <_> 4 9 16 2 3. 0 + <_> + + <_> + 4 7 17 2 -1. + <_> + 4 8 17 1 2. + 0 + <_> + + <_> + 4 7 17 3 -1. + <_> + 4 8 17 1 3. + 0 <_> <_> @@ -8019,18 +8519,11 @@ <_> <_> - 4 8 16 4 -1. + 4 8 18 4 -1. <_> - 4 8 8 2 2. + 4 8 9 2 2. <_> - 12 10 8 2 2. - 0 - <_> - - <_> - 4 8 15 6 -1. - <_> - 4 10 15 2 3. + 13 10 9 2 2. 0 <_> @@ -8049,18 +8542,18 @@ <_> <_> - 4 9 3 2 -1. + 4 9 2 2 -1. <_> - 5 9 1 2 3. + 4 9 1 1 2. + <_> + 5 10 1 1 2. 0 <_> <_> - 4 9 2 4 -1. + 4 9 2 2 -1. <_> - 4 9 1 2 2. - <_> - 5 11 1 2 2. + 5 9 1 2 2. 0 <_> @@ -8072,18 +8565,16 @@ <_> <_> - 4 9 2 6 -1. + 4 9 2 9 -1. <_> - 4 11 2 2 3. + 4 12 2 3 3. 0 <_> <_> - 4 9 8 6 -1. + 4 9 15 1 -1. <_> - 4 9 4 3 2. - <_> - 8 12 4 3 2. + 9 9 5 1 3. 0 <_> @@ -8102,9 +8593,9 @@ <_> <_> - 4 9 15 4 -1. + 4 9 15 3 -1. <_> - 9 9 5 4 3. + 9 9 5 3 3. 0 <_> @@ -8115,6 +8606,15 @@ <_> 12 10 8 1 2. 0 + <_> + + <_> + 4 9 16 6 -1. + <_> + 4 9 8 3 2. + <_> + 12 12 8 3 2. + 0 <_> <_> @@ -8127,9 +8627,11 @@ <_> <_> - 4 9 15 15 -1. + 4 9 20 2 -1. <_> - 4 14 15 5 3. + 4 9 10 1 2. + <_> + 14 10 10 1 2. 0 <_> @@ -8141,9 +8643,9 @@ <_> <_> - 4 9 20 6 -1. + 4 9 18 3 -1. <_> - 4 11 20 2 3. + 4 10 18 1 3. 0 <_> @@ -8171,18 +8673,25 @@ <_> <_> - 4 10 3 5 -1. + 4 10 6 3 -1. <_> - 5 10 1 5 3. + 7 10 3 3 2. 0 <_> <_> - 4 10 16 10 -1. + 4 10 18 2 -1. <_> - 4 10 8 5 2. + 4 10 9 1 2. <_> - 12 15 8 5 2. + 13 11 9 1 2. + 0 + <_> + + <_> + 4 10 17 6 -1. + <_> + 4 12 17 2 3. 0 <_> @@ -8201,25 +8710,30 @@ <_> <_> - 4 11 3 5 -1. + 4 11 1 8 -1. <_> - 5 11 1 5 3. + 4 15 1 4 2. 0 <_> <_> - 4 11 3 10 -1. + 4 11 3 6 -1. <_> - 4 16 3 5 2. + 5 11 1 6 3. 0 <_> <_> - 4 11 16 2 -1. + 4 11 6 3 -1. <_> - 4 11 8 1 2. + 6 11 2 3 3. + 0 + <_> + <_> - 12 12 8 1 2. + 4 11 15 2 -1. + <_> + 4 12 15 1 2. 0 <_> @@ -8228,20 +8742,6 @@ <_> 5 12 1 1 3. 0 - <_> - - <_> - 4 12 3 2 -1. - <_> - 5 12 1 2 3. - 0 - <_> - - <_> - 4 12 1 6 -1. - <_> - 4 15 1 3 2. - 0 <_> <_> @@ -8252,23 +8752,30 @@ <_> <_> - 4 12 4 4 -1. + 4 12 3 8 -1. <_> - 4 14 4 2 2. + 4 16 3 4 2. 0 <_> <_> - 4 12 18 8 -1. + 4 12 17 12 -1. <_> - 13 12 9 8 2. + 4 16 17 4 3. 0 <_> <_> - 4 13 9 5 -1. + 4 13 3 1 -1. <_> - 7 13 3 5 3. + 5 13 1 1 3. + 0 + <_> + + <_> + 4 13 3 9 -1. + <_> + 4 16 3 3 3. 0 <_> @@ -8280,30 +8787,69 @@ <_> <_> - 4 16 4 1 -1. + 4 15 4 2 -1. <_> - 6 16 2 1 2. + 6 15 2 2 2. 0 <_> <_> - 4 16 9 2 -1. + 4 15 9 4 -1. <_> - 7 16 3 2 3. + 7 15 3 4 3. 0 <_> <_> - 4 19 3 4 -1. + 4 15 16 4 -1. <_> - 5 19 1 4 3. + 4 15 8 2 2. + <_> + 12 17 8 2 2. 0 <_> <_> - 4 22 12 2 -1. + 4 18 3 5 -1. <_> - 4 23 12 1 2. + 5 18 1 5 3. + 0 + <_> + + <_> + 4 18 3 6 -1. + <_> + 5 18 1 6 3. + 0 + <_> + + <_> + 4 18 15 5 -1. + <_> + 9 18 5 5 3. + 0 + <_> + + <_> + 4 18 9 6 -1. + <_> + 4 21 9 3 2. + 0 + <_> + + <_> + 5 1 14 2 -1. + <_> + 5 1 7 1 2. + <_> + 12 2 7 1 2. + 0 + <_> + + <_> + 5 1 11 8 -1. + <_> + 5 5 11 4 2. 0 <_> @@ -8315,18 +8861,9 @@ <_> <_> - 5 2 4 12 -1. + 5 2 6 2 -1. <_> - 5 2 2 6 2. - <_> - 7 8 2 6 2. - 0 - <_> - - <_> - 5 2 4 12 -1. - <_> - 7 2 2 12 2. + 7 2 2 2 3. 0 <_> @@ -8337,6 +8874,13 @@ <_> 12 3 7 1 2. 0 + <_> + + <_> + 5 2 14 8 -1. + <_> + 5 6 14 4 2. + 0 <_> <_> @@ -8344,6 +8888,13 @@ <_> 5 7 16 5 2. 0 + <_> + + <_> + 5 3 6 1 -1. + <_> + 7 3 2 1 3. + 0 <_> <_> @@ -8351,6 +8902,22 @@ <_> 7 3 2 2 3. 0 + <_> + + <_> + 5 3 4 10 -1. + <_> + 5 3 2 5 2. + <_> + 7 8 2 5 2. + 0 + <_> + + <_> + 5 3 9 12 -1. + <_> + 8 3 3 12 3. + 0 <_> <_> @@ -8363,9 +8930,39 @@ <_> <_> - 5 4 5 3 -1. + 5 3 15 8 -1. <_> - 5 5 5 1 3. + 5 7 15 4 2. + 0 + <_> + + <_> + 5 4 2 4 -1. + <_> + 5 4 1 2 2. + <_> + 6 6 1 2 2. + 0 + <_> + + <_> + 5 4 6 4 -1. + <_> + 7 4 2 4 3. + 0 + <_> + + <_> + 5 4 4 12 -1. + <_> + 7 4 2 12 2. + 0 + <_> + + <_> + 5 4 12 8 -1. + <_> + 9 4 4 8 3. 0 <_> @@ -8376,15 +8973,6 @@ <_> 12 5 7 1 2. 0 - <_> - - <_> - 5 4 16 18 -1. - <_> - 5 4 8 9 2. - <_> - 13 13 8 9 2. - 0 <_> <_> @@ -8394,6 +8982,22 @@ <_> 6 6 1 1 2. 0 + <_> + + <_> + 5 5 2 4 -1. + <_> + 5 5 1 2 2. + <_> + 6 7 1 2 2. + 0 + <_> + + <_> + 5 5 6 6 -1. + <_> + 5 7 6 2 3. + 0 <_> <_> @@ -8403,6 +9007,22 @@ <_> 12 6 7 1 2. 0 + <_> + + <_> + 5 5 16 2 -1. + <_> + 5 5 8 1 2. + <_> + 13 6 8 1 2. + 0 + <_> + + <_> + 5 5 13 6 -1. + <_> + 5 7 13 2 3. + 0 <_> <_> @@ -8410,6 +9030,50 @@ <_> 5 7 14 2 3. 0 + <_> + + <_> + 5 5 15 6 -1. + <_> + 5 7 15 2 3. + 0 + <_> + + <_> + 5 5 15 9 -1. + <_> + 5 8 15 3 3. + 0 + <_> + + <_> + 5 6 1 2 -1. + <_> + 5 7 1 1 2. + 0 + <_> + + <_> + 5 6 2 4 -1. + <_> + 5 6 1 2 2. + <_> + 6 8 1 2 2. + 0 + <_> + + <_> + 5 6 6 1 -1. + <_> + 7 6 2 1 3. + 0 + <_> + + <_> + 5 6 4 3 -1. + <_> + 5 7 4 1 3. + 0 <_> <_> @@ -8422,23 +9086,32 @@ <_> <_> - 5 6 19 6 -1. + 5 7 2 2 -1. <_> - 5 8 19 2 3. + 6 7 1 2 2. 0 <_> <_> - 5 7 1 3 -1. + 5 7 2 6 -1. <_> - 5 8 1 1 3. + 5 7 1 3 2. + <_> + 6 10 1 3 2. 0 <_> <_> - 5 7 4 6 -1. + 5 7 4 1 -1. <_> - 7 7 2 6 2. + 7 7 2 1 2. + 0 + <_> + + <_> + 5 7 6 5 -1. + <_> + 7 7 2 5 3. 0 <_> @@ -8447,6 +9120,20 @@ <_> 5 8 3 1 2. 0 + <_> + + <_> + 5 7 3 3 -1. + <_> + 5 8 3 1 3. + 0 + <_> + + <_> + 5 7 3 6 -1. + <_> + 5 9 3 2 3. + 0 <_> <_> @@ -8464,18 +9151,18 @@ <_> <_> - 5 7 5 2 -1. + 5 7 5 6 -1. <_> - 5 8 5 1 2. + 5 9 5 2 3. 0 <_> <_> - 5 7 14 10 -1. + 5 7 14 4 -1. <_> - 5 7 7 5 2. + 5 7 7 2 2. <_> - 12 12 7 5 2. + 12 9 7 2 2. 0 <_> @@ -8487,9 +9174,16 @@ <_> <_> - 5 7 15 4 -1. + 5 7 14 4 -1. <_> - 5 9 15 2 2. + 5 9 14 2 2. + 0 + <_> + + <_> + 5 7 15 2 -1. + <_> + 5 8 15 1 2. 0 <_> @@ -8498,20 +9192,6 @@ <_> 5 9 15 2 3. 0 - <_> - - <_> - 5 7 16 2 -1. - <_> - 5 8 16 1 2. - 0 - <_> - - <_> - 5 7 16 6 -1. - <_> - 5 9 16 2 3. - 0 <_> <_> @@ -8522,46 +9202,64 @@ <_> <_> - 5 8 2 4 -1. + 5 8 2 2 -1. <_> - 5 8 1 2 2. + 5 8 1 1 2. <_> - 6 10 1 2 2. + 6 9 1 1 2. 0 <_> <_> - 5 8 3 2 -1. + 5 8 4 5 -1. <_> - 5 9 3 1 2. + 7 8 2 5 2. 0 <_> <_> - 5 9 3 1 -1. + 5 8 12 4 -1. <_> - 6 9 1 1 3. + 9 8 4 4 3. 0 <_> <_> - 5 9 1 3 -1. + 5 8 15 3 -1. <_> - 5 10 1 1 3. + 10 8 5 3 3. 0 <_> <_> - 5 9 1 9 -1. + 5 8 14 4 -1. <_> - 5 12 1 3 3. + 5 8 7 2 2. + <_> + 12 10 7 2 2. 0 <_> <_> - 5 9 8 1 -1. + 5 9 4 4 -1. <_> - 9 9 4 1 2. + 7 9 2 4 2. + 0 + <_> + + <_> + 5 9 4 3 -1. + <_> + 5 10 4 1 3. + 0 + <_> + + <_> + 5 9 8 8 -1. + <_> + 5 9 4 4 2. + <_> + 9 13 4 4 2. 0 <_> @@ -8582,20 +9280,34 @@ <_> <_> - 5 9 14 8 -1. + 5 9 14 12 -1. <_> - 5 9 7 4 2. + 5 9 7 6 2. <_> - 12 13 7 4 2. + 12 15 7 6 2. 0 <_> <_> - 5 9 16 2 -1. + 5 9 18 2 -1. <_> - 5 9 8 1 2. + 5 9 9 1 2. <_> - 13 10 8 1 2. + 14 10 9 1 2. + 0 + <_> + + <_> + 5 9 13 3 -1. + <_> + 5 10 13 1 3. + 0 + <_> + + <_> + 5 9 15 6 -1. + <_> + 5 12 15 3 2. 0 <_> @@ -8609,9 +9321,9 @@ <_> <_> - 5 10 15 1 -1. + 5 10 3 3 -1. <_> - 10 10 5 1 3. + 6 10 1 3 3. 0 <_> @@ -8620,6 +9332,20 @@ <_> 6 11 1 2 3. 0 + <_> + + <_> + 5 11 3 3 -1. + <_> + 6 11 1 3 3. + 0 + <_> + + <_> + 5 11 3 13 -1. + <_> + 6 11 1 13 3. + 0 <_> <_> @@ -8630,39 +9356,37 @@ <_> <_> - 5 12 17 2 -1. + 5 12 1 6 -1. <_> - 5 13 17 1 2. + 5 15 1 3 2. 0 <_> <_> - 5 13 4 6 -1. + 5 13 15 8 -1. <_> - 5 13 2 3 2. - <_> - 7 16 2 3 2. + 5 17 15 4 2. 0 <_> <_> - 5 13 18 10 -1. + 5 14 3 3 -1. <_> - 14 13 9 10 2. + 5 15 3 1 3. 0 <_> <_> - 5 15 9 3 -1. + 5 15 2 2 -1. <_> - 8 15 3 3 3. + 6 15 1 2 2. 0 <_> <_> - 5 17 3 7 -1. + 5 19 3 5 -1. <_> - 6 17 1 7 3. + 6 19 1 5 3. 0 <_> @@ -8674,44 +9398,44 @@ <_> <_> - 6 0 3 6 -1. + 6 0 1 6 -1. <_> - 6 3 3 3 2. + 6 3 1 3 2. 0 <_> <_> - 6 0 12 2 -1. + 6 0 11 10 -1. <_> - 12 0 6 2 2. + 6 5 11 5 2. 0 <_> <_> - 6 0 14 12 -1. + 6 1 6 12 -1. <_> - 6 6 14 6 2. + 8 1 2 12 3. 0 <_> <_> - 6 1 6 7 -1. + 6 2 3 6 -1. <_> - 8 1 2 7 3. + 7 2 1 6 3. 0 <_> <_> - 6 1 6 11 -1. + 6 2 6 2 -1. <_> - 8 1 2 11 3. + 8 2 2 2 3. 0 <_> <_> - 6 2 6 12 -1. + 6 2 6 10 -1. <_> - 8 2 2 12 3. + 8 2 2 10 3. 0 <_> @@ -8723,25 +9447,16 @@ <_> <_> - 6 3 2 2 -1. + 6 3 6 4 -1. <_> - 6 4 2 1 2. + 8 3 2 4 3. 0 <_> <_> - 6 3 14 18 -1. + 6 3 9 1 -1. <_> - 6 3 7 9 2. - <_> - 13 12 7 9 2. - 0 - <_> - - <_> - 6 4 1 2 -1. - <_> - 6 5 1 1 2. + 9 3 3 1 3. 0 <_> @@ -8753,9 +9468,23 @@ <_> <_> - 6 5 2 1 -1. + 6 4 6 4 -1. <_> - 7 5 1 1 2. + 8 4 2 4 3. + 0 + <_> + + <_> + 6 5 3 2 -1. + <_> + 7 5 1 2 3. + 0 + <_> + + <_> + 6 5 3 3 -1. + <_> + 7 5 1 3 3. 0 <_> @@ -8776,39 +9505,18 @@ <_> <_> - 6 5 12 6 -1. + 6 6 4 1 -1. <_> - 6 7 12 2 3. + 8 6 2 1 2. 0 <_> <_> - 6 6 10 2 -1. + 6 6 12 2 -1. <_> - 6 6 5 1 2. + 6 6 6 1 2. <_> - 11 7 5 1 2. - 0 - <_> - - <_> - 6 6 12 6 -1. - <_> - 6 8 12 2 3. - 0 - <_> - - <_> - 6 6 14 4 -1. - <_> - 6 8 14 2 2. - 0 - <_> - - <_> - 6 7 1 3 -1. - <_> - 6 8 1 1 3. + 12 7 6 1 2. 0 <_> @@ -8817,6 +9525,13 @@ <_> 6 9 1 2 3. 0 + <_> + + <_> + 6 7 2 2 -1. + <_> + 6 8 2 1 2. + 0 <_> <_> @@ -8841,23 +9556,39 @@ <_> <_> - 6 8 2 4 -1. + 6 7 12 2 -1. <_> - 7 8 1 4 2. + 6 7 6 1 2. + <_> + 12 8 6 1 2. 0 <_> <_> - 6 8 2 3 -1. + 6 7 8 12 -1. <_> - 6 9 2 1 3. + 6 13 8 6 2. 0 <_> <_> - 6 8 9 6 -1. + 6 7 12 15 -1. <_> - 9 8 3 6 3. + 6 12 12 5 3. + 0 + <_> + + <_> + 6 8 2 6 -1. + <_> + 6 11 2 3 2. + 0 + <_> + + <_> + 6 8 3 2 -1. + <_> + 6 9 3 1 2. 0 <_> @@ -8878,16 +9609,23 @@ <_> <_> - 6 8 8 12 -1. + 6 9 2 2 -1. <_> - 6 14 8 6 2. + 6 10 2 1 2. 0 <_> <_> - 6 9 2 6 -1. + 6 9 2 3 -1. <_> - 6 11 2 2 3. + 6 10 2 1 3. + 0 + <_> + + <_> + 6 9 6 1 -1. + <_> + 9 9 3 1 2. 0 <_> @@ -8896,36 +9634,6 @@ <_> 6 10 3 1 3. 0 - <_> - - <_> - 6 9 3 6 -1. - <_> - 6 12 3 3 2. - 0 - <_> - - <_> - 6 9 6 6 -1. - <_> - 6 9 3 3 2. - <_> - 9 12 3 3 2. - 0 - <_> - - <_> - 6 9 12 2 -1. - <_> - 10 9 4 2 3. - 0 - <_> - - <_> - 6 9 12 3 -1. - <_> - 10 9 4 3 3. - 0 <_> <_> @@ -8938,11 +9646,9 @@ <_> <_> - 6 9 14 2 -1. + 6 9 13 12 -1. <_> - 6 9 7 1 2. - <_> - 13 10 7 1 2. + 6 13 13 4 3. 0 <_> @@ -8951,6 +9657,13 @@ <_> 6 11 1 1 3. 0 + <_> + + <_> + 6 10 2 2 -1. + <_> + 7 10 1 2 2. + 0 <_> <_> @@ -8958,6 +9671,13 @@ <_> 7 10 1 3 2. 0 + <_> + + <_> + 6 10 3 14 -1. + <_> + 7 10 1 14 3. + 0 <_> <_> @@ -8979,6 +9699,29 @@ <_> 6 11 3 1 3. 0 + <_> + + <_> + 6 10 9 5 -1. + <_> + 9 10 3 5 3. + 0 + <_> + + <_> + 6 10 12 1 -1. + <_> + 10 10 4 1 3. + 0 + <_> + + <_> + 6 10 8 4 -1. + <_> + 6 10 4 2 2. + <_> + 10 12 4 2 2. + 0 <_> <_> @@ -8988,6 +9731,22 @@ <_> 12 11 6 1 2. 0 + <_> + + <_> + 6 10 12 12 -1. + <_> + 6 10 6 6 2. + <_> + 12 16 6 6 2. + 0 + <_> + + <_> + 6 10 18 1 -1. + <_> + 15 10 9 1 2. + 0 <_> <_> @@ -9026,16 +9785,32 @@ <_> <_> - 6 11 4 3 -1. + 6 11 12 3 -1. <_> - 6 12 4 1 3. + 6 12 12 1 3. 0 <_> <_> - 6 11 16 3 -1. + 6 11 13 3 -1. <_> - 6 12 16 1 3. + 6 12 13 1 3. + 0 + <_> + + <_> + 6 12 14 2 -1. + <_> + 6 12 7 1 2. + <_> + 13 13 7 1 2. + 0 + <_> + + <_> + 6 12 13 2 -1. + <_> + 6 13 13 1 2. 0 <_> @@ -9047,30 +9822,30 @@ <_> <_> - 6 16 1 3 -1. + 6 14 2 2 -1. <_> - 6 17 1 1 3. + 7 14 1 2 2. 0 <_> <_> - 6 17 3 6 -1. + 6 15 2 3 -1. <_> - 7 17 1 6 3. + 6 16 2 1 3. 0 <_> <_> - 6 17 11 4 -1. + 6 17 10 6 -1. <_> - 6 19 11 2 2. + 6 20 10 3 2. 0 <_> <_> - 6 18 12 2 -1. + 6 18 3 6 -1. <_> - 6 19 12 1 2. + 7 18 1 6 3. 0 <_> @@ -9082,9 +9857,25 @@ <_> <_> - 6 20 14 4 -1. + 6 20 9 4 -1. <_> - 6 22 14 2 2. + 6 22 9 2 2. + 0 + <_> + + <_> + 6 23 3 1 -1. + <_> + 7 23 1 1 3. + 0 + <_> + + <_> + 7 0 2 8 -1. + <_> + 7 0 1 4 2. + <_> + 8 4 1 4 2. 0 <_> @@ -9096,16 +9887,9 @@ <_> <_> - 7 0 7 2 -1. + 7 1 2 4 -1. <_> - 7 1 7 1 2. - 0 - <_> - - <_> - 7 0 11 10 -1. - <_> - 7 5 11 5 2. + 7 3 2 2 2. 0 <_> @@ -9117,82 +9901,30 @@ <_> <_> - 7 1 10 2 -1. + 7 2 4 21 -1. <_> - 7 1 5 1 2. - <_> - 12 2 5 1 2. + 9 2 2 21 2. 0 <_> <_> - 7 2 2 2 -1. + 7 3 1 3 -1. <_> - 7 2 1 1 2. - <_> - 8 3 1 1 2. + 7 4 1 1 3. 0 <_> <_> - 7 2 10 2 -1. + 7 3 3 5 -1. <_> - 7 2 5 1 2. - <_> - 12 3 5 1 2. + 8 3 1 5 3. 0 <_> <_> - 7 3 10 2 -1. + 7 4 3 10 -1. <_> - 7 3 5 1 2. - <_> - 12 4 5 1 2. - 0 - <_> - - <_> - 7 4 2 4 -1. - <_> - 8 4 1 4 2. - 0 - <_> - - <_> - 7 4 3 4 -1. - <_> - 8 4 1 4 3. - 0 - <_> - - <_> - 7 4 3 7 -1. - <_> - 8 4 1 7 3. - 0 - <_> - - <_> - 7 4 2 8 -1. - <_> - 8 4 1 8 2. - 0 - <_> - - <_> - 7 4 9 7 -1. - <_> - 10 4 3 7 3. - 0 - <_> - - <_> - 7 4 10 2 -1. - <_> - 7 4 5 1 2. - <_> - 12 5 5 1 2. + 8 4 1 10 3. 0 <_> @@ -9208,6 +9940,13 @@ <_> 8 5 1 2 3. 0 + <_> + + <_> + 7 5 3 3 -1. + <_> + 8 5 1 3 3. + 0 <_> <_> @@ -9218,25 +9957,16 @@ <_> <_> - 7 5 3 7 -1. + 7 5 2 7 -1. <_> - 8 5 1 7 3. + 8 5 1 7 2. 0 <_> <_> - 7 5 3 6 -1. + 7 5 2 6 -1. <_> - 7 7 3 2 3. - 0 - <_> - - <_> - 7 5 10 2 -1. - <_> - 7 5 5 1 2. - <_> - 12 6 5 1 2. + 7 7 2 2 3. 0 <_> @@ -9245,6 +9975,27 @@ <_> 7 7 11 2 3. 0 + <_> + + <_> + 7 6 3 1 -1. + <_> + 8 6 1 1 3. + 0 + <_> + + <_> + 7 6 1 3 -1. + <_> + 7 7 1 1 3. + 0 + <_> + + <_> + 7 6 4 6 -1. + <_> + 9 6 2 6 2. + 0 <_> <_> @@ -9254,6 +10005,22 @@ <_> 12 7 5 1 2. 0 + <_> + + <_> + 7 6 12 2 -1. + <_> + 7 6 6 1 2. + <_> + 13 7 6 1 2. + 0 + <_> + + <_> + 7 7 1 2 -1. + <_> + 7 8 1 1 2. + 0 <_> <_> @@ -9271,9 +10038,18 @@ <_> <_> - 7 7 12 15 -1. + 7 7 2 4 -1. <_> - 7 12 12 5 3. + 7 9 2 2 2. + 0 + <_> + + <_> + 7 7 10 2 -1. + <_> + 7 7 5 1 2. + <_> + 12 8 5 1 2. 0 <_> @@ -9294,16 +10070,20 @@ <_> <_> - 7 8 3 16 -1. + 7 8 2 4 -1. <_> - 8 8 1 16 3. + 7 8 1 2 2. + <_> + 8 10 1 2 2. 0 <_> <_> - 7 8 4 16 -1. + 7 8 10 2 -1. <_> - 9 8 2 16 2. + 7 8 5 1 2. + <_> + 12 9 5 1 2. 0 <_> @@ -9315,18 +10095,16 @@ <_> <_> - 7 9 2 2 -1. + 7 9 1 3 -1. <_> - 7 9 1 1 2. - <_> - 8 10 1 1 2. + 7 10 1 1 3. 0 <_> <_> - 7 9 2 3 -1. + 7 9 3 3 -1. <_> - 7 10 2 1 3. + 8 9 1 3 3. 0 <_> @@ -9362,6 +10140,15 @@ <_> 12 10 5 1 2. 0 + <_> + + <_> + 7 9 12 2 -1. + <_> + 7 9 6 1 2. + <_> + 13 10 6 1 2. + 0 <_> <_> @@ -9386,32 +10173,9 @@ <_> <_> - 7 10 4 4 -1. + 7 10 6 4 -1. <_> - 7 10 2 2 2. - <_> - 9 12 2 2 2. - 0 - <_> - - <_> - 7 10 4 4 -1. - <_> - 9 10 2 4 2. - 0 - <_> - - <_> - 7 10 6 5 -1. - <_> - 9 10 2 5 3. - 0 - <_> - - <_> - 7 10 9 7 -1. - <_> - 10 10 3 7 3. + 9 10 2 4 3. 0 <_> @@ -9429,6 +10193,13 @@ <_> 8 11 1 1 2. 0 + <_> + + <_> + 7 11 2 2 -1. + <_> + 7 12 2 1 2. + 0 <_> <_> @@ -9439,72 +10210,37 @@ <_> <_> - 7 13 12 3 -1. + 7 14 1 3 -1. <_> - 11 13 4 3 3. + 7 15 1 1 3. 0 <_> <_> - 7 13 13 10 -1. + 7 16 10 8 -1. <_> - 7 18 13 5 2. + 7 20 10 4 2. 0 <_> <_> - 7 15 6 3 -1. + 7 18 3 6 -1. <_> - 9 15 2 3 3. - 0 - <_> - - <_> - 7 16 1 6 -1. - <_> - 7 19 1 3 2. - 0 - <_> - - <_> - 7 16 9 2 -1. - <_> - 10 16 3 2 3. - 0 - <_> - - <_> - 7 17 11 6 -1. - <_> - 7 20 11 3 2. - 0 - <_> - - <_> - 7 18 5 6 -1. - <_> - 7 20 5 2 3. + 8 18 1 6 3. 0 <_> <_> 7 18 9 6 -1. <_> - 7 21 9 3 2. + 7 20 9 2 3. 0 <_> <_> - 7 18 10 6 -1. + 7 19 3 3 -1. <_> - 7 20 10 2 3. - 0 - <_> - - <_> - 7 18 11 6 -1. - <_> - 7 21 11 3 2. + 8 19 1 3 3. 0 <_> @@ -9516,23 +10252,30 @@ <_> <_> - 7 20 9 3 -1. + 7 20 7 4 -1. <_> - 7 21 9 1 3. + 7 22 7 2 2. 0 <_> <_> - 8 0 8 1 -1. + 7 20 11 4 -1. <_> - 12 0 4 1 2. + 7 22 11 2 2. 0 <_> <_> - 8 0 10 1 -1. + 7 22 3 2 -1. <_> - 13 0 5 1 2. + 8 22 1 2 3. + 0 + <_> + + <_> + 8 0 8 2 -1. + <_> + 12 0 4 2 2. 0 <_> @@ -9544,11 +10287,9 @@ <_> <_> - 8 0 16 8 -1. + 8 0 8 10 -1. <_> - 8 0 8 4 2. - <_> - 16 4 8 4 2. + 8 5 8 5 2. 0 <_> @@ -9562,51 +10303,88 @@ <_> <_> - 8 0 9 2 -1. + 8 0 10 3 -1. <_> - 8 1 9 1 2. + 8 1 10 1 3. 0 <_> <_> - 8 1 9 10 -1. + 8 1 8 1 -1. <_> - 8 6 9 5 2. + 12 1 4 1 2. 0 <_> <_> - 8 3 6 10 -1. + 8 2 3 2 -1. <_> - 10 3 2 10 3. + 9 2 1 2 3. 0 <_> <_> - 8 4 3 1 -1. + 8 2 8 20 -1. <_> - 9 4 1 1 3. + 12 2 4 20 2. 0 <_> <_> - 8 4 3 5 -1. + 8 3 3 8 -1. <_> - 9 4 1 5 3. + 9 3 1 8 3. 0 <_> <_> - 8 4 2 7 -1. + 8 3 3 9 -1. <_> - 9 4 1 7 2. + 9 3 1 9 3. 0 <_> <_> - 8 4 3 9 -1. + 8 3 6 1 -1. <_> - 9 4 1 9 3. + 11 3 3 1 2. + 0 + <_> + + <_> + 8 3 4 3 -1. + <_> + 8 4 4 1 3. + 0 + <_> + + <_> + 8 3 8 2 -1. + <_> + 8 3 4 1 2. + <_> + 12 4 4 1 2. + 0 + <_> + + <_> + 8 4 3 2 -1. + <_> + 9 4 1 2 3. + 0 + <_> + + <_> + 8 4 2 8 -1. + <_> + 9 4 1 8 2. + 0 + <_> + + <_> + 8 4 3 3 -1. + <_> + 8 5 3 1 3. 0 <_> @@ -9620,9 +10398,9 @@ <_> <_> - 8 5 1 4 -1. + 8 4 7 15 -1. <_> - 8 7 1 2 2. + 8 9 7 5 3. 0 <_> @@ -9631,6 +10409,13 @@ <_> 9 5 1 2 3. 0 + <_> + + <_> + 8 5 2 3 -1. + <_> + 9 5 1 3 2. + 0 <_> <_> @@ -9645,20 +10430,6 @@ <_> 9 5 1 6 2. 0 - <_> - - <_> - 8 5 3 6 -1. - <_> - 9 5 1 6 3. - 0 - <_> - - <_> - 8 5 2 7 -1. - <_> - 9 5 1 7 2. - 0 <_> <_> @@ -9666,13 +10437,6 @@ <_> 9 5 1 7 3. 0 - <_> - - <_> - 8 5 2 3 -1. - <_> - 8 6 2 1 3. - 0 <_> <_> @@ -9683,11 +10447,9 @@ <_> <_> - 8 5 8 2 -1. + 8 5 8 12 -1. <_> - 8 5 4 1 2. - <_> - 12 6 4 1 2. + 12 5 4 12 2. 0 <_> @@ -9703,15 +10465,6 @@ <_> 9 6 1 5 3. 0 - <_> - - <_> - 8 6 8 2 -1. - <_> - 8 6 4 1 2. - <_> - 12 7 4 1 2. - 0 <_> <_> @@ -9724,16 +10477,11 @@ <_> <_> - 8 7 12 6 -1. + 8 8 2 2 -1. <_> - 12 7 4 6 3. - 0 - <_> - + 8 8 1 1 2. <_> - 8 7 16 1 -1. - <_> - 16 7 8 1 2. + 9 9 1 1 2. 0 <_> @@ -9745,11 +10493,23 @@ <_> <_> - 8 9 2 4 -1. + 8 8 3 3 -1. <_> - 8 9 1 2 2. + 8 9 3 1 3. + 0 + <_> + <_> - 9 11 1 2 2. + 8 9 1 3 -1. + <_> + 8 10 1 1 3. + 0 + <_> + + <_> + 8 9 3 2 -1. + <_> + 9 9 1 2 3. 0 <_> @@ -9760,15 +10520,6 @@ <_> 9 12 1 3 2. 0 - <_> - - <_> - 8 9 8 2 -1. - <_> - 8 9 4 1 2. - <_> - 12 10 4 1 2. - 0 <_> <_> @@ -9783,6 +10534,22 @@ <_> 9 10 1 1 3. 0 + <_> + + <_> + 8 10 2 2 -1. + <_> + 8 10 1 1 2. + <_> + 9 11 1 1 2. + 0 + <_> + + <_> + 8 10 2 2 -1. + <_> + 9 10 1 2 2. + 0 <_> <_> @@ -9790,22 +10557,6 @@ <_> 9 10 1 2 3. 0 - <_> - - <_> - 8 10 2 8 -1. - <_> - 8 10 1 4 2. - <_> - 9 14 1 4 2. - 0 - <_> - - <_> - 8 10 4 2 -1. - <_> - 10 10 2 2 2. - 0 <_> <_> @@ -9815,6 +10566,24 @@ <_> 10 14 2 4 2. 0 + <_> + + <_> + 8 10 8 2 -1. + <_> + 8 10 4 1 2. + <_> + 12 11 4 1 2. + 0 + <_> + + <_> + 8 11 2 2 -1. + <_> + 8 11 1 1 2. + <_> + 9 12 1 1 2. + 0 <_> <_> @@ -9827,16 +10596,25 @@ <_> <_> - 8 14 1 3 -1. + 8 11 4 10 -1. <_> - 8 15 1 1 3. + 8 11 2 5 2. + <_> + 10 16 2 5 2. 0 <_> <_> - 8 14 3 10 -1. + 8 13 9 10 -1. <_> - 9 14 1 10 3. + 8 18 9 5 2. + 0 + <_> + + <_> + 8 15 4 4 -1. + <_> + 10 15 2 4 2. 0 <_> @@ -9845,34 +10623,6 @@ <_> 11 16 3 3 3. 0 - <_> - - <_> - 8 16 9 4 -1. - <_> - 11 16 3 4 3. - 0 - <_> - - <_> - 8 17 10 6 -1. - <_> - 8 19 10 2 3. - 0 - <_> - - <_> - 8 17 10 6 -1. - <_> - 8 20 10 3 2. - 0 - <_> - - <_> - 8 18 9 6 -1. - <_> - 11 18 3 6 3. - 0 <_> <_> @@ -9880,13 +10630,6 @@ <_> 9 19 1 5 3. 0 - <_> - - <_> - 8 19 7 3 -1. - <_> - 8 20 7 1 3. - 0 <_> <_> @@ -9894,41 +10637,6 @@ <_> 9 20 1 3 3. 0 - <_> - - <_> - 8 20 3 4 -1. - <_> - 9 20 1 4 3. - 0 - <_> - - <_> - 8 20 7 4 -1. - <_> - 8 22 7 2 2. - 0 - <_> - - <_> - 8 20 12 4 -1. - <_> - 8 22 12 2 2. - 0 - <_> - - <_> - 8 22 3 1 -1. - <_> - 9 22 1 1 3. - 0 - <_> - - <_> - 8 22 3 2 -1. - <_> - 9 22 1 2 3. - 0 <_> <_> @@ -9939,23 +10647,39 @@ <_> <_> - 9 0 5 10 -1. + 9 0 2 4 -1. <_> - 9 5 5 5 2. + 10 0 1 4 2. 0 <_> <_> - 9 0 6 4 -1. + 9 0 6 1 -1. <_> - 9 2 6 2 2. + 12 0 3 1 2. 0 <_> <_> - 9 0 6 8 -1. + 9 0 5 4 -1. <_> - 9 4 6 4 2. + 9 2 5 2 2. + 0 + <_> + + <_> + 9 0 6 10 -1. + <_> + 9 5 6 5 2. + 0 + <_> + + <_> + 9 0 14 8 -1. + <_> + 9 0 7 4 2. + <_> + 16 4 7 4 2. 0 <_> @@ -9976,23 +10700,32 @@ <_> <_> - 9 0 8 4 -1. + 9 0 14 12 -1. <_> - 9 2 8 2 2. + 9 0 7 6 2. + <_> + 16 6 7 6 2. 0 <_> <_> - 9 1 2 3 -1. + 9 1 3 12 -1. <_> - 10 1 1 3 2. + 10 1 1 12 3. 0 <_> <_> - 9 1 15 15 -1. + 9 1 4 15 -1. <_> - 9 6 15 5 3. + 11 1 2 15 2. + 0 + <_> + + <_> + 9 1 6 1 -1. + <_> + 12 1 3 1 2. 0 <_> @@ -10004,72 +10737,74 @@ <_> <_> - 9 2 6 1 -1. + 9 2 6 18 -1. <_> - 12 2 3 1 2. + 12 2 3 18 2. 0 <_> <_> - 9 2 6 22 -1. + 9 2 15 3 -1. <_> - 12 2 3 22 2. + 9 3 15 1 3. 0 <_> <_> - 9 2 6 8 -1. + 9 3 3 9 -1. <_> - 9 6 6 4 2. + 10 3 1 9 3. 0 <_> <_> - 9 4 4 9 -1. + 9 3 8 6 -1. <_> - 11 4 2 9 2. + 9 6 8 3 2. 0 <_> <_> - 9 4 3 3 -1. + 9 3 15 15 -1. <_> - 9 5 3 1 3. + 9 8 15 5 3. 0 <_> <_> - 9 4 3 6 -1. + 9 4 3 4 -1. <_> - 9 7 3 3 2. + 10 4 1 4 3. 0 <_> <_> - 9 4 6 18 -1. + 9 4 6 2 -1. <_> - 12 4 3 18 2. + 9 4 3 1 2. + <_> + 12 5 3 1 2. 0 <_> <_> - 9 4 12 2 -1. + 9 4 14 5 -1. <_> - 13 4 4 2 3. + 16 4 7 5 2. 0 <_> <_> - 9 5 2 6 -1. + 9 5 2 5 -1. <_> - 10 5 1 6 2. + 10 5 1 5 2. 0 <_> <_> - 9 5 6 5 -1. + 9 5 3 6 -1. <_> - 11 5 2 5 3. + 10 5 1 6 3. 0 <_> @@ -10088,9 +10823,16 @@ <_> <_> - 9 6 4 9 -1. + 9 5 4 3 -1. <_> - 11 6 2 9 2. + 9 6 4 1 3. + 0 + <_> + + <_> + 9 6 4 4 -1. + <_> + 11 6 2 4 2. 0 <_> @@ -10099,6 +10841,13 @@ <_> 9 7 3 1 3. 0 + <_> + + <_> + 9 6 6 7 -1. + <_> + 12 6 3 7 2. + 0 <_> <_> @@ -10106,6 +10855,13 @@ <_> 9 7 4 1 3. 0 + <_> + + <_> + 9 6 15 10 -1. + <_> + 9 11 15 5 2. + 0 <_> <_> @@ -10118,37 +10874,62 @@ <_> <_> - 9 7 8 6 -1. + 9 8 3 3 -1. <_> - 13 7 4 6 2. + 9 9 3 1 3. 0 <_> <_> - 9 8 9 9 -1. + 9 8 7 10 -1. <_> - 12 8 3 9 3. + 9 13 7 5 2. 0 <_> <_> - 9 8 4 3 -1. + 9 9 2 2 -1. <_> - 9 9 4 1 3. + 10 9 1 2 2. 0 <_> <_> - 9 9 5 3 -1. + 9 9 3 3 -1. <_> - 9 10 5 1 3. + 9 10 3 1 3. 0 <_> <_> - 9 10 9 5 -1. + 9 9 9 6 -1. <_> - 12 10 3 5 3. + 12 9 3 6 3. + 0 + <_> + + <_> + 9 10 2 4 -1. + <_> + 9 10 1 2 2. + <_> + 10 12 1 2 2. + 0 + <_> + + <_> + 9 10 6 2 -1. + <_> + 9 10 3 1 2. + <_> + 12 11 3 1 2. + 0 + <_> + + <_> + 9 10 8 1 -1. + <_> + 13 10 4 1 2. 0 <_> @@ -10160,37 +10941,41 @@ <_> <_> - 9 11 3 5 -1. + 9 11 2 4 -1. <_> - 10 11 1 5 3. + 9 11 1 2 2. + <_> + 10 13 1 2 2. 0 <_> <_> - 9 15 6 1 -1. + 9 11 2 6 -1. <_> - 11 15 2 1 3. + 9 11 1 3 2. + <_> + 10 14 1 3 2. 0 <_> <_> - 9 15 6 2 -1. + 9 13 2 11 -1. <_> - 11 15 2 2 3. + 10 13 1 11 2. 0 <_> <_> - 9 15 9 9 -1. + 9 14 6 3 -1. <_> - 12 15 3 9 3. + 11 14 2 3 3. 0 <_> <_> - 9 16 6 3 -1. + 9 16 4 3 -1. <_> - 11 16 2 3 3. + 11 16 2 3 2. 0 <_> @@ -10202,30 +10987,37 @@ <_> <_> - 9 16 6 7 -1. + 9 16 6 8 -1. <_> - 11 16 2 7 3. + 11 16 2 8 3. 0 <_> <_> - 9 17 6 4 -1. + 9 16 6 3 -1. <_> - 11 17 2 4 3. + 9 17 6 1 3. 0 <_> <_> - 9 17 5 3 -1. + 9 17 6 2 -1. <_> - 9 18 5 1 3. + 11 17 2 2 3. 0 <_> <_> - 9 18 8 6 -1. + 9 17 6 7 -1. <_> - 9 20 8 2 3. + 11 17 2 7 3. + 0 + <_> + + <_> + 9 18 5 3 -1. + <_> + 9 19 5 1 3. 0 <_> @@ -10237,23 +11029,9 @@ <_> <_> - 9 19 6 3 -1. + 9 19 7 3 -1. <_> - 9 20 6 1 3. - 0 - <_> - - <_> - 9 19 6 4 -1. - <_> - 9 21 6 2 2. - 0 - <_> - - <_> - 9 19 8 3 -1. - <_> - 9 20 8 1 3. + 9 20 7 1 3. 0 <_> @@ -10262,6 +11040,13 @@ <_> 10 20 1 4 3. 0 + <_> + + <_> + 9 20 3 2 -1. + <_> + 9 21 3 1 2. + 0 <_> <_> @@ -10269,6 +11054,34 @@ <_> 9 21 5 1 3. 0 + <_> + + <_> + 9 20 6 3 -1. + <_> + 9 21 6 1 3. + 0 + <_> + + <_> + 9 20 6 4 -1. + <_> + 9 22 6 2 2. + 0 + <_> + + <_> + 9 20 7 3 -1. + <_> + 9 21 7 1 3. + 0 + <_> + + <_> + 9 20 8 4 -1. + <_> + 9 22 8 2 2. + 0 <_> <_> @@ -10276,20 +11089,6 @@ <_> 10 21 1 2 3. 0 - <_> - - <_> - 9 21 3 3 -1. - <_> - 10 21 1 3 3. - 0 - <_> - - <_> - 9 21 6 2 -1. - <_> - 9 22 6 1 2. - 0 <_> <_> @@ -10300,34 +11099,23 @@ <_> <_> - 10 0 4 1 -1. + 10 0 1 6 -1. <_> - 12 0 2 1 2. + 10 3 1 3 2. 0 <_> <_> - 10 0 4 2 -1. + 10 0 6 1 -1. <_> - 10 0 2 1 2. - <_> - 12 1 2 1 2. + 13 0 3 1 2. 0 <_> <_> - 10 0 4 4 -1. + 10 0 4 8 -1. <_> - 10 0 2 2 2. - <_> - 12 2 2 2 2. - 0 - <_> - - <_> - 10 0 3 6 -1. - <_> - 10 3 3 3 2. + 10 4 4 4 2. 0 <_> @@ -10338,13 +11126,6 @@ <_> 17 5 7 5 2. 0 - <_> - - <_> - 10 1 2 9 -1. - <_> - 11 1 1 9 2. - 0 <_> <_> @@ -10357,9 +11138,16 @@ <_> <_> - 10 3 2 9 -1. + 10 2 1 6 -1. <_> - 11 3 1 9 2. + 10 5 1 3 2. + 0 + <_> + + <_> + 10 3 6 1 -1. + <_> + 13 3 3 1 2. 0 <_> @@ -10371,39 +11159,44 @@ <_> <_> - 10 3 6 2 -1. + 10 3 3 3 -1. <_> - 10 3 3 1 2. - <_> - 13 4 3 1 2. + 10 4 3 1 3. 0 <_> <_> 10 4 3 3 -1. <_> - 10 5 3 1 3. + 11 4 1 3 3. 0 <_> <_> - 10 4 7 15 -1. + 10 4 2 8 -1. <_> - 10 9 7 5 3. + 11 4 1 8 2. 0 <_> <_> 10 5 3 3 -1. <_> - 10 6 3 1 3. + 11 5 1 3 3. 0 <_> <_> - 10 6 7 3 -1. + 10 5 4 11 -1. <_> - 10 7 7 1 3. + 12 5 2 11 2. + 0 + <_> + + <_> + 10 6 6 3 -1. + <_> + 10 7 6 1 3. 0 <_> @@ -10415,16 +11208,16 @@ <_> <_> - 10 7 4 14 -1. + 10 7 4 7 -1. <_> - 12 7 2 14 2. + 12 7 2 7 2. 0 <_> <_> - 10 7 3 3 -1. + 10 7 9 6 -1. <_> - 10 8 3 1 3. + 13 7 3 6 3. 0 <_> @@ -10436,53 +11229,65 @@ <_> <_> - 10 7 8 12 -1. + 10 8 2 3 -1. <_> - 10 13 8 6 2. + 10 9 2 1 3. 0 <_> <_> - 10 9 10 8 -1. + 10 8 4 2 -1. <_> - 10 9 5 4 2. - <_> - 15 13 5 4 2. + 10 9 4 1 2. 0 <_> <_> - 10 9 6 8 -1. + 10 8 8 10 -1. <_> - 10 13 6 4 2. + 10 13 8 5 2. 0 <_> <_> - 10 10 2 6 -1. + 10 9 1 3 -1. <_> - 11 10 1 6 2. + 10 10 1 1 3. 0 <_> <_> - 10 10 2 3 -1. + 10 9 2 3 -1. <_> - 10 11 2 1 3. + 10 10 2 1 3. 0 <_> <_> - 10 10 14 4 -1. + 10 9 6 4 -1. <_> - 10 12 14 2 2. + 13 9 3 4 2. 0 <_> <_> - 10 11 2 3 -1. + 10 10 14 3 -1. <_> - 10 12 2 1 3. + 10 11 14 1 3. + 0 + <_> + + <_> + 10 11 1 3 -1. + <_> + 10 12 1 1 3. + 0 + <_> + + <_> + 10 11 4 3 -1. + <_> + 10 12 4 1 3. 0 <_> @@ -10494,16 +11299,48 @@ <_> <_> - 10 15 8 3 -1. + 10 12 2 8 -1. <_> - 14 15 4 3 2. + 10 12 1 4 2. + <_> + 11 16 1 4 2. 0 <_> <_> - 10 16 3 2 -1. + 10 15 4 3 -1. <_> - 11 16 1 2 3. + 10 16 4 1 3. + 0 + <_> + + <_> + 10 15 6 6 -1. + <_> + 10 17 6 2 3. + 0 + <_> + + <_> + 10 16 6 8 -1. + <_> + 10 16 3 4 2. + <_> + 13 20 3 4 2. + 0 + <_> + + <_> + 10 16 4 2 -1. + <_> + 10 17 4 1 2. + 0 + <_> + + <_> + 10 16 4 3 -1. + <_> + 10 17 4 1 3. 0 <_> @@ -10515,18 +11352,23 @@ <_> <_> - 10 18 12 2 -1. + 10 17 5 3 -1. <_> - 10 18 6 1 2. - <_> - 16 19 6 1 2. + 10 18 5 1 3. 0 <_> <_> - 10 20 3 2 -1. + 10 18 5 3 -1. <_> - 11 20 1 2 3. + 10 19 5 1 3. + 0 + <_> + + <_> + 10 19 5 3 -1. + <_> + 10 20 5 1 3. 0 <_> @@ -10549,13 +11391,6 @@ <_> 10 21 4 1 3. 0 - <_> - - <_> - 10 20 4 4 -1. - <_> - 10 22 4 2 2. - 0 <_> <_> @@ -10566,27 +11401,9 @@ <_> <_> - 10 20 5 4 -1. + 10 21 3 1 -1. <_> - 10 22 5 2 2. - 0 - <_> - - <_> - 10 20 10 4 -1. - <_> - 10 20 5 2 2. - <_> - 15 22 5 2 2. - 0 - <_> - - <_> - 10 20 14 4 -1. - <_> - 10 20 7 2 2. - <_> - 17 22 7 2 2. + 11 21 1 1 3. 0 <_> @@ -10598,16 +11415,23 @@ <_> <_> - 10 21 2 2 -1. + 10 21 6 3 -1. <_> - 10 22 2 1 2. + 12 21 2 3 3. 0 <_> <_> - 10 21 14 2 -1. + 10 21 5 2 -1. <_> - 17 21 7 2 2. + 10 22 5 1 2. + 0 + <_> + + <_> + 10 22 3 1 -1. + <_> + 11 22 1 1 3. 0 <_> @@ -10619,51 +11443,30 @@ <_> <_> - 11 1 3 7 -1. + 11 0 2 12 -1. <_> - 12 1 1 7 3. + 11 4 2 4 3. 0 <_> <_> - 11 1 6 1 -1. + 11 0 12 19 -1. <_> - 13 1 2 1 3. + 15 0 4 19 3. 0 <_> <_> - 11 1 4 15 -1. + 11 2 4 20 -1. <_> - 13 1 2 15 2. + 13 2 2 20 2. 0 <_> <_> - 11 2 3 4 -1. + 11 3 3 3 -1. <_> - 12 2 1 4 3. - 0 - <_> - - <_> - 11 2 2 12 -1. - <_> - 12 2 1 12 2. - 0 - <_> - - <_> - 11 2 2 13 -1. - <_> - 12 2 1 13 2. - 0 - <_> - - <_> - 11 3 1 3 -1. - <_> - 11 4 1 1 3. + 12 3 1 3 3. 0 <_> @@ -10672,6 +11475,13 @@ <_> 12 3 1 5 3. 0 + <_> + + <_> + 11 3 3 6 -1. + <_> + 12 3 1 6 3. + 0 <_> <_> @@ -10682,23 +11492,16 @@ <_> <_> - 11 3 6 12 -1. + 11 3 2 3 -1. <_> - 13 3 2 12 3. + 11 4 2 1 3. 0 <_> <_> - 11 3 4 13 -1. + 11 3 12 14 -1. <_> - 13 3 2 13 2. - 0 - <_> - - <_> - 11 3 9 2 -1. - <_> - 14 3 3 2 3. + 15 3 4 14 3. 0 <_> @@ -10707,6 +11510,20 @@ <_> 12 4 1 5 3. 0 + <_> + + <_> + 11 4 2 3 -1. + <_> + 11 5 2 1 3. + 0 + <_> + + <_> + 11 4 9 1 -1. + <_> + 14 4 3 1 3. + 0 <_> <_> @@ -10717,37 +11534,9 @@ <_> <_> - 11 5 3 3 -1. + 11 5 8 4 -1. <_> - 12 5 1 3 3. - 0 - <_> - - <_> - 11 5 3 4 -1. - <_> - 12 5 1 4 3. - 0 - <_> - - <_> - 11 5 4 10 -1. - <_> - 13 5 2 10 2. - 0 - <_> - - <_> - 11 5 4 3 -1. - <_> - 11 6 4 1 3. - 0 - <_> - - <_> - 11 6 1 3 -1. - <_> - 11 7 1 1 3. + 11 7 8 2 2. 0 <_> @@ -10756,27 +11545,6 @@ <_> 11 7 2 1 3. 0 - <_> - - <_> - 11 6 6 5 -1. - <_> - 13 6 2 5 3. - 0 - <_> - - <_> - 11 6 3 3 -1. - <_> - 11 7 3 1 3. - 0 - <_> - - <_> - 11 6 9 11 -1. - <_> - 14 6 3 11 3. - 0 <_> <_> @@ -10784,13 +11552,6 @@ <_> 11 7 4 1 3. 0 - <_> - - <_> - 11 6 5 3 -1. - <_> - 11 7 5 1 3. - 0 <_> <_> @@ -10798,6 +11559,15 @@ <_> 11 8 1 1 3. 0 + <_> + + <_> + 11 7 2 2 -1. + <_> + 11 7 1 1 2. + <_> + 12 8 1 1 2. + 0 <_> <_> @@ -10808,9 +11578,18 @@ <_> <_> - 11 7 5 3 -1. + 11 7 4 2 -1. <_> - 11 8 5 1 3. + 11 7 2 1 2. + <_> + 13 8 2 1 2. + 0 + <_> + + <_> + 11 7 4 3 -1. + <_> + 11 8 4 1 3. 0 <_> @@ -10819,6 +11598,13 @@ <_> 11 9 1 1 3. 0 + <_> + + <_> + 11 8 1 10 -1. + <_> + 11 13 1 5 2. + 0 <_> <_> @@ -10836,18 +11622,25 @@ <_> <_> - 11 9 2 2 -1. + 11 8 8 8 -1. <_> - 11 9 1 1 2. + 11 8 4 4 2. <_> - 12 10 1 1 2. + 15 12 4 4 2. 0 <_> <_> - 11 9 3 3 -1. + 11 8 7 10 -1. <_> - 11 10 3 1 3. + 11 13 7 5 2. + 0 + <_> + + <_> + 11 9 6 6 -1. + <_> + 13 9 2 6 3. 0 <_> @@ -10856,13 +11649,6 @@ <_> 11 10 4 1 3. 0 - <_> - - <_> - 11 10 1 3 -1. - <_> - 11 11 1 1 3. - 0 <_> <_> @@ -10873,11 +11659,25 @@ <_> <_> - 11 10 8 2 -1. + 11 10 6 8 -1. <_> - 11 10 4 1 2. + 11 10 3 4 2. <_> - 15 11 4 1 2. + 14 14 3 4 2. + 0 + <_> + + <_> + 11 10 4 3 -1. + <_> + 11 11 4 1 3. + 0 + <_> + + <_> + 11 10 5 3 -1. + <_> + 11 11 5 1 3. 0 <_> @@ -10889,69 +11689,32 @@ <_> <_> - 11 12 6 3 -1. + 11 11 10 10 -1. <_> - 13 12 2 3 3. + 11 11 5 5 2. + <_> + 16 16 5 5 2. 0 <_> <_> - 11 14 9 3 -1. + 11 13 6 2 -1. <_> - 14 14 3 3 3. + 13 13 2 2 3. 0 <_> <_> - 11 16 3 3 -1. + 11 14 2 9 -1. <_> - 11 17 3 1 3. + 11 17 2 3 3. 0 <_> <_> - 11 18 5 6 -1. + 11 15 1 2 -1. <_> - 11 20 5 2 3. - 0 - <_> - - <_> - 11 18 12 6 -1. - <_> - 11 18 6 3 2. - <_> - 17 21 6 3 2. - 0 - <_> - - <_> - 11 19 2 4 -1. - <_> - 11 21 2 2 2. - 0 - <_> - - <_> - 11 19 12 4 -1. - <_> - 11 19 6 2 2. - <_> - 17 21 6 2 2. - 0 - <_> - - <_> - 11 20 3 2 -1. - <_> - 12 20 1 2 3. - 0 - <_> - - <_> - 11 20 3 3 -1. - <_> - 12 20 1 3 3. + 11 16 1 1 2. 0 <_> @@ -10963,18 +11726,30 @@ <_> <_> - 11 21 3 1 -1. + 11 20 3 3 -1. <_> - 12 21 1 1 3. + 11 21 3 1 3. 0 <_> <_> - 11 21 2 2 -1. + 11 21 2 1 -1. <_> - 11 21 1 1 2. + 12 21 1 1 2. + 0 + <_> + <_> - 12 22 1 1 2. + 11 21 3 2 -1. + <_> + 12 21 1 2 3. + 0 + <_> + + <_> + 11 21 2 3 -1. + <_> + 12 21 1 3 2. 0 <_> @@ -10983,13 +11758,6 @@ <_> 11 22 3 1 2. 0 - <_> - - <_> - 11 22 3 1 -1. - <_> - 12 22 1 1 3. - 0 <_> <_> @@ -11000,106 +11768,127 @@ <_> <_> - 12 0 12 1 -1. + 12 0 8 12 -1. <_> - 18 0 6 1 2. + 12 0 4 6 2. + <_> + 16 6 4 6 2. 0 <_> <_> - 12 0 12 10 -1. + 12 0 12 6 -1. <_> - 12 0 6 5 2. + 12 0 6 3 2. <_> - 18 5 6 5 2. + 18 3 6 3 2. 0 <_> <_> - 12 0 12 12 -1. + 12 1 1 3 -1. <_> - 12 0 6 6 2. - <_> - 18 6 6 6 2. + 12 2 1 1 3. 0 <_> <_> - 12 1 2 12 -1. + 12 1 2 7 -1. <_> - 13 1 1 12 2. + 13 1 1 7 2. 0 <_> <_> - 12 1 6 7 -1. + 12 1 12 4 -1. <_> - 14 1 2 7 3. + 12 1 6 2 2. + <_> + 18 3 6 2 2. 0 <_> <_> - 12 1 6 15 -1. + 12 2 3 3 -1. <_> - 14 1 2 15 3. + 13 2 1 3 3. 0 <_> <_> - 12 1 9 13 -1. + 12 2 3 7 -1. <_> - 15 1 3 13 3. + 13 2 1 7 3. 0 <_> <_> - 12 2 9 4 -1. + 12 2 6 1 -1. <_> - 15 2 3 4 3. + 14 2 2 1 3. 0 <_> <_> - 12 3 6 1 -1. + 12 2 6 4 -1. <_> - 14 3 2 1 3. + 14 2 2 4 3. 0 <_> <_> - 12 3 6 9 -1. + 12 2 6 18 -1. <_> - 14 3 2 9 3. + 12 8 6 6 3. 0 <_> <_> - 12 3 6 3 -1. + 12 3 6 11 -1. <_> - 12 4 6 1 3. + 14 3 2 11 3. 0 <_> <_> - 12 4 2 6 -1. + 12 3 9 3 -1. <_> - 13 4 1 6 2. + 15 3 3 3 3. 0 <_> <_> - 12 4 8 6 -1. + 12 3 12 3 -1. <_> - 12 4 4 3 2. - <_> - 16 7 4 3 2. + 12 4 12 1 3. 0 <_> <_> - 12 5 3 3 -1. + 12 4 2 12 -1. <_> - 12 6 3 1 3. + 13 4 1 12 2. + 0 + <_> + + <_> + 12 4 2 3 -1. + <_> + 12 5 2 1 3. + 0 + <_> + + <_> + 12 5 3 5 -1. + <_> + 13 5 1 5 3. + 0 + <_> + + <_> + 12 5 4 3 -1. + <_> + 12 6 4 1 3. 0 <_> @@ -11108,6 +11897,22 @@ <_> 12 7 1 1 3. 0 + <_> + + <_> + 12 6 2 3 -1. + <_> + 12 7 2 1 3. + 0 + <_> + + <_> + 12 6 8 4 -1. + <_> + 12 6 4 2 2. + <_> + 16 8 4 2 2. + 0 <_> <_> @@ -11125,16 +11930,9 @@ <_> <_> - 12 7 3 3 -1. + 12 8 1 3 -1. <_> - 12 8 3 1 3. - 0 - <_> - - <_> - 12 7 4 3 -1. - <_> - 12 8 4 1 3. + 12 9 1 1 3. 0 <_> @@ -11143,6 +11941,13 @@ <_> 12 9 3 1 3. 0 + <_> + + <_> + 12 8 4 3 -1. + <_> + 12 9 4 1 3. + 0 <_> <_> @@ -11153,41 +11958,11 @@ <_> <_> - 12 9 2 3 -1. + 12 10 2 12 -1. <_> - 12 10 2 1 3. - 0 - <_> - + 12 10 1 6 2. <_> - 12 9 4 6 -1. - <_> - 12 9 2 3 2. - <_> - 14 12 2 3 2. - 0 - <_> - - <_> - 12 9 6 7 -1. - <_> - 14 9 2 7 3. - 0 - <_> - - <_> - 12 9 6 6 -1. - <_> - 12 9 3 3 2. - <_> - 15 12 3 3 2. - 0 - <_> - - <_> - 12 10 6 2 -1. - <_> - 14 10 2 2 3. + 13 16 1 6 2. 0 <_> @@ -11198,6 +11973,20 @@ <_> 14 15 2 5 2. 0 + <_> + + <_> + 12 11 2 3 -1. + <_> + 12 12 2 1 3. + 0 + <_> + + <_> + 12 11 4 4 -1. + <_> + 14 11 2 4 2. + 0 <_> <_> @@ -11210,61 +11999,18 @@ <_> <_> - 12 11 6 10 -1. + 12 15 6 5 -1. <_> - 12 11 3 5 2. - <_> - 15 16 3 5 2. + 14 15 2 5 3. 0 <_> <_> - 12 11 8 8 -1. + 12 15 10 4 -1. <_> - 12 11 4 4 2. + 12 15 5 2 2. <_> - 16 15 4 4 2. - 0 - <_> - - <_> - 12 12 9 3 -1. - <_> - 15 12 3 3 3. - 0 - <_> - - <_> - 12 12 10 8 -1. - <_> - 12 12 5 4 2. - <_> - 17 16 5 4 2. - 0 - <_> - - <_> - 12 13 4 8 -1. - <_> - 12 13 2 4 2. - <_> - 14 17 2 4 2. - 0 - <_> - - <_> - 12 14 3 7 -1. - <_> - 13 14 1 7 3. - 0 - <_> - - <_> - 12 14 8 4 -1. - <_> - 12 14 4 2 2. - <_> - 16 16 4 2 2. + 17 17 5 2 2. 0 <_> @@ -11276,16 +12022,27 @@ <_> <_> - 12 19 3 5 -1. + 12 17 3 3 -1. <_> - 13 19 1 5 3. + 13 17 1 3 3. 0 <_> <_> - 12 20 3 4 -1. + 12 17 8 6 -1. <_> - 13 20 1 4 3. + 12 17 4 3 2. + <_> + 16 20 4 3 2. + 0 + <_> + + <_> + 12 18 12 6 -1. + <_> + 12 18 6 3 2. + <_> + 18 21 6 3 2. 0 <_> @@ -11297,30 +12054,9 @@ <_> <_> - 12 22 3 2 -1. + 13 0 11 14 -1. <_> - 13 22 1 2 3. - 0 - <_> - - <_> - 13 0 1 10 -1. - <_> - 13 5 1 5 2. - 0 - <_> - - <_> - 13 1 2 12 -1. - <_> - 14 1 1 12 2. - 0 - <_> - - <_> - 13 1 6 8 -1. - <_> - 15 1 2 8 3. + 13 7 11 7 2. 0 <_> @@ -11329,15 +12065,6 @@ <_> 14 2 1 3 2. 0 - <_> - - <_> - 13 2 2 6 -1. - <_> - 13 2 1 3 2. - <_> - 14 5 1 3 2. - 0 <_> <_> @@ -11348,32 +12075,37 @@ <_> <_> - 13 3 2 4 -1. + 13 3 3 3 -1. <_> - 13 3 1 2 2. - <_> - 14 5 1 2 2. + 14 3 1 3 3. 0 <_> <_> - 13 3 6 8 -1. + 13 3 6 1 -1. <_> - 15 3 2 8 3. + 15 3 2 1 3. 0 <_> <_> - 13 4 6 9 -1. + 13 4 1 2 -1. <_> - 15 4 2 9 3. + 13 5 1 1 2. 0 <_> <_> - 13 5 3 5 -1. + 13 4 3 7 -1. <_> - 14 5 1 5 3. + 14 4 1 7 3. + 0 + <_> + + <_> + 13 4 3 8 -1. + <_> + 14 4 1 8 3. 0 <_> @@ -11385,32 +12117,51 @@ <_> <_> - 13 6 2 3 -1. + 13 6 1 3 -1. <_> - 13 7 2 1 3. + 13 7 1 1 3. 0 <_> <_> - 13 7 2 4 -1. + 13 7 6 6 -1. <_> - 14 7 1 4 2. + 15 7 2 6 3. 0 <_> <_> - 13 8 2 3 -1. + 13 7 3 3 -1. <_> - 13 9 2 1 3. + 13 8 3 1 3. 0 <_> <_> 13 8 6 8 -1. <_> - 13 8 3 4 2. + 15 8 2 8 3. + 0 + <_> + <_> - 16 12 3 4 2. + 13 9 3 4 -1. + <_> + 14 9 1 4 3. + 0 + <_> + + <_> + 13 9 4 3 -1. + <_> + 15 9 2 3 2. + 0 + <_> + + <_> + 13 9 6 4 -1. + <_> + 15 9 2 4 3. 0 <_> @@ -11422,9 +12173,9 @@ <_> <_> - 13 10 3 1 -1. + 13 9 9 2 -1. <_> - 14 10 1 1 3. + 13 10 9 1 2. 0 <_> @@ -11436,25 +12187,18 @@ <_> <_> - 13 10 2 3 -1. + 13 10 4 1 -1. <_> - 13 11 2 1 3. + 15 10 2 1 2. 0 <_> <_> - 13 10 4 8 -1. + 13 10 4 4 -1. <_> - 13 10 2 4 2. + 13 10 2 2 2. <_> - 15 14 2 4 2. - 0 - <_> - - <_> - 13 10 9 1 -1. - <_> - 16 10 3 1 3. + 15 12 2 2 2. 0 <_> @@ -11466,53 +12210,76 @@ <_> <_> - 13 11 4 2 -1. + 13 11 3 3 -1. <_> - 13 11 2 1 2. - <_> - 15 12 2 1 2. + 13 12 3 1 3. 0 <_> <_> - 13 15 6 1 -1. + 13 12 3 3 -1. <_> - 15 15 2 1 3. + 13 13 3 1 3. 0 <_> <_> - 13 17 8 1 -1. + 13 13 2 6 -1. <_> - 17 17 4 1 2. + 13 13 1 3 2. + <_> + 14 16 1 3 2. 0 <_> <_> - 13 19 3 5 -1. + 13 15 2 5 -1. <_> - 14 19 1 5 3. + 14 15 1 5 2. 0 <_> <_> - 13 20 3 2 -1. + 13 19 3 3 -1. <_> - 14 20 1 2 3. + 14 19 1 3 3. 0 <_> <_> - 13 21 3 3 -1. + 13 20 3 3 -1. <_> - 14 21 1 3 3. + 14 20 1 3 3. 0 <_> <_> - 14 0 1 2 -1. + 13 22 3 2 -1. <_> - 14 1 1 1 2. + 14 22 1 2 3. + 0 + <_> + + <_> + 14 0 1 10 -1. + <_> + 14 5 1 5 2. + 0 + <_> + + <_> + 14 0 2 7 -1. + <_> + 15 0 1 7 2. + 0 + <_> + + <_> + 14 0 2 22 -1. + <_> + 14 0 1 11 2. + <_> + 15 11 1 11 2. 0 <_> @@ -11526,58 +12293,71 @@ <_> <_> - 14 1 1 8 -1. + 14 0 10 8 -1. <_> - 14 5 1 4 2. + 14 0 5 4 2. + <_> + 19 4 5 4 2. 0 <_> <_> - 14 2 3 8 -1. + 14 0 10 12 -1. <_> - 15 2 1 8 3. + 14 0 5 6 2. + <_> + 19 6 5 6 2. 0 <_> <_> - 14 2 3 12 -1. + 14 1 2 2 -1. <_> - 15 2 1 12 3. + 15 1 1 2 2. 0 <_> <_> - 14 2 7 3 -1. + 14 1 4 4 -1. <_> - 14 3 7 1 3. + 14 3 4 2 2. 0 <_> <_> - 14 3 6 3 -1. + 14 1 10 2 -1. <_> - 14 4 6 1 3. + 19 1 5 2 2. 0 <_> <_> - 14 4 1 4 -1. + 14 2 6 7 -1. <_> - 14 6 1 2 2. + 16 2 2 7 3. 0 <_> <_> - 14 4 3 6 -1. + 14 3 2 4 -1. <_> - 15 4 1 6 3. + 14 3 1 2 2. + <_> + 15 5 1 2 2. 0 <_> <_> - 14 4 3 7 -1. + 14 4 3 3 -1. <_> - 15 4 1 7 3. + 15 4 1 3 3. + 0 + <_> + + <_> + 14 4 6 1 -1. + <_> + 16 4 2 1 3. 0 <_> @@ -11586,27 +12366,6 @@ <_> 14 5 3 1 3. 0 - <_> - - <_> - 14 4 7 3 -1. - <_> - 14 5 7 1 3. - 0 - <_> - - <_> - 14 4 8 3 -1. - <_> - 14 5 8 1 3. - 0 - <_> - - <_> - 14 4 10 6 -1. - <_> - 14 6 10 2 3. - 0 <_> <_> @@ -11624,46 +12383,95 @@ <_> <_> - 14 5 3 4 -1. + 14 5 4 2 -1. <_> - 15 5 1 4 3. + 16 5 2 2 2. 0 <_> <_> - 14 5 2 6 -1. + 14 5 3 10 -1. <_> - 15 5 1 6 2. + 14 10 3 5 2. 0 <_> <_> - 14 5 3 6 -1. + 14 5 4 6 -1. <_> - 15 5 1 6 3. + 14 7 4 2 3. 0 <_> <_> - 14 5 5 6 -1. + 14 6 3 2 -1. <_> - 14 7 5 2 3. + 15 6 1 2 3. 0 <_> <_> - 14 7 6 16 -1. + 14 6 3 4 -1. <_> - 16 7 2 16 3. + 15 6 1 4 3. 0 <_> <_> - 14 8 2 6 -1. + 14 6 2 6 -1. <_> - 14 8 1 3 2. + 15 6 1 6 2. + 0 + <_> + <_> - 15 11 1 3 2. + 14 6 6 2 -1. + <_> + 16 6 2 2 3. + 0 + <_> + + <_> + 14 6 6 17 -1. + <_> + 16 6 2 17 3. + 0 + <_> + + <_> + 14 8 2 13 -1. + <_> + 15 8 1 13 2. + 0 + <_> + + <_> + 14 8 4 6 -1. + <_> + 14 10 4 2 3. + 0 + <_> + + <_> + 14 9 2 2 -1. + <_> + 15 9 1 2 2. + 0 + <_> + + <_> + 14 9 3 2 -1. + <_> + 15 9 1 2 3. + 0 + <_> + + <_> + 14 9 2 4 -1. + <_> + 14 9 1 2 2. + <_> + 15 11 1 2 2. 0 <_> @@ -11672,15 +12480,6 @@ <_> 15 9 1 3 2. 0 - <_> - - <_> - 14 9 2 8 -1. - <_> - 14 9 1 4 2. - <_> - 15 13 1 4 2. - 0 <_> <_> @@ -11691,9 +12490,16 @@ <_> <_> - 14 9 9 2 -1. + 14 9 6 1 -1. <_> - 14 10 9 1 2. + 16 9 2 1 3. + 0 + <_> + + <_> + 14 9 9 9 -1. + <_> + 14 12 9 3 3. 0 <_> @@ -11709,6 +12515,15 @@ <_> 15 10 1 1 3. 0 + <_> + + <_> + 14 10 2 2 -1. + <_> + 14 10 1 1 2. + <_> + 15 11 1 1 2. + 0 <_> <_> @@ -11726,9 +12541,9 @@ <_> <_> - 14 10 2 3 -1. + 14 10 3 3 -1. <_> - 15 10 1 3 2. + 15 10 1 3 3. 0 <_> @@ -11742,69 +12557,143 @@ <_> <_> - 14 10 2 8 -1. + 14 12 6 2 -1. <_> - 14 10 1 4 2. - <_> - 15 14 1 4 2. + 16 12 2 2 3. 0 <_> <_> - 14 13 3 8 -1. + 14 12 6 5 -1. <_> - 15 13 1 8 3. + 16 12 2 5 3. 0 <_> <_> - 14 18 8 6 -1. + 14 14 8 6 -1. <_> - 14 18 4 3 2. + 14 14 4 3 2. <_> - 18 21 4 3 2. + 18 17 4 3 2. 0 <_> <_> - 14 22 3 2 -1. + 14 14 10 10 -1. <_> - 15 22 1 2 3. + 14 14 5 5 2. + <_> + 19 19 5 5 2. 0 <_> <_> - 15 0 3 11 -1. + 14 16 10 8 -1. <_> - 16 0 1 11 3. + 14 16 5 4 2. + <_> + 19 20 5 4 2. 0 <_> <_> - 15 2 4 4 -1. + 14 18 8 4 -1. <_> - 15 4 4 2 2. + 14 18 4 2 2. + <_> + 18 20 4 2 2. 0 <_> <_> - 15 3 2 3 -1. + 14 19 3 4 -1. <_> - 15 4 2 1 3. + 15 19 1 4 3. 0 <_> <_> - 15 4 2 9 -1. + 14 19 3 5 -1. <_> - 16 4 1 9 2. + 15 19 1 5 3. 0 <_> <_> - 15 4 6 6 -1. + 14 20 3 4 -1. <_> - 15 6 6 2 3. + 15 20 1 4 3. + 0 + <_> + + <_> + 14 23 3 1 -1. + <_> + 15 23 1 1 3. + 0 + <_> + + <_> + 15 0 8 1 -1. + <_> + 19 0 4 1 2. + 0 + <_> + + <_> + 15 0 8 2 -1. + <_> + 19 0 4 2 2. + 0 + <_> + + <_> + 15 2 2 10 -1. + <_> + 16 2 1 10 2. + 0 + <_> + + <_> + 15 2 6 7 -1. + <_> + 17 2 2 7 3. + 0 + <_> + + <_> + 15 2 5 3 -1. + <_> + 15 3 5 1 3. + 0 + <_> + + <_> + 15 4 2 6 -1. + <_> + 16 4 1 6 2. + 0 + <_> + + <_> + 15 4 2 8 -1. + <_> + 16 4 1 8 2. + 0 + <_> + + <_> + 15 4 6 8 -1. + <_> + 18 4 3 8 2. + 0 + <_> + + <_> + 15 4 8 3 -1. + <_> + 15 5 8 1 3. 0 <_> @@ -11813,6 +12702,13 @@ <_> 16 5 1 2 2. 0 + <_> + + <_> + 15 5 3 2 -1. + <_> + 16 5 1 2 3. + 0 <_> <_> @@ -11823,30 +12719,53 @@ <_> <_> - 15 6 3 1 -1. + 15 5 3 6 -1. <_> - 16 6 1 1 3. + 16 5 1 6 3. 0 <_> <_> - 15 6 3 8 -1. + 15 6 3 18 -1. <_> - 15 10 3 4 2. + 15 12 3 6 3. 0 <_> <_> - 15 7 4 6 -1. + 15 6 6 7 -1. <_> - 15 9 4 2 3. + 18 6 3 7 2. 0 <_> <_> - 15 7 6 3 -1. + 15 6 8 4 -1. <_> - 15 8 6 1 3. + 15 6 4 2 2. + <_> + 19 8 4 2 2. + 0 + <_> + + <_> + 15 7 3 6 -1. + <_> + 15 9 3 2 3. + 0 + <_> + + <_> + 15 7 5 4 -1. + <_> + 15 9 5 2 2. + 0 + <_> + + <_> + 15 7 5 6 -1. + <_> + 15 9 5 2 3. 0 <_> @@ -11881,37 +12800,48 @@ <_> <_> - 15 9 1 10 -1. + 15 8 2 4 -1. <_> - 15 14 1 5 2. + 15 8 1 2 2. + <_> + 16 10 1 2 2. 0 <_> <_> - 15 9 3 5 -1. + 15 8 1 12 -1. <_> - 16 9 1 5 3. + 15 14 1 6 2. 0 <_> <_> - 15 9 6 4 -1. + 15 9 2 2 -1. <_> - 18 9 3 4 2. + 15 9 1 1 2. + <_> + 16 10 1 1 2. 0 <_> <_> - 15 9 3 15 -1. + 15 9 3 4 -1. <_> - 15 14 3 5 3. + 16 9 1 4 3. 0 <_> <_> - 15 9 6 3 -1. + 15 9 2 3 -1. <_> - 15 10 6 1 3. + 15 10 2 1 3. + 0 + <_> + + <_> + 15 9 7 3 -1. + <_> + 15 10 7 1 3. 0 <_> @@ -11937,67 +12867,39 @@ <_> <_> - 15 10 3 3 -1. + 15 10 3 5 -1. <_> - 15 11 3 1 3. + 16 10 1 5 3. 0 <_> <_> - 15 11 3 2 -1. + 15 12 4 8 -1. <_> - 15 12 3 1 2. + 15 12 2 4 2. + <_> + 17 16 2 4 2. 0 <_> <_> - 15 11 3 12 -1. + 15 15 4 3 -1. <_> - 15 15 3 4 3. + 15 16 4 1 3. 0 <_> <_> - 15 11 9 6 -1. + 15 16 5 3 -1. <_> - 15 13 9 2 3. + 15 17 5 1 3. 0 <_> <_> - 15 14 2 10 -1. + 15 19 3 4 -1. <_> - 15 19 2 5 2. - 0 - <_> - - <_> - 15 14 8 3 -1. - <_> - 19 14 4 3 2. - 0 - <_> - - <_> - 15 14 5 3 -1. - <_> - 15 15 5 1 3. - 0 - <_> - - <_> - 15 16 6 8 -1. - <_> - 15 16 3 4 2. - <_> - 18 20 3 4 2. - 0 - <_> - - <_> - 15 17 7 3 -1. - <_> - 15 18 7 1 3. + 16 19 1 4 3. 0 <_> @@ -12006,6 +12908,13 @@ <_> 15 20 9 1 3. 0 + <_> + + <_> + 15 20 6 3 -1. + <_> + 18 20 3 3 2. + 0 <_> <_> @@ -12020,6 +12929,15 @@ <_> 20 0 4 2 2. 0 + <_> + + <_> + 16 0 8 4 -1. + <_> + 16 0 4 2 2. + <_> + 20 2 4 2 2. + 0 <_> <_> @@ -12050,50 +12968,60 @@ <_> <_> - 16 3 2 4 -1. + 16 1 4 13 -1. <_> - 16 3 1 2 2. - <_> - 17 5 1 2 2. + 18 1 2 13 2. 0 <_> <_> - 16 3 7 3 -1. + 16 2 3 2 -1. <_> - 16 4 7 1 3. + 17 2 1 2 3. 0 <_> <_> - 16 4 2 9 -1. + 16 3 2 3 -1. <_> - 16 7 2 3 3. + 16 4 2 1 3. 0 <_> <_> - 16 5 4 10 -1. + 16 4 1 3 -1. <_> - 16 5 2 5 2. - <_> - 18 10 2 5 2. + 16 5 1 1 3. 0 <_> <_> - 16 5 8 6 -1. + 16 4 2 2 -1. <_> - 16 5 4 3 2. + 16 4 1 1 2. <_> - 20 8 4 3 2. + 17 5 1 1 2. 0 <_> <_> - 16 6 2 6 -1. + 16 5 2 3 -1. <_> - 16 8 2 2 3. + 17 5 1 3 2. + 0 + <_> + + <_> + 16 6 2 9 -1. + <_> + 16 9 2 3 3. + 0 + <_> + + <_> + 16 6 4 4 -1. + <_> + 18 6 2 4 2. 0 <_> @@ -12105,16 +13033,9 @@ <_> <_> - 16 6 6 6 -1. + 16 6 7 6 -1. <_> - 16 8 6 2 3. - 0 - <_> - - <_> - 16 7 1 3 -1. - <_> - 16 8 1 1 3. + 16 8 7 2 3. 0 <_> @@ -12123,27 +13044,6 @@ <_> 16 9 1 2 3. 0 - <_> - - <_> - 16 7 3 16 -1. - <_> - 17 7 1 16 3. - 0 - <_> - - <_> - 16 7 4 1 -1. - <_> - 18 7 2 1 2. - 0 - <_> - - <_> - 16 7 2 2 -1. - <_> - 16 8 2 1 2. - 0 <_> <_> @@ -12151,13 +13051,6 @@ <_> 16 8 2 1 3. 0 - <_> - - <_> - 16 7 4 2 -1. - <_> - 18 7 2 2 2. - 0 <_> <_> @@ -12168,16 +13061,9 @@ <_> <_> - 16 7 2 15 -1. + 16 7 3 2 -1. <_> - 16 12 2 5 3. - 0 - <_> - - <_> - 16 7 4 6 -1. - <_> - 18 7 2 6 2. + 16 8 3 1 2. 0 <_> @@ -12193,6 +13079,22 @@ <_> 16 9 3 2 3. 0 + <_> + + <_> + 16 7 6 4 -1. + <_> + 16 7 3 2 2. + <_> + 19 9 3 2 2. + 0 + <_> + + <_> + 16 7 4 3 -1. + <_> + 16 8 4 1 3. + 0 <_> <_> @@ -12216,13 +13118,6 @@ <_> 17 9 1 1 2. 0 - <_> - - <_> - 16 8 2 5 -1. - <_> - 17 8 1 5 2. - 0 <_> <_> @@ -12233,18 +13128,18 @@ <_> <_> - 16 8 6 2 -1. + 16 8 8 2 -1. <_> - 16 8 3 1 2. + 16 8 4 1 2. <_> - 19 9 3 1 2. + 20 9 4 1 2. 0 <_> <_> - 16 8 6 3 -1. + 16 9 3 1 -1. <_> - 16 9 6 1 3. + 17 9 1 1 3. 0 <_> @@ -12256,9 +13151,46 @@ <_> <_> - 16 9 6 3 -1. + 16 9 2 3 -1. <_> - 16 10 6 1 3. + 17 9 1 3 2. + 0 + <_> + + <_> + 16 9 4 1 -1. + <_> + 18 9 2 1 2. + 0 + <_> + + <_> + 16 9 2 2 -1. + <_> + 16 10 2 1 2. + 0 + <_> + + <_> + 16 9 4 4 -1. + <_> + 18 9 2 4 2. + 0 + <_> + + <_> + 16 9 6 6 -1. + <_> + 16 9 3 3 2. + <_> + 19 12 3 3 2. + 0 + <_> + + <_> + 16 10 1 2 -1. + <_> + 16 11 1 1 2. 0 <_> @@ -12267,6 +13199,36 @@ <_> 16 11 1 1 3. 0 + <_> + + <_> + 16 10 2 2 -1. + <_> + 16 10 1 1 2. + <_> + 17 11 1 1 2. + 0 + <_> + + <_> + 16 10 2 2 -1. + <_> + 17 10 1 2 2. + 0 + <_> + + <_> + 16 10 2 5 -1. + <_> + 17 10 1 5 2. + 0 + <_> + + <_> + 16 10 3 13 -1. + <_> + 17 10 1 13 3. + 0 <_> <_> @@ -12277,25 +13239,16 @@ <_> <_> - 16 10 6 2 -1. + 16 10 3 3 -1. <_> - 16 10 3 1 2. - <_> - 19 11 3 1 2. + 16 11 3 1 3. 0 <_> <_> - 16 10 4 2 -1. + 16 11 1 2 -1. <_> - 16 11 4 1 2. - 0 - <_> - - <_> - 16 10 6 4 -1. - <_> - 16 12 6 2 2. + 16 12 1 1 2. 0 <_> @@ -12321,138 +13274,65 @@ <_> <_> - 16 11 3 3 -1. + 16 13 3 3 -1. <_> - 16 12 3 1 3. + 16 14 3 1 3. 0 <_> <_> - 16 11 4 2 -1. + 16 14 4 1 -1. <_> - 16 12 4 1 2. + 18 14 2 1 2. 0 <_> <_> - 16 11 8 6 -1. + 16 15 4 3 -1. <_> - 16 11 4 3 2. - <_> - 20 14 4 3 2. + 18 15 2 3 2. 0 <_> <_> - 16 12 4 8 -1. + 16 15 6 2 -1. <_> - 16 12 2 4 2. - <_> - 18 16 2 4 2. + 19 15 3 2 2. 0 <_> <_> - 16 13 2 2 -1. + 16 15 8 3 -1. <_> - 16 13 1 1 2. - <_> - 17 14 1 1 2. + 20 15 4 3 2. 0 <_> <_> - 16 13 4 6 -1. + 16 16 4 1 -1. <_> - 16 13 2 3 2. - <_> - 18 16 2 3 2. + 18 16 2 1 2. 0 <_> <_> - 16 13 8 8 -1. + 16 17 3 7 -1. <_> - 20 13 4 8 2. + 17 17 1 7 3. 0 <_> <_> - 16 14 8 5 -1. + 16 17 6 3 -1. <_> - 20 14 4 5 2. + 16 18 6 1 3. 0 <_> <_> - 16 15 4 4 -1. + 16 19 3 4 -1. <_> - 18 15 2 4 2. - 0 - <_> - - <_> - 16 15 4 8 -1. - <_> - 16 15 2 4 2. - <_> - 18 19 2 4 2. - 0 - <_> - - <_> - 16 15 3 3 -1. - <_> - 16 16 3 1 3. - 0 - <_> - - <_> - 16 15 6 3 -1. - <_> - 19 15 3 3 2. - 0 - <_> - - <_> - 16 16 3 3 -1. - <_> - 16 17 3 1 3. - 0 - <_> - - <_> - 16 18 3 3 -1. - <_> - 17 18 1 3 3. - 0 - <_> - - <_> - 16 18 3 6 -1. - <_> - 17 18 1 6 3. - 0 - <_> - - <_> - 16 20 3 4 -1. - <_> - 17 20 1 4 3. - 0 - <_> - - <_> - 16 22 3 1 -1. - <_> - 17 22 1 1 3. - 0 - <_> - - <_> - 17 0 1 8 -1. - <_> - 17 4 1 4 2. + 17 19 1 4 3. 0 <_> @@ -12464,9 +13344,9 @@ <_> <_> - 17 2 3 3 -1. + 17 2 1 4 -1. <_> - 18 2 1 3 3. + 17 4 1 2 2. 0 <_> @@ -12478,9 +13358,39 @@ <_> <_> - 17 3 4 15 -1. + 17 3 3 2 -1. <_> - 17 8 4 5 3. + 18 3 1 2 3. + 0 + <_> + + <_> + 17 3 2 8 -1. + <_> + 17 3 1 4 2. + <_> + 18 7 1 4 2. + 0 + <_> + + <_> + 17 3 3 3 -1. + <_> + 17 4 3 1 3. + 0 + <_> + + <_> + 17 4 1 3 -1. + <_> + 17 5 1 1 3. + 0 + <_> + + <_> + 17 4 2 2 -1. + <_> + 18 4 1 2 2. 0 <_> @@ -12494,9 +13404,18 @@ <_> <_> - 17 5 1 9 -1. + 17 6 1 6 -1. <_> - 17 8 1 3 3. + 17 8 1 2 3. + 0 + <_> + + <_> + 17 6 4 8 -1. + <_> + 17 6 2 4 2. + <_> + 19 10 2 4 2. 0 <_> @@ -12508,9 +13427,9 @@ <_> <_> - 17 6 4 3 -1. + 17 6 5 3 -1. <_> - 17 7 4 1 3. + 17 7 5 1 3. 0 <_> @@ -12529,9 +13448,11 @@ <_> <_> - 17 7 2 2 -1. + 17 7 2 6 -1. <_> - 17 8 2 1 2. + 17 7 1 3 2. + <_> + 18 10 1 3 2. 0 <_> @@ -12543,46 +13464,9 @@ <_> <_> - 17 7 2 6 -1. + 17 8 6 4 -1. <_> - 17 9 2 2 3. - 0 - <_> - - <_> - 17 7 3 3 -1. - <_> - 17 8 3 1 3. - 0 - <_> - - <_> - 17 8 1 3 -1. - <_> - 17 9 1 1 3. - 0 - <_> - - <_> - 17 8 2 2 -1. - <_> - 17 8 1 1 2. - <_> - 18 9 1 1 2. - 0 - <_> - - <_> - 17 8 1 4 -1. - <_> - 17 10 1 2 2. - 0 - <_> - - <_> - 17 8 5 14 -1. - <_> - 17 15 5 7 2. + 17 10 6 2 2. 0 <_> @@ -12594,16 +13478,34 @@ <_> <_> - 17 9 1 4 -1. + 17 9 2 6 -1. <_> - 17 11 1 2 2. + 17 9 1 3 2. + <_> + 18 12 1 3 2. 0 <_> <_> - 17 9 4 6 -1. + 17 9 4 2 -1. <_> - 17 11 4 2 3. + 17 9 2 1 2. + <_> + 19 10 2 1 2. + 0 + <_> + + <_> + 17 9 3 2 -1. + <_> + 17 10 3 1 2. + 0 + <_> + + <_> + 17 9 5 3 -1. + <_> + 17 10 5 1 3. 0 <_> @@ -12622,23 +13524,25 @@ <_> <_> - 17 10 3 14 -1. + 17 10 2 2 -1. <_> - 18 10 1 14 3. + 17 10 1 1 2. + <_> + 18 11 1 1 2. 0 <_> <_> - 17 10 4 1 -1. + 17 10 2 4 -1. <_> - 19 10 2 1 2. + 18 10 1 4 2. 0 <_> <_> - 17 10 2 3 -1. + 17 10 3 4 -1. <_> - 17 11 2 1 3. + 18 10 1 4 3. 0 <_> @@ -12652,9 +13556,9 @@ <_> <_> - 17 10 6 5 -1. + 17 11 1 3 -1. <_> - 20 10 3 5 2. + 17 12 1 1 3. 0 <_> @@ -12673,23 +13577,25 @@ <_> <_> - 17 11 3 11 -1. + 17 11 2 2 -1. <_> - 18 11 1 11 3. + 17 12 2 1 2. 0 <_> <_> - 17 11 3 4 -1. + 17 11 4 2 -1. <_> - 17 13 3 2 2. + 17 11 2 1 2. + <_> + 19 12 2 1 2. 0 <_> <_> - 17 12 3 1 -1. + 17 12 3 2 -1. <_> - 18 12 1 1 3. + 18 12 1 2 3. 0 <_> @@ -12701,85 +13607,107 @@ <_> <_> - 17 15 4 1 -1. + 17 14 2 3 -1. <_> - 19 15 2 1 2. + 17 15 2 1 3. 0 <_> <_> - 17 15 4 3 -1. + 17 14 4 2 -1. <_> - 19 15 2 3 2. + 19 14 2 2 2. 0 <_> <_> - 17 16 4 1 -1. + 17 15 4 2 -1. <_> - 19 16 2 1 2. + 19 15 2 2 2. 0 <_> <_> - 17 18 7 3 -1. + 17 16 4 3 -1. <_> - 17 19 7 1 3. + 19 16 2 3 2. 0 <_> <_> - 17 20 3 4 -1. + 17 17 3 7 -1. <_> - 18 20 1 4 3. + 18 17 1 7 3. 0 <_> <_> - 18 0 3 4 -1. + 17 19 3 4 -1. <_> - 19 0 1 4 3. + 18 19 1 4 3. 0 <_> <_> - 18 0 6 12 -1. + 17 21 3 3 -1. <_> - 18 0 3 6 2. - <_> - 21 6 3 6 2. + 18 21 1 3 3. 0 <_> <_> - 18 0 6 14 -1. + 18 0 4 1 -1. <_> - 18 0 3 7 2. - <_> - 21 7 3 7 2. + 20 0 2 1 2. 0 <_> <_> - 18 3 3 3 -1. + 18 0 6 1 -1. <_> - 19 3 1 3 3. + 21 0 3 1 2. 0 <_> <_> - 18 3 2 9 -1. + 18 0 6 4 -1. <_> - 18 6 2 3 3. + 21 0 3 4 2. 0 <_> <_> - 18 4 2 2 -1. + 18 1 1 12 -1. <_> - 18 4 1 1 2. + 18 5 1 4 3. + 0 + <_> + <_> - 19 5 1 1 2. + 18 2 3 3 -1. + <_> + 19 2 1 3 3. + 0 + <_> + + <_> + 18 3 3 2 -1. + <_> + 19 3 1 2 3. + 0 + <_> + + <_> + 18 3 1 9 -1. + <_> + 18 6 1 3 3. + 0 + <_> + + <_> + 18 3 3 4 -1. + <_> + 19 3 1 4 3. 0 <_> @@ -12791,18 +13719,16 @@ <_> <_> - 18 4 4 3 -1. + 18 4 3 4 -1. <_> - 18 5 4 1 3. + 19 4 1 4 3. 0 <_> <_> - 18 5 2 2 -1. + 18 5 6 15 -1. <_> - 18 5 1 1 2. - <_> - 19 6 1 1 2. + 21 5 3 15 2. 0 <_> @@ -12821,16 +13747,9 @@ <_> <_> - 18 6 5 3 -1. + 18 6 4 3 -1. <_> - 18 7 5 1 3. - 0 - <_> - - <_> - 18 7 1 2 -1. - <_> - 18 8 1 1 2. + 18 7 4 1 3. 0 <_> @@ -12851,21 +13770,7 @@ <_> 18 7 3 2 -1. <_> - 19 7 1 2 3. - 0 - <_> - - <_> - 18 7 2 3 -1. - <_> - 18 8 2 1 3. - 0 - <_> - - <_> - 18 7 3 3 -1. - <_> - 18 8 3 1 3. + 18 8 3 1 2. 0 <_> @@ -12874,6 +13779,15 @@ <_> 18 9 1 1 3. 0 + <_> + + <_> + 18 8 2 2 -1. + <_> + 18 8 1 1 2. + <_> + 19 9 1 1 2. + 0 <_> <_> @@ -12884,9 +13798,9 @@ <_> <_> - 18 8 6 8 -1. + 18 8 3 14 -1. <_> - 21 8 3 8 2. + 18 15 3 7 2. 0 <_> @@ -12911,20 +13825,6 @@ <_> 19 9 1 2 3. 0 - <_> - - <_> - 18 9 4 2 -1. - <_> - 20 9 2 2 2. - 0 - <_> - - <_> - 18 9 3 9 -1. - <_> - 18 12 3 3 3. - 0 <_> <_> @@ -12944,9 +13844,9 @@ <_> <_> - 18 10 2 8 -1. + 18 10 2 2 -1. <_> - 18 14 2 4 2. + 18 11 2 1 2. 0 <_> @@ -12955,6 +13855,13 @@ <_> 21 10 3 4 2. 0 + <_> + + <_> + 18 10 6 5 -1. + <_> + 21 10 3 5 2. + 0 <_> <_> @@ -12965,72 +13872,102 @@ <_> <_> - 18 11 3 12 -1. + 18 11 3 6 -1. <_> - 19 11 1 12 3. + 19 11 1 6 3. 0 <_> <_> - 18 12 3 3 -1. + 18 11 3 9 -1. <_> - 19 12 1 3 3. + 19 11 1 9 3. 0 <_> <_> - 18 12 6 1 -1. + 18 11 3 8 -1. <_> - 21 12 3 1 2. + 18 15 3 4 2. 0 <_> <_> - 18 12 3 6 -1. + 18 12 3 4 -1. <_> - 18 15 3 3 2. + 19 12 1 4 3. 0 <_> <_> - 18 15 1 3 -1. + 18 12 2 6 -1. <_> - 18 16 1 1 3. + 18 15 2 3 2. 0 <_> <_> - 18 15 6 5 -1. + 18 12 6 2 -1. <_> - 21 15 3 5 2. + 21 12 3 2 2. 0 <_> <_> - 18 16 4 2 -1. + 18 12 3 12 -1. <_> - 20 16 2 2 2. + 18 16 3 4 3. 0 <_> <_> - 18 17 3 6 -1. + 18 13 3 1 -1. <_> - 19 17 1 6 3. + 19 13 1 1 3. 0 <_> <_> - 18 18 3 5 -1. + 18 14 6 6 -1. <_> - 19 18 1 5 3. + 21 14 3 6 2. 0 <_> <_> - 19 0 3 1 -1. + 18 20 3 4 -1. <_> - 20 0 1 1 3. + 19 20 1 4 3. + 0 + <_> + + <_> + 18 20 6 3 -1. + <_> + 18 21 6 1 3. + 0 + <_> + + <_> + 19 2 2 4 -1. + <_> + 19 2 1 2 2. + <_> + 20 4 1 2 2. + 0 + <_> + + <_> + 19 4 1 4 -1. + <_> + 19 6 1 2 2. + 0 + <_> + + <_> + 19 4 1 20 -1. + <_> + 19 14 1 10 2. 0 <_> @@ -13039,6 +13976,13 @@ <_> 19 6 2 2 2. 0 + <_> + + <_> + 19 4 4 3 -1. + <_> + 19 5 4 1 3. + 0 <_> <_> @@ -13062,6 +14006,48 @@ <_> 19 7 2 1 3. 0 + <_> + + <_> + 19 6 5 3 -1. + <_> + 19 7 5 1 3. + 0 + <_> + + <_> + 19 6 5 9 -1. + <_> + 19 9 5 3 3. + 0 + <_> + + <_> + 19 7 1 12 -1. + <_> + 19 11 1 4 3. + 0 + <_> + + <_> + 19 7 2 3 -1. + <_> + 19 8 2 1 3. + 0 + <_> + + <_> + 19 8 1 3 -1. + <_> + 19 9 1 1 3. + 0 + <_> + + <_> + 19 8 2 3 -1. + <_> + 20 8 1 3 2. + 0 <_> <_> @@ -13072,9 +14058,18 @@ <_> <_> - 19 10 3 14 -1. + 19 9 3 2 -1. <_> - 20 10 1 14 3. + 20 9 1 2 3. + 0 + <_> + + <_> + 19 10 2 2 -1. + <_> + 19 10 1 1 2. + <_> + 20 11 1 1 2. 0 <_> @@ -13086,37 +14081,51 @@ <_> <_> - 19 11 3 12 -1. + 19 11 3 7 -1. <_> - 20 11 1 12 3. + 20 11 1 7 3. 0 <_> <_> - 19 12 3 10 -1. + 19 11 3 10 -1. <_> - 20 12 1 10 3. + 20 11 1 10 3. 0 <_> <_> - 19 13 3 1 -1. + 19 11 3 11 -1. <_> - 20 13 1 1 3. + 20 11 1 11 3. 0 <_> <_> - 19 17 3 7 -1. + 19 11 3 13 -1. <_> - 20 17 1 7 3. + 20 11 1 13 3. 0 <_> <_> - 19 18 3 5 -1. + 19 14 3 10 -1. <_> - 20 18 1 5 3. + 20 14 1 10 3. + 0 + <_> + + <_> + 19 15 3 2 -1. + <_> + 19 16 3 1 2. + 0 + <_> + + <_> + 19 18 3 3 -1. + <_> + 20 18 1 3 3. 0 <_> @@ -13128,32 +14137,30 @@ <_> <_> - 19 20 4 3 -1. + 19 20 5 3 -1. <_> - 19 21 4 1 3. + 19 21 5 1 3. 0 <_> <_> - 20 1 4 4 -1. + 20 4 1 3 -1. <_> - 22 1 2 4 2. + 20 5 1 1 3. 0 <_> <_> - 20 4 2 3 -1. + 20 5 1 2 -1. <_> - 20 5 2 1 3. + 20 6 1 1 2. 0 <_> <_> - 20 5 2 2 -1. + 20 5 1 3 -1. <_> - 20 5 1 1 2. - <_> - 21 6 1 1 2. + 20 6 1 1 3. 0 <_> @@ -13165,93 +14172,107 @@ <_> <_> - 20 11 4 3 -1. + 20 5 3 9 -1. <_> - 20 12 4 1 3. + 20 8 3 3 3. 0 <_> <_> - 20 12 3 8 -1. + 20 6 4 9 -1. <_> - 21 12 1 8 3. + 20 9 4 3 3. 0 <_> <_> - 20 12 3 11 -1. + 20 8 4 16 -1. <_> - 21 12 1 11 3. + 22 8 2 16 2. 0 <_> <_> - 20 12 3 12 -1. + 20 9 4 6 -1. <_> - 21 12 1 12 3. + 20 11 4 2 3. 0 <_> <_> - 20 18 3 1 -1. + 20 10 3 10 -1. <_> - 21 18 1 1 3. + 21 10 1 10 3. 0 <_> <_> - 21 4 1 3 -1. + 20 10 3 9 -1. <_> - 21 5 1 1 3. + 20 13 3 3 3. 0 <_> <_> - 21 9 3 3 -1. + 20 16 3 3 -1. <_> - 21 10 3 1 3. + 21 16 1 3 3. 0 <_> <_> - 21 9 3 6 -1. + 20 17 3 7 -1. <_> - 21 11 3 2 3. + 21 17 1 7 3. 0 <_> <_> - 21 10 2 4 -1. + 20 17 4 6 -1. <_> - 21 12 2 2 2. + 20 19 4 2 3. 0 <_> <_> - 21 12 3 9 -1. + 20 18 3 3 -1. <_> - 22 12 1 9 3. + 21 18 1 3 3. 0 <_> <_> - 21 13 3 11 -1. + 21 1 2 4 -1. <_> - 22 13 1 11 3. + 21 3 2 2 2. 0 <_> <_> - 21 15 3 4 -1. + 21 5 1 3 -1. <_> - 22 15 1 4 3. + 21 6 1 1 3. 0 <_> <_> - 21 15 3 9 -1. + 21 6 3 9 -1. <_> - 22 15 1 9 3. + 21 9 3 3 3. + 0 + <_> + + <_> + 21 10 3 3 -1. + <_> + 21 11 3 1 3. + 0 + <_> + + <_> + 21 13 3 7 -1. + <_> + 22 13 1 7 3. 0 <_> @@ -13263,23 +14284,44 @@ <_> <_> - 21 16 3 8 -1. + 21 16 3 7 -1. <_> - 22 16 1 8 3. + 22 16 1 7 3. 0 <_> <_> - 21 20 3 4 -1. + 21 17 3 5 -1. <_> - 22 20 1 4 3. + 22 17 1 5 3. 0 <_> <_> - 21 22 3 2 -1. + 21 17 3 6 -1. <_> - 22 22 1 2 3. + 21 19 3 2 3. + 0 + <_> + + <_> + 21 17 3 6 -1. + <_> + 21 20 3 3 2. + 0 + <_> + + <_> + 21 19 3 3 -1. + <_> + 22 19 1 3 3. + 0 + <_> + + <_> + 21 19 3 5 -1. + <_> + 22 19 1 5 3. 0 <_> @@ -13291,16 +14333,23 @@ <_> <_> - 22 12 2 12 -1. + 22 11 2 3 -1. <_> - 22 16 2 4 3. + 22 12 2 1 3. 0 <_> <_> - 22 20 2 3 -1. + 23 7 1 3 -1. <_> - 22 21 2 1 3. + 23 8 1 1 3. + 0 + <_> + + <_> + 23 9 1 3 -1. + <_> + 23 10 1 1 3. 0 <_> @@ -13312,8 +14361,22 @@ <_> <_> - 23 17 1 6 -1. + 23 14 1 9 -1. <_> - 23 19 1 2 3. + 23 17 1 3 3. + 0 + <_> + + <_> + 23 15 1 9 -1. + <_> + 23 18 1 3 3. + 0 + <_> + + <_> + 23 18 1 6 -1. + <_> + 23 20 1 2 3. 0 diff --git a/data/haarcascades/haarcascade_frontalcatface_extended.xml b/data/haarcascades/haarcascade_frontalcatface_extended.xml old mode 100644 new mode 100755 index 0777644517..ccee995f73 --- a/data/haarcascades/haarcascade_frontalcatface_extended.xml +++ b/data/haarcascades/haarcascade_frontalcatface_extended.xml @@ -22,15 +22,20 @@ KNOWN LIMITATIONS: - Sometimes, the detector mistakenly thinks that a human face is a cat face. In - situations where either a human or a cat might be encountered, use both a - human face detector and a cat face detector. Then, if a detected human face - and a detected cat face intersect, reject the cat face. - An upright subject is assumed. In situations where the cat's face might be sideways or upside down (e.g. the cat is rolling over), try various rotations of the input image. + CHANGELOG: + + 2016-08-06: Re-trained with more negative samples and more stages. False + positives are much rarer now. If you tailored your code for the cascade's + previous version, now you should re-adjust the arguments of + CascadeClassifier::detectMultiScale. For example, decrease the value of the + minNeighbors argument. You do not need to use a human face detector to + cross-check the positives anymore. + 2014-04-25: First release (at https://bitbucket.org/Joe_Howse/angora-blue) + ////////////////////////////////////////////////////////////////////////// | Contributors License Agreement | IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. @@ -39,7 +44,7 @@ | If you do not agree to this license, do not download, install, | copy or use the software. | - | Copyright (c) 2014, Joseph Howse (Nummist Media Corporation Limited, + | Copyright (c) 2014-2016, Joseph Howse (Nummist Media Corporation Limited, | Halifax, Nova Scotia, Canada). All rights reserved. | | Redistribution and use in source and binary forms, with or without @@ -77,7 +82,7 @@ 24 GAB - 9.9900001287460327e-01 + 9.9500000476837158e-01 5.0000000000000000e-01 9.4999999999999996e-01 1 @@ -86,5564 +91,6036 @@ 0 1 ALL - 15 + 20 <_> - 28 - -2.0972909927368164e+00 + 13 + -1.4294912815093994e+00 <_> - 0 -1 388 -1.4772760681807995e-02 + 0 -1 394 -1.5126220881938934e-02 - 8.4035199880599976e-01 -1.2701500952243805e-01 + 7.5887596607208252e-01 -3.4230688214302063e-01 <_> - 0 -1 736 4.5831585302948952e-03 + 0 -1 737 3.9337221533060074e-03 - -2.3791725933551788e-01 6.1978793144226074e-01 + -3.3288389444351196e-01 5.2361363172531128e-01 <_> - 0 -1 754 -1.5044892206788063e-02 + 0 -1 757 -1.5044892206788063e-02 - 5.7160794734954834e-01 -2.0493283867835999e-01 + 5.5565774440765381e-01 -2.2505992650985718e-01 <_> - 0 -1 437 -1.5646889805793762e-02 + 0 -1 450 -1.5777055174112320e-02 - 7.6283878087997437e-01 -1.6358052194118500e-01 + 7.2692525386810303e-01 -1.6206762194633484e-01 <_> - 0 -1 432 3.0781796202063560e-02 + 0 -1 443 3.0781796202063560e-02 - -1.8158669769763947e-01 7.5050812959671021e-01 + -1.8173390626907349e-01 7.3483395576477051e-01 <_> - 0 -1 238 1.8483418971300125e-02 + 0 -1 220 1.8483418971300125e-02 - -2.0087972283363342e-01 5.2843624353408813e-01 + -1.8690711259841919e-01 5.0116515159606934e-01 <_> - 0 -1 680 1.3191045261919498e-02 + 0 -1 681 1.3474167324602604e-02 - -1.5244702994823456e-01 5.8166426420211792e-01 + -1.5681208670139313e-01 5.8611637353897095e-01 <_> - 0 -1 531 5.3334265947341919e-02 + 0 -1 554 5.3415738046169281e-02 - -1.6860350966453552e-01 7.1358704566955566e-01 + -1.6418528556823730e-01 6.8128466606140137e-01 <_> - 0 -1 782 8.3916599396616220e-04 + 0 -1 741 5.4243900813162327e-03 - -2.1746076643466949e-01 4.2143425345420837e-01 + -1.8231739103794098e-01 4.6716138720512390e-01 <_> - 0 -1 333 1.7697989940643311e-02 + 0 -1 336 1.7689792439341545e-02 - -1.3514791429042816e-01 6.1385941505432129e-01 + -1.3713267445564270e-01 6.0434049367904663e-01 <_> - 0 -1 290 -2.8310909867286682e-02 + 0 -1 187 2.2149257711134851e-04 - 5.3606474399566650e-01 -1.5554395318031311e-01 + -2.7738124132156372e-01 2.8165665268898010e-01 <_> - 0 -1 147 4.1034919559024274e-04 + 0 -1 288 -2.8517641127109528e-02 - -2.8903219103813171e-01 3.1018218398094177e-01 + 5.5257320404052734e-01 -1.2970162928104401e-01 <_> - 0 -1 537 3.9831817150115967e-02 + 0 -1 369 4.3854981660842896e-02 - -1.8419378995895386e-01 4.3500679731369019e-01 - <_> - - 0 -1 558 -5.2749719470739365e-03 - - -8.7773287296295166e-01 1.1703799664974213e-01 - <_> - - 0 -1 811 -3.6777660250663757e-02 - - 4.1285938024520874e-01 -2.1606418490409851e-01 - <_> - - 0 -1 324 9.4376102089881897e-02 - - -1.0109311342239380e-01 6.0879749059677124e-01 - <_> - - 0 -1 564 -1.6132533550262451e-02 - - 5.1245921850204468e-01 -1.5503944456577301e-01 - <_> - - 0 -1 507 -6.9251265376806259e-03 - - 4.2284211516380310e-01 -1.5949958562850952e-01 - <_> - - 0 -1 882 -8.4776207804679871e-03 - - 4.0007081627845764e-01 -1.6089719533920288e-01 - <_> - - 0 -1 110 -9.0452972799539566e-03 - - -7.6785671710968018e-01 9.3979701399803162e-02 - <_> - - 0 -1 246 3.0019454658031464e-02 - - -1.3505084812641144e-01 4.7249373793601990e-01 - <_> - - 0 -1 804 3.6142929457128048e-03 - - 8.1217512488365173e-02 -7.7168470621109009e-01 - <_> - - 0 -1 806 -4.7642881982028484e-03 - - -7.8209573030471802e-01 6.2777772545814514e-02 - <_> - - 0 -1 816 3.0351843684911728e-02 - - -1.1295587569475174e-01 5.8056473731994629e-01 - <_> - - 0 -1 146 -5.9288680553436279e-02 - - 5.5029523372650146e-01 -1.1994160711765289e-01 - <_> - - 0 -1 11 2.2238820791244507e-02 - - -1.4121483266353607e-01 4.5770901441574097e-01 - <_> - - 0 -1 294 -4.1477128863334656e-02 - - 5.7035386562347412e-01 -1.0164763778448105e-01 - <_> - - 0 -1 710 -1.1866136919707060e-03 - - 3.4064662456512451e-01 -1.6186751425266266e-01 + -1.9231440126895905e-01 4.2093500494956970e-01 <_> - 30 - -1.5367478132247925e+00 + 27 + -1.5509251356124878e+00 <_> - 0 -1 654 8.4006171673536301e-03 + 0 -1 337 2.4014184251427650e-02 - -1.0249307751655579e-01 7.6660197973251343e-01 + -2.1038578450679779e-01 7.3892170190811157e-01 <_> - 0 -1 443 -1.0703811421990395e-02 + 0 -1 475 -5.5319909006357193e-03 - 6.9929075241088867e-01 -1.6515852510929108e-01 + 4.4344031810760498e-01 -2.8907662630081177e-01 <_> - 0 -1 1 6.3192001543939114e-03 + 0 -1 4 2.7481060475111008e-02 - -2.2415910661220551e-01 4.3903940916061401e-01 + -1.9128543138504028e-01 5.1661676168441772e-01 <_> - 0 -1 651 2.0642649382352829e-02 + 0 -1 457 -1.1628001928329468e-02 - -1.8032769858837128e-01 5.8923733234405518e-01 + 5.1978123188018799e-01 -1.7051684856414795e-01 <_> - 0 -1 378 4.0111690759658813e-03 + 0 -1 393 1.5159824397414923e-03 - -2.4117745459079742e-01 5.4825514554977417e-01 + -2.9784303903579712e-01 3.9050224423408508e-01 <_> - 0 -1 173 2.0640484988689423e-02 + 0 -1 901 1.3662670738995075e-02 - -2.4204613268375397e-01 4.0820708870887756e-01 + -1.4316783845424652e-01 4.4111710786819458e-01 <_> - 0 -1 116 -9.2923976480960846e-03 + 0 -1 780 -3.6911026109009981e-03 - 3.6315548419952393e-01 -2.0153710246086121e-01 + 3.2185173034667969e-01 -2.3853960633277893e-01 <_> - 0 -1 851 3.5129714757204056e-02 + 0 -1 769 3.3176485449075699e-02 - -1.3475686311721802e-01 6.5953320264816284e-01 + -7.4603199958801270e-02 7.5860917568206787e-01 <_> - 0 -1 333 2.0278891548514366e-02 + 0 -1 317 -5.7046953588724136e-03 - -1.0143157839775085e-01 5.9142571687698364e-01 + -7.5004047155380249e-01 1.0240622609853745e-01 <_> - 0 -1 737 6.4985908102244139e-04 + 0 -1 73 7.9660946503281593e-03 - -1.9716840982437134e-01 3.4134888648986816e-01 + 9.8882928490638733e-02 -7.3491615056991577e-01 <_> - 0 -1 287 -6.6223340108990669e-03 + 0 -1 739 3.0965393409132957e-02 - -6.9885939359664917e-01 9.7095526754856110e-02 + -1.6046196222305298e-01 4.5570060610771179e-01 <_> - 0 -1 82 7.4231177568435669e-03 + 0 -1 612 -4.0078125894069672e-03 - 9.8552420735359192e-02 -6.5358603000640869e-01 + -7.1539020538330078e-01 6.9276176393032074e-02 <_> - 0 -1 692 -3.0081106349825859e-02 + 0 -1 647 -8.2283765077590942e-03 - 4.5352721214294434e-01 -1.4968612790107727e-01 + 3.2576236128807068e-01 -1.8509653210639954e-01 <_> - 0 -1 62 -6.0633812099695206e-02 + 0 -1 170 3.4253271296620369e-03 - 6.5072047710418701e-01 -9.9382333457469940e-02 + 1.0964145511388779e-01 -5.8205413818359375e-01 <_> - 0 -1 814 -5.1941806450486183e-03 + 0 -1 434 9.0980646200478077e-04 - 3.9397239685058594e-01 -1.6142791509628296e-01 + -2.0425215363502502e-01 2.7488732337951660e-01 <_> - 0 -1 261 6.0986238531768322e-03 + 0 -1 427 5.9772443026304245e-02 - 8.6411900818347931e-02 -7.3878693580627441e-01 + -1.3786207139492035e-01 4.0762668848037720e-01 <_> - 0 -1 108 -8.2402750849723816e-03 + 0 -1 209 -4.1712004691362381e-02 - -7.4236625432968140e-01 6.7853815853595734e-02 + 4.9409377574920654e-01 -1.1713714897632599e-01 <_> - 0 -1 908 -3.0396101996302605e-02 + 0 -1 248 -3.0311278998851776e-02 - 4.9337482452392578e-01 -1.3200622797012329e-01 + 5.1191121339797974e-01 -1.0507214814424515e-01 <_> - 0 -1 188 5.1566954702138901e-02 + 0 -1 339 -6.5785087645053864e-03 - -1.3631668686866760e-01 4.2621469497680664e-01 + -7.6472043991088867e-01 8.0923363566398621e-02 <_> - 0 -1 150 -9.3598978128284216e-04 + 0 -1 37 1.1685060337185860e-02 - 3.2463693618774414e-01 -2.0737074315547943e-01 + 5.0379037857055664e-02 -7.9744982719421387e-01 <_> - 0 -1 905 7.0394594222307205e-03 + 0 -1 423 6.5714016556739807e-02 - 8.9326366782188416e-02 -6.1088448762893677e-01 + -1.1398456245660782e-01 4.9489131569862366e-01 <_> - 0 -1 396 -6.5201576799154282e-03 + 0 -1 755 9.7422497346997261e-03 - 3.7555626034736633e-01 -1.5273806452751160e-01 + -1.4347794651985168e-01 3.6561754345893860e-01 <_> - 0 -1 103 3.9127394556999207e-03 + 0 -1 870 4.9857441335916519e-03 - 8.3254240453243256e-02 -7.3406547307968140e-01 + 7.9834438860416412e-02 -7.2391557693481445e-01 <_> - 0 -1 39 9.5308097079396248e-03 + 0 -1 735 -1.1547822505235672e-03 - -1.7045913636684418e-01 3.2230368256568909e-01 + 4.1867440938949585e-01 -1.2869183719158173e-01 <_> - 0 -1 796 1.5843525528907776e-02 + 0 -1 519 -4.4658007100224495e-03 - -1.4033445715904236e-01 3.9502236247062683e-01 + -6.7933702468872070e-01 8.2867160439491272e-02 <_> - 0 -1 555 5.9641832485795021e-03 + 0 -1 862 3.6325352266430855e-03 - 6.4340040087699890e-02 -8.5145986080169678e-01 + 6.6807270050048828e-02 -6.0182958841323853e-01 <_> - 0 -1 601 -4.8106643371284008e-03 + 0 -1 127 7.4123376980423927e-03 - -6.9040679931640625e-01 6.5658122301101685e-02 - <_> - - 0 -1 731 -9.3304895563051105e-04 - - 4.1242164373397827e-01 -1.4879603683948517e-01 - <_> - - 0 -1 779 4.1272714734077454e-03 - - -1.2624038755893707e-01 4.6513134241104126e-01 - <_> - - 0 -1 184 2.2929732222110033e-03 - - 1.0915581136941910e-01 -5.1519250869750977e-01 + -1.5108695626258850e-01 3.2046884298324585e-01 <_> - 44 - -1.6336240768432617e+00 + 26 + -1.3890913724899292e+00 <_> - 0 -1 334 2.5117650628089905e-02 + 0 -1 619 1.7836617305874825e-02 - 3.5861257463693619e-02 8.1681501865386963e-01 + -2.1508488059043884e-01 6.6796410083770752e-01 <_> - 0 -1 459 -6.6137146204710007e-03 + 0 -1 457 -8.5781915113329887e-03 - 4.6177890896797180e-01 -2.3009553551673889e-01 + 5.0962758064270020e-01 -2.2129471600055695e-01 <_> - 0 -1 394 -3.1423813197761774e-03 + 0 -1 165 3.1586211174726486e-02 - 4.0471413731575012e-01 -2.0868653059005737e-01 + -2.1485456824302673e-01 4.2591696977615356e-01 <_> - 0 -1 0 -3.7308693863451481e-03 + 0 -1 518 2.5690056383609772e-02 - 3.2831424474716187e-01 -2.6703229546546936e-01 + -1.5910078585147858e-01 6.7842948436737061e-01 <_> - 0 -1 178 7.8482955694198608e-02 + 0 -1 768 -2.2857591509819031e-02 - -1.5199472010135651e-01 4.6242395043373108e-01 + 5.7221925258636475e-01 -1.3710150122642517e-01 <_> - 0 -1 772 -2.6338286697864532e-03 + 0 -1 741 4.7176675871014595e-03 - 3.1739279627799988e-01 -2.3944588005542755e-01 + -2.3617559671401978e-01 3.9870622754096985e-01 <_> - 0 -1 75 9.2347152531147003e-02 + 0 -1 615 -2.3281413596123457e-03 - -1.5557752549648285e-01 6.0793381929397583e-01 + -7.0095318555831909e-01 1.3746888935565948e-01 <_> - 0 -1 315 -1.6786376014351845e-02 + 0 -1 139 1.0266102617606521e-03 - 5.2824962139129639e-01 -1.1138658970594406e-01 + -2.6873087882995605e-01 2.6495781540870667e-01 <_> - 0 -1 755 -3.8150474429130554e-02 + 0 -1 2 -7.6808528974652290e-03 - 4.3382674455642700e-01 -1.4826944470405579e-01 + 3.6925876140594482e-01 -2.1339643001556396e-01 <_> - 0 -1 318 4.3135927990078926e-03 + 0 -1 454 6.4357556402683258e-02 - 1.1878431588411331e-01 -5.8886390924453735e-01 + -1.1779088526964188e-01 5.5030888319015503e-01 <_> - 0 -1 412 7.1479372680187225e-02 + 0 -1 296 8.9486092329025269e-02 - -1.0972832888364792e-01 5.7183718681335449e-01 + -1.4395782351493835e-01 5.3468054533004761e-01 <_> - 0 -1 104 7.3613431304693222e-03 + 0 -1 253 -5.6334878318011761e-03 - 9.7729764878749847e-02 -6.5627050399780273e-01 + -6.5704786777496338e-01 1.3971389830112457e-01 <_> - 0 -1 414 5.1306895911693573e-02 + 0 -1 834 -8.0200601369142532e-03 - -1.6079875826835632e-01 4.0451571345329285e-01 + 3.6956611275672913e-01 -1.8284171819686890e-01 <_> - 0 -1 367 -4.7303801402449608e-03 + 0 -1 732 8.3984360098838806e-03 - -6.5826851129531860e-01 8.7291486561298370e-02 + -1.3507588207721710e-01 4.4903004169464111e-01 <_> - 0 -1 712 -1.8283914541825652e-03 + 0 -1 246 -5.7764705270528793e-03 - 3.7762144207954407e-01 -1.4564067125320435e-01 + -6.5459579229354858e-01 1.1050829291343689e-01 <_> - 0 -1 131 5.1737688481807709e-03 + 0 -1 630 3.9896301925182343e-02 - 8.7748050689697266e-02 -6.2685465812683105e-01 + -1.5822732448577881e-01 3.6069712042808533e-01 <_> - 0 -1 647 -3.2173446379601955e-03 + 0 -1 11 -6.8376958370208740e-02 - -7.3641878366470337e-01 5.7915702462196350e-02 + 6.2642019987106323e-01 -8.3647280931472778e-02 <_> - 0 -1 819 -5.4384516552090645e-03 + 0 -1 696 -2.7075063437223434e-02 - 4.2479231953620911e-01 -1.2763169407844543e-01 + 4.0549215674400330e-01 -1.4247153699398041e-01 <_> - 0 -1 159 2.6621888391673565e-03 + 0 -1 933 6.8107023835182190e-03 - -2.1836103498935699e-01 3.1271252036094666e-01 + 7.7754773199558258e-02 -6.4665120840072632e-01 <_> - 0 -1 125 1.2338031083345413e-02 + 0 -1 131 3.6659452598541975e-03 - 7.9128213226795197e-02 -8.1891500949859619e-01 + 7.9356946051120758e-02 -5.4679936170578003e-01 <_> - 0 -1 639 -1.0976660996675491e-02 + 0 -1 182 2.3308303207159042e-02 - 2.9887822270393372e-01 -1.8205311894416809e-01 + -1.4383231103420258e-01 3.4179633855819702e-01 <_> - 0 -1 646 1.4158659614622593e-03 + 0 -1 389 -3.2547116279602051e-02 - 8.9180864393711090e-02 -5.9163159132003784e-01 + 3.6395668983459473e-01 -1.2551946938037872e-01 <_> - 0 -1 141 -2.0067330449819565e-02 + 0 -1 471 1.6501296311616898e-02 - 2.6213398575782776e-01 -1.7981344461441040e-01 + -1.0674661397933960e-01 4.2714300751686096e-01 <_> - 0 -1 95 3.1120348721742630e-03 + 0 -1 616 -2.9296698048710823e-03 - 8.4207154810428619e-02 -5.7088595628738403e-01 + -5.7476091384887695e-01 8.5429534316062927e-02 <_> - 0 -1 121 -9.9351592361927032e-03 + 0 -1 828 1.3306898763403296e-03 - -7.2243571281433105e-01 5.1867216825485229e-02 + -1.2303277105093002e-01 3.7224721908569336e-01 <_> - 0 -1 198 1.3314767275005579e-03 + 0 -1 18 9.8933260887861252e-03 - -1.7091234028339386e-01 2.5805294513702393e-01 - <_> - - 0 -1 211 3.5102412104606628e-02 - - -1.1150742322206497e-01 4.2247176170349121e-01 - <_> - - 0 -1 780 2.4332102388143539e-02 - - -1.2760649621486664e-01 3.5613566637039185e-01 - <_> - - 0 -1 913 3.4916624426841736e-03 - - 7.4707798659801483e-02 -6.2106835842132568e-01 - <_> - - 0 -1 554 3.1960286200046539e-02 - - -8.5123799741268158e-02 5.5780071020126343e-01 - <_> - - 0 -1 210 2.5646466761827469e-02 - - 9.6616283059120178e-02 -4.8778736591339111e-01 - <_> - - 0 -1 65 4.8584854230284691e-03 - - 5.4295353591442108e-02 -6.2732213735580444e-01 - <_> - - 0 -1 525 -4.3544219806790352e-03 - - -5.7990497350692749e-01 5.8335512876510620e-02 - <_> - - 0 -1 818 1.5392700443044305e-03 - - -1.0273179411888123e-01 4.0286800265312195e-01 - <_> - - 0 -1 625 -3.5907807759940624e-03 - - -5.7972615957260132e-01 7.4733175337314606e-02 - <_> - - 0 -1 742 -2.6264857500791550e-02 - - 3.9446443319320679e-01 -1.1581628769636154e-01 - <_> - - 0 -1 458 1.6059044748544693e-02 - - -1.0167770087718964e-01 3.6267307400703430e-01 - <_> - - 0 -1 233 -4.1905373334884644e-02 - - 4.7364938259124756e-01 -8.8032789528369904e-02 - <_> - - 0 -1 42 2.0880695432424545e-02 - - -1.2106557935476303e-01 3.8552695512771606e-01 - <_> - - 0 -1 959 3.2229241915047169e-03 - - 6.9974288344383240e-02 -6.0391223430633545e-01 - <_> - - 0 -1 830 7.0135584101080894e-03 - - -1.0977950692176819e-01 3.7435680627822876e-01 - <_> - - 0 -1 798 -6.5330024808645248e-03 - - -6.9873285293579102e-01 5.8301825076341629e-02 - <_> - - 0 -1 766 -6.3728205859661102e-03 - - 2.4119727313518524e-01 -1.5554191172122955e-01 - <_> - - 0 -1 598 -3.9798039942979813e-03 - - 3.2675772905349731e-01 -1.1990765482187271e-01 + 6.7675270140171051e-02 -6.7935848236083984e-01 <_> - 48 - -1.6315091848373413e+00 + 31 + -1.4026626348495483e+00 <_> - 0 -1 398 -1.6997709870338440e-02 + 0 -1 876 -1.4927964657545090e-02 - 7.5603079795837402e-01 1.9442643970251083e-03 + 6.3834953308105469e-01 -1.8698258697986603e-01 <_> - 0 -1 858 -1.5086915343999863e-02 + 0 -1 467 -1.1759694665670395e-02 - 6.3829183578491211e-01 -1.4418891072273254e-01 + 5.0763273239135742e-01 -2.0944127440452576e-01 <_> - 0 -1 734 7.5988154858350754e-03 + 0 -1 775 1.1289508081972599e-02 - -1.6574914753437042e-01 4.6998679637908936e-01 + -1.4533838629722595e-01 5.3039866685867310e-01 <_> - 0 -1 440 -7.5363442301750183e-03 + 0 -1 335 1.3691024854779243e-02 - 4.4424122571945190e-01 -1.8298716843128204e-01 + -1.3143934309482574e-01 5.9853446483612061e-01 <_> - 0 -1 441 1.0129272937774658e-02 + 0 -1 399 -8.6051290854811668e-03 - -2.0301033556461334e-01 5.5256271362304688e-01 + 3.1604155898094177e-01 -2.2497664391994476e-01 <_> - 0 -1 732 3.0099015682935715e-02 + 0 -1 898 1.1611104011535645e-02 - -9.0159557759761810e-02 5.2430152893066406e-01 + -1.7180299758911133e-01 3.6340636014938354e-01 <_> - 0 -1 880 1.0154332034289837e-02 + 0 -1 919 5.4911419283598661e-04 - -2.1865487098693848e-01 3.7318554520606995e-01 + -2.0625770092010498e-01 3.0243906378746033e-01 <_> - 0 -1 753 -5.7211541570723057e-03 + 0 -1 448 -1.1997690424323082e-02 - 2.9541808366775513e-01 -2.3727707564830780e-01 + 6.7541980743408203e-01 -1.0784135758876801e-01 <_> - 0 -1 609 -2.3081460967659950e-03 + 0 -1 610 -2.0809918642044067e-03 - -6.5867960453033447e-01 8.6644835770130157e-02 + -5.7404327392578125e-01 1.1769672483205795e-01 <_> - 0 -1 892 3.4120366908609867e-03 + 0 -1 277 6.8656861782073975e-02 - 7.3793835937976837e-02 -6.1988431215286255e-01 + -1.4633083343505859e-01 4.1269731521606445e-01 <_> - 0 -1 423 1.1280932230874896e-03 + 0 -1 215 -4.5645810663700104e-02 - -1.7844060063362122e-01 2.9092252254486084e-01 + 5.4341620206832886e-01 -1.1726979166269302e-01 <_> - 0 -1 252 3.4356258809566498e-02 + 0 -1 890 -1.8052812665700912e-02 - -1.4515927433967590e-01 3.3726382255554199e-01 + 3.6646232008934021e-01 -1.3256482779979706e-01 <_> - 0 -1 583 4.2802840471267700e-02 + 0 -1 897 9.2329997569322586e-03 - -1.0719767957925797e-01 4.7673487663269043e-01 + 9.1808989644050598e-02 -6.4987671375274658e-01 <_> - 0 -1 395 -2.2776997648179531e-03 + 0 -1 142 -2.9587259050458670e-03 - 3.6087805032730103e-01 -1.2924250960350037e-01 + 2.4805040657520294e-01 -2.0830279588699341e-01 <_> - 0 -1 390 6.0573252849280834e-03 + 0 -1 151 -7.1467030793428421e-03 - 6.6139653325080872e-02 -7.4114394187927246e-01 + -6.6564339399337769e-01 8.8065519928932190e-02 <_> - 0 -1 271 -1.0843809694051743e-02 + 0 -1 756 -5.7738199830055237e-03 - 4.1086801886558533e-01 -1.3518220186233521e-01 + 2.4252247810363770e-01 -2.1394193172454834e-01 <_> - 0 -1 265 2.5435941293835640e-02 + 0 -1 207 6.4636822789907455e-03 - -1.2997664511203766e-01 3.8705968856811523e-01 + 8.4821723401546478e-02 -6.4125812053680420e-01 <_> - 0 -1 649 1.6918467590585351e-03 + 0 -1 527 -2.8782974928617477e-02 - 9.5908589661121368e-02 -6.5462106466293335e-01 + 3.5874211788177490e-01 -1.4370997250080109e-01 <_> - 0 -1 690 2.5078756734728813e-03 + 0 -1 715 -1.8174832221120596e-03 - 5.6727513670921326e-02 -6.1011266708374023e-01 + 3.7480926513671875e-01 -1.2761794030666351e-01 <_> - 0 -1 77 -1.0462226346135139e-02 + 0 -1 590 -1.9234847277402878e-03 - 3.6109340190887451e-01 -1.2214753031730652e-01 + -5.6678783893585205e-01 9.0299606323242188e-02 <_> - 0 -1 157 -1.6778277233242989e-02 + 0 -1 588 2.8048637323081493e-03 - -5.3534448146820068e-01 8.2928635179996490e-02 + 8.5870750248432159e-02 -5.8541411161422729e-01 <_> - 0 -1 831 -1.5040259808301926e-02 + 0 -1 178 7.0693701505661011e-02 - 2.8428143262863159e-01 -1.4685547351837158e-01 + -1.2318307906389236e-01 3.9827430248260498e-01 <_> - 0 -1 907 -6.6617773845791817e-03 + 0 -1 554 6.2659628689289093e-02 - -5.6624877452850342e-01 7.8970976173877716e-02 + -9.1229990124702454e-02 5.0639665126800537e-01 <_> - 0 -1 695 8.1638405099511147e-03 + 0 -1 321 -3.7420655135065317e-03 - -1.6379712522029877e-01 2.6822853088378906e-01 + 3.5059738159179688e-01 -1.2444343417882919e-01 <_> - 0 -1 52 1.9468305632472038e-02 + 0 -1 273 6.8388320505619049e-03 - -1.2091565877199173e-01 3.3373209834098816e-01 + -1.0419095307588577e-01 4.5085826516151428e-01 <_> - 0 -1 164 -6.4643016085028648e-03 + 0 -1 76 7.1193519979715347e-03 - -6.3222587108612061e-01 6.6180422902107239e-02 + 9.1205865144729614e-02 -5.2279585599899292e-01 <_> - 0 -1 284 3.5924967378377914e-02 + 0 -1 791 -9.8787562455981970e-04 - -1.0186699032783508e-01 4.2578670382499695e-01 + 2.8105542063713074e-01 -1.5169830620288849e-01 <_> - 0 -1 354 1.6905765980482101e-02 + 0 -1 639 1.8099821172654629e-03 - -1.3217522203922272e-01 3.3241125941276550e-01 + 6.5428622066974640e-02 -6.9196063280105591e-01 <_> - 0 -1 515 5.7176817208528519e-03 + 0 -1 726 -6.0212425887584686e-03 - 6.6569112241268158e-02 -6.5681034326553345e-01 + -6.2636482715606689e-01 5.1543414592742920e-02 <_> - 0 -1 276 -1.0900674387812614e-03 + 0 -1 818 5.1644006744027138e-03 - 3.9689606428146362e-01 -1.1235479265451431e-01 + 6.3040286302566528e-02 -6.3455927371978760e-01 <_> - 0 -1 760 -2.3833939805626869e-02 + 0 -1 205 9.4506526365876198e-03 - 3.8570886850357056e-01 -1.0193232446908951e-01 - <_> - - 0 -1 344 -1.4802538789808750e-02 - - 3.4205844998359680e-01 -1.4262656867504120e-01 - <_> - - 0 -1 448 3.9707131683826447e-02 - - -9.5635637640953064e-02 4.4075250625610352e-01 - <_> - - 0 -1 547 6.4531993120908737e-03 - - 5.7593464851379395e-02 -7.0275545120239258e-01 - <_> - - 0 -1 922 -4.7811353579163551e-03 - - 2.7453303337097168e-01 -1.3652370870113373e-01 - <_> - - 0 -1 896 3.3349171280860901e-03 - - 5.8540347963571548e-02 -7.1738266944885254e-01 - <_> - - 0 -1 127 -1.0832921601831913e-02 - - -6.2031352519989014e-01 4.7055520117282867e-02 - <_> - - 0 -1 696 -3.5385387018322945e-03 - - 2.7126258611679077e-01 -1.3402579724788666e-01 - <_> - - 0 -1 785 -2.1408915519714355e-02 - - 3.6707195639610291e-01 -1.0640451312065125e-01 - <_> - - 0 -1 617 6.6339373588562012e-02 - - -1.0504902899265289e-01 3.3936560153961182e-01 - <_> - - 0 -1 581 2.2766939364373684e-03 - - 7.2598882019519806e-02 -5.3970605134963989e-01 - <_> - - 0 -1 626 1.6875732690095901e-03 - - 8.7735749781131744e-02 -4.0284165740013123e-01 - <_> - - 0 -1 623 8.4530832245945930e-03 - - -9.3997113406658173e-02 4.1698867082595825e-01 - <_> - - 0 -1 429 5.5649573914706707e-03 - - -8.7597280740737915e-02 3.8827970623970032e-01 - <_> - - 0 -1 429 -3.5470342263579369e-03 - - 3.3585703372955322e-01 -1.3658957183361053e-01 - <_> - - 0 -1 954 4.2132395319640636e-03 - - 7.2930902242660522e-02 -5.1745194196701050e-01 - <_> - - 0 -1 527 3.4532562131062150e-04 - - -1.7970138788223267e-01 2.1011430025100708e-01 - <_> - - 0 -1 828 -4.0376763790845871e-03 - - 2.7334249019622803e-01 -1.3640886545181274e-01 + -1.3443979620933533e-01 3.1506177783012390e-01 <_> - 57 - -1.5859905481338501e+00 + 38 + -1.4621645212173462e+00 <_> - 0 -1 376 -1.5983805060386658e-02 + 0 -1 383 -1.5925668179988861e-02 - 7.4085760116577148e-01 5.4202862083911896e-02 + 6.2127149105072021e-01 -1.8520653247833252e-01 <_> - 0 -1 654 1.4518834650516510e-02 + 0 -1 648 1.0260052047669888e-02 - -1.6582691669464111e-01 5.1249128580093384e-01 + -2.4736632406711578e-01 4.2336893081665039e-01 <_> - 0 -1 820 -1.0167414322495461e-02 + 0 -1 3 5.7025998830795288e-03 - 4.5000806450843811e-01 -1.3064502179622650e-01 + -2.3670144379138947e-01 3.3228391408920288e-01 <_> - 0 -1 493 2.7079641819000244e-02 + 0 -1 264 9.3164276331663132e-03 - -1.6735902428627014e-01 6.3848841190338135e-01 + -1.7946784198284149e-01 4.6311038732528687e-01 <_> - 0 -1 774 1.9515088060870767e-03 + 0 -1 830 -5.0438079051673412e-03 - -1.1798944324254990e-01 3.9749121665954590e-01 + 4.4613519310951233e-01 -1.6072992980480194e-01 <_> - 0 -1 332 1.3693260028958321e-02 + 0 -1 793 2.8381291776895523e-03 - -8.5312500596046448e-02 5.4718613624572754e-01 + -1.8486896157264709e-01 3.5892590880393982e-01 <_> - 0 -1 254 6.0192337259650230e-03 + 0 -1 455 6.7377656698226929e-02 - 5.7217631489038467e-02 -6.6589832305908203e-01 + -1.7760114371776581e-01 3.9539518952369690e-01 <_> - 0 -1 139 -5.6810788810253143e-03 + 0 -1 44 -8.7916189804673195e-03 - -5.7089996337890625e-01 8.1808418035507202e-02 + -5.9182339906692505e-01 1.1145308613777161e-01 <_> - 0 -1 898 4.8240914475172758e-04 + 0 -1 874 1.3353329151868820e-02 - -2.2115968167781830e-01 2.1608626842498779e-01 + -1.1993711441755295e-01 4.8862439393997192e-01 <_> - 0 -1 699 -6.6948928870260715e-03 + 0 -1 324 -1.0008489713072777e-02 - -6.5513664484024048e-01 7.3252275586128235e-02 + 4.1768664121627808e-01 -1.2453128397464752e-01 <_> - 0 -1 607 -1.4181779697537422e-02 + 0 -1 795 -1.4410717412829399e-03 - 3.2152280211448669e-01 -1.5524932742118835e-01 + 3.4100320935249329e-01 -1.6849595308303833e-01 <_> - 0 -1 172 1.6027893871068954e-02 + 0 -1 123 1.1647527664899826e-01 - -1.3886103034019470e-01 3.2296729087829590e-01 + -9.7596585750579834e-02 4.2289251089096069e-01 <_> - 0 -1 379 3.8102023303508759e-02 + 0 -1 301 -9.8112244158983231e-03 - -8.4586337208747864e-02 5.0823771953582764e-01 + 2.6155915856361389e-01 -2.0234876871109009e-01 <_> - 0 -1 627 -6.8796845152974129e-03 + 0 -1 425 6.3042029738426208e-02 - 2.8458747267723083e-01 -1.6626659035682678e-01 + -1.2662252783775330e-01 3.6811619997024536e-01 <_> - 0 -1 316 -5.7869823649525642e-03 + 0 -1 553 -1.7675247043371201e-02 - -6.7561829090118408e-01 6.7125916481018066e-02 + 4.1690909862518311e-01 -1.1987055838108063e-01 <_> - 0 -1 84 -1.0403458960354328e-02 + 0 -1 105 4.0485346689820290e-03 - -6.8244606256484985e-01 5.5120140314102173e-02 + 7.0249855518341064e-02 -7.3556905984878540e-01 <_> - 0 -1 253 7.2765655815601349e-02 + 0 -1 675 8.2748252898454666e-03 - -1.2289700657129288e-01 3.4603855013847351e-01 + -1.6168670356273651e-01 2.8835350275039673e-01 <_> - 0 -1 145 -5.2832886576652527e-02 + 0 -1 313 -5.0843162462115288e-03 - 3.6294373869895935e-01 -1.1915811896324158e-01 + -5.8562570810317993e-01 8.9675068855285645e-02 <_> - 0 -1 791 -2.0185699686408043e-03 + 0 -1 249 6.0826279222965240e-03 - 3.0245268344879150e-01 -1.5617357194423676e-01 + 4.7766357660293579e-02 -6.8612217903137207e-01 <_> - 0 -1 606 -2.8552478179335594e-03 + 0 -1 48 8.5826087743043900e-03 - -6.5382599830627441e-01 6.9692179560661316e-02 + -1.6963686048984528e-01 2.6875671744346619e-01 <_> - 0 -1 167 -3.6076260730624199e-03 + 0 -1 38 2.4908576160669327e-02 - -5.5573904514312744e-01 6.0684457421302795e-02 + 8.5034154355525970e-02 -5.7059210538864136e-01 <_> - 0 -1 85 -1.2505692429840565e-03 + 0 -1 879 2.0448346622288227e-03 - 2.2487366199493408e-01 -1.7713856697082520e-01 + -1.8642950057983398e-01 2.3178242146968842e-01 <_> - 0 -1 643 1.6213182359933853e-02 + 0 -1 16 2.4130716919898987e-02 - 6.7865289747714996e-02 -5.5539685487747192e-01 + -1.2823060154914856e-01 3.4394741058349609e-01 <_> - 0 -1 24 -2.7728214859962463e-02 + 0 -1 154 -4.7494415193796158e-03 - -5.8333241939544678e-01 5.7263575494289398e-02 + -7.1827727556228638e-01 6.8053275346755981e-02 <_> - 0 -1 267 -1.2375607620924711e-03 + 0 -1 199 -1.7751917243003845e-02 - 2.9786622524261475e-01 -1.2998357415199280e-01 + -5.5972510576248169e-01 5.2141726016998291e-02 <_> - 0 -1 622 2.4766498245298862e-03 + 0 -1 339 5.5826390162110329e-03 - 8.8138826191425323e-02 -4.3225872516632080e-01 + 4.8266090452671051e-02 -5.9813541173934937e-01 <_> - 0 -1 382 1.0034437291324139e-03 + 0 -1 387 1.4416726771742105e-03 - -1.1115902662277222e-01 3.2714295387268066e-01 + -9.2707693576812744e-02 4.1495534777641296e-01 <_> - 0 -1 374 -6.4956350252032280e-03 + 0 -1 192 -2.1779362577944994e-03 - -7.0529288053512573e-01 6.1914756894111633e-02 + 2.7112621068954468e-01 -1.5071788430213928e-01 <_> - 0 -1 409 -1.2748142704367638e-02 + 0 -1 607 3.0656920280307531e-03 - 3.6699298024177551e-01 -1.0546508431434631e-01 + 6.0340058058500290e-02 -6.5465551614761353e-01 <_> - 0 -1 494 -5.6289080530405045e-03 + 0 -1 469 1.9947460293769836e-01 - -8.3690512180328369e-01 4.8901058733463287e-02 + -9.5098674297332764e-02 3.9016976952552795e-01 <_> - 0 -1 846 -3.0219005420804024e-03 + 0 -1 857 -2.0255323499441147e-02 - 2.2210697829723358e-01 -1.6297030448913574e-01 + 4.3044877052307129e-01 -8.8302992284297943e-02 <_> - 0 -1 938 2.9230308718979359e-03 + 0 -1 446 5.4685659706592560e-03 - 8.0248229205608368e-02 -4.7586214542388916e-01 + -8.7241113185882568e-02 3.9513549208641052e-01 <_> - 0 -1 620 -1.6901228576898575e-02 + 0 -1 463 -1.0883151553571224e-03 - 3.2134863734245300e-01 -1.1946766823530197e-01 + 2.9802373051643372e-01 -1.3696449995040894e-01 <_> - 0 -1 452 -1.6434368444606662e-03 + 0 -1 655 -5.0911568105220795e-03 - 3.5056352615356445e-01 -1.0065372288227081e-01 + -6.2439930438995361e-01 6.2544539570808411e-02 <_> - 0 -1 104 6.0744080692529678e-03 + 0 -1 221 -5.2395770326256752e-03 - 7.7158488333225250e-02 -5.0687175989151001e-01 + -6.9036418199539185e-01 4.5142117887735367e-02 <_> - 0 -1 677 -6.2521770596504211e-02 + 0 -1 955 4.0486194193363190e-02 - 3.5145899653434753e-01 -1.0493072122335434e-01 + -7.5753845274448395e-02 5.2426725625991821e-01 <_> - 0 -1 738 1.4936760999262333e-03 + 0 -1 300 4.1610337793827057e-03 - -1.1596123874187469e-01 3.1784045696258545e-01 + 6.6071115434169769e-02 -5.8079534769058228e-01 <_> - 0 -1 935 -4.6554272994399071e-03 + 0 -1 272 -6.4253048039972782e-03 - -5.8499008417129517e-01 6.5426386892795563e-02 - <_> - - 0 -1 718 5.1631154492497444e-03 - - 4.6380143612623215e-02 -6.5920770168304443e-01 - <_> - - 0 -1 431 5.7699503377079964e-03 - - -1.0032630711793900e-01 3.4062737226486206e-01 - <_> - - 0 -1 306 -9.6255233511328697e-03 - - 2.2360336780548096e-01 -1.5362788736820221e-01 - <_> - - 0 -1 372 -2.8061982244253159e-02 - - 2.5125834345817566e-01 -1.2988410890102386e-01 - <_> - - 0 -1 807 7.1229478344321251e-03 - - 5.3426012396812439e-02 -6.4893049001693726e-01 - <_> - - 0 -1 46 1.4473337680101395e-02 - - -1.2796792387962341e-01 2.5788536667823792e-01 - <_> - - 0 -1 240 -4.4487215578556061e-02 - - 4.8267531394958496e-01 -7.5288593769073486e-02 - <_> - - 0 -1 408 3.3553102985024452e-03 - - 6.5222866833209991e-02 -5.3387296199798584e-01 - <_> - - 0 -1 6 2.6522833853960037e-02 - - 4.7097213566303253e-02 -5.7117742300033569e-01 - <_> - - 0 -1 407 5.3791850805282593e-03 - - 4.9663346260786057e-02 -5.0957924127578735e-01 - <_> - - 0 -1 684 -8.8640749454498291e-03 - - 3.3878505229949951e-01 -8.6965307593345642e-02 - <_> - - 0 -1 78 2.7605522423982620e-02 - - 4.4678669422864914e-02 -6.9978964328765869e-01 - <_> - - 0 -1 944 -1.1171739548444748e-02 - - -7.3840415477752686e-01 3.0841451138257980e-02 - <_> - - 0 -1 731 -1.0616163490340114e-03 - - 3.0718466639518738e-01 -9.7260892391204834e-02 - <_> - - 0 -1 169 -7.2728879749774933e-03 - - -7.1966600418090820e-01 4.3096855282783508e-02 - <_> - - 0 -1 924 -1.1083125136792660e-02 - - 3.8436344265937805e-01 -8.1930950284004211e-02 - <_> - - 0 -1 674 -7.1662524715065956e-03 - - 2.0970225334167480e-01 -1.5484949946403503e-01 - <_> - - 0 -1 20 8.2661323249340057e-03 - - 5.9242360293865204e-02 -5.1503551006317139e-01 - <_> - - 0 -1 748 7.3844827711582184e-03 - - 3.3728431910276413e-02 -7.2390365600585938e-01 + 3.0481830239295959e-01 -1.1435022950172424e-01 <_> - 61 - -1.5647197961807251e+00 + 44 + -1.4235107898712158e+00 <_> - 0 -1 443 -7.5000515207648277e-03 + 0 -1 716 -2.2738082334399223e-03 - 6.9735616445541382e-01 -7.0126228965818882e-03 + 5.9519726037979126e-01 -1.6779936850070953e-01 <_> - 0 -1 713 -2.5447460357099771e-03 + 0 -1 457 -1.2204157188534737e-02 - 5.4742383956909180e-01 -1.3766847550868988e-01 + 4.6985983848571777e-01 -1.7339397966861725e-01 <_> - 0 -1 278 6.3486215658485889e-03 + 0 -1 754 3.1242824625223875e-03 - -1.5121677517890930e-01 6.0269719362258911e-01 + -2.2488421201705933e-01 3.4029743075370789e-01 <_> - 0 -1 860 2.5572092272341251e-03 + 0 -1 777 -3.9868438616394997e-03 - -2.1577885746955872e-01 3.9897701144218445e-01 + 3.8314539194107056e-01 -1.8952924013137817e-01 <_> - 0 -1 510 -6.5959235653281212e-03 + 0 -1 538 -5.4737669415771961e-03 - 3.2995587587356567e-01 -2.0266638696193695e-01 + 2.4583901464939117e-01 -2.3114782571792603e-01 <_> - 0 -1 857 1.5824008733034134e-02 + 0 -1 453 1.5154287219047546e-02 - -1.4384938776493073e-01 5.4570239782333374e-01 + -1.0675037652254105e-01 5.8347207307815552e-01 <_> - 0 -1 335 3.4904260188341141e-02 + 0 -1 397 -1.4294658321887255e-03 - -1.0439507663249969e-01 5.3645384311676025e-01 + 3.8292840123176575e-01 -1.2911921739578247e-01 <_> - 0 -1 2 7.4804951436817646e-03 + 0 -1 750 -7.4405185878276825e-03 - -1.7777608335018158e-01 3.0247840285301208e-01 + 2.8356546163558960e-01 -1.7810684442520142e-01 <_> - 0 -1 61 -5.1247365772724152e-02 + 0 -1 786 -4.0357224643230438e-03 - 5.7459318637847900e-01 -1.0999230295419693e-01 + 2.6303085684776306e-01 -1.6862161457538605e-01 <_> - 0 -1 629 -5.0416901707649231e-02 + 0 -1 618 -5.8342106640338898e-03 - 4.6202743053436279e-01 -8.9995197951793671e-02 + 3.2040205597877502e-01 -1.4103877544403076e-01 <_> - 0 -1 177 1.2860384769737720e-02 + 0 -1 161 1.7279960215091705e-02 - -1.5580976009368896e-01 2.6711037755012512e-01 + -1.7433850467205048e-01 2.7985212206840515e-01 <_> - 0 -1 645 2.3457493633031845e-02 + 0 -1 292 2.2125110030174255e-02 - 5.4399158805608749e-02 -7.5605469942092896e-01 + -1.1797516793012619e-01 4.0373948216438293e-01 <_> - 0 -1 775 -3.4703868441283703e-03 + 0 -1 958 -4.4059187173843384e-02 - 2.3663245141506195e-01 -1.6793093085289001e-01 + 5.2820503711700439e-01 -7.0916719734668732e-02 <_> - 0 -1 256 4.2368983849883080e-03 + 0 -1 194 -3.8316637277603149e-02 - 6.2613829970359802e-02 -6.2294322252273560e-01 + 3.8833045959472656e-01 -1.0811555385589600e-01 <_> - 0 -1 727 -8.7803313508629799e-03 + 0 -1 178 4.5704744756221771e-02 - 3.0670607089996338e-01 -1.2937802076339722e-01 + -1.7566929757595062e-01 3.4665411710739136e-01 <_> - 0 -1 38 7.3221437633037567e-03 + 0 -1 434 1.1523386929184198e-03 - 8.7675094604492188e-02 -4.8196199536323547e-01 + -1.7257389426231384e-01 2.5989890098571777e-01 <_> - 0 -1 176 5.7109566405415535e-03 + 0 -1 121 -1.0491746477782726e-02 - -1.6586679220199585e-01 2.4693855643272400e-01 + -6.1285555362701416e-01 7.1230083703994751e-02 <_> - 0 -1 393 -1.0330275399610400e-03 + 0 -1 395 -4.5014433562755585e-03 - 2.8573888540267944e-01 -1.2924034893512726e-01 + -5.7712453603744507e-01 5.8887075632810593e-02 <_> - 0 -1 558 -4.1551878675818443e-03 + 0 -1 950 -3.7281280383467674e-03 - -6.7751622200012207e-01 5.5871110409498215e-02 + -6.7359894514083862e-01 5.2957162261009216e-02 <_> - 0 -1 770 -8.7040066719055176e-03 + 0 -1 331 3.4461893141269684e-02 - 2.6861536502838135e-01 -1.4459304511547089e-01 + -1.0375578701496124e-01 3.7974634766578674e-01 <_> - 0 -1 196 3.9226360619068146e-02 + 0 -1 462 -1.3906960375607014e-03 - -1.0390799492597580e-01 3.5152482986450195e-01 + 3.9171192049980164e-01 -1.0048408061265945e-01 <_> - 0 -1 115 -4.7440445050597191e-03 + 0 -1 85 1.6332454979419708e-02 - 2.5985953211784363e-01 -1.4647118747234344e-01 + 8.6256101727485657e-02 -4.5887523889541626e-01 <_> - 0 -1 375 -3.9255903102457523e-03 + 0 -1 356 -6.0738036409020424e-03 - -5.1697838306427002e-01 7.4196860194206238e-02 + -5.2265202999114990e-01 6.5308839082717896e-02 <_> - 0 -1 273 -1.0538822039961815e-02 + 0 -1 486 -3.3630726393312216e-03 - 3.7007546424865723e-01 -1.1099486052989960e-01 + -5.6505429744720459e-01 5.5844355374574661e-02 <_> - 0 -1 336 -6.4126476645469666e-03 + 0 -1 418 -1.5329496003687382e-02 - -6.8768596649169922e-01 6.5695002675056458e-02 + 3.4475114941596985e-01 -1.0086353123188019e-01 <_> - 0 -1 614 -6.6444426774978638e-03 + 0 -1 587 -9.0496204793453217e-03 - 2.3941572010517120e-01 -1.5043427050113678e-01 + 2.9553902149200439e-01 -1.1406829208135605e-01 <_> - 0 -1 784 3.6154527217149734e-02 + 0 -1 794 -3.1109917908906937e-03 - -9.1301433742046356e-02 4.3764653801918030e-01 + -4.4897687435150146e-01 7.3615357279777527e-02 <_> - 0 -1 321 2.0614354871213436e-03 + 0 -1 939 3.3499556593596935e-03 - -1.0028914362192154e-01 3.4935840964317322e-01 + 5.4718658328056335e-02 -5.4810231924057007e-01 <_> - 0 -1 937 -2.6316416915506124e-03 + 0 -1 188 1.8374501960352063e-03 - -4.7376596927642822e-01 7.9684391617774963e-02 + -1.3522666692733765e-01 2.4655479192733765e-01 <_> - 0 -1 136 -6.9046420976519585e-03 + 0 -1 908 2.6134990621358156e-03 - -5.4207211732864380e-01 5.3584035485982895e-02 + 6.6369861364364624e-02 -4.7342041134834290e-01 <_> - 0 -1 792 -7.9165250062942505e-03 + 0 -1 65 -7.4155852198600769e-03 - 2.3244017362594604e-01 -1.4517860114574432e-01 + 2.0866124331951141e-01 -1.5775154531002045e-01 <_> - 0 -1 285 6.6963117569684982e-03 + 0 -1 515 3.9352793246507645e-03 - 5.6810487061738968e-02 -6.3260114192962646e-01 + 5.1660846918821335e-02 -6.2589824199676514e-01 <_> - 0 -1 810 -1.8640372902154922e-02 + 0 -1 735 -1.0450070258229971e-03 - 2.3912836611270905e-01 -1.4180511236190796e-01 + 3.3525371551513672e-01 -1.0084854811429977e-01 <_> - 0 -1 451 -1.2744618579745293e-03 + 0 -1 784 1.2639444321393967e-03 - 3.5026183724403381e-01 -9.4078496098518372e-02 + -1.2103077769279480e-01 2.7691018581390381e-01 <_> - 0 -1 385 -6.6458717919886112e-03 + 0 -1 479 7.7577251940965652e-03 - -6.4737498760223389e-01 5.4980348795652390e-02 + 4.6813234686851501e-02 -7.3385792970657349e-01 <_> - 0 -1 759 5.5033955723047256e-03 + 0 -1 18 -1.0632604360580444e-02 - 3.6262378096580505e-02 -7.0103096961975098e-01 + -7.1024382114410400e-01 3.3777639269828796e-02 <_> - 0 -1 371 -6.0990457423031330e-03 + 0 -1 183 1.8631946295499802e-02 - 3.1506294012069702e-01 -1.0298713296651840e-01 + -1.4613701403141022e-01 2.1491082012653351e-01 <_> - 0 -1 955 -9.5215532928705215e-04 + 0 -1 608 4.9128942191600800e-03 - -3.3243876695632935e-01 9.4536833465099335e-02 + 5.3445268422365189e-02 -6.3314527273178101e-01 <_> - 0 -1 133 -4.8709083348512650e-03 + 0 -1 473 -9.8230186849832535e-03 - -5.5286788940429688e-01 4.8858009278774261e-02 + 2.6917773485183716e-01 -1.1376978456974030e-01 <_> - 0 -1 476 -1.9530812278389931e-03 + 0 -1 910 -3.0754944309592247e-03 - 2.6475632190704346e-01 -1.2214422971010208e-01 + -5.0787961483001709e-01 6.1582125723361969e-02 <_> - 0 -1 852 -1.6108162701129913e-02 + 0 -1 659 -6.7374799400568008e-03 - 2.4747616052627563e-01 -1.4181286096572876e-01 + 2.3871047794818878e-01 -1.2552142143249512e-01 <_> - 0 -1 747 -3.3051617443561554e-02 + 0 -1 507 -1.1759715154767036e-02 - 4.7526669502258301e-01 -6.3493676483631134e-02 + 3.3646693825721741e-01 -9.4460532069206238e-02 <_> - 0 -1 465 -2.0969051867723465e-02 + 0 -1 318 -4.1377237066626549e-03 - 3.7475255131721497e-01 -8.7978623807430267e-02 + -5.0522220134735107e-01 6.2668189406394958e-02 <_> - 0 -1 862 -1.1976938694715500e-03 + 0 -1 320 1.7267453949898481e-03 - 2.8161275386810303e-01 -1.0515356063842773e-01 - <_> - - 0 -1 937 3.0867555178701878e-03 - - 6.1260223388671875e-02 -5.0152593851089478e-01 - <_> - - 0 -1 261 5.4881181567907333e-03 - - 5.0317917019128799e-02 -5.4196691513061523e-01 - <_> - - 0 -1 302 -3.6943652667105198e-03 - - -5.8759558200836182e-01 4.4150535017251968e-02 - <_> - - 0 -1 91 2.3760091513395309e-02 - - -1.0199809074401855e-01 3.0310767889022827e-01 - <_> - - 0 -1 86 -2.1728422492742538e-02 - - 3.1364366412162781e-01 -1.0069291293621063e-01 - <_> - - 0 -1 36 -2.5134570896625519e-02 - - -5.1455682516098022e-01 5.5909216403961182e-02 - <_> - - 0 -1 17 2.5713320821523666e-02 - - -1.2262356281280518e-01 2.5486063957214355e-01 - <_> - - 0 -1 600 3.4806665498763323e-03 - - 4.3244410306215286e-02 -7.0197206735610962e-01 - <_> - - 0 -1 96 -3.8689947687089443e-03 - - -5.8558273315429688e-01 4.0547560900449753e-02 - <_> - - 0 -1 787 -1.0773935355246067e-03 - - 3.0767098069190979e-01 -9.5467783510684967e-02 - <_> - - 0 -1 789 2.9714959673583508e-03 - - -7.1951679885387421e-02 3.9655500650405884e-01 - <_> - - 0 -1 67 -8.8994875550270081e-03 - - -6.3042962551116943e-01 4.7020766884088516e-02 - <_> - - 0 -1 588 6.7773810587823391e-03 - - -7.5779460370540619e-02 3.6968868970870972e-01 - <_> - - 0 -1 508 -8.9795496314764023e-03 - - 2.2023639082908630e-01 -1.3685037195682526e-01 - <_> - - 0 -1 258 -1.4680022373795509e-02 - - 2.9656830430030823e-01 -9.4061806797981262e-02 - <_> - - 0 -1 208 -9.5530468970537186e-03 - - 2.9208987951278687e-01 -1.0542043298482895e-01 - <_> - - 0 -1 847 -1.4967216411605477e-03 - - 2.1045146882534027e-01 -1.3942880928516388e-01 + -8.0607026815414429e-02 3.8304185867309570e-01 <_> - 67 - -1.5504211187362671e+00 + 47 + -1.4313566684722900e+00 <_> - 0 -1 454 -1.0960219427943230e-02 + 0 -1 882 -1.1920252814888954e-02 - 6.5447217226028442e-01 5.0713799893856049e-02 + 5.6617152690887451e-01 -1.5811842679977417e-01 <_> - 0 -1 864 -1.1516783386468887e-02 + 0 -1 568 -4.3085627257823944e-03 - 4.6027910709381104e-01 -1.5864185988903046e-01 + 4.4759327173233032e-01 -1.6846470534801483e-01 <_> - 0 -1 751 3.3400617539882660e-03 + 0 -1 883 1.1177745182067156e-03 - -2.1552324295043945e-01 3.4321418404579163e-01 + -1.5351393818855286e-01 4.3508940935134888e-01 <_> - 0 -1 154 -3.8353595882654190e-03 + 0 -1 798 3.5418532788753510e-02 - 3.3496814966201782e-01 -2.3464411497116089e-01 + -1.2973460555076599e-01 3.6943939328193665e-01 <_> - 0 -1 57 -5.9523088857531548e-03 + 0 -1 393 2.2405586205422878e-03 - 2.8272038698196411e-01 -2.0106634497642517e-01 + -1.8800468742847443e-01 3.2498928904533386e-01 <_> - 0 -1 788 -1.3916005846112967e-03 + 0 -1 265 -1.7982896417379379e-02 - 3.4103384613990784e-01 -1.5115562081336975e-01 + 4.5607218146324158e-01 -1.0459473729133606e-01 <_> - 0 -1 325 -2.2318472620099783e-03 + 0 -1 152 -4.9088716506958008e-02 - 3.1695351004600525e-01 -1.6021527349948883e-01 + 3.4279289841651917e-01 -1.5114119648933411e-01 <_> - 0 -1 677 8.3244532346725464e-02 + 0 -1 275 7.1780886501073837e-03 - -8.9079469442367554e-02 5.3136157989501953e-01 + 6.3825756311416626e-02 -6.2449872493743896e-01 <_> - 0 -1 832 4.8591636121273041e-02 + 0 -1 849 3.9123920723795891e-03 - -1.0279218852519989e-01 3.9601847529411316e-01 + 7.1502417325973511e-02 -6.3956946134567261e-01 <_> - 0 -1 921 9.5052458345890045e-03 + 0 -1 689 -4.1980943642556667e-03 - 5.5167526006698608e-02 -7.4528604745864868e-01 + 2.1998657286167145e-01 -1.9890366494655609e-01 <_> - 0 -1 612 -3.7635704502463341e-03 + 0 -1 660 -4.5476644299924374e-03 - -6.5434825420379639e-01 5.7055845856666565e-02 + 2.1866278350353241e-01 -1.9852560758590698e-01 <_> - 0 -1 809 1.7548685718793422e-04 + 0 -1 944 -4.4158436357975006e-03 - -2.3401582241058350e-01 1.6428647935390472e-01 + 2.3959043622016907e-01 -1.7090958356857300e-01 <_> - 0 -1 156 -5.4875545203685760e-02 + 0 -1 281 -4.7058244235813618e-03 - 2.5605452060699463e-01 -1.5396752953529358e-01 + -5.1537507772445679e-01 9.0310461819171906e-02 <_> - 0 -1 5 -6.1811439692974091e-02 + 0 -1 116 -8.7488889694213867e-03 - 4.2922756075859070e-01 -8.8362246751785278e-02 + 2.2937677800655365e-01 -1.8315380811691284e-01 <_> - 0 -1 229 1.3979763025417924e-03 + 0 -1 645 -3.1655649654567242e-03 - -7.3071695864200592e-02 4.5563563704490662e-01 + -7.3091191053390503e-01 6.5193220973014832e-02 <_> - 0 -1 229 -5.5876211263239384e-04 + 0 -1 267 6.4696683548390865e-03 - 2.9506489634513855e-01 -1.2031728774309158e-01 + -1.1077737808227539e-01 3.7207809090614319e-01 <_> - 0 -1 31 -4.3148966506123543e-03 + 0 -1 615 2.2985613904893398e-03 - -5.7403188943862915e-01 6.6134005784988403e-02 + 7.7800542116165161e-02 -5.1104581356048584e-01 <_> - 0 -1 228 -5.3551131859421730e-03 + 0 -1 359 4.5809363946318626e-03 - -5.2288484573364258e-01 6.9182172417640686e-02 + 5.7778771966695786e-02 -5.7898092269897461e-01 <_> - 0 -1 117 -3.6877401173114777e-02 + 0 -1 188 1.1279166210442781e-03 - 3.3143782615661621e-01 -1.2777587771415710e-01 + -1.7981146275997162e-01 1.9939005374908447e-01 <_> - 0 -1 364 4.1612848639488220e-02 + 0 -1 347 -1.2820301577448845e-02 - -1.4963860809803009e-01 2.9361200332641602e-01 + 5.1867282390594482e-01 -6.9989629089832306e-02 <_> - 0 -1 423 6.6619878634810448e-04 + 0 -1 810 4.4866472482681274e-02 - -1.8005952239036560e-01 2.1171462535858154e-01 + -1.4253044128417969e-01 3.0062338709831238e-01 <_> - 0 -1 155 2.2130949422717094e-02 + 0 -1 412 -3.5413210280239582e-03 - 5.7936761528253555e-02 -5.9410941600799561e-01 + -5.7618641853332520e-01 6.0328345745801926e-02 <_> - 0 -1 469 1.2182788923382759e-02 + 0 -1 362 -7.4678594246506691e-03 - -1.1940150707960129e-01 2.9696035385131836e-01 + -5.0187259912490845e-01 6.1294022947549820e-02 <_> - 0 -1 182 2.8001153841614723e-03 + 0 -1 678 1.8058011308312416e-02 - -1.4503511786460876e-01 2.2681860625743866e-01 + 5.3603217005729675e-02 -5.8919399976730347e-01 <_> - 0 -1 945 2.8729443438351154e-03 + 0 -1 935 -6.8098572082817554e-03 - 6.5800048410892487e-02 -4.9987852573394775e-01 + -5.4100829362869263e-01 5.5898215621709824e-02 <_> - 0 -1 63 -5.0598740577697754e-01 + 0 -1 307 3.6491458304226398e-03 - 6.1999630928039551e-01 -5.6771270930767059e-02 + 4.7378763556480408e-02 -5.9323132038116455e-01 <_> - 0 -1 219 -9.6983816474676132e-03 + 0 -1 284 1.4524955768138170e-03 - 3.2087686657905579e-01 -9.7375035285949707e-02 + -8.8994570076465607e-02 3.8729071617126465e-01 <_> - 0 -1 497 3.0797901563346386e-03 + 0 -1 219 -6.2408884987235069e-03 - -1.2448154389858246e-01 2.5827226042747498e-01 + -6.6442847251892090e-01 5.1082015037536621e-02 <_> - 0 -1 451 -1.5816848026588559e-03 + 0 -1 744 -9.9360430613160133e-04 - 4.1313612461090088e-01 -9.0998791158199310e-02 + 3.2972389459609985e-01 -1.0494423657655716e-01 <_> - 0 -1 101 -9.5680113881826401e-03 + 0 -1 285 3.9777760393917561e-03 - -7.0231872797012329e-01 5.5185325443744659e-02 + 5.4083213210105896e-02 -6.2114214897155762e-01 <_> - 0 -1 94 3.1543439254164696e-03 + 0 -1 380 -1.4884659089148045e-02 - 4.8739165067672729e-02 -5.4295998811721802e-01 + 2.4066454172134399e-01 -1.2317410856485367e-01 <_> - 0 -1 224 -7.8436743933707476e-04 + 0 -1 436 3.3154981210827827e-03 - 3.0286926031112671e-01 -1.0217373818159103e-01 + -1.1744727939367294e-01 2.9429042339324951e-01 <_> - 0 -1 143 4.3993473052978516e-01 + 0 -1 976 -4.7508114948868752e-03 - -4.0746804326772690e-02 7.4451828002929688e-01 + -4.5763325691223145e-01 6.7066885530948639e-02 <_> - 0 -1 565 -3.5277460701763630e-03 + 0 -1 779 -1.1973761022090912e-02 - -4.5241990685462952e-01 7.3149621486663818e-02 + 2.5750914216041565e-01 -1.1354148387908936e-01 <_> - 0 -1 468 8.3879064768552780e-03 + 0 -1 740 4.9072699621319771e-03 - 3.3294096589088440e-02 -7.2618806362152100e-01 + -1.1266437917947769e-01 3.0022394657135010e-01 <_> - 0 -1 818 9.9020544439554214e-04 + 0 -1 56 6.5630510449409485e-02 - -1.0716802626848221e-01 2.8766462206840515e-01 + -1.0180503129959106e-01 3.0517497658729553e-01 <_> - 0 -1 825 -2.9110300820320845e-03 + 0 -1 354 -2.3393325507640839e-02 - 2.8586754202842712e-01 -1.1559913307428360e-01 + 3.2443770766258240e-01 -9.5363102853298187e-02 <_> - 0 -1 242 -5.1425592973828316e-03 + 0 -1 834 -3.8902116939425468e-03 - -6.1106848716735840e-01 4.6430643647909164e-02 + 2.0148487389087677e-01 -1.4944279193878174e-01 <_> - 0 -1 69 1.7738080024719238e-01 + 0 -1 185 -2.5926973670721054e-02 - -7.0887565612792969e-02 4.1917768120765686e-01 + -4.4917497038841248e-01 6.9752328097820282e-02 <_> - 0 -1 389 -1.1850059032440186e-02 + 0 -1 173 -7.1825529448688030e-03 - 3.1747487187385559e-01 -1.0234380513429642e-01 + -5.6838059425354004e-01 4.9584377557039261e-02 <_> - 0 -1 529 -1.0039219632744789e-02 + 0 -1 548 -9.9399685859680176e-03 - 2.0376846194267273e-01 -1.4407536387443542e-01 + 3.0747908353805542e-01 -1.1064232140779495e-01 <_> - 0 -1 676 1.9497467204928398e-02 + 0 -1 978 -3.6286246031522751e-03 - 4.7855406999588013e-02 -5.7639378309249878e-01 + -6.0276371240615845e-01 5.2405584603548050e-02 <_> - 0 -1 193 5.5466167628765106e-02 + 0 -1 820 1.5756220091134310e-03 - -7.4624486267566681e-02 4.1103851795196533e-01 + -1.1615782976150513e-01 2.6717522740364075e-01 <_> - 0 -1 893 -3.9324127137660980e-03 + 0 -1 426 3.5662509500980377e-02 - -5.5429047346115112e-01 5.0012629479169846e-02 + -1.0885569453239441e-01 2.9044550657272339e-01 <_> - 0 -1 662 -8.9037272846326232e-04 + 0 -1 554 5.3282946348190308e-02 - 2.0536813139915466e-01 -1.3225764036178589e-01 + -8.1855505704879761e-02 4.0298762917518616e-01 <_> - 0 -1 3 4.6562731266021729e-02 + 0 -1 988 3.3901704009622335e-03 - -9.1293826699256897e-02 2.9735872149467468e-01 + 5.5047694593667984e-02 -5.4021596908569336e-01 <_> - 0 -1 548 -1.5474244952201843e-01 + 0 -1 384 1.3204356655478477e-03 - -8.6353981494903564e-01 3.4763321280479431e-02 - <_> - - 0 -1 893 2.4359119124710560e-03 - - 5.9721726924180984e-02 -4.1146609187126160e-01 - <_> - - 0 -1 402 1.3576634228229523e-02 - - -9.4201639294624329e-02 3.0719256401062012e-01 - <_> - - 0 -1 456 -9.8991915583610535e-03 - - 2.6257899403572083e-01 -9.5683693885803223e-02 - <_> - - 0 -1 479 -3.0812243930995464e-03 - - 2.1774919331073761e-01 -1.1509665846824646e-01 - <_> - - 0 -1 275 -1.9958070479333401e-03 - - 3.5399836301803589e-01 -7.2066798806190491e-02 - <_> - - 0 -1 919 3.0025159940123558e-03 - - 4.2854189872741699e-02 -6.0343819856643677e-01 - <_> - - 0 -1 836 -1.1377423070371151e-03 - - 2.0119668543338776e-01 -1.2889184057712555e-01 - <_> - - 0 -1 661 3.7626659031957388e-03 - - 4.6901285648345947e-02 -5.7279956340789795e-01 - <_> - - 0 -1 724 -3.9297584444284439e-03 - - 3.5875543951988220e-01 -7.3908790946006775e-02 - <_> - - 0 -1 885 -2.5286607444286346e-02 - - 3.5751584172248840e-01 -6.7418299615383148e-02 - <_> - - 0 -1 749 -3.9539579302072525e-03 - - 2.0609807968139648e-01 -1.4521332085132599e-01 - <_> - - 0 -1 911 -5.7711899280548096e-03 - - -5.2898341417312622e-01 4.7179169952869415e-02 - <_> - - 0 -1 701 -3.3264106605201960e-03 - - 2.2409056127071381e-01 -1.1467082053422928e-01 - <_> - - 0 -1 703 6.1332453042268753e-02 - - 3.7662509828805923e-02 -7.1230965852737427e-01 - <_> - - 0 -1 251 -1.4834193512797356e-02 - - -5.5149120092391968e-01 3.9850924164056778e-02 - <_> - - 0 -1 7 -1.0773484408855438e-01 - - -4.9263399839401245e-01 4.9221854656934738e-02 - <_> - - 0 -1 648 -6.5140398219227791e-03 - - -6.7663580179214478e-01 3.3736269921064377e-02 - <_> - - 0 -1 30 -2.4242542684078217e-02 - - -6.9796782732009888e-01 2.7110328897833824e-02 - <_> - - 0 -1 393 -1.7814380116760731e-03 - - 2.9062062501907349e-01 -8.0135107040405273e-02 - <_> - - 0 -1 801 4.7076190821826458e-03 - - 3.7101462483406067e-02 -6.7659527063369751e-01 + -9.4643965363502502e-02 3.0430349707603455e-01 <_> - 80 - -1.5639265775680542e+00 + 48 + -1.3744181394577026e+00 <_> - 0 -1 561 -4.3974462896585464e-03 + 0 -1 788 3.9594387635588646e-03 - 7.1587848663330078e-01 8.4948554635047913e-02 + -1.5454453229904175e-01 4.9922767281532288e-01 <_> - 0 -1 198 1.8174322322010994e-03 + 0 -1 467 -1.6322813928127289e-02 - -1.7691791057586670e-01 4.3212845921516418e-01 + 4.2537182569503784e-01 -1.5276345610618591e-01 <_> - 0 -1 735 -5.5131856352090836e-03 + 0 -1 746 1.6230947803705931e-03 - 4.5490756630897522e-01 -1.4189453423023224e-01 + -2.2640861570835114e-01 2.5220483541488647e-01 <_> - 0 -1 282 1.1955455876886845e-02 + 0 -1 115 -6.0441931709647179e-03 - -2.0918996632099152e-01 4.3714949488639832e-01 + 2.2711095213890076e-01 -2.1762822568416595e-01 <_> - 0 -1 819 -3.4246121067553759e-03 + 0 -1 6 1.1688062921166420e-02 - 3.5878163576126099e-01 -1.5395726263523102e-01 + -1.6991630196571350e-01 2.8343129158020020e-01 <_> - 0 -1 187 -4.3844994157552719e-02 + 0 -1 624 -3.1942571513354778e-03 - 4.3700152635574341e-01 -1.2767519056797028e-01 + -6.2475329637527466e-01 7.3184341192245483e-02 <_> - 0 -1 839 -6.3555962406098843e-03 + 0 -1 11 -7.6569117605686188e-02 - 2.9515129327774048e-01 -1.6441816091537476e-01 + 5.5236744880676270e-01 -7.7832877635955811e-02 <_> - 0 -1 534 -2.6965860743075609e-03 + 0 -1 306 1.8717286875471473e-03 - 1.9414065778255463e-01 -2.0237676799297333e-01 + 8.4293909370899200e-02 -5.2716743946075439e-01 <_> - 0 -1 460 -1.3908351771533489e-02 + 0 -1 351 3.5880310460925102e-03 - 2.5903883576393127e-01 -1.5587335824966431e-01 + -1.2907223403453827e-01 3.3967444300651550e-01 <_> - 0 -1 343 -1.4053133316338062e-02 + 0 -1 176 -5.7136151008307934e-03 - 5.4957073926925659e-01 -8.1244736909866333e-02 + -5.9208476543426514e-01 7.7793844044208527e-02 <_> - 0 -1 918 -5.3004794754087925e-03 + 0 -1 150 -1.9309867173433304e-02 - -5.8528614044189453e-01 7.3730856180191040e-02 + 2.5386241078376770e-01 -1.7397734522819519e-01 <_> - 0 -1 491 -3.1702318228781223e-03 + 0 -1 327 -2.4289516732096672e-03 - 1.9391658902168274e-01 -1.8859483301639557e-01 + 3.2221227884292603e-01 -1.2751287221908569e-01 <_> - 0 -1 474 -4.5197797007858753e-03 + 0 -1 25 -8.5500031709671021e-02 - -5.4193162918090820e-01 5.9990171343088150e-02 + -7.7962499856948853e-01 5.0715133547782898e-02 <_> - 0 -1 956 -5.4979130625724792e-02 + 0 -1 770 5.7447291910648346e-03 - 4.7812277078628540e-01 -6.7818723618984222e-02 + -1.1523491144180298e-01 3.6400210857391357e-01 <_> - 0 -1 876 8.1017805496230721e-04 + 0 -1 781 5.8936916291713715e-02 - -9.5595575869083405e-02 3.1569144129753113e-01 + -8.7829843163490295e-02 4.1893997788429260e-01 <_> - 0 -1 841 -2.8012446127831936e-03 + 0 -1 984 -4.1379006579518318e-03 - -4.9929830431938171e-01 6.8443782627582550e-02 + -6.3083720207214355e-01 6.4935714006423950e-02 <_> - 0 -1 833 -6.0123754665255547e-03 + 0 -1 565 -4.6407114714384079e-03 - 3.8719713687896729e-01 -8.9717194437980652e-02 + -6.5650087594985962e-01 5.4394256323575974e-02 <_> - 0 -1 842 3.6350139416754246e-03 + 0 -1 877 1.5865347813814878e-03 - 6.6413506865501404e-02 -4.8185935616493225e-01 + -1.7255148291587830e-01 2.3248092830181122e-01 <_> - 0 -1 452 -1.3544321991503239e-03 + 0 -1 624 2.8971401043236256e-03 - 2.5372084975242615e-01 -1.2267075479030609e-01 + 6.0526229441165924e-02 -5.4368048906326294e-01 <_> - 0 -1 827 -3.1020103488117456e-03 + 0 -1 773 1.5737174544483423e-03 - 2.7389132976531982e-01 -1.1379010230302811e-01 + -1.1744406074285507e-01 3.0534917116165161e-01 <_> - 0 -1 767 1.5349574387073517e-03 + 0 -1 609 1.6838097944855690e-03 - -1.0861707478761673e-01 2.8958576917648315e-01 + 6.6153712570667267e-02 -5.9224641323089600e-01 <_> - 0 -1 170 6.4284317195415497e-03 + 0 -1 912 3.2287575304508209e-03 - 5.9735804796218872e-02 -5.6773471832275391e-01 + 5.2678912878036499e-02 -5.7474386692047119e-01 <_> - 0 -1 280 -8.9295972138643265e-03 + 0 -1 850 -3.1512752175331116e-03 - -6.7040807008743286e-01 3.8283705711364746e-02 + 3.7773844599723816e-01 -8.7322145700454712e-02 <_> - 0 -1 764 -1.7896143253892660e-03 + 0 -1 894 8.2073279190808535e-04 - 2.1716582775115967e-01 -1.4856858551502228e-01 + -1.0513201355934143e-01 3.4025487303733826e-01 <_> - 0 -1 523 6.2072295695543289e-03 + 0 -1 603 2.8983387164771557e-03 - -8.8489770889282227e-02 3.3571973443031311e-01 + 5.1720291376113892e-02 -6.5431916713714600e-01 <_> - 0 -1 526 1.9034199649468064e-03 + 0 -1 852 -5.7246205396950245e-03 - 6.7696519196033478e-02 -4.5386880636215210e-01 + -7.8483843803405762e-01 3.5195719450712204e-02 <_> - 0 -1 524 -2.1953256800770760e-03 + 0 -1 44 -1.1572695337235928e-02 - -4.2716285586357117e-01 6.5683454275131226e-02 + -6.7286187410354614e-01 3.5210411995649338e-02 <_> - 0 -1 215 5.3394897840917110e-03 + 0 -1 80 -1.4562263153493404e-02 - -1.0160661488771439e-01 2.9586192965507507e-01 + 2.4655815958976746e-01 -1.2278749793767929e-01 <_> - 0 -1 763 2.0328685641288757e-03 + 0 -1 269 7.8490225132554770e-04 - -9.5586851239204407e-02 3.0505907535552979e-01 + -1.4652141928672791e-01 3.0276218056678772e-01 <_> - 0 -1 160 4.3488927185535431e-03 + 0 -1 725 -1.4289810787886381e-03 - 7.9764112830162048e-02 -3.8651520013809204e-01 + 1.8906314671039581e-01 -1.5791040658950806e-01 <_> - 0 -1 518 -4.0209172293543816e-03 + 0 -1 108 -9.4615388661623001e-03 - 3.0502754449844360e-01 -8.9127995073795319e-02 + -6.9036215543746948e-01 3.9911076426506042e-02 <_> - 0 -1 234 -4.8844739794731140e-02 + 0 -1 21 2.3225568234920502e-02 - 4.2813199758529663e-01 -6.7647248506546021e-02 + 5.0278317183256149e-02 -5.2323836088180542e-01 <_> - 0 -1 360 6.9915860891342163e-02 + 0 -1 959 1.4046948403120041e-02 - -8.3985306322574615e-02 3.2602414488792419e-01 + -7.9005211591720581e-02 4.0158179402351379e-01 <_> - 0 -1 535 4.9919363111257553e-02 + 0 -1 126 3.7851710803806782e-03 - -7.2998367249965668e-02 4.6169292926788330e-01 + -1.3530673086643219e-01 2.1973098814487457e-01 <_> - 0 -1 606 3.0068659689277411e-03 + 0 -1 142 -3.6725951358675957e-03 - 5.5069219321012497e-02 -6.1965858936309814e-01 + 1.9924460351467133e-01 -1.5001934766769409e-01 <_> - 0 -1 158 1.7419853247702122e-03 + 0 -1 963 -3.1669549643993378e-03 - -8.2020215690135956e-02 3.6006987094879150e-01 + -4.2041611671447754e-01 7.4019186198711395e-02 <_> - 0 -1 168 -4.1090780869126320e-03 + 0 -1 695 -1.3667810708284378e-02 - -5.2174150943756104e-01 5.6436747312545776e-02 + 2.5204744935035706e-01 -1.2807497382164001e-01 <_> - 0 -1 665 -4.5902859419584274e-03 + 0 -1 214 -3.5862527787685394e-02 - 2.2742575407028198e-01 -1.2061754614114761e-01 + 3.2997950911521912e-01 -8.9863941073417664e-02 <_> - 0 -1 27 -2.8690489009022713e-02 + 0 -1 946 -6.2667285092175007e-03 - -3.5808193683624268e-01 7.5659923255443573e-02 + -5.5024039745330811e-01 5.7369034737348557e-02 <_> - 0 -1 926 4.1000463068485260e-02 + 0 -1 438 -6.4383493736386299e-03 - -6.2531292438507080e-02 4.5491513609886169e-01 + 3.3817592263221741e-01 -9.3247875571250916e-02 <_> - 0 -1 126 -4.2531453073024750e-03 + 0 -1 439 5.4173925891518593e-03 - -6.1825770139694214e-01 4.9510892480611801e-02 + -1.0427469760179520e-01 2.9482829570770264e-01 <_> - 0 -1 670 -1.4550488442182541e-02 + 0 -1 400 -1.5132453292608261e-02 - -7.7191162109375000e-01 2.5961024686694145e-02 + 3.2000914216041565e-01 -9.8272062838077545e-02 <_> - 0 -1 288 -7.4881664477288723e-04 + 0 -1 606 -1.2513613328337669e-02 - 2.8547286987304688e-01 -8.8079601526260376e-02 + 2.8962445259094238e-01 -1.2084391713142395e-01 <_> - 0 -1 337 1.3214498758316040e-03 + 0 -1 91 -9.8966564983129501e-03 - -7.6633729040622711e-02 3.7057441473007202e-01 + -5.8358079195022583e-01 5.1291342824697495e-02 <_> - 0 -1 455 5.3907292895019054e-03 + 0 -1 932 1.3835988938808441e-02 - 4.9379035830497742e-02 -5.7583230733871460e-01 + -9.0702146291732788e-02 3.2527267932891846e-01 <_> - 0 -1 838 -2.4113813415169716e-03 + 0 -1 92 3.6492943763732910e-03 - 2.0829583704471588e-01 -1.3430447876453400e-01 + 8.4720104932785034e-02 -3.4649613499641418e-01 <_> - 0 -1 87 1.1464932933449745e-02 + 0 -1 478 -1.3878188095986843e-02 - 4.9434442073106766e-02 -6.5971946716308594e-01 + 2.9309025406837463e-01 -9.6585884690284729e-02 <_> - 0 -1 486 -1.3421529904007912e-02 + 0 -1 580 2.8816664125770330e-03 - -7.4524301290512085e-01 2.5121277198195457e-02 - <_> - - 0 -1 910 2.8626890853047371e-03 - - 6.1505425721406937e-02 -3.5306212306022644e-01 - <_> - - 0 -1 416 1.1442219838500023e-02 - - 5.3547207266092300e-02 -4.0409806370735168e-01 - <_> - - 0 -1 538 5.7390062138438225e-03 - - -9.7106143832206726e-02 2.4726873636245728e-01 - <_> - - 0 -1 485 -1.3369014486670494e-02 - - 3.4151887893676758e-01 -9.5434606075286865e-02 - <_> - - 0 -1 611 3.3499381970614195e-03 - - 4.9335762858390808e-02 -4.9601793289184570e-01 - <_> - - 0 -1 281 1.2374855577945709e-02 - - -5.7205036282539368e-02 5.0581747293472290e-01 - <_> - - 0 -1 500 2.7577474713325500e-02 - - -8.7777808308601379e-02 2.9972809553146362e-01 - <_> - - 0 -1 43 2.1137124300003052e-01 - - -6.2023047357797623e-02 4.0350961685180664e-01 - <_> - - 0 -1 221 -3.5103857517242432e-02 - - 2.9696103930473328e-01 -8.2776337862014771e-02 - <_> - - 0 -1 292 -2.8949903789907694e-03 - - -3.7250569462776184e-01 6.6616289317607880e-02 - <_> - - 0 -1 511 3.6181407049298286e-03 - - -9.3407385051250458e-02 2.5402054190635681e-01 - <_> - - 0 -1 445 1.1848636902868748e-02 - - -8.2135058939456940e-02 2.9939675331115723e-01 - <_> - - 0 -1 438 -1.0207802988588810e-02 - - 2.1719035506248474e-01 -1.1622364073991776e-01 - <_> - - 0 -1 257 3.0942540615797043e-02 - - 4.5177377760410309e-02 -5.0523322820663452e-01 - <_> - - 0 -1 16 -3.1778869032859802e-01 - - -8.8358139991760254e-01 2.1195204928517342e-02 - <_> - - 0 -1 513 -1.0037058964371681e-02 - - -5.8986192941665649e-01 3.0863022431731224e-02 - <_> - - 0 -1 888 9.1691948473453522e-03 - - -6.4322948455810547e-02 3.7386918067932129e-01 - <_> - - 0 -1 658 1.3658402487635612e-02 - - -1.0158041864633560e-01 2.6782375574111938e-01 - <_> - - 0 -1 309 2.7183804195374250e-03 - - 5.5635135620832443e-02 -3.9148023724555969e-01 - <_> - - 0 -1 310 1.3893332798033953e-03 - - -1.2399668246507645e-01 1.7072468996047974e-01 - <_> - - 0 -1 283 -1.8156928941607475e-02 - - -6.3868224620819092e-01 3.4263785928487778e-02 - <_> - - 0 -1 408 6.4471308141946793e-03 - - 1.8927905708551407e-02 -8.5299736261367798e-01 - <_> - - 0 -1 44 1.4844031073153019e-02 - - -1.2482391297817230e-01 1.7663741111755371e-01 - <_> - - 0 -1 50 -1.9531816244125366e-02 - - 3.1519362330436707e-01 -8.2499116659164429e-02 - <_> - - 0 -1 90 2.2133110091090202e-02 - - -9.0632885694503784e-02 2.2813312709331512e-01 - <_> - - 0 -1 119 -5.8851181529462337e-03 - - 2.0633347332477570e-01 -1.1403661221265793e-01 - <_> - - 0 -1 773 1.4685674104839563e-03 - - -6.8528242409229279e-02 3.6765024065971375e-01 - <_> - - 0 -1 856 -5.6167589500546455e-03 - - 2.1468248963356018e-01 -1.1975194513797760e-01 - <_> - - 0 -1 530 -1.0915055871009827e-01 - - 4.9222618341445923e-01 -4.6790093183517456e-02 - <_> - - 0 -1 638 -4.3774135410785675e-03 - - 2.6555654406547546e-01 -8.1355758011341095e-02 - <_> - - 0 -1 97 -5.5184490047395229e-03 - - -4.7854590415954590e-01 4.9387764185667038e-02 - <_> - - 0 -1 646 -1.8072805833071470e-03 - - -6.4401823282241821e-01 3.1085403636097908e-02 + -1.0839603841304779e-01 2.5134062767028809e-01 <_> - 91 - -1.5610778331756592e+00 + 57 + -1.3757541179656982e+00 <_> - 0 -1 821 -1.1308195069432259e-02 + 0 -1 742 -4.1507836431264877e-03 - 6.4171379804611206e-01 6.3050843775272369e-02 + 4.7857573628425598e-01 -1.5079282224178314e-01 <_> - 0 -1 454 -1.6007030382752419e-02 + 0 -1 539 -4.2431484907865524e-03 - 4.6389564871788025e-01 -1.2460056692361832e-01 + 2.7976706624031067e-01 -2.1182695031166077e-01 <_> - 0 -1 782 1.5086517669260502e-03 + 0 -1 422 7.2727665305137634e-02 - -1.4270767569541931e-01 3.3293032646179199e-01 + -1.1322361230850220e-01 4.6931907534599304e-01 <_> - 0 -1 207 -5.5297352373600006e-02 + 0 -1 120 7.3349894955754280e-03 - 4.7708284854888916e-01 -1.1913372576236725e-01 + -2.2507375478744507e-01 2.3486614227294922e-01 <_> - 0 -1 209 1.3316229917109013e-02 + 0 -1 79 -1.3757663965225220e-01 - -1.6993317008018494e-01 3.8821667432785034e-01 + 5.5153369903564453e-01 -8.4895148873329163e-02 <_> - 0 -1 752 8.1390906125307083e-03 + 0 -1 592 6.8098353222012520e-04 - -1.5329377353191376e-01 2.8196957707405090e-01 + -1.7585472762584686e-01 2.2849111258983612e-01 <_> - 0 -1 313 -1.5794128412380815e-03 + 0 -1 110 2.7579340338706970e-01 - -4.3692907691001892e-01 1.1585860699415207e-01 + -1.1671220511198044e-01 3.2674804329872131e-01 <_> - 0 -1 346 -7.4164522811770439e-03 + 0 -1 921 5.4910051403567195e-04 - -7.0102095603942871e-01 3.1883224844932556e-02 + -2.0603717863559723e-01 1.8896938860416412e-01 <_> - 0 -1 347 2.9237023554742336e-03 + 0 -1 155 -5.5065844208002090e-03 - -1.2032959610223770e-01 3.1826072931289673e-01 + -5.7701790332794189e-01 6.9212622940540314e-02 <_> - 0 -1 412 8.3931483328342438e-02 + 0 -1 824 -8.3996364846825600e-03 - -7.1062639355659485e-02 5.1401311159133911e-01 + 4.6683028340339661e-01 -7.4202880263328552e-02 <_> - 0 -1 879 5.1326253451406956e-03 + 0 -1 843 -1.1010931339114904e-03 - -1.5315851569175720e-01 2.3686404526233673e-01 + 1.9711431860923767e-01 -1.7736457288265228e-01 <_> - 0 -1 10 1.2808490544557571e-02 + 0 -1 217 -4.4837296009063721e-03 - -1.2817305326461792e-01 2.8131189942359924e-01 + -6.0108631849288940e-01 4.9327563494443893e-02 <_> - 0 -1 327 5.5591724812984467e-02 + 0 -1 211 2.5086081586778164e-03 - -9.7707554697990417e-02 3.7602767348289490e-01 + 6.9480538368225098e-02 -4.8671180009841919e-01 <_> - 0 -1 650 -2.4632480926811695e-03 + 0 -1 201 1.5808893367648125e-03 - -5.5093276500701904e-01 6.5490268170833588e-02 + -1.0519328713417053e-01 3.2050549983978271e-01 <_> - 0 -1 661 -3.1798938289284706e-03 + 0 -1 210 1.4971228083595634e-03 - -5.6288594007492065e-01 5.3227964788675308e-02 + -8.4364958107471466e-02 4.3016371130943298e-01 <_> - 0 -1 652 -1.4345918316394091e-03 + 0 -1 343 -2.6089220773428679e-03 - -5.1232701539993286e-01 5.7506360113620758e-02 + -4.2146065831184387e-01 8.8990658521652222e-02 <_> - 0 -1 861 1.9692238420248032e-03 + 0 -1 42 -7.7147269621491432e-03 - -1.6736923158168793e-01 1.8856795132160187e-01 + -6.6330111026763916e-01 5.0671890377998352e-02 <_> - 0 -1 261 -5.5519137531518936e-03 + 0 -1 85 -1.7141735181212425e-02 - -5.2823477983474731e-01 5.2204202860593796e-02 + -4.8750495910644531e-01 5.6981299072504044e-02 <_> - 0 -1 342 3.1600738875567913e-03 + 0 -1 146 1.3850606046617031e-02 - -8.0669216811656952e-02 3.6808264255523682e-01 + 7.4964463710784912e-02 -4.4079580903053284e-01 <_> - 0 -1 144 7.3207332752645016e-03 + 0 -1 341 -1.4932476915419102e-03 - 5.4134551435709000e-02 -5.3350186347961426e-01 + 3.1057041883468628e-01 -1.0369800031185150e-01 <_> - 0 -1 303 3.5804554354399443e-03 + 0 -1 382 -8.3094676956534386e-03 - 4.3425790965557098e-02 -5.3225243091583252e-01 + 2.2514784336090088e-01 -1.4621259272098541e-01 <_> - 0 -1 368 -3.4314931835979223e-03 + 0 -1 462 -7.2969077154994011e-04 - 3.3590000867843628e-01 -7.8590616583824158e-02 + 2.6934301853179932e-01 -1.2512375414371490e-01 <_> - 0 -1 958 6.8407682701945305e-03 + 0 -1 430 -1.3652374967932701e-02 - 4.5175880193710327e-02 -6.1210322380065918e-01 + -4.9215099215507507e-01 7.3141731321811676e-02 <_> - 0 -1 957 -4.1379006579518318e-03 + 0 -1 20 9.4011947512626648e-03 - -5.3888756036758423e-01 4.4202055782079697e-02 + 4.1364993900060654e-02 -6.5001028776168823e-01 <_> - 0 -1 350 1.3155659660696983e-02 + 0 -1 657 4.0921592153608799e-03 - -7.9103693366050720e-02 3.3573821187019348e-01 + 4.0478449314832687e-02 -5.9830683469772339e-01 <_> - 0 -1 356 3.1921269837766886e-03 + 0 -1 847 1.5591707779094577e-03 - 5.7063572108745575e-02 -5.0549602508544922e-01 + -9.3049824237823486e-02 3.1007137894630432e-01 <_> - 0 -1 906 2.3588772863149643e-02 + 0 -1 973 3.4408085048198700e-03 - -8.3102487027645111e-02 3.0777907371520996e-01 + 4.7337688505649567e-02 -6.5880972146987915e-01 <_> - 0 -1 464 -6.1599123291671276e-03 + 0 -1 847 -1.3411687687039375e-03 - 1.6074487566947937e-01 -1.5700389444828033e-01 + 2.8307750821113586e-01 -1.0693576931953430e-01 <_> - 0 -1 830 6.4594233408570290e-03 + 0 -1 534 -5.7181939482688904e-03 - -9.5241472125053406e-02 3.0516397953033447e-01 + -4.7754487395286560e-01 6.3519261777400970e-02 <_> - 0 -1 581 -2.0677673164755106e-03 + 0 -1 374 -5.0096530467271805e-03 - -5.0822901725769043e-01 5.9834387153387070e-02 + -6.1091655492782593e-01 3.9555240422487259e-02 <_> - 0 -1 872 2.0666117779910564e-03 + 0 -1 1 -4.1508115828037262e-03 - -7.2401538491249084e-02 3.5851547122001648e-01 + 2.1694649755954742e-01 -1.3193054497241974e-01 <_> - 0 -1 231 5.3266487084329128e-03 + 0 -1 844 -1.6968715935945511e-02 - 5.4928623139858246e-02 -4.8396179080009460e-01 + 2.7644789218902588e-01 -1.0202119499444962e-01 <_> - 0 -1 930 -7.7358852140605450e-03 + 0 -1 103 1.0276203043758869e-02 - -4.8261037468910217e-01 4.4207476079463959e-02 + -9.0598084032535553e-02 2.9703584313392639e-01 <_> - 0 -1 909 7.9007837921380997e-03 + 0 -1 350 -1.8649294506758451e-03 - -9.4954080879688263e-02 2.7517431974411011e-01 + 2.8791305422782898e-01 -9.2735975980758667e-02 <_> - 0 -1 470 4.0566008538007736e-03 + 0 -1 942 3.3354205079376698e-03 - 4.3646700680255890e-02 -5.8921122550964355e-01 + 5.3746312856674194e-02 -5.0940161943435669e-01 <_> - 0 -1 245 3.5946490243077278e-03 + 0 -1 396 -1.4105688314884901e-03 - -1.3110473752021790e-01 1.8304315209388733e-01 + 2.4489782750606537e-01 -1.1008579283952713e-01 <_> - 0 -1 206 -2.6677086949348450e-02 + 0 -1 611 2.3928448557853699e-02 - 2.8980365395545959e-01 -8.3346247673034668e-02 + 5.2839644253253937e-02 -4.9896511435508728e-01 <_> - 0 -1 213 5.4062507115304470e-03 + 0 -1 807 -3.8580424152314663e-03 - -9.1766953468322754e-02 2.9673796892166138e-01 + -4.8197838664054871e-01 5.3767576813697815e-02 <_> - 0 -1 230 -5.1793372258543968e-03 + 0 -1 679 -3.0590491369366646e-03 - -6.1112493276596069e-01 4.3332517147064209e-02 + -5.2978992462158203e-01 4.6741079539060593e-02 <_> - 0 -1 397 -9.1262701898813248e-03 + 0 -1 468 -2.9391471762210131e-03 - 2.1878185868263245e-01 -1.1105874925851822e-01 + -3.4711557626724243e-01 6.9464050233364105e-02 <_> - 0 -1 387 9.5943324267864227e-03 + 0 -1 667 -7.0184348151087761e-03 - -8.7977558374404907e-02 3.2010060548782349e-01 + 3.1962895393371582e-01 -8.3362981677055359e-02 <_> - 0 -1 668 -5.0256419926881790e-03 + 0 -1 664 1.0384586639702320e-03 - 2.1040959656238556e-01 -1.0872460156679153e-01 + -1.0797444730997086e-01 2.4896475672721863e-01 <_> - 0 -1 681 3.0062482692301273e-03 + 0 -1 628 -8.0418614670634270e-03 - -1.0699967294931412e-01 2.9316556453704834e-01 + -7.3527222871780396e-01 3.6740459501743317e-02 <_> - 0 -1 744 1.1852329596877098e-02 + 0 -1 193 -3.1738542020320892e-02 - 3.9550069719552994e-02 -6.0533910989761353e-01 + 2.6166516542434692e-01 -1.0992183536291122e-01 <_> - 0 -1 533 -5.2753865718841553e-02 + 0 -1 194 3.6780342459678650e-02 - 2.6370123028755188e-01 -9.2691496014595032e-02 + -8.7741106748580933e-02 3.7106978893280029e-01 <_> - 0 -1 446 3.8847257383167744e-03 + 0 -1 494 -6.4193591475486755e-02 - 6.4825706183910370e-02 -4.1523045301437378e-01 + 3.1807181239128113e-01 -8.8648937642574310e-02 <_> - 0 -1 556 -2.6287192013114691e-03 + 0 -1 46 3.4801474213600159e-01 - -5.0846499204635620e-01 4.2991567403078079e-02 + -5.5967021733522415e-02 5.3631168603897095e-01 <_> - 0 -1 330 2.2053448483347893e-03 + 0 -1 490 7.5712919235229492e-02 - -1.0581049323081970e-01 2.3079065978527069e-01 + -5.9786085039377213e-02 4.1973164677619934e-01 <_> - 0 -1 552 -3.7466879002749920e-03 + 0 -1 983 7.8374873846769333e-03 - -5.2957397699356079e-01 4.6158149838447571e-02 + -6.8252839148044586e-02 3.9001336693763733e-01 <_> - 0 -1 501 -2.9029445722699165e-03 + 0 -1 867 3.3967243507504463e-03 - -4.1290035843849182e-01 5.1479596644639969e-02 + 5.7270396500825882e-02 -4.7492286562919617e-01 <_> - 0 -1 13 3.7801317870616913e-02 + 0 -1 158 3.2095968723297119e-02 - -1.0680335760116577e-01 2.2418104112148285e-01 + 3.0982470139861107e-02 -7.2973543405532837e-01 <_> - 0 -1 73 -8.4752835333347321e-02 + 0 -1 939 4.1734268888831139e-03 - -7.8421443700790405e-01 3.0642487108707428e-02 + 3.0397623777389526e-02 -6.8009066581726074e-01 <_> - 0 -1 619 9.6596507355570793e-03 + 0 -1 545 3.2336891163140535e-03 - -9.7389675676822662e-02 2.4497544765472412e-01 + -9.4194613397121429e-02 2.5351443886756897e-01 <_> - 0 -1 519 7.2564175352454185e-03 + 0 -1 55 -3.8070861250162125e-02 - -9.8195895552635193e-02 2.9686492681503296e-01 + 2.7447724342346191e-01 -8.3862110972404480e-02 <_> - 0 -1 33 -1.0029030963778496e-02 + 0 -1 358 4.6657784841954708e-03 - -5.6505876779556274e-01 4.1911888867616653e-02 + 3.7179920822381973e-02 -6.7654901742935181e-01 <_> - 0 -1 540 -9.7039304673671722e-03 + 0 -1 247 -3.9379103109240532e-03 - 2.1148304641246796e-01 -1.0376640409231186e-01 + -5.9923279285430908e-01 3.2963614910840988e-02 <_> - 0 -1 425 -1.8890092615038157e-03 + 0 -1 699 -4.8031057231128216e-03 - 2.2384525835514069e-01 -1.0597650706768036e-01 - <_> - - 0 -1 587 -1.4225458726286888e-03 - - 2.1189780533313751e-01 -1.1053096503019333e-01 - <_> - - 0 -1 301 4.3249968439340591e-03 - - 4.1859358549118042e-02 -5.3136503696441650e-01 - <_> - - 0 -1 418 -2.5746987666934729e-03 - - -3.3480682969093323e-01 6.2653385102748871e-02 - <_> - - 0 -1 822 1.9772505387663841e-02 - - -5.8535441756248474e-02 3.9204162359237671e-01 - <_> - - 0 -1 255 -9.6579845994710922e-03 - - 2.2001895308494568e-01 -9.4623439013957977e-02 - <_> - - 0 -1 320 1.5255061443895102e-03 - - -8.3463013172149658e-02 3.1410121917724609e-01 - <_> - - 0 -1 136 6.2276879325509071e-03 - - 5.6847181171178818e-02 -4.1030114889144897e-01 - <_> - - 0 -1 214 9.0132874902337790e-04 - - -8.4593303501605988e-02 2.7151137590408325e-01 - <_> - - 0 -1 953 -4.6218577772378922e-03 - - -4.0008178353309631e-01 5.6437231600284576e-02 - <_> - - 0 -1 730 -1.5077156014740467e-02 - - 2.3747061192989349e-01 -9.1518931090831757e-02 - <_> - - 0 -1 34 2.1273698657751083e-02 - - 5.3466927260160446e-02 -4.5392176508903503e-01 - <_> - - 0 -1 227 -6.0164434835314751e-03 - - 2.3596890270709991e-01 -1.2803076207637787e-01 - <_> - - 0 -1 148 8.9327711611986160e-03 - - 4.2524505406618118e-02 -5.8664286136627197e-01 - <_> - - 0 -1 118 7.3118656873703003e-03 - - -6.9641888141632080e-02 3.3589112758636475e-01 - <_> - - 0 -1 616 2.6424862444400787e-03 - - 3.4661941230297089e-02 -6.7860239744186401e-01 - <_> - - 0 -1 641 5.9287068434059620e-03 - - 2.7298627421259880e-02 -6.5472942590713501e-01 - <_> - - 0 -1 877 -7.8424429520964622e-03 - - -6.3548064231872559e-01 2.7554484084248543e-02 - <_> - - 0 -1 541 -2.1585542708635330e-03 - - 2.2929325699806213e-01 -9.0029284358024597e-02 - <_> - - 0 -1 484 1.5804420690983534e-03 - - -9.7765833139419556e-02 2.2442239522933960e-01 - <_> - - 0 -1 478 -1.2139983475208282e-02 - - 2.9934337735176086e-01 -7.2730682790279388e-02 - <_> - - 0 -1 149 2.2737295366823673e-03 - - 4.6053361147642136e-02 -4.7994795441627502e-01 - <_> - - 0 -1 229 2.0574156660586596e-03 - - -4.9065478146076202e-02 4.6873793005943298e-01 - <_> - - 0 -1 132 5.9092035517096519e-03 - - 3.3293012529611588e-02 -6.2421238422393799e-01 - <_> - - 0 -1 569 -2.0584808662533760e-02 - - 2.6486057043075562e-01 -7.6441936194896698e-02 - <_> - - 0 -1 92 1.1120462790131569e-02 - - 4.4590156525373459e-02 -5.2196294069290161e-01 - <_> - - 0 -1 797 -3.4440308809280396e-03 - - 1.5679638087749481e-01 -1.3589784502983093e-01 - <_> - - 0 -1 963 -1.0556755587458611e-02 - - 3.0609151721000671e-01 -7.2761178016662598e-02 - <_> - - 0 -1 67 8.1238988786935806e-03 - - 4.4047191739082336e-02 -4.8989585041999817e-01 - <_> - - 0 -1 25 -1.1493992060422897e-02 - - 2.0072945952415466e-01 -1.1034463346004486e-01 - <_> - - 0 -1 586 2.3690698668360710e-02 - - -1.2550449371337891e-01 1.8665367364883423e-01 - <_> - - 0 -1 871 1.5682559460401535e-02 - - -7.4671298265457153e-02 2.8130453824996948e-01 - <_> - - 0 -1 399 -3.3444758504629135e-02 - - 2.6843747496604919e-01 -8.3811916410923004e-02 - <_> - - 0 -1 610 3.0884463340044022e-02 - - -9.9225074052810669e-02 2.2484876215457916e-01 - <_> - - 0 -1 222 -4.0955815464258194e-02 - - 1.8551258742809296e-01 -1.1869347840547562e-01 + 2.2248022258281708e-01 -1.0560184717178345e-01 <_> - 90 - -1.4453492164611816e+00 + 55 + -1.3843152523040771e+00 <_> - 0 -1 735 -4.5189578086137772e-03 + 0 -1 456 6.7532630637288094e-03 - 6.7139738798141479e-01 9.2261902987957001e-02 + -1.5934121608734131e-01 5.1630091667175293e-01 <_> - 0 -1 199 4.2574461549520493e-03 + 0 -1 685 1.6582473181188107e-03 - -1.1547925323247910e-01 4.7692731022834778e-01 + -1.4192129671573639e-01 4.6970281004905701e-01 <_> - 0 -1 395 -3.0073656234890223e-03 + 0 -1 741 8.5381623357534409e-03 - 3.6661648750305176e-01 -1.3400055468082428e-01 + -1.4064009487628937e-01 4.3454051017761230e-01 <_> - 0 -1 185 2.0850619673728943e-01 + 0 -1 711 -5.8347072452306747e-02 - -1.7360156774520874e-01 2.8776788711547852e-01 + 4.8053690791130066e-01 -1.1435888707637787e-01 <_> - 0 -1 263 -3.3409267663955688e-02 + 0 -1 200 7.5503322295844555e-04 - 4.2965263128280640e-01 -1.1280254274606705e-01 + -1.6613751649856567e-01 3.5059270262718201e-01 <_> - 0 -1 444 8.2403160631656647e-03 + 0 -1 463 -1.6263198340311646e-03 - -1.3494767248630524e-01 3.0936670303344727e-01 + 3.3983412384986877e-01 -1.2952369451522827e-01 <_> - 0 -1 201 -5.4142652079463005e-03 + 0 -1 982 -4.9476943910121918e-02 - -5.0563532114028931e-01 6.3294559717178345e-02 + 5.1085108518600464e-01 -7.6757252216339111e-02 <_> - 0 -1 691 -1.3661640696227551e-02 + 0 -1 148 1.5736839268356562e-03 - 2.6760646700859070e-01 -1.3282431662082672e-01 + -9.8503805696964264e-02 4.2097148299217224e-01 <_> - 0 -1 5 -6.6441677510738373e-02 + 0 -1 970 2.8940830379724503e-03 - 4.2027309536933899e-01 -9.1117665171623230e-02 + 8.0476768314838409e-02 -5.9272909164428711e-01 <_> - 0 -1 363 -3.6823814734816551e-03 + 0 -1 470 -8.5198890883475542e-04 - -6.0496860742568970e-01 6.3766337931156158e-02 + 2.7713751792907715e-01 -1.2991340458393097e-01 <_> - 0 -1 363 3.5007880069315434e-03 + 0 -1 513 -3.2718123402446508e-03 - 5.9523750096559525e-02 -5.4523044824600220e-01 + 3.1215441226959229e-01 -1.2980756163597107e-01 <_> - 0 -1 223 1.5307647408917546e-03 + 0 -1 244 6.0219354927539825e-03 - -1.1713726073503494e-01 3.1415259838104248e-01 + 7.2135269641876221e-02 -5.9813290834426880e-01 <_> - 0 -1 769 -1.7609039321541786e-02 + 0 -1 81 2.3065296933054924e-02 - 3.9622062444686890e-01 -8.1705585122108459e-02 + 7.1330830454826355e-02 -5.3722465038299561e-01 <_> - 0 -1 878 2.3612366989254951e-02 + 0 -1 187 2.7176631192560308e-05 - -1.1964736133813858e-01 2.8404179215431213e-01 + -2.6853099465370178e-01 1.4315985143184662e-01 <_> - 0 -1 9 -1.2014270760118961e-02 + 0 -1 401 5.4575498215854168e-03 - 2.7746838331222534e-01 -1.1446747928857803e-01 + 5.5034745484590530e-02 -5.7176333665847778e-01 <_> - 0 -1 450 -4.6456828713417053e-03 + 0 -1 391 2.5911496777553111e-05 - -5.3870040178298950e-01 5.2098110318183899e-02 + -2.3133303225040436e-01 1.4060766994953156e-01 <_> - 0 -1 447 5.3105363622307777e-03 + 0 -1 12 2.1752633154392242e-02 - -1.0284136235713959e-01 3.0061340332031250e-01 + 5.9929180890321732e-02 -5.0224888324737549e-01 <_> - 0 -1 463 -3.2729478552937508e-03 + 0 -1 860 3.5099866800010204e-03 - 1.9203263521194458e-01 -1.6125205159187317e-01 + 4.7387380152940750e-02 -5.8126205205917358e-01 <_> - 0 -1 329 9.8467990756034851e-03 + 0 -1 755 8.6558861657977104e-03 - 4.8938397318124771e-02 -5.1129150390625000e-01 + -1.3651072978973389e-01 2.2407715022563934e-01 <_> - 0 -1 270 3.2083394471555948e-03 + 0 -1 990 3.0432851053774357e-03 - -8.5019417107105255e-02 3.4343490004539490e-01 + 5.7905938476324081e-02 -5.5585581064224243e-01 <_> - 0 -1 228 5.5270073935389519e-03 + 0 -1 240 3.4083288628607988e-03 - 6.3495978713035583e-02 -4.8666983842849731e-01 + 4.6358574181795120e-02 -5.6204903125762939e-01 <_> - 0 -1 866 -2.3475135676562786e-03 + 0 -1 241 -4.1327420622110367e-03 - 2.5843459367752075e-01 -1.1678623408079147e-01 + -4.3748503923416138e-01 6.6312022507190704e-02 <_> - 0 -1 689 -1.5939555596560240e-03 + 0 -1 887 5.4382300004363060e-04 - -3.2783389091491699e-01 8.0364800989627838e-02 + -1.2188895046710968e-01 2.6694831252098083e-01 <_> - 0 -1 422 -4.1191074997186661e-03 + 0 -1 886 2.0359107293188572e-03 - -5.5736887454986572e-01 4.6545837074518204e-02 + -6.9375663995742798e-02 4.1734528541564941e-01 <_> - 0 -1 834 1.7747837118804455e-03 + 0 -1 894 5.6087510893121362e-04 - -7.7934704720973969e-02 3.3011713624000549e-01 + -1.2235503643751144e-01 2.9018589854240417e-01 <_> - 0 -1 789 -1.6894178697839379e-03 + 0 -1 957 5.4084453731775284e-03 - 2.2780518233776093e-01 -1.1316975951194763e-01 + 5.1494579762220383e-02 -6.3784217834472656e-01 <_> - 0 -1 625 -2.0341284107416868e-03 + 0 -1 99 1.9748538732528687e-02 - -3.8829386234283447e-01 6.9249257445335388e-02 + -7.0414997637271881e-02 4.8995351791381836e-01 <_> - 0 -1 655 -3.4458152949810028e-03 + 0 -1 147 -2.0231239497661591e-02 - -4.0543556213378906e-01 5.8193698525428772e-02 + -5.9452813863754272e-01 5.5317912250757217e-02 <_> - 0 -1 813 -9.3588102608919144e-03 + 0 -1 763 -8.5184378549456596e-03 - 3.1281456351280212e-01 -7.8269012272357941e-02 + -4.9081006646156311e-01 5.1023125648498535e-02 <_> - 0 -1 322 -4.9023423343896866e-03 + 0 -1 952 6.4936149865388870e-03 - -4.0507251024246216e-01 6.6911309957504272e-02 + -8.6577519774436951e-02 3.6036944389343262e-01 <_> - 0 -1 68 -4.8415181040763855e-01 + 0 -1 30 -4.0995404124259949e-02 - 6.5363335609436035e-01 -4.0620740503072739e-02 + 4.0132537484169006e-01 -7.1912504732608795e-02 <_> - 0 -1 18 2.6781920343637466e-02 + 0 -1 501 3.1340471468865871e-03 - -1.0990447551012039e-01 2.1767459809780121e-01 + -1.2547470629215240e-01 2.2158138453960419e-01 <_> - 0 -1 800 -9.4280913472175598e-03 + 0 -1 184 -1.9882351160049438e-02 - -7.4746483564376831e-01 2.9869174584746361e-02 + -7.1213179826736450e-01 4.2412471026182175e-02 <_> - 0 -1 492 -7.7869845554232597e-03 + 0 -1 559 2.0461969077587128e-02 - 3.0222293734550476e-01 -8.3480700850486755e-02 + -1.0324169695377350e-01 2.9102885723114014e-01 <_> - 0 -1 426 3.5958206281065941e-03 + 0 -1 686 -1.2761610560119152e-03 - -8.2547821104526520e-02 2.9035624861717224e-01 + 2.3810100555419922e-01 -1.1509060114622116e-01 <_> - 0 -1 487 5.8124819770455360e-03 + 0 -1 549 -3.3783772960305214e-03 - -9.7843483090400696e-02 2.6563084125518799e-01 + -5.6838840246200562e-01 5.6331343948841095e-02 <_> - 0 -1 66 -6.3764736987650394e-03 + 0 -1 302 5.0912564620375633e-03 - -4.6169018745422363e-01 5.5747114121913910e-02 + 4.7987211495637894e-02 -4.7997272014617920e-01 <_> - 0 -1 186 -7.2099521756172180e-02 + 0 -1 508 -4.1752815246582031e-02 - -7.3345041275024414e-01 2.8517069295048714e-02 + -5.9290748834609985e-01 4.2219188064336777e-02 <_> - 0 -1 120 -8.2340046763420105e-02 + 0 -1 263 -1.3672109693288803e-02 - -6.5312498807907104e-01 2.9036073014140129e-02 + 2.7416154742240906e-01 -9.8633147776126862e-02 <_> - 0 -1 927 -1.5001616440713406e-02 + 0 -1 329 4.5463615097105503e-03 - -6.3826096057891846e-01 3.2474573701620102e-02 + -9.5323033630847931e-02 3.3586710691452026e-01 <_> - 0 -1 288 1.1907238513231277e-03 + 0 -1 472 -1.1957241222262383e-02 - -7.9208493232727051e-02 2.9137271642684937e-01 + 1.6140049695968628e-01 -1.6837921738624573e-01 <_> - 0 -1 594 3.1184246763586998e-03 + 0 -1 95 -2.4866103194653988e-03 - 4.7656070441007614e-02 -4.7487255930900574e-01 + -3.8348227739334106e-01 6.6880211234092712e-02 <_> - 0 -1 603 8.2192681729793549e-03 + 0 -1 130 3.3222150523215532e-03 - 2.6732290163636208e-02 -7.3682332038879395e-01 + 4.9669362604618073e-02 -5.2419567108154297e-01 <_> - 0 -1 264 7.1536734700202942e-02 + 0 -1 767 1.2700627557933331e-03 - -6.6174156963825226e-02 3.4596624970436096e-01 + -1.0981336981058121e-01 2.4314954876899719e-01 <_> - 0 -1 707 -1.3247081078588963e-02 + 0 -1 643 -4.0526064112782478e-03 - 2.2122915089130402e-01 -1.1525890231132507e-01 + -5.4617625474929810e-01 4.6236973255872726e-02 <_> - 0 -1 88 6.4605651423335075e-03 + 0 -1 889 -1.7611857037991285e-03 - 5.1374625414609909e-02 -4.2834889888763428e-01 + 2.0527404546737671e-01 -1.1924317479133606e-01 <_> - 0 -1 714 -1.9957395270466805e-03 + 0 -1 832 -2.8845192864537239e-03 - 2.8387853503227234e-01 -8.6039707064628601e-02 + 2.0061042904853821e-01 -1.4499643445014954e-01 <_> - 0 -1 939 2.5912611745297909e-03 + 0 -1 969 -9.4242449849843979e-03 - 6.0468357056379318e-02 -3.9721179008483887e-01 + -7.2513866424560547e-01 3.4894362092018127e-02 <_> - 0 -1 716 1.9276916980743408e-02 + 0 -1 972 3.7029895465821028e-03 - -8.2993559539318085e-02 3.0764940381050110e-01 + 5.5003125220537186e-02 -4.1173446178436279e-01 <_> - 0 -1 887 -4.9096969887614250e-03 + 0 -1 785 -8.4825151134282351e-04 - 2.7268949151039124e-01 -8.6130671203136444e-02 + 2.6719486713409424e-01 -9.9083028733730316e-02 <_> - 0 -1 950 3.6836266517639160e-03 + 0 -1 54 1.5727356076240540e-02 - 5.9468954801559448e-02 -3.9446946978569031e-01 + -1.2551975250244141e-01 2.0588764548301697e-01 <_> - 0 -1 520 3.0758073553442955e-03 + 0 -1 106 5.9068910777568817e-03 - -9.7390249371528625e-02 2.4346484243869781e-01 + 6.0179408639669418e-02 -4.1827461123466492e-01 <_> - 0 -1 522 -4.2319851927459240e-03 + 0 -1 27 -3.9538964629173279e-02 - 3.0930569767951965e-01 -7.9394333064556122e-02 + 3.4726879000663757e-01 -7.4968926608562469e-02 <_> - 0 -1 405 7.2837145999073982e-03 + 0 -1 10 4.7501657158136368e-02 - 4.7933470457792282e-02 -4.8675662279129028e-01 + -7.6978117227554321e-02 3.5068345069885254e-01 <_> - 0 -1 467 -6.2543689273297787e-03 + 0 -1 259 -5.9454172151163220e-04 - -4.8621338605880737e-01 4.2082890868186951e-02 - <_> - - 0 -1 872 -1.1530111078172922e-03 - - 2.6954403519630432e-01 -8.6280718445777893e-02 - <_> - - 0 -1 560 4.0323145687580109e-02 - - -9.4530344009399414e-02 2.3481069505214691e-01 - <_> - - 0 -1 15 -1.2282184325158596e-02 - - -7.2538161277770996e-01 3.0701907351613045e-02 - <_> - - 0 -1 678 3.7427488714456558e-02 - - 2.9119925573468208e-02 -6.4663606882095337e-01 - <_> - - 0 -1 568 2.5721127167344093e-03 - - 4.9338530749082565e-02 -4.0851938724517822e-01 - <_> - - 0 -1 925 -2.0106829702854156e-02 - - -6.2753307819366455e-01 3.1198438256978989e-02 - <_> - - 0 -1 936 2.5536534376442432e-03 - - 2.3092683404684067e-02 -7.4033683538436890e-01 - <_> - - 0 -1 876 -1.3628168962895870e-03 - - 3.4928113222122192e-01 -6.5548241138458252e-02 - <_> - - 0 -1 875 -9.9153746850788593e-04 - - 2.2522389888763428e-01 -9.1688700020313263e-02 - <_> - - 0 -1 965 5.0148647278547287e-03 - - 3.9175543934106827e-02 -5.5856782197952271e-01 - <_> - - 0 -1 853 9.1358053032308817e-04 - - -1.2273798882961273e-01 1.8954706192016602e-01 - <_> - - 0 -1 762 1.6373313963413239e-02 - - 3.9829690009355545e-02 -5.7986593246459961e-01 - <_> - - 0 -1 544 1.4575564302504063e-02 - - -8.6225226521492004e-02 2.4198558926582336e-01 - <_> - - 0 -1 967 5.1754433661699295e-04 - - 8.9498788118362427e-02 -2.1777628362178802e-01 - <_> - - 0 -1 79 -1.1098009534180164e-02 - - 2.2925806045532227e-01 -8.3799630403518677e-02 - <_> - - 0 -1 308 2.4133864790201187e-02 - - -1.0102383792400360e-01 2.0877565443515778e-01 - <_> - - 0 -1 152 -3.7758771330118179e-02 - - 4.3367731571197510e-01 -5.1683723926544189e-02 - <_> - - 0 -1 218 9.0820249170064926e-03 - - 4.0468864142894745e-02 -5.4790335893630981e-01 - <_> - - 0 -1 385 -3.8959060329943895e-03 - - -3.4300115704536438e-01 5.6340463459491730e-02 - <_> - - 0 -1 815 -1.0297749191522598e-02 - - 2.9084947705268860e-01 -8.1125274300575256e-02 - <_> - - 0 -1 815 8.3358399569988251e-03 - - -6.9515161216259003e-02 3.0880457162857056e-01 - <_> - - 0 -1 805 4.1338298469781876e-02 - - 3.2240319997072220e-02 -6.5160977840423584e-01 - <_> - - 0 -1 345 2.6844158768653870e-02 - - -6.5987348556518555e-02 3.1071534752845764e-01 - <_> - - 0 -1 93 -4.4573536142706871e-03 - - -3.4222671389579773e-01 6.0962244868278503e-02 - <_> - - 0 -1 217 -5.6259175762534142e-03 - - 1.9679838418960571e-01 -9.9301390349864960e-02 - <_> - - 0 -1 130 -3.4068014472723007e-02 - - -5.7343089580535889e-01 3.5370521247386932e-02 - <_> - - 0 -1 415 -4.1321285068988800e-02 - - -5.4799556732177734e-01 3.2511439174413681e-02 - <_> - - 0 -1 702 -4.5842211693525314e-03 - - 2.0696444809436798e-01 -9.3100592494010925e-02 - <_> - - 0 -1 705 -8.6525538936257362e-03 - - -5.2304923534393311e-01 4.0334302932024002e-02 - <_> - - 0 -1 656 -8.1807989627122879e-03 - - 3.0393254756927490e-01 -6.9615311920642853e-02 - <_> - - 0 -1 867 -6.2429648824036121e-03 - - -5.0806474685668945e-01 4.2720243334770203e-02 - <_> - - 0 -1 660 -4.3397732079029083e-03 - - -4.7173827886581421e-01 3.7593103945255280e-02 - <_> - - 0 -1 392 -2.4694669991731644e-03 - - 3.4972354769706726e-01 -6.2289424240589142e-02 - <_> - - 0 -1 496 4.6105296351015568e-03 - - 4.8353113234043121e-02 -3.9337757229804993e-01 - <_> - - 0 -1 368 1.5546558424830437e-03 - - -8.5152842104434967e-02 2.4539804458618164e-01 + 1.6073931753635406e-01 -1.5279982984066010e-01 <_> - 100 - -1.6321692466735840e+00 + 58 + -1.2862224578857422e+00 <_> - 0 -1 443 -9.9800406023859978e-03 + 0 -1 882 -1.3625519350171089e-02 - 6.5110075473785400e-01 7.0068746805191040e-02 + 5.0128185749053955e-01 -1.1663150042295456e-01 <_> - 0 -1 656 1.2785504572093487e-02 + 0 -1 375 -2.2920668125152588e-03 - -1.5662825107574463e-01 4.5551964640617371e-01 + 3.9538189768791199e-01 -1.3872602581977844e-01 <_> - 0 -1 197 4.0613190503790975e-04 + 0 -1 792 1.0770710650831461e-03 - -2.3326659202575684e-01 2.4264821410179138e-01 + -1.7133137583732605e-01 3.1510788202285767e-01 <_> - 0 -1 0 -4.4671623036265373e-03 + 0 -1 452 -1.2591466307640076e-02 - 3.0027064681053162e-01 -1.7738959193229675e-01 + 3.9579889178276062e-01 -1.4279782772064209e-01 <_> - 0 -1 733 7.1196053177118301e-03 + 0 -1 460 -4.7927081584930420e-02 - -1.3141728937625885e-01 4.3263924121856689e-01 + -4.9305588006973267e-01 5.6685980409383774e-02 <_> - 0 -1 855 7.1185962297022343e-03 + 0 -1 474 -2.5895023718476295e-03 - -1.5669579803943634e-01 3.3418005704879761e-01 + 1.6586430370807648e-01 -2.2577352821826935e-01 <_> - 0 -1 725 4.5672003179788589e-03 + 0 -1 112 9.8585948348045349e-02 - -1.2860487401485443e-01 3.1136614084243774e-01 + -7.2541341185569763e-02 5.3971153497695923e-01 <_> - 0 -1 859 -1.0435921140015125e-03 + 0 -1 521 7.2299325838685036e-03 - 1.9418887794017792e-01 -1.7872068285942078e-01 + 7.2869211435317993e-02 -6.0541796684265137e-01 <_> - 0 -1 111 -8.6360834538936615e-03 + 0 -1 202 -6.0262705665081739e-04 - -6.0729598999023438e-01 3.6422688513994217e-02 + 2.7961328625679016e-01 -1.3374039530754089e-01 <_> - 0 -1 685 6.4469715580344200e-03 + 0 -1 253 5.3171166218817234e-03 - -1.7270094156265259e-01 1.8412014842033386e-01 + 6.1562143266201019e-02 -5.3435516357421875e-01 <_> - 0 -1 920 -3.2128435559570789e-03 + 0 -1 109 -7.3790093883872032e-03 - -5.6947451829910278e-01 5.5858459323644638e-02 + -5.8770626783370972e-01 5.2599798887968063e-02 <_> - 0 -1 202 2.9547505080699921e-02 + 0 -1 179 2.2994203027337790e-04 - 5.4511282593011856e-02 -4.9024525284767151e-01 + -2.2165967524051666e-01 1.6663813591003418e-01 <_> - 0 -1 161 -5.3524523973464966e-03 + 0 -1 366 -2.7968082576990128e-03 - -4.3886002898216248e-01 5.9159737080335617e-02 + -4.5023602247238159e-01 6.7983791232109070e-02 <_> - 0 -1 159 2.2656358778476715e-03 + 0 -1 949 -4.4262632727622986e-03 - -1.4958912134170532e-01 1.9237321615219116e-01 + -5.4457426071166992e-01 5.3928002715110779e-02 <_> - 0 -1 272 -1.7663020640611649e-02 + 0 -1 431 -6.1236601322889328e-03 - 3.4963962435722351e-01 -9.8792962729930878e-02 + 2.9386061429977417e-01 -1.0868654400110245e-01 <_> - 0 -1 135 -1.4769199490547180e-01 + 0 -1 364 6.1672870069742203e-03 - 3.8789209723472595e-01 -7.4754111468791962e-02 + 6.7409984767436981e-02 -4.2896196246147156e-01 <_> - 0 -1 961 -1.2649353593587875e-02 + 0 -1 335 1.5454929322004318e-02 - 3.6447465419769287e-01 -7.8627258539199829e-02 + -9.3371987342834473e-02 3.2237896323204041e-01 <_> - 0 -1 203 -1.6667589545249939e-01 + 0 -1 285 -5.5358107201755047e-03 - 3.1024694442749023e-01 -9.8567992448806763e-02 + -6.3797932863235474e-01 4.7232467681169510e-02 <_> - 0 -1 823 1.5327525325119495e-03 + 0 -1 210 -5.8793288189917803e-04 - -8.7889634072780609e-02 3.3739477396011353e-01 + 2.6480975747108459e-01 -1.1852940917015076e-01 <_> - 0 -1 37 -4.9399482086300850e-03 + 0 -1 203 1.2575921136885881e-03 - -6.0582613945007324e-01 4.7072298824787140e-02 + -1.2490244954824448e-01 2.8103300929069519e-01 <_> - 0 -1 663 1.6168793663382530e-03 + 0 -1 41 3.3034523949027061e-03 - -1.1102212965488434e-01 2.4625547230243683e-01 + 6.2105692923069000e-02 -4.5968556404113770e-01 <_> - 0 -1 38 -7.9764677211642265e-03 + 0 -1 45 -2.6582641527056694e-02 - -4.5467814803123474e-01 5.6168641895055771e-02 + -5.0849837064743042e-01 5.3966015577316284e-02 <_> - 0 -1 803 2.1164701320230961e-03 + 0 -1 49 2.7427850291132927e-02 - 3.9522409439086914e-02 -5.8244407176971436e-01 + 5.2529457956552505e-02 -5.3614085912704468e-01 <_> - 0 -1 423 1.2181616621091962e-03 + 0 -1 39 -2.1938718855381012e-03 - -1.1960548907518387e-01 1.8955740332603455e-01 + -5.6713318824768066e-01 4.6497207134962082e-02 <_> - 0 -1 414 6.2020774930715561e-02 + 0 -1 926 8.5861550178378820e-04 - -9.2262148857116699e-02 2.4536235630512238e-01 + -1.1162154376506805e-01 2.8105884790420532e-01 <_> - 0 -1 98 1.5368127264082432e-02 + 0 -1 886 -8.4925384726375341e-04 - -7.4950158596038818e-02 3.8813439011573792e-01 + 3.1280112266540527e-01 -1.2138028442859650e-01 <_> - 0 -1 631 -3.6116694100201130e-03 + 0 -1 956 2.9905270785093307e-03 - -5.8402395248413086e-01 4.3880671262741089e-02 + 6.1607286334037781e-02 -5.1581907272338867e-01 <_> - 0 -1 669 -5.4048337042331696e-03 + 0 -1 968 5.8231391012668610e-03 - 2.7466323971748352e-01 -8.3315111696720123e-02 + 4.7376025468111038e-02 -5.1492005586624146e-01 <_> - 0 -1 190 -5.7541755959391594e-03 + 0 -1 480 4.2811138555407524e-03 - -4.8696601390838623e-01 5.0719954073429108e-02 + 3.2761037349700928e-02 -6.7820072174072266e-01 <_> - 0 -1 868 -8.8466441957280040e-04 + 0 -1 915 9.5272483304142952e-04 - 1.4997816085815430e-01 -1.4873522520065308e-01 + -1.5452747046947479e-01 1.7837351560592651e-01 <_> - 0 -1 419 -1.3690529391169548e-02 + 0 -1 270 -2.7698231860995293e-04 - -4.2396122217178345e-01 5.1716264337301254e-02 + 1.8924367427825928e-01 -1.3868112862110138e-01 <_> - 0 -1 231 -9.2098396271467209e-03 + 0 -1 370 3.0586202628910542e-03 - -6.8742758035659790e-01 2.8357446193695068e-02 + 5.3298473358154297e-02 -4.7908756136894226e-01 <_> - 0 -1 433 -1.0102453641593456e-02 + 0 -1 639 2.0293965935707092e-03 - 3.0423650145530701e-01 -7.5886160135269165e-02 + 3.1667634844779968e-02 -6.7199909687042236e-01 <_> - 0 -1 789 -2.1283417008817196e-03 + 0 -1 639 -1.8073513638228178e-03 - 2.2551217675209045e-01 -9.5488928258419037e-02 + -6.4894622564315796e-01 3.3469315618276596e-02 <_> - 0 -1 675 2.2938135080039501e-03 + 0 -1 320 -1.1197938583791256e-03 - 3.2833088189363480e-02 -6.4737302064895630e-01 + 2.2734998166561127e-01 -1.1382233351469040e-01 <_> - 0 -1 795 -2.0679826848208904e-03 + 0 -1 828 1.2703117681667209e-03 - 2.9072764515876770e-01 -8.1707596778869629e-02 + -9.7680233418941498e-02 2.9997348785400391e-01 <_> - 0 -1 495 1.8802012782543898e-03 + 0 -1 835 -1.8036495894193649e-03 - -1.0236340761184692e-01 2.4278828501701355e-01 + 2.3566392064094543e-01 -1.1566326767206192e-01 <_> - 0 -1 566 -1.5465463511645794e-03 + 0 -1 222 2.3318463936448097e-03 - -3.8903787732124329e-01 5.6320030242204666e-02 + 5.5787801742553711e-02 -4.4648987054824829e-01 <_> - 0 -1 630 6.3281953334808350e-03 + 0 -1 111 1.8485619220882654e-03 - -9.9905796349048615e-02 2.2087195515632629e-01 + -1.0420991480350494e-01 2.4521166086196899e-01 <_> - 0 -1 704 3.3235952258110046e-02 + 0 -1 101 8.2633290439844131e-03 - 5.0302099436521530e-02 -4.9443060159683228e-01 + 5.3129263222217560e-02 -4.8460647463798523e-01 <_> - 0 -1 894 -1.9428483210504055e-03 + 0 -1 760 2.7392050469643436e-05 - -6.7564088106155396e-01 2.7948424220085144e-02 + -1.7487643659114838e-01 1.3620604574680328e-01 <_> - 0 -1 849 1.1729343095794320e-03 + 0 -1 352 2.6163433212786913e-03 - -1.1950153112411499e-01 1.8506029248237610e-01 + -9.9586494266986847e-02 2.4075058102607727e-01 <_> - 0 -1 941 5.4220901802182198e-03 + 0 -1 94 3.6149267107248306e-03 - 5.0924405455589294e-02 -4.3448522686958313e-01 + 4.2312353849411011e-02 -5.5195075273513794e-01 <_> - 0 -1 768 3.0700212810188532e-03 + 0 -1 403 1.4812931418418884e-02 - -7.6845921576023102e-02 2.6929470896720886e-01 + -6.7619144916534424e-02 3.7573158740997314e-01 <_> - 0 -1 914 2.6065693236887455e-03 + 0 -1 814 -2.8877586591988802e-03 - 5.5169116705656052e-02 -3.9985677599906921e-01 + -5.3493702411651611e-01 5.1065266132354736e-02 <_> - 0 -1 884 2.6848190464079380e-03 + 0 -1 930 3.5591312916949391e-04 - 2.7681041508913040e-02 -6.6643798351287842e-01 + -1.2231220304965973e-01 1.9974029064178467e-01 <_> - 0 -1 471 4.9525322392582893e-03 + 0 -1 36 -1.0347569361329079e-02 - -7.8715771436691284e-02 2.6918828487396240e-01 + -6.3408315181732178e-01 4.0167611092329025e-02 <_> - 0 -1 466 -1.2217788025736809e-02 + 0 -1 34 -4.4028884731233120e-03 - 2.5042393803596497e-01 -9.2959709465503693e-02 + -5.1359844207763672e-01 4.3052427470684052e-02 <_> - 0 -1 51 -9.7617935389280319e-03 + 0 -1 856 -1.6173283802345395e-03 - -5.8083361387252808e-01 4.1861489415168762e-02 + 1.4859439432621002e-01 -1.4985026419162750e-01 <_> - 0 -1 528 -3.0802208930253983e-03 + 0 -1 996 -3.1839800067245960e-03 - -5.4920911788940430e-01 3.1410869210958481e-02 + -4.1493499279022217e-01 6.0393124818801880e-02 <_> - 0 -1 499 8.8869817554950714e-03 + 0 -1 960 -7.9784039407968521e-03 - -5.7799737900495529e-02 3.5997068881988525e-01 + 2.8296649456024170e-01 -8.6312569677829742e-02 <_> - 0 -1 383 -1.6894126310944557e-03 + 0 -1 797 2.8750954661518335e-03 - 1.5611077845096588e-01 -1.3526220619678497e-01 + -6.7822508513927460e-02 3.2967612147331238e-01 <_> - 0 -1 80 1.1576576158404350e-02 + 0 -1 992 -1.1433581821620464e-03 - 2.6843478903174400e-02 -7.7421426773071289e-01 + -3.4375748038291931e-01 6.8774074316024780e-02 <_> - 0 -1 283 -1.0315187275409698e-02 + 0 -1 668 1.7783213406801224e-03 - -3.7911209464073181e-01 4.7785960137844086e-02 + -8.8273152709007263e-02 2.6904863119125366e-01 <_> - 0 -1 216 9.3458819901570678e-04 + 0 -1 670 -6.3564153388142586e-03 - -1.0482961684465408e-01 1.9531208276748657e-01 + 3.4165042638778687e-01 -7.6342806220054626e-02 <_> - 0 -1 225 -2.1154026035219431e-03 + 0 -1 712 5.8753319084644318e-02 - 3.2437980175018311e-01 -7.0380724966526031e-02 + 3.6884155124425888e-02 -7.0002478361129761e-01 <_> - 0 -1 328 7.0915305987000465e-03 + 0 -1 345 -1.2118986342102289e-03 - 3.1504381448030472e-02 -7.1498668193817139e-01 + 1.8067996203899384e-01 -1.2888990342617035e-01 <_> - 0 -1 968 1.5262098750099540e-03 + 0 -1 268 -3.4786794334650040e-02 - 4.3178513646125793e-02 -4.1175857186317444e-01 - <_> - - 0 -1 194 -2.6456830091774464e-03 - - -6.6830241680145264e-01 2.7078842744231224e-02 - <_> - - 0 -1 722 1.3623384293168783e-03 - - -9.6260324120521545e-02 1.9846718013286591e-01 - <_> - - 0 -1 672 -3.4019351005554199e-03 - - 1.3638894259929657e-01 -1.4331445097923279e-01 - <_> - - 0 -1 667 -4.2538799345493317e-02 - - -6.8543094396591187e-01 2.7219040319323540e-02 - <_> - - 0 -1 572 5.1494771614670753e-03 - - -8.3506844937801361e-02 2.4553795158863068e-01 - <_> - - 0 -1 509 -1.3525998219847679e-03 - - 2.0083853602409363e-01 -1.1441762000322342e-01 - <_> - - 0 -1 889 -4.7460300847887993e-03 - - -5.8234161138534546e-01 3.3193428069353104e-02 - <_> - - 0 -1 559 -1.8419034779071808e-02 - - 2.5098413228988647e-01 -7.8263558447360992e-02 - <_> - - 0 -1 837 -3.6029946058988571e-03 - - 2.5004243850708008e-01 -7.8106440603733063e-02 - <_> - - 0 -1 12 1.0855928063392639e-02 - - 3.8721837103366852e-02 -5.0439488887786865e-01 - <_> - - 0 -1 6 3.1823229044675827e-02 - - 2.8006808832287788e-02 -6.5438795089721680e-01 - <_> - - 0 -1 35 9.0156495571136475e-02 - - 3.6854032427072525e-02 -4.6750095486640930e-01 - <_> - - 0 -1 876 8.1275019329041243e-04 - - -8.1435337662696838e-02 2.3081797361373901e-01 - <_> - - 0 -1 843 -2.2238264791667461e-03 - - -4.6506562829017639e-01 4.2775552719831467e-02 - <_> - - 0 -1 21 8.5265887901186943e-03 - - -9.9068634212017059e-02 1.8661868572235107e-01 - <_> - - 0 -1 601 5.0247795879840851e-03 - - 3.5677276551723480e-02 -5.6390231847763062e-01 - <_> - - 0 -1 353 1.2137264013290405e-02 - - 2.3600205779075623e-02 -6.9947057962417603e-01 - <_> - - 0 -1 687 5.8652815641835332e-04 - - -1.0546504706144333e-01 1.8301849067211151e-01 - <_> - - 0 -1 783 -1.2803040444850922e-02 - - 2.4169570207595825e-01 -9.3701913952827454e-02 - <_> - - 0 -1 362 1.9234570208936930e-03 - - 4.1152808815240860e-02 -5.3527724742889404e-01 - <_> - - 0 -1 413 -5.1119372248649597e-02 - - 2.0418803393840790e-01 -1.0016205906867981e-01 - <_> - - 0 -1 643 2.0427668467164040e-02 - - 3.8303721696138382e-02 -5.6752574443817139e-01 - <_> - - 0 -1 916 1.0702429572120309e-03 - - -1.1941519379615784e-01 1.5449772775173187e-01 - <_> - - 0 -1 45 6.3908234238624573e-02 - - -8.0574154853820801e-02 2.4723786115646362e-01 - <_> - - 0 -1 239 -8.9891534298658371e-03 - - 2.7232396602630615e-01 -7.9600028693675995e-02 - <_> - - 0 -1 181 -7.4440538883209229e-03 - - 1.7151834070682526e-01 -1.1733634769916534e-01 - <_> - - 0 -1 298 9.3747628852725029e-03 - - -5.8857422322034836e-02 3.3993646502494812e-01 - <_> - - 0 -1 890 3.9659179747104645e-03 - - 3.7981141358613968e-02 -5.3772449493408203e-01 - <_> - - 0 -1 698 -2.7701430954039097e-03 - - 2.1686923503875732e-01 -9.1246932744979858e-02 - <_> - - 0 -1 592 -3.0083605088293552e-03 - - -5.1033967733383179e-01 3.8351774215698242e-02 - <_> - - 0 -1 40 5.2285091951489449e-03 - - 6.6746503114700317e-02 -2.5510028004646301e-01 - <_> - - 0 -1 542 2.6635453104972839e-03 - - -8.8651068508625031e-02 2.1260604262351990e-01 - <_> - - 0 -1 545 -3.4417591989040375e-02 - - -6.6850775480270386e-01 3.1463332474231720e-02 - <_> - - 0 -1 550 -9.7544072195887566e-04 - - 2.0566202700138092e-01 -1.0702812671661377e-01 - <_> - - 0 -1 361 1.6097709536552429e-01 - - -4.7826759517192841e-02 3.8993999361991882e-01 - <_> - - 0 -1 489 1.0004348587244749e-03 - - -1.0796900838613510e-01 2.1362201869487762e-01 - <_> - - 0 -1 420 4.0136128664016724e-03 - - -8.1376187503337860e-02 2.2793699800968170e-01 - <_> - - 0 -1 562 3.2076346687972546e-03 - - -1.0031759738922119e-01 2.2700363397598267e-01 - <_> - - 0 -1 53 -4.1395910084247589e-03 - - -4.5727050304412842e-01 4.4953804463148117e-02 - <_> - - 0 -1 595 4.9559203907847404e-03 - - 3.0349666252732277e-02 -5.6468343734741211e-01 - <_> - - 0 -1 835 1.9516122993081808e-03 - - -8.4078930318355560e-02 2.1666139364242554e-01 - <_> - - 0 -1 200 2.8487551957368851e-02 - - -5.8517321944236755e-02 3.7208831310272217e-01 + 2.8380703926086426e-01 -1.0494612902402878e-01 <_> - 100 - -1.5313543081283569e+00 + 61 + -1.3526766300201416e+00 <_> - 0 -1 865 -1.1964191682636738e-02 + 0 -1 875 9.3241240829229355e-03 - 6.5611332654953003e-01 8.7084025144577026e-02 + -1.1945860832929611e-01 4.8265087604522705e-01 <_> - 0 -1 570 -3.6326241679489613e-03 + 0 -1 573 -4.0869116783142090e-03 - 3.0753159523010254e-01 -2.0207116007804871e-01 + 2.7903670072555542e-01 -2.3448269069194794e-01 <_> - 0 -1 739 1.6091932775452733e-03 + 0 -1 676 8.3140000700950623e-02 - -2.1601480245590210e-01 2.4574394524097443e-01 + -8.5437655448913574e-02 5.4905670881271362e-01 <_> - 0 -1 151 -1.0807140171527863e-01 + 0 -1 802 2.6708254590630531e-03 - 5.8551537990570068e-01 -8.0984398722648621e-02 + -1.6097296774387360e-01 3.5868695378303528e-01 <_> - 0 -1 122 6.6386028192937374e-03 + 0 -1 75 2.2817514836788177e-03 - -2.3309321701526642e-01 2.5712442398071289e-01 + -1.6324259340763092e-01 2.3956388235092163e-01 <_> - 0 -1 480 6.6436373163014650e-04 + 0 -1 745 6.7889376077800989e-04 - -1.7002807557582855e-01 2.2093741595745087e-01 + -2.5205141305923462e-01 1.6190616786479950e-01 <_> - 0 -1 109 5.9623841661959887e-04 + 0 -1 811 3.1512721907347441e-03 - -2.1071858704090118e-01 1.5259474515914917e-01 + -1.3325424492359161e-01 2.7017220854759216e-01 <_> - 0 -1 296 -2.1322746761143208e-03 + 0 -1 53 5.7821646332740784e-02 - -3.6114820837974548e-01 7.9649142920970917e-02 + -6.7158013582229614e-02 4.1875806450843811e-01 <_> - 0 -1 102 -6.9360136985778809e-03 + 0 -1 442 2.8442896902561188e-02 - -5.2729552984237671e-01 5.9225857257843018e-02 + 5.5711831897497177e-02 -5.8136337995529175e-01 <_> - 0 -1 1 7.2746481746435165e-03 + 0 -1 644 -1.7370734130963683e-03 - -1.5284915268421173e-01 2.0500071346759796e-01 + -6.7132610082626343e-01 3.2464105635881424e-02 <_> - 0 -1 793 -2.4507325142621994e-03 + 0 -1 324 -1.9680276513099670e-02 - -4.4374018907546997e-01 6.2125567346811295e-02 + 3.9044600725173950e-01 -8.8745564222335815e-02 <_> - 0 -1 677 -1.1941835284233093e-01 + 0 -1 224 1.0001409798860550e-02 - 5.9646230936050415e-01 -5.0393357872962952e-02 + -1.5947268903255463e-01 2.7087828516960144e-01 <_> - 0 -1 830 2.4319710209965706e-03 + 0 -1 644 1.2495646951720119e-03 - -1.4628271758556366e-01 2.2020979225635529e-01 + 8.3702936768531799e-02 -4.6324184536933899e-01 <_> - 0 -1 503 4.0825735777616501e-03 + 0 -1 144 3.0510198324918747e-02 - 4.6519946306943893e-02 -6.0437613725662231e-01 + -1.0709584504365921e-01 3.2648065686225891e-01 <_> - 0 -1 112 3.3597379922866821e-02 + 0 -1 995 -3.7916197907179594e-03 - 5.5770415812730789e-02 -4.4832473993301392e-01 + -6.1073684692382812e-01 4.7788143157958984e-02 <_> - 0 -1 142 -4.1159454733133316e-02 + 0 -1 880 8.5655774455517530e-04 - -4.2802116274833679e-01 5.6050233542919159e-02 + -2.0807541906833649e-01 1.5517778694629669e-01 <_> - 0 -1 357 -3.1343686860054731e-03 + 0 -1 986 -3.2812850549817085e-03 - -4.5189481973648071e-01 4.5713383704423904e-02 + -5.8795136213302612e-01 4.5926980674266815e-02 <_> - 0 -1 449 -3.9362995885312557e-03 + 0 -1 499 3.6125673796050251e-04 - 2.6333171129226685e-01 -8.6672604084014893e-02 + -1.6806155443191528e-01 1.7441834509372711e-01 <_> - 0 -1 274 -3.4228354692459106e-02 + 0 -1 591 -1.2282358948141336e-03 - 2.8555384278297424e-01 -8.0961830914020538e-02 + -4.7641313076019287e-01 5.6790668517351151e-02 <_> - 0 -1 192 2.3194378241896629e-02 + 0 -1 411 9.3263220041990280e-03 - -1.0957508534193039e-01 2.6531192660331726e-01 + -7.4045926332473755e-02 3.7817317247390747e-01 <_> - 0 -1 812 1.1790241114795208e-03 + 0 -1 591 7.4745330493897200e-04 - -1.2578412890434265e-01 2.2350181639194489e-01 + 8.0762349069118500e-02 -3.5692575573921204e-01 <_> - 0 -1 757 2.4525973945856094e-02 + 0 -1 900 7.4315653182566166e-03 - 3.9447281509637833e-02 -6.4369696378707886e-01 + -8.5764542222023010e-02 3.2155406475067139e-01 <_> - 0 -1 234 -5.5821083486080170e-02 + 0 -1 776 2.7057509869337082e-02 - 3.8404938578605652e-01 -6.1516307294368744e-02 + 6.9296583533287048e-02 -4.2836430668830872e-01 <_> - 0 -1 297 8.5053090006113052e-03 + 0 -1 504 3.9283365011215210e-02 - -1.1682828515768051e-01 2.0639540255069733e-01 + -1.0806435346603394e-01 2.9007008671760559e-01 <_> - 0 -1 28 -4.6913616359233856e-02 + 0 -1 23 -3.4139624238014221e-01 - -3.3303919434547424e-01 6.8057745695114136e-02 + 5.0227731466293335e-01 -6.3795588910579681e-02 <_> - 0 -1 531 -6.0622256249189377e-02 + 0 -1 502 -1.8172953277826309e-02 - 3.0634361505508423e-01 -8.0411903560161591e-02 + 2.7207729220390320e-01 -1.0322675853967667e-01 <_> - 0 -1 962 3.3126091584563255e-03 + 0 -1 509 1.5265008434653282e-02 - 6.4039744436740875e-02 -3.6264923214912415e-01 + -1.0788526386022568e-01 2.4405729770660400e-01 <_> - 0 -1 923 -6.2155202031135559e-03 + 0 -1 465 -1.4973650686442852e-03 - 2.6324889063835144e-01 -8.5208639502525330e-02 + 2.8644701838493347e-01 -1.0436929017305374e-01 <_> - 0 -1 840 -3.6174536217004061e-03 + 0 -1 674 2.1207414101809263e-03 - -6.3895624876022339e-01 3.7891831248998642e-02 + 4.5713264495134354e-02 -6.6571021080017090e-01 <_> - 0 -1 321 -3.0694848392158747e-03 + 0 -1 254 1.3393461704254150e-02 - 2.7301403880119324e-01 -8.3168596029281616e-02 + -8.4284797310829163e-02 3.6480179429054260e-01 <_> - 0 -1 106 -1.6663860296830535e-03 + 0 -1 560 9.7873376216739416e-04 - -4.9059715867042542e-01 4.4817935675382614e-02 + -1.2960052490234375e-01 2.2095513343811035e-01 <_> - 0 -1 36 1.6716115176677704e-02 + 0 -1 747 -4.9731796607375145e-03 - 6.0621056705713272e-02 -3.4729966521263123e-01 + 2.7467787265777588e-01 -1.0236363112926483e-01 <_> - 0 -1 401 1.3494723476469517e-02 + 0 -1 294 -7.9883169382810593e-03 - 3.1516350805759430e-02 -6.2451899051666260e-01 + -5.3638678789138794e-01 5.3369920700788498e-02 <_> - 0 -1 321 1.9665439613163471e-03 + 0 -1 413 2.3855306208133698e-03 - -8.6126960813999176e-02 2.5302976369857788e-01 + 5.4967612028121948e-02 -4.2117682099342346e-01 <_> - 0 -1 477 -2.8690965846180916e-02 + 0 -1 899 -3.0849636532366276e-03 - 2.9214075207710266e-01 -6.8187572062015533e-02 + 2.6192533969879150e-01 -9.4207443296909332e-02 <_> - 0 -1 430 5.4161301814019680e-03 + 0 -1 653 4.3416069820523262e-03 - -8.5594080388545990e-02 2.6200750470161438e-01 + -1.5543100237846375e-01 1.6663897037506104e-01 <_> - 0 -1 269 -3.6381594836711884e-02 + 0 -1 451 3.8728015497326851e-03 - -5.9561169147491455e-01 3.6925114691257477e-02 + 4.9280565232038498e-02 -4.9337747693061829e-01 <_> - 0 -1 421 -6.7269792780280113e-03 + 0 -1 563 1.8099667504429817e-03 - -7.9720497131347656e-01 2.4374464526772499e-02 + 4.2697191238403320e-02 -5.2748012542724609e-01 <_> - 0 -1 947 -7.4932668358087540e-03 + 0 -1 157 -3.3727339468896389e-03 - -8.1190264225006104e-01 1.9826157018542290e-02 + 2.0491680502891541e-01 -1.2846539914608002e-01 <_> - 0 -1 165 -5.5202767252922058e-03 + 0 -1 344 3.1393815297633410e-03 - 1.8447315692901611e-01 -1.1608960479497910e-01 + -7.3090612888336182e-02 3.4941059350967407e-01 <_> - 0 -1 869 2.9039490036666393e-03 + 0 -1 851 3.2568261958658695e-03 - 6.3957199454307556e-02 -3.0787152051925659e-01 + 4.5729346573352814e-02 -5.7302659749984741e-01 <_> - 0 -1 41 2.4206712841987610e-01 + 0 -1 853 -2.0513155031949282e-03 - -3.4878797829151154e-02 5.9678316116333008e-01 + -5.4655516147613525e-01 3.8907390087842941e-02 <_> - 0 -1 901 5.8509008958935738e-03 + 0 -1 656 -2.7090720832347870e-03 - -8.4465004503726959e-02 2.3755706846714020e-01 + -5.2781039476394653e-01 3.8093525916337967e-02 <_> - 0 -1 943 1.1404031887650490e-02 + 0 -1 738 -3.6282267421483994e-02 - -6.2884598970413208e-02 3.3538460731506348e-01 + -5.8760797977447510e-01 3.4759882837533951e-02 <_> - 0 -1 946 -6.4798449166119099e-03 + 0 -1 558 3.7925848737359047e-03 - 2.6907229423522949e-01 -8.0378860235214233e-02 + -8.5966393351554871e-02 2.6226586103439331e-01 <_> - 0 -1 175 -1.5257325768470764e-01 + 0 -1 991 -3.7565450184047222e-03 - 3.7274152040481567e-01 -5.3593669086694717e-02 + -5.7828390598297119e-01 3.9440535008907318e-02 <_> - 0 -1 300 -7.8410096466541290e-03 + 0 -1 906 -7.8137982636690140e-03 - 3.5559067130088806e-01 -6.0485389083623886e-02 + 3.5042202472686768e-01 -6.6597603261470795e-02 <_> - 0 -1 895 4.6420615399256349e-04 + 0 -1 904 -3.1100357882678509e-03 - -1.3953977823257446e-01 1.4700867235660553e-01 + 1.8389418721199036e-01 -1.4107073843479156e-01 <_> - 0 -1 365 -2.7928948402404785e-03 + 0 -1 449 9.1797057539224625e-03 - -3.7794330716133118e-01 5.3649291396141052e-02 + -6.2711343169212341e-02 3.4819519519805908e-01 <_> - 0 -1 761 -6.2361196614801884e-03 + 0 -1 255 -2.9698751866817474e-02 - 2.3622865974903107e-01 -8.5419490933418274e-02 + 2.8956320881843567e-01 -8.5679493844509125e-02 <_> - 0 -1 758 -1.0482727549970150e-02 + 0 -1 720 7.9502481967210770e-03 - -4.9808895587921143e-01 4.5149747282266617e-02 + 3.9165180176496506e-02 -6.0753583908081055e-01 <_> - 0 -1 728 5.1559107378125191e-03 + 0 -1 621 2.2064188960939646e-03 - -8.4864191710948944e-02 2.6940858364105225e-01 + 3.5431943833827972e-02 -5.5480444431304932e-01 <_> - 0 -1 854 1.3875829055905342e-02 + 0 -1 175 -3.1044434756040573e-02 - -6.8634092807769775e-02 3.0264788866043091e-01 + -6.2628567218780518e-01 3.1049268320202827e-02 <_> - 0 -1 549 2.0931879989802837e-03 + 0 -1 0 -1.3199620880186558e-03 - -8.1713855266571045e-02 2.2649072110652924e-01 + 1.5564316511154175e-01 -1.3879336416721344e-01 <_> - 0 -1 580 2.2430280223488808e-03 + 0 -1 397 -9.6068280981853604e-04 - 3.2463703304529190e-02 -6.4346092939376831e-01 + 1.9332279264926910e-01 -1.1179215461015701e-01 <_> - 0 -1 686 9.5147592946887016e-03 + 0 -1 43 7.4608568102121353e-03 - 2.9569771140813828e-02 -5.5541282892227173e-01 + 5.7219974696636200e-02 -4.2135125398635864e-01 <_> - 0 -1 358 -1.5026458539068699e-02 + 0 -1 293 -4.3320422992110252e-03 - 2.9199507832527161e-01 -6.7493163049221039e-02 + -6.8079024553298950e-01 2.9504306614398956e-02 <_> - 0 -1 576 -3.0254235025495291e-03 + 0 -1 274 -6.5548438578844070e-03 - -3.6120423674583435e-01 5.3320098668336868e-02 + 2.9043409228324890e-01 -8.7089523673057556e-02 <_> - 0 -1 543 -3.7556474562734365e-03 + 0 -1 204 4.2611984536051750e-03 - 2.4651855230331421e-01 -7.6555579900741577e-02 + -8.5929870605468750e-02 3.1930494308471680e-01 <_> - 0 -1 870 5.2875939756631851e-02 + 0 -1 635 -7.2978977113962173e-03 - -6.2019556760787964e-02 3.0396047234535217e-01 + 1.4620631933212280e-01 -1.7617914080619812e-01 <_> - 0 -1 915 -6.4307113643735647e-04 + 0 -1 225 -2.2543172817677259e-03 - 1.4872814714908600e-01 -1.2868101894855499e-01 - <_> - - 0 -1 802 -2.7651647105813026e-02 - - -4.7678905725479126e-01 4.2087376117706299e-02 - <_> - - 0 -1 673 -2.5210313033312559e-03 - - -6.7401230335235596e-01 2.5271434336900711e-02 - <_> - - 0 -1 107 -1.7504607094451785e-03 - - -6.6526460647583008e-01 2.3153429850935936e-02 - <_> - - 0 -1 137 -1.2022716924548149e-02 - - -6.5252929925918579e-01 2.4157531559467316e-02 - <_> - - 0 -1 23 -1.6721414402127266e-02 - - 2.0145316421985626e-01 -8.8073857128620148e-02 - <_> - - 0 -1 664 -6.1156335286796093e-03 - - 2.3662807047367096e-01 -8.2179009914398193e-02 - <_> - - 0 -1 726 4.1717891581356525e-03 - - 3.0463650822639465e-02 -6.4868044853210449e-01 - <_> - - 0 -1 83 1.0461646597832441e-03 - - -1.0331799834966660e-01 1.7261520028114319e-01 - <_> - - 0 -1 158 -7.5713603291660547e-04 - - 2.2451940178871155e-01 -9.4167023897171021e-02 - <_> - - 0 -1 377 -5.1019098609685898e-03 - - 1.7748890817165375e-01 -1.0525784641504288e-01 - <_> - - 0 -1 951 5.8564399369060993e-03 - - 2.7441246435046196e-02 -6.8668657541275024e-01 - <_> - - 0 -1 331 3.8241008296608925e-03 - - -6.8950459361076355e-02 2.7575340867042542e-01 - <_> - - 0 -1 174 1.1478068307042122e-02 - - 3.9409350603818893e-02 -5.4299759864807129e-01 - <_> - - 0 -1 605 -1.4753835275769234e-03 - - -4.5533245801925659e-01 3.6614906042814255e-02 - <_> - - 0 -1 605 9.4340764917433262e-04 - - 6.0544602572917938e-02 -2.9981470108032227e-01 - <_> - - 0 -1 599 -3.6590839736163616e-03 - - 2.3720666766166687e-01 -8.0204457044601440e-02 - <_> - - 0 -1 100 -3.1423069536685944e-02 - - -7.1167147159576416e-01 2.8132835403084755e-02 - <_> - - 0 -1 403 3.5741357132792473e-03 - - 1.7519874498248100e-02 -8.3257293701171875e-01 - <_> - - 0 -1 585 -6.8605719134211540e-03 - - -6.9204151630401611e-01 2.0872814580798149e-02 - <_> - - 0 -1 902 -8.8996449485421181e-03 - - 1.8208101391792297e-01 -9.8315775394439697e-02 - <_> - - 0 -1 881 6.5573323518037796e-03 - - -7.4690498411655426e-02 2.5062057375907898e-01 - <_> - - 0 -1 912 1.4275535941123962e-02 - - 2.7385318651795387e-02 -6.8721151351928711e-01 - <_> - - 0 -1 241 -2.1887188777327538e-03 - - -4.7836220264434814e-01 3.3499576151371002e-02 - <_> - - 0 -1 6 1.9212976098060608e-02 - - 5.0344366580247879e-02 -3.3104887604713440e-01 - <_> - - 0 -1 521 1.0552004911005497e-02 - - -9.7779601812362671e-02 2.0047651231288910e-01 - <_> - - 0 -1 883 -4.9180793575942516e-04 - - 1.4232192933559418e-01 -1.3171885907649994e-01 - <_> - - 0 -1 964 3.2934427261352539e-02 - - 2.9324809089303017e-02 -5.8789533376693726e-01 - <_> - - 0 -1 305 -1.9249429460614920e-03 - - 1.5106591582298279e-01 -1.2231025844812393e-01 - <_> - - 0 -1 729 -4.4266097247600555e-03 - - 2.6083472371101379e-01 -7.3457822203636169e-02 - <_> - - 0 -1 666 -3.5673312842845917e-02 - - -6.6919100284576416e-01 2.9960991814732552e-02 - <_> - - 0 -1 602 -8.5658043622970581e-02 - - -5.1538497209548950e-01 2.9327427968382835e-02 - <_> - - 0 -1 348 -3.5126551985740662e-02 - - 2.3199184238910675e-01 -7.9689562320709229e-02 - <_> - - 0 -1 123 5.8309547603130341e-03 - - 3.0431609600782394e-02 -6.1856180429458618e-01 - <_> - - 0 -1 22 -4.4557070359587669e-03 - - 2.6333442330360413e-01 -7.0679754018783569e-02 - <_> - - 0 -1 373 1.2730281800031662e-02 - - -6.6051281988620758e-02 3.1401801109313965e-01 - <_> - - 0 -1 498 -4.6875262632966042e-03 - - 1.9294278323650360e-01 -1.0184600949287415e-01 - <_> - - 0 -1 195 -2.9066612478345633e-03 - - 1.9944235682487488e-01 -9.2275582253932953e-02 - <_> - - 0 -1 482 -3.1784668099135160e-03 - - -4.1009154915809631e-01 4.5929219573736191e-02 - <_> - - 0 -1 618 -3.7226981949061155e-03 - - 2.2945560514926910e-01 -7.6773315668106079e-02 + -5.9305733442306519e-01 3.9764832705259323e-02 <_> - 100 - -1.6428810358047485e+00 + 70 + -1.3067549467086792e+00 <_> - 0 -1 777 3.3433635253459215e-03 + 0 -1 742 -5.6160744279623032e-03 - 7.8417956829071045e-02 6.1746358871459961e-01 + 4.7913768887519836e-01 -9.8717339336872101e-02 <_> - 0 -1 171 4.1375826112926006e-03 + 0 -1 536 -5.6263338774442673e-03 - -1.0486003011465073e-01 4.9714615941047668e-01 + 2.8639736771583557e-01 -1.7997759580612183e-01 <_> - 0 -1 512 -5.4358085617423058e-03 + 0 -1 795 -1.6268140170723200e-03 - 2.9817372560501099e-01 -1.8134090304374695e-01 + 3.0874463915824890e-01 -1.3907180726528168e-01 <_> - 0 -1 734 5.7432046160101891e-03 + 0 -1 802 -1.3920383062213659e-03 - -2.1621760725975037e-01 2.8316897153854370e-01 + 3.2034638524055481e-01 -1.3876211643218994e-01 <_> - 0 -1 56 -2.2321434225887060e-03 + 0 -1 826 3.4234612248837948e-03 - 2.0751045644283295e-01 -1.5781952440738678e-01 + -1.0860712081193924e-01 3.2174232602119446e-01 <_> - 0 -1 113 1.4339581131935120e-02 + 0 -1 525 4.3767906725406647e-02 - -9.7252883017063141e-02 4.0868076682090759e-01 + -1.3255064189434052e-01 3.7021124362945557e-01 <_> - 0 -1 205 -1.1081973090767860e-02 + 0 -1 401 -4.4696494005620480e-03 - 3.3920571208000183e-01 -1.0915800184011459e-01 + -4.5687621831893921e-01 8.2243621349334717e-02 <_> - 0 -1 332 1.4586398378014565e-02 + 0 -1 332 -7.1945399977266788e-03 - -8.6110286414623260e-02 3.1800067424774170e-01 + -6.4334297180175781e-01 4.5623987913131714e-02 <_> - 0 -1 369 -1.6978669445961714e-03 + 0 -1 273 6.5287351608276367e-03 - 2.5036969780921936e-01 -1.2437737733125687e-01 + -8.9336074888706207e-02 3.3727860450744629e-01 <_> - 0 -1 708 1.2829914689064026e-02 + 0 -1 771 2.8297028038650751e-03 - 5.1119163632392883e-02 -5.4143118858337402e-01 + -1.0177894681692123e-01 3.5831856727600098e-01 <_> - 0 -1 675 -1.6196181531995535e-03 + 0 -1 925 1.1526069603860378e-02 - -5.3631567955017090e-01 4.6280529350042343e-02 + 7.5238041579723358e-02 -4.8319393396377563e-01 <_> - 0 -1 897 -2.3190132342278957e-03 + 0 -1 207 4.7937319613993168e-03 - -4.3289941549301147e-01 6.0517251491546631e-02 + 5.7682428508996964e-02 -4.7086900472640991e-01 <_> - 0 -1 212 3.5206928849220276e-02 + 0 -1 395 -3.6777029745280743e-03 - -9.1207198798656464e-02 3.1217202544212341e-01 + -4.2743790149688721e-01 7.4363298714160919e-02 <_> - 0 -1 763 3.1395033001899719e-03 + 0 -1 839 -8.0760312266647816e-04 - -7.8746505081653595e-02 3.6259949207305908e-01 + 1.4320656657218933e-01 -1.9929704070091248e-01 <_> - 0 -1 262 1.1297637596726418e-02 + 0 -1 233 3.7253312766551971e-03 - 7.4857383966445923e-02 -3.7226554751396179e-01 + 5.2736207842826843e-02 -5.2105212211608887e-01 <_> - 0 -1 786 4.6712577342987061e-02 + 0 -1 416 -2.3560712113976479e-02 - -9.2495582997798920e-02 2.9710096120834351e-01 + 4.0658730268478394e-01 -7.3024936020374298e-02 <_> - 0 -1 323 -6.8688929080963135e-02 + 0 -1 311 -4.5593185350298882e-03 - -4.8226192593574524e-01 4.9391020089387894e-02 + -6.3590377569198608e-01 3.5127460956573486e-02 <_> - 0 -1 969 -3.5051193553954363e-03 + 0 -1 551 -2.4863984435796738e-03 - -4.8506668210029602e-01 4.1722387075424194e-02 + -4.5599257946014404e-01 5.3035512566566467e-02 <_> - 0 -1 694 1.1046628467738628e-02 + 0 -1 424 -2.6802124921232462e-03 - -5.4003205150365829e-02 4.2598679661750793e-01 + 1.9116453826427460e-01 -1.3404799997806549e-01 <_> - 0 -1 26 -2.0021714270114899e-02 + 0 -1 11 -7.7647715806961060e-02 - -4.3884435296058655e-01 4.9609564244747162e-02 + 4.1297465562820435e-01 -6.3970938324928284e-02 <_> - 0 -1 59 1.1850561946630478e-02 + 0 -1 566 2.3329094983637333e-03 - -7.8088991343975067e-02 2.7602908015251160e-01 + -1.2160944193601608e-01 2.3117628693580627e-01 <_> - 0 -1 180 4.1900265961885452e-02 + 0 -1 5 -6.6609308123588562e-03 - -9.9447727203369141e-02 2.0865923166275024e-01 + 2.2600707411766052e-01 -1.2069495767354965e-01 <_> - 0 -1 590 -2.9064953327178955e-02 + 0 -1 133 -5.0821684300899506e-02 - 2.9170644283294678e-01 -7.3766425251960754e-02 + 3.2217630743980408e-01 -7.6335281133651733e-02 <_> - 0 -1 474 -2.6618237607181072e-03 + 0 -1 537 -7.0379404351115227e-03 - -3.2550674676895142e-01 7.5278282165527344e-02 + 1.8399104475975037e-01 -1.4812190830707550e-01 <_> - 0 -1 342 3.2252955716103315e-03 + 0 -1 134 -3.3276520669460297e-02 - -6.9696784019470215e-02 3.1337058544158936e-01 + -6.0358065366744995e-01 3.5330448299646378e-02 <_> - 0 -1 582 7.8913231845945120e-04 + 0 -1 392 7.5909225270152092e-03 - 6.9301478564739227e-02 -3.2840612530708313e-01 + 3.1779482960700989e-02 -6.4767998456954956e-01 <_> - 0 -1 287 6.6613638773560524e-03 + 0 -1 613 -5.6639023125171661e-02 - 4.5366134494543076e-02 -4.4648596644401550e-01 + -4.6455994248390198e-01 4.6072337776422501e-02 <_> - 0 -1 721 1.9416993018239737e-03 + 0 -1 124 3.7777128163725138e-03 - -1.3086521625518799e-01 1.5360382199287415e-01 + 5.7451672852039337e-02 -3.7793967127799988e-01 <_> - 0 -1 633 6.0106818564236164e-03 + 0 -1 271 8.9145395904779434e-03 - 4.8219148069620132e-02 -4.1355597972869873e-01 + -7.5942978262901306e-02 3.1487807631492615e-01 <_> - 0 -1 267 -6.8208400625735521e-04 + 0 -1 841 -1.4818884432315826e-02 - 1.6169321537017822e-01 -1.2492433935403824e-01 + 2.7122247219085693e-01 -9.8314434289932251e-02 <_> - 0 -1 756 1.0027646087110043e-02 + 0 -1 381 -5.5922558531165123e-03 - 3.0267864465713501e-02 -6.4555937051773071e-01 + -6.4762401580810547e-01 4.1314963251352310e-02 <_> - 0 -1 948 -6.4138583838939667e-03 + 0 -1 595 3.1491921981796622e-04 - -6.9905740022659302e-01 2.3570762947201729e-02 + -1.4864055812358856e-01 1.4411780238151550e-01 <_> - 0 -1 270 4.4392300769686699e-03 + 0 -1 136 -5.7063563726842403e-03 - -5.8655023574829102e-02 3.3790254592895508e-01 + -4.6024248003959656e-01 4.7999884933233261e-02 <_> - 0 -1 556 3.8361353799700737e-03 + 0 -1 210 -1.2257394846528769e-03 - 3.1548105180263519e-02 -6.6295272111892700e-01 + 3.2288366556167603e-01 -7.0425607264041901e-02 <_> - 0 -1 872 -1.0007477831095457e-03 + 0 -1 775 -1.6291948035359383e-02 - 2.2688214480876923e-01 -8.8843353092670441e-02 + 2.7573275566101074e-01 -8.3055868744850159e-02 <_> - 0 -1 928 4.7894790768623352e-03 + 0 -1 156 -8.1639690324664116e-04 - 3.0278960242867470e-02 -6.1569523811340332e-01 + 1.7044979333877563e-01 -1.4129574596881866e-01 <_> - 0 -1 946 5.6278239935636520e-03 + 0 -1 975 5.1114819943904877e-03 - -7.8841529786586761e-02 2.4433708190917969e-01 + 3.3882420510053635e-02 -6.9941717386245728e-01 <_> - 0 -1 942 -7.3229577392339706e-03 + 0 -1 977 -2.8371806256473064e-03 - 3.3265948295593262e-01 -6.7663870751857758e-02 + -3.7707236409187317e-01 5.7759616523981094e-02 <_> - 0 -1 29 -4.5515028759837151e-03 + 0 -1 772 5.3479857742786407e-03 - -4.6472606062889099e-01 4.3983772397041321e-02 + 4.1541736572980881e-02 -4.8687714338302612e-01 <_> - 0 -1 293 1.8201436614617705e-03 + 0 -1 735 1.1360908392816782e-03 - -8.1468850374221802e-02 2.3861412703990936e-01 + -7.8717894852161407e-02 2.9692038893699646e-01 <_> - 0 -1 134 -1.1703525483608246e-01 + 0 -1 947 1.4100213302299380e-03 - -6.7043519020080566e-01 2.9206298291683197e-02 + 4.3843001127243042e-02 -5.1339787244796753e-01 <_> - 0 -1 314 -5.0897812470793724e-03 + 0 -1 387 8.7079760851338506e-04 - 5.1766836643218994e-01 -4.1514929383993149e-02 + -9.8695866763591766e-02 2.2730629146099091e-01 <_> - 0 -1 72 -8.7873879820108414e-03 + 0 -1 211 -5.4065873846411705e-03 - -5.2038532495498657e-01 4.0998894721269608e-02 + -6.3011974096298218e-01 3.7802927196025848e-02 <_> - 0 -1 183 -5.6120483204722404e-03 + 0 -1 816 -1.6894804313778877e-02 - -7.3375105857849121e-01 2.1229419857263565e-02 + -5.0091201066970825e-01 3.5215172916650772e-02 <_> - 0 -1 244 1.0250378400087357e-02 + 0 -1 766 1.4164673630148172e-03 - 2.5667199864983559e-02 -6.1355572938919067e-01 + -8.8441111147403717e-02 2.4102251231670380e-01 <_> - 0 -1 771 -4.8573492094874382e-03 + 0 -1 704 -1.1464871931821108e-03 - 1.6895917057991028e-01 -1.1120435595512390e-01 + 1.9273723661899567e-01 -1.1090471595525742e-01 <_> - 0 -1 312 2.5750461965799332e-02 + 0 -1 861 -3.2706123311072588e-03 - 3.5605397075414658e-02 -5.4535841941833496e-01 + -4.5202803611755371e-01 4.7059688717126846e-02 <_> - 0 -1 932 4.1080308146774769e-03 + 0 -1 70 1.1416582390666008e-02 - 5.0505056977272034e-02 -3.3836016058921814e-01 + 2.6714416220784187e-02 -6.9660711288452148e-01 <_> - 0 -1 317 3.9434060454368591e-03 + 0 -1 310 2.7643535286188126e-03 - -8.8688671588897705e-02 2.0660057663917542e-01 + 4.7252438962459564e-02 -3.9458727836608887e-01 <_> - 0 -1 553 6.5294457599520683e-03 + 0 -1 435 2.4567130021750927e-03 - -1.2931570410728455e-01 1.6514816880226135e-01 + -7.5188823044300079e-02 2.9944056272506714e-01 <_> - 0 -1 931 2.2269077599048615e-02 + 0 -1 441 -7.3516201227903366e-03 - -4.7366518527269363e-02 3.8508006930351257e-01 + 2.8476437926292419e-01 -9.2367134988307953e-02 <_> - 0 -1 455 3.5300105810165405e-03 + 0 -1 662 -4.3670929968357086e-02 - 5.3873997181653976e-02 -3.3755952119827271e-01 + -6.8588620424270630e-01 3.3353023231029510e-02 <_> - 0 -1 286 -2.4763222783803940e-02 + 0 -1 138 -6.4992159605026245e-02 - -3.2349804043769836e-01 5.6731209158897400e-02 + -7.9678738117218018e-01 2.0331909880042076e-02 <_> - 0 -1 790 3.1297234818339348e-03 + 0 -1 286 -1.1700032278895378e-02 - -6.7191042006015778e-02 2.7804708480834961e-01 + -6.1183351278305054e-01 2.7328895404934883e-02 <_> - 0 -1 621 -1.7003760440275073e-03 + 0 -1 589 3.0743866227567196e-03 - -4.2539414763450623e-01 4.3875113129615784e-02 + -7.7295452356338501e-02 2.6685911417007446e-01 <_> - 0 -1 750 8.3633856847882271e-03 + 0 -1 584 -1.5546076931059361e-02 - 3.0976327136158943e-02 -5.2819561958312988e-01 + -5.5246621370315552e-01 4.0912687778472900e-02 <_> - 0 -1 473 -8.7768933735787868e-04 + 0 -1 40 6.5568592399358749e-03 - 1.9984373450279236e-01 -9.0307638049125671e-02 + -1.0432150214910507e-01 1.9379787147045135e-01 <_> - 0 -1 874 -9.2862239107489586e-03 + 0 -1 29 -8.0047458410263062e-02 - -6.9824051856994629e-01 2.5733994320034981e-02 + 3.9228948950767517e-01 -5.2565738558769226e-02 <_> - 0 -1 393 -1.1124708689749241e-03 + 0 -1 227 1.5684183686971664e-02 - 1.9901444017887115e-01 -9.2606224119663239e-02 + -1.1151826381683350e-01 1.8633136153221130e-01 <_> - 0 -1 575 -3.2134181819856167e-03 + 0 -1 546 2.3603178560733795e-03 - 2.3832809925079346e-01 -7.1890726685523987e-02 + -1.0219112038612366e-01 2.0333246886730194e-01 <_> - 0 -1 516 5.9113521128892899e-03 + 0 -1 585 -3.5169085022062063e-03 - -6.7413553595542908e-02 2.7445399761199951e-01 + 2.7427124977111816e-01 -8.6362943053245544e-02 <_> - 0 -1 615 -4.5188870280981064e-03 + 0 -1 476 9.4871241599321365e-03 - -4.0147483348846436e-01 4.4757787138223648e-02 + 3.5626750439405441e-02 -6.2631088495254517e-01 <_> - 0 -1 48 2.8254585340619087e-03 + 0 -1 629 -9.3261618167161942e-03 - 4.3743204325437546e-02 -3.7922030687332153e-01 + -7.1806514263153076e-01 2.4241568520665169e-02 <_> - 0 -1 637 -2.6064300909638405e-03 + 0 -1 666 -6.3302312046289444e-03 - 2.0811253786087036e-01 -8.2700952887535095e-02 + 2.1094995737075806e-01 -9.2475786805152893e-02 <_> - 0 -1 635 1.0516709880903363e-03 + 0 -1 598 -2.8244811110198498e-03 - -8.9635595679283142e-02 2.6205003261566162e-01 + 2.6596403121948242e-01 -8.0099694430828094e-02 <_> - 0 -1 453 -1.2204772792756557e-03 + 0 -1 145 -1.1591307818889618e-02 - 2.0626722276210785e-01 -8.6367763578891754e-02 + 2.3619163036346436e-01 -8.5169024765491486e-02 <_> - 0 -1 765 5.0495425239205360e-03 + 0 -1 117 2.1401243284344673e-03 - 4.5425735414028168e-02 -4.1301593184471130e-01 + -1.0995808988809586e-01 2.1230246126651764e-01 <_> - 0 -1 440 -3.2243374735116959e-03 + 0 -1 562 4.2046746239066124e-03 - 1.4690431952476501e-01 -1.2587989866733551e-01 + 3.6688093096017838e-02 -6.1654287576675415e-01 <_> - 0 -1 340 -2.3263287730515003e-03 + 0 -1 605 1.1085141450166702e-03 - -4.1975629329681396e-01 4.7924898564815521e-02 + -8.0656312406063080e-02 2.7754181623458862e-01 <_> - 0 -1 307 -5.4887672886252403e-03 + 0 -1 829 -8.2805287092924118e-03 - -4.1799965500831604e-01 3.8171879947185516e-02 - <_> - - 0 -1 628 4.6792116016149521e-02 - - -5.7823952287435532e-02 3.2188871502876282e-01 - <_> - - 0 -1 824 2.3481161333620548e-03 - - -5.3754303604364395e-02 3.0415624380111694e-01 - <_> - - 0 -1 179 -3.5063792020082474e-03 - - -3.8483345508575439e-01 4.7024305909872055e-02 - <_> - - 0 -1 247 1.6757374396547675e-03 - - -1.3115778565406799e-01 1.6631519794464111e-01 - <_> - - 0 -1 232 1.1546656489372253e-02 - - -5.0141811370849609e-02 3.1787791848182678e-01 - <_> - - 0 -1 504 1.8043547868728638e-02 - - 2.5008214637637138e-02 -7.1255826950073242e-01 - <_> - - 0 -1 204 -3.1235523521900177e-02 - - 2.1876916289329529e-01 -7.7429860830307007e-02 - <_> - - 0 -1 248 9.7835529595613480e-03 - - -5.6040864437818527e-02 2.7669593691825867e-01 - <_> - - 0 -1 341 2.8905952349305153e-03 - - 5.1800269633531570e-02 -3.1925117969512939e-01 - <_> - - 0 -1 436 7.8792851418256760e-03 - - -6.0856487601995468e-02 2.8146442770957947e-01 - <_> - - 0 -1 717 1.3523480854928493e-02 - - 2.4503752589225769e-02 -7.2409152984619141e-01 - <_> - - 0 -1 966 3.1048720702528954e-03 - - 4.5725930482149124e-02 -3.3751598000526428e-01 - <_> - - 0 -1 808 -1.0647572576999664e-02 - - -5.4894274473190308e-01 2.8428088873624802e-02 - <_> - - 0 -1 49 -4.8104384914040565e-03 - - 2.0432402193546295e-01 -8.2248799502849579e-02 - <_> - - 0 -1 4 2.7336277067661285e-02 - - -6.7068248987197876e-02 2.3702095448970795e-01 - <_> - - 0 -1 940 -1.7123305797576904e-01 - - 5.2998173236846924e-01 -3.1578365713357925e-02 - <_> - - 0 -1 781 -4.3723154813051224e-03 - - 2.8745722770690918e-01 -5.7618625462055206e-02 - <_> - - 0 -1 743 6.7968526855111122e-03 - - -6.3940502703189850e-02 2.5016403198242188e-01 - <_> - - 0 -1 47 -1.6302993753924966e-03 - - -2.6190960407257080e-01 6.1918053776025772e-02 - <_> - - 0 -1 712 1.7953850328922272e-03 - - -5.3176742047071457e-02 3.0019727349281311e-01 - <_> - - 0 -1 311 6.2259500846266747e-03 - - 3.1048897653818130e-02 -5.6447005271911621e-01 - <_> - - 0 -1 712 -1.4370339922606945e-03 - - 1.8240424990653992e-01 -8.9968219399452209e-02 - <_> - - 0 -1 226 -9.0678166598081589e-03 - - -6.3961440324783325e-01 2.3404622450470924e-02 - <_> - - 0 -1 604 -8.2531813532114029e-03 - - -5.9389066696166992e-01 2.3573497310280800e-02 - <_> - - 0 -1 573 -2.2232248447835445e-03 - - 1.9480818510055542e-01 -8.3372615277767181e-02 - <_> - - 0 -1 355 -6.5612345933914185e-03 - - -4.2599579691886902e-01 3.7793021649122238e-02 - <_> - - 0 -1 571 1.2282801326364279e-03 - - -8.5198581218719482e-02 1.9753733277320862e-01 - <_> - - 0 -1 162 -1.0268764197826385e-01 - - -3.9634877443313599e-01 4.0690928697586060e-02 - <_> - - 0 -1 711 -1.5864435583353043e-02 - - 1.9112223386764526e-01 -8.7620854377746582e-02 - <_> - - 0 -1 715 4.8304852680303156e-04 - - -1.2651769816875458e-01 1.5627197921276093e-01 + -6.5883606672286987e-01 3.6048211157321930e-02 <_> - 100 - -1.5192077159881592e+00 + 70 + -1.2368309497833252e+00 <_> - 0 -1 563 -7.2759687900543213e-03 + 0 -1 716 -3.3105849288403988e-03 - 6.4157706499099731e-01 1.0701754689216614e-01 + 5.0566112995147705e-01 -8.2956805825233459e-02 <_> - 0 -1 713 -3.8208619225770235e-03 + 0 -1 190 4.5855166390538216e-03 - 4.9172374606132507e-01 -9.4503603875637054e-02 + -1.3226345181465149e-01 3.9034894108772278e-01 <_> - 0 -1 817 3.4225741401314735e-03 + 0 -1 576 -2.6665716432034969e-03 - -1.3255690038204193e-01 3.2899302244186401e-01 + 2.7508354187011719e-01 -1.3807572424411774e-01 <_> - 0 -1 384 3.3628481905907393e-03 + 0 -1 734 1.8106825649738312e-02 - -1.6529263556003571e-01 3.8905930519104004e-01 + -1.2738862633705139e-01 3.5449108481407166e-01 <_> - 0 -1 400 4.2874794453382492e-03 + 0 -1 830 -5.7813120074570179e-03 - 6.4744032919406891e-02 -4.9827992916107178e-01 + 2.7463605999946594e-01 -1.2951526045799255e-01 <_> - 0 -1 462 -3.3541000448167324e-03 + 0 -1 379 8.9321136474609375e-03 - 1.6614496707916260e-01 -1.8601009249687195e-01 + 4.8491790890693665e-02 -5.8104276657104492e-01 <_> - 0 -1 683 -1.8176173325628042e-03 + 0 -1 17 6.2806839123368263e-03 - 2.6610982418060303e-01 -1.1267235130071640e-01 + -1.3215491175651550e-01 2.1852293610572815e-01 <_> - 0 -1 268 -2.2096108645200729e-02 + 0 -1 9 -4.3670572340488434e-02 - 3.2448813319206238e-01 -8.3371557295322418e-02 + 3.8786840438842773e-01 -7.4191503226757050e-02 <_> - 0 -1 751 5.8036940172314644e-03 + 0 -1 554 -6.2309622764587402e-02 - -1.2335725873708725e-01 2.5443312525749207e-01 + 3.3408007025718689e-01 -8.7087221443653107e-02 <_> - 0 -1 243 4.7676274552941322e-03 + 0 -1 686 -3.2859744969755411e-03 - -1.4914961159229279e-01 1.8570756912231445e-01 + 3.3486780524253845e-01 -8.9008949697017670e-02 <_> - 0 -1 386 2.7053440135205165e-05 + 0 -1 346 -3.9627305231988430e-03 - -2.1181178092956543e-01 1.1339543759822845e-01 + 2.6155433058738708e-01 -9.5614455640316010e-02 <_> - 0 -1 917 -2.5647766888141632e-03 + 0 -1 434 1.0877416934818029e-03 - -4.3090465664863586e-01 5.7283867150545120e-02 + -1.4199735224246979e-01 1.8414285778999329e-01 <_> - 0 -1 5 -9.9645227193832397e-02 + 0 -1 249 5.4819821380078793e-03 - 4.7573822736740112e-01 -5.1954109221696854e-02 + 7.4260123074054718e-02 -5.6989872455596924e-01 <_> - 0 -1 794 2.8423275798559189e-03 + 0 -1 916 4.9011572264134884e-04 - -7.9270146787166595e-02 3.1205773353576660e-01 + -1.9576059281826019e-01 1.3506270945072174e-01 <_> - 0 -1 336 -4.7821709886193275e-03 + 0 -1 911 -7.7052684500813484e-03 - -4.4589859247207642e-01 5.0418782979249954e-02 + -5.0443643331527710e-01 6.1383318156003952e-02 <_> - 0 -1 770 1.6041981056332588e-02 + 0 -1 164 4.8691947013139725e-03 - -7.6039068400859833e-02 3.0843210220336914e-01 + 4.3469026684761047e-02 -5.2802342176437378e-01 <_> - 0 -1 778 -3.6943168379366398e-03 + 0 -1 344 2.4673391599208117e-03 - 2.7407246828079224e-01 -8.8150359690189362e-02 + -8.9178681373596191e-02 3.0606627464294434e-01 <_> - 0 -1 71 8.4026419790461659e-04 + 0 -1 172 -3.6682826466858387e-03 - -1.5873835980892181e-01 1.3953365385532379e-01 + -6.5514552593231201e-01 4.7427203506231308e-02 <_> - 0 -1 70 -8.0992765724658966e-03 + 0 -1 365 2.5194899644702673e-03 - -5.3085809946060181e-01 3.9269823580980301e-02 + 4.9365170300006866e-02 -4.0812951326370239e-01 <_> - 0 -1 826 3.7676268257200718e-03 + 0 -1 531 5.8970693498849869e-03 - 7.0321731269359589e-02 -3.0400907993316650e-01 + 3.5579398274421692e-02 -6.4191317558288574e-01 <_> - 0 -1 719 -8.4449478890746832e-04 + 0 -1 842 1.7767311073839664e-03 - 1.6032356023788452e-01 -1.2606577575206757e-01 + -8.6629316210746765e-02 2.7705979347229004e-01 <_> - 0 -1 424 1.9298447296023369e-03 + 0 -1 885 4.0457276627421379e-03 - -7.4880234897136688e-02 2.8130438923835754e-01 + 5.6002113968133926e-02 -4.7005215287208557e-01 <_> - 0 -1 517 -3.1593129970133305e-03 + 0 -1 522 3.2862280495464802e-03 - -4.1825935244560242e-01 4.7720715403556824e-02 + -1.2930884957313538e-01 2.0613414049148560e-01 <_> - 0 -1 19 7.7791810035705566e-03 + 0 -1 322 1.4660503948107362e-03 - 4.1349764913320541e-02 -4.5770570635795593e-01 + -9.9395424127578735e-02 3.3950179815292358e-01 <_> - 0 -1 427 -3.2682183664292097e-03 + 0 -1 266 1.9015703350305557e-02 - 2.1473638713359833e-01 -9.5344312489032745e-02 + 6.0197159647941589e-02 -5.1893943548202515e-01 <_> - 0 -1 490 -2.2884239442646503e-03 + 0 -1 102 -7.1178808808326721e-02 - 2.4062317609786987e-01 -9.0378150343894958e-02 + -4.3668299913406372e-01 4.7340013086795807e-02 <_> - 0 -1 844 2.5960609782487154e-03 + 0 -1 795 -4.6305771684274077e-04 - 3.4732636064291000e-02 -6.1617314815521240e-01 + 1.4736598730087280e-01 -1.5406486392021179e-01 <_> - 0 -1 32 8.0937854945659637e-03 + 0 -1 298 -4.7644632868468761e-03 - 3.9185214787721634e-02 -4.7461858391761780e-01 + -5.0336647033691406e-01 4.4053792953491211e-02 <_> - 0 -1 289 5.6226095184683800e-03 + 0 -1 761 -8.5318256169557571e-03 - 3.3066269010305405e-02 -5.4723787307739258e-01 + -5.9967356920242310e-01 3.2567754387855530e-02 <_> - 0 -1 249 3.3066368196159601e-03 + 0 -1 713 -2.7496295515447855e-03 - -1.0691711306571960e-01 1.8520861864089966e-01 + 1.3502316176891327e-01 -1.6025592386722565e-01 <_> - 0 -1 277 -6.9545931182801723e-03 + 0 -1 607 4.2666587978601456e-03 - 2.8144246339797974e-01 -6.7726366221904755e-02 + 2.5802688673138618e-02 -7.8170543909072876e-01 <_> - 0 -1 37 2.0960648544132710e-03 + 0 -1 216 -2.9856398701667786e-02 - 6.5764650702476501e-02 -3.1323519349098206e-01 + 2.4982222914695740e-01 -8.8180385529994965e-02 <_> - 0 -1 546 -2.9915343038737774e-03 + 0 -1 226 2.2136634215712547e-03 - 2.4481751024723053e-01 -7.8186720609664917e-02 + -1.4314906299114227e-01 1.6945528984069824e-01 <_> - 0 -1 461 9.8559018224477768e-03 + 0 -1 640 1.6336794942617416e-02 - 2.9282161965966225e-02 -6.9216150045394897e-01 + 4.6008959412574768e-02 -4.9338266253471375e-01 <_> - 0 -1 567 -9.9846869707107544e-03 + 0 -1 459 7.9861842095851898e-03 - 3.1725984811782837e-01 -6.4144395291805267e-02 + -1.1460029333829880e-01 1.9282819330692291e-01 <_> - 0 -1 417 4.0295444428920746e-02 + 0 -1 650 -1.7455726629123092e-03 - -1.0545746237039566e-01 1.9351178407669067e-01 + 1.7520657181739807e-01 -1.2269173562526703e-01 <_> - 0 -1 359 -4.5808870345354080e-03 + 0 -1 124 -6.2451506964862347e-03 - -2.7045866847038269e-01 6.3011758029460907e-02 + -4.5638361573219299e-01 4.8106320202350616e-02 <_> - 0 -1 76 -3.4120261669158936e-02 + 0 -1 406 8.5668899118900299e-03 - -5.0046062469482422e-01 3.3663876354694366e-02 + -8.0403454601764679e-02 3.0411326885223389e-01 <_> - 0 -1 475 5.9857115149497986e-02 + 0 -1 974 8.6863581091165543e-03 - -6.3651382923126221e-02 2.9614394903182983e-01 + 3.4176670014858246e-02 -7.3028022050857544e-01 <_> - 0 -1 434 3.9175078272819519e-03 + 0 -1 36 1.0814646258950233e-02 - 3.2706990838050842e-02 -5.7929420471191406e-01 + 2.5131458416581154e-02 -6.7325627803802490e-01 <_> - 0 -1 60 1.1147339828312397e-02 + 0 -1 709 4.4222913682460785e-02 - -7.9590849578380585e-02 2.3456735908985138e-01 + 3.9326712489128113e-02 -5.1067680120468140e-01 <_> - 0 -1 642 -2.5253929197788239e-03 + 0 -1 903 3.7128489930182695e-03 - -5.9936809539794922e-01 2.9250813648104668e-02 + -1.3248492777347565e-01 1.6692358255386353e-01 <_> - 0 -1 578 -1.6680266708135605e-02 + 0 -1 129 -4.6475054696202278e-03 - 3.0521371960639954e-01 -5.8340109884738922e-02 + 1.7683532834053040e-01 -1.2570241093635559e-01 <_> - 0 -1 800 7.4669495224952698e-03 + 0 -1 291 4.2433524504303932e-03 - 3.1027967110276222e-02 -6.2497019767761230e-01 + 3.6985948681831360e-02 -5.8369445800781250e-01 <_> - 0 -1 913 2.8406577184796333e-03 + 0 -1 315 -5.1774000748991966e-03 - 4.1042126715183258e-02 -4.1006734967231750e-01 + 5.1487326622009277e-01 -4.1473735123872757e-02 <_> - 0 -1 702 -4.7403648495674133e-03 + 0 -1 855 4.2645614594221115e-03 - 2.0529302954673767e-01 -8.8142603635787964e-02 + 3.7253957241773605e-02 -5.7676959037780762e-01 <_> - 0 -1 700 3.7362352013587952e-03 + 0 -1 83 4.8632645048201084e-03 - -6.1495106667280197e-02 3.4078758955001831e-01 + -6.7035257816314697e-02 3.1131938099861145e-01 <_> - 0 -1 679 -4.4546797871589661e-02 + 0 -1 250 2.6089766994118690e-02 - -8.9466398954391479e-01 2.2682141512632370e-02 + -8.2920446991920471e-02 3.0445784330368042e-01 <_> - 0 -1 416 9.0460591018199921e-03 + 0 -1 625 -1.9001008477061987e-03 - 4.8672281205654144e-02 -3.3261755108833313e-01 + -4.3419414758682251e-01 4.6812325716018677e-02 <_> - 0 -1 574 -3.9043920114636421e-03 + 0 -1 891 -6.0952613130211830e-03 - 2.2659721970558167e-01 -7.7551431953907013e-02 + -5.1850622892379761e-01 3.6754775792360306e-02 <_> - 0 -1 380 1.0861126706004143e-02 + 0 -1 564 1.2120242230594158e-02 - -7.7613808214664459e-02 2.2056312859058380e-01 + -7.4773810803890228e-02 2.6738941669464111e-01 <_> - 0 -1 338 -1.2531490065157413e-03 + 0 -1 817 -1.8978580832481384e-02 - 2.2868460416793823e-01 -8.1201769411563873e-02 + 2.5657230615615845e-01 -8.0304212868213654e-02 <_> - 0 -1 339 -5.6936070322990417e-03 + 0 -1 338 4.3438978493213654e-02 - -5.6885385513305664e-01 3.6236546933650970e-02 + -6.2818735837936401e-02 3.2261833548545837e-01 <_> - 0 -1 140 1.4989164192229509e-03 + 0 -1 773 9.4384723342955112e-04 - 3.5795394331216812e-02 -4.7115951776504517e-01 + -9.8582215607166290e-02 2.2370135784149170e-01 <_> - 0 -1 81 4.8389505594968796e-02 + 0 -1 519 -4.1803726926445961e-03 - 2.8578057885169983e-02 -5.6662684679031372e-01 + -4.9802374839782715e-01 4.3809909373521805e-02 <_> - 0 -1 706 -6.7009456455707550e-02 + 0 -1 195 -9.7246468067169189e-03 - 3.6811140179634094e-01 -4.8919521272182465e-02 + 2.2823798656463623e-01 -9.8547600209712982e-02 <_> - 0 -1 129 -6.9928979501128197e-03 + 0 -1 658 2.7193846181035042e-03 - 2.2268642485141754e-01 -8.1494621932506561e-02 + -9.1188244521617889e-02 2.2684387862682343e-01 <_> - 0 -1 506 -5.0552012398838997e-03 + 0 -1 174 6.2224082648754120e-03 - -3.9911568164825439e-01 4.8226438462734222e-02 + 3.2258503139019012e-02 -6.0108250379562378e-01 <_> - 0 -1 577 -1.6228569438681006e-03 + 0 -1 77 -4.8602908849716187e-01 - 2.0442382991313934e-01 -9.1497577726840973e-02 + 6.3337916135787964e-01 -3.3006772398948669e-02 <_> - 0 -1 812 1.4232760295271873e-03 + 0 -1 550 -5.3604291751980782e-03 - -8.9272662997245789e-02 1.9328704476356506e-01 + 2.9434949159622192e-01 -6.1312302947044373e-02 <_> - 0 -1 435 1.4769298955798149e-02 + 0 -1 541 5.5021280422806740e-03 - 4.3185703456401825e-02 -4.1162547469139099e-01 + 4.1839476674795151e-02 -4.5681878924369812e-01 <_> - 0 -1 688 1.0630609467625618e-02 + 0 -1 326 -1.3823953922837973e-03 - 2.0712809637188911e-02 -7.4652433395385742e-01 + 1.6067574918270111e-01 -1.1796293407678604e-01 <_> - 0 -1 366 -4.6220947988331318e-03 + 0 -1 514 2.0954519510269165e-02 - -2.6612642407417297e-01 6.2285874038934708e-02 + -5.7253565639257431e-02 3.3830171823501587e-01 <_> - 0 -1 608 -2.2310419008135796e-03 + 0 -1 409 7.4234008789062500e-03 - -6.4442801475524902e-01 2.2920599207282066e-02 + -7.4798591434955597e-02 2.6430690288543701e-01 <_> - 0 -1 259 -7.5279012322425842e-02 + 0 -1 578 2.1767318248748779e-03 - -5.4105269908905029e-01 2.7185589075088501e-02 + -8.0530151724815369e-02 2.5947657227516174e-01 <_> - 0 -1 319 6.8284743465483189e-03 + 0 -1 623 1.8930230289697647e-03 - -8.5639610886573792e-02 1.9920121133327484e-01 + -8.1788897514343262e-02 2.2988820075988770e-01 <_> - 0 -1 410 -7.6434519141912460e-03 + 0 -1 533 6.9275917485356331e-03 - 2.4088086187839508e-01 -6.8174593150615692e-02 + 2.6962997391819954e-02 -7.6910203695297241e-01 <_> - 0 -1 644 -3.6089830100536346e-03 + 0 -1 334 6.7140227183699608e-03 - 1.8979941308498383e-01 -9.1478735208511353e-02 + 2.3244854062795639e-02 -6.8406605720520020e-01 <_> - 0 -1 105 4.5644217729568481e-01 + 0 -1 632 -3.4494437277317047e-02 - -3.5746987909078598e-02 5.1038581132888794e-01 + -6.5257686376571655e-01 2.4584138765931129e-02 <_> - 0 -1 55 4.3285787105560303e-03 + 0 -1 787 1.9636256620287895e-03 - 5.0642926245927811e-02 -3.4335514903068542e-01 - <_> - - 0 -1 114 -3.0497182160615921e-03 - - 1.5943552553653717e-01 -1.0838232934474945e-01 - <_> - - 0 -1 153 2.9164180159568787e-03 - - -6.2386274337768555e-02 2.6772892475128174e-01 - <_> - - 0 -1 536 -6.7837955430150032e-03 - - -2.8828456997871399e-01 5.4219286888837814e-02 - <_> - - 0 -1 318 4.7922343946993351e-03 - - 4.1374113410711288e-02 -3.9169260859489441e-01 - <_> - - 0 -1 933 1.1295514181256294e-02 - - -5.8489643037319183e-02 2.8171694278717041e-01 - <_> - - 0 -1 847 -1.9917660392820835e-03 - - 1.6076046228408813e-01 -1.1378295719623566e-01 - <_> - - 0 -1 613 -1.5121680917218328e-03 - - -4.2076098918914795e-01 3.7524472922086716e-02 - <_> - - 0 -1 266 -2.0562859252095222e-02 - - 1.6639313101768494e-01 -9.5253549516201019e-02 - <_> - - 0 -1 709 -2.3025400936603546e-02 - - -3.1259611248970032e-01 5.8197792619466782e-02 - <_> - - 0 -1 584 -3.6875833757221699e-03 - - 2.2967162728309631e-01 -7.0608235895633698e-02 - <_> - - 0 -1 632 1.2718647718429565e-02 - - 4.4480670243501663e-02 -4.1392150521278381e-01 - <_> - - 0 -1 392 1.1408344144001603e-03 - - -8.0126009881496429e-02 2.2867898643016815e-01 - <_> - - 0 -1 138 2.8175862506031990e-02 - - -7.3071323335170746e-02 2.3685938119888306e-01 - <_> - - 0 -1 596 6.4620561897754669e-02 - - 4.4116552919149399e-02 -4.2114758491516113e-01 - <_> - - 0 -1 237 -2.5126901455223560e-03 - - 1.7448952794075012e-01 -9.9981509149074554e-02 - <_> - - 0 -1 949 -2.7390490286052227e-03 - - -3.7159797549247742e-01 4.5618161559104919e-02 - <_> - - 0 -1 351 4.5697823166847229e-02 - - 2.5755234062671661e-02 -5.6903475522994995e-01 - <_> - - 0 -1 720 -8.8378116488456726e-03 - - 1.5099802613258362e-01 -9.9460050463676453e-02 - <_> - - 0 -1 488 3.5273849498480558e-03 - - 4.6311099082231522e-02 -3.4411522746086121e-01 - <_> - - 0 -1 876 8.8435463840141892e-04 - - -6.9374859333038330e-02 2.2488924860954285e-01 - <_> - - 0 -1 876 -1.6139955259859562e-03 - - 3.3221766352653503e-01 -5.1287319511175156e-02 - <_> - - 0 -1 970 4.1209710761904716e-03 - - 3.1247327104210854e-02 -5.1796287298202515e-01 - <_> - - 0 -1 593 6.8625092506408691e-02 - - -4.8976749181747437e-02 3.6052888631820679e-01 - <_> - - 0 -1 128 1.9539505243301392e-02 - - -3.5133589059114456e-02 4.0571358799934387e-01 - <_> - - 0 -1 295 1.0195776820182800e-02 - - 2.9883516952395439e-02 -5.4385137557983398e-01 - <_> - - 0 -1 636 -9.7053672652691603e-04 - - 1.7753951251506805e-01 -8.5428759455680847e-02 - <_> - - 0 -1 299 7.0950109511613846e-03 - - 2.6922283694148064e-02 -5.7553297281265259e-01 - <_> - - 0 -1 89 3.3868722617626190e-02 - - 2.4893242865800858e-02 -5.1963424682617188e-01 - <_> - - 0 -1 799 8.9386161416769028e-03 - - -6.5781995654106140e-02 2.1598634123802185e-01 - <_> - - 0 -1 934 -1.1335080489516258e-03 - - 1.3626587390899658e-01 -1.2551343441009521e-01 + -9.1118760406970978e-02 2.0629465579986572e-01 <_> - 100 - -1.5342161655426025e+00 + 80 + -1.3304495811462402e+00 <_> - 0 -1 442 6.4967479556798935e-03 + 0 -1 572 -9.1053368523716927e-03 - 9.2756643891334534e-02 6.3256287574768066e-01 + 4.8031216859817505e-01 -9.3147851526737213e-02 <_> - 0 -1 735 -7.0229507982730865e-03 + 0 -1 715 -2.1384856663644314e-03 - 4.7454160451889038e-01 -9.1181516647338867e-02 + 3.4027156233787537e-01 -1.4834050834178925e-01 <_> - 0 -1 788 -1.1249051894992590e-03 + 0 -1 953 1.2453617528080940e-02 - 2.7701923251152039e-01 -1.5582662820816040e-01 + -8.0359503626823425e-02 4.7585478425025940e-01 <_> - 0 -1 272 2.1593673154711723e-02 + 0 -1 198 5.0965799018740654e-03 - -1.2302023172378540e-01 4.3630394339561462e-01 + -1.6364066302776337e-01 2.9590085148811340e-01 <_> - 0 -1 657 2.7066322509199381e-03 + 0 -1 477 -3.1894792336970568e-03 - -1.9653171300888062e-01 1.8972468376159668e-01 + 1.7039565742015839e-01 -2.1295401453971863e-01 <_> - 0 -1 789 1.9835126586258411e-03 + 0 -1 314 -1.4799979981034994e-03 - -1.0700473189353943e-01 3.2027366757392883e-01 + -4.1050529479980469e-01 5.3783610463142395e-02 <_> - 0 -1 381 -2.2188067436218262e-02 + 0 -1 66 6.0710287652909756e-03 - -3.4057390689849854e-01 9.7314909100532532e-02 + -1.5162153542041779e-01 1.8406888842582703e-01 <_> - 0 -1 900 6.6005333792418242e-04 + 0 -1 401 4.3081510812044144e-03 - -1.9594040513038635e-01 1.6130633652210236e-01 + 5.0293717533349991e-02 -4.6324169635772705e-01 <_> - 0 -1 189 9.8964036442339420e-04 + 0 -1 970 1.8933035898953676e-03 - -1.6125436127185822e-01 1.5948192775249481e-01 + 6.5655551850795746e-02 -3.9198148250579834e-01 <_> - 0 -1 557 5.2934061735868454e-02 + 0 -1 782 -1.6021143645048141e-02 - -7.4111364781856537e-02 3.6531463265419006e-01 + 2.2748421132564545e-01 -1.0609938949346542e-01 <_> - 0 -1 423 9.6504454268142581e-04 + 0 -1 928 -8.9298677630722523e-04 - -1.4388854801654816e-01 1.8791662156581879e-01 + 3.1164079904556274e-01 -1.1380065232515335e-01 <_> - 0 -1 326 -6.5498230978846550e-03 + 0 -1 888 -1.4284942299127579e-03 - -5.1886290311813354e-01 4.9368891865015030e-02 + 2.7966943383216858e-01 -9.6580952405929565e-02 <_> - 0 -1 309 -3.1677065417170525e-03 + 0 -1 822 2.5015190243721008e-02 - -4.5819568634033203e-01 4.6636309474706650e-02 + 4.2534209787845612e-02 -6.2623745203018188e-01 <_> - 0 -1 58 -3.8453172892332077e-03 + 0 -1 583 -2.8645459096878767e-03 - 1.8924130499362946e-01 -1.2508736550807953e-01 + -4.1426309943199158e-01 5.1780503243207932e-02 <_> - 0 -1 279 1.0155377909541130e-02 + 0 -1 902 3.2044243998825550e-03 - -7.4480414390563965e-02 3.1350296735763550e-01 + -1.1883606761693954e-01 1.9546063244342804e-01 <_> - 0 -1 275 9.4711792189627886e-04 + 0 -1 319 -1.0433372110128403e-02 - -1.0617389529943466e-01 2.3810641467571259e-01 + 2.6159819960594177e-01 -9.3164652585983276e-02 <_> - 0 -1 892 -2.4116779677569866e-03 + 0 -1 287 -9.7299478948116302e-03 - -3.9038985967636108e-01 6.1166737228631973e-02 + -4.9464005231857300e-01 5.0998747348785400e-02 <_> - 0 -1 260 -3.9347349666059017e-03 + 0 -1 206 -2.1688457578420639e-02 - -5.7243233919143677e-01 3.4851558506488800e-02 + 5.6923902034759521e-01 -4.9958106130361557e-02 <_> - 0 -1 328 6.6558746621012688e-03 + 0 -1 38 -2.9492072761058807e-02 - 2.8953079134225845e-02 -6.2028181552886963e-01 + -6.1336356401443481e-01 4.7003138810396194e-02 <_> - 0 -1 341 -2.2842539474368095e-03 + 0 -1 35 -2.4866596795618534e-03 - -3.3340734243392944e-01 5.2056297659873962e-02 + -3.9986124634742737e-01 5.7781789451837540e-02 <_> - 0 -1 829 7.6677929610013962e-04 + 0 -1 965 4.0488247759640217e-03 - -9.4001799821853638e-02 2.0127503573894501e-01 + 4.6429801732301712e-02 -4.4500553607940674e-01 <_> - 0 -1 8 -3.9554573595523834e-02 + 0 -1 735 -9.3909690622240305e-04 - 3.9717516303062439e-01 -5.0761125981807709e-02 + 2.4617424607276917e-01 -9.0848781168460846e-02 <_> - 0 -1 166 -2.2336144000291824e-02 + 0 -1 989 -5.2673118188977242e-03 - 2.0378184318542480e-01 -1.0499230772256851e-01 + -6.4129960536956787e-01 3.5207435488700867e-02 <_> - 0 -1 682 4.1007921099662781e-03 + 0 -1 806 -6.1755320057272911e-03 - 3.9605572819709778e-02 -5.6042844057083130e-01 + 1.7039734125137329e-01 -1.3195209205150604e-01 <_> - 0 -1 187 -6.3549563288688660e-02 + 0 -1 201 1.5832348726689816e-03 - 5.9350001811981201e-01 -3.4742560237646103e-02 + -9.2635877430438995e-02 2.5755262374877930e-01 <_> - 0 -1 370 3.7244942504912615e-03 + 0 -1 914 2.8633023612201214e-03 - -5.1448952406644821e-02 3.1930196285247803e-01 + 5.0923369824886322e-02 -4.6171438694000244e-01 <_> - 0 -1 483 1.2377202510833740e-02 + 0 -1 12 -2.3722708225250244e-02 - 3.3052973449230194e-02 -6.5478527545928955e-01 + -4.5609694719314575e-01 4.3677136301994324e-02 <_> - 0 -1 499 -1.0786693543195724e-02 + 0 -1 419 5.8846692554652691e-03 - 2.4589619040489197e-01 -7.2101429104804993e-02 + 5.1512561738491058e-02 -4.4899132847785950e-01 <_> - 0 -1 439 -1.4055164530873299e-02 + 0 -1 201 -8.2513026427477598e-04 - 3.5272973775863647e-01 -5.8014977723360062e-02 + 2.4914309382438660e-01 -8.9795768260955811e-02 <_> - 0 -1 391 -1.4940403401851654e-02 + 0 -1 690 -2.9888928402215242e-03 - -4.5820471644401550e-01 4.5480247586965561e-02 + -4.0133482217788696e-01 5.5449619889259338e-02 <_> - 0 -1 850 1.8285561818629503e-03 + 0 -1 237 1.8384978175163269e-02 - 3.2248783856630325e-02 -4.9957463145256042e-01 + 4.9513496458530426e-02 -4.2024865746498108e-01 <_> - 0 -1 26 1.8330020830035210e-02 + 0 -1 947 -2.4238843470811844e-03 - 4.6777416020631790e-02 -3.7174671888351440e-01 + -6.7325645685195923e-01 2.8972415253520012e-02 <_> - 0 -1 579 -1.1065398575738072e-03 + 0 -1 724 8.1563717685639858e-04 - -3.4255436062812805e-01 4.5848693698644638e-02 + -1.4400914311408997e-01 1.5184181928634644e-01 <_> - 0 -1 481 -2.7136057615280151e-03 + 0 -1 315 2.1788734011352062e-03 - 2.4459818005561829e-01 -6.8955913186073303e-02 + -8.2650899887084961e-02 2.5927037000656128e-01 <_> - 0 -1 163 3.5836829338222742e-03 + 0 -1 376 3.7263201083987951e-03 - 3.9574686437845230e-02 -4.1517943143844604e-01 + -6.3213117420673370e-02 3.8062268495559692e-01 <_> - 0 -1 205 1.3739100657403469e-02 + 0 -1 631 3.0819473322480917e-03 - -6.2165945768356323e-02 2.8256937861442566e-01 + 3.9066124707460403e-02 -6.2055569887161255e-01 <_> - 0 -1 763 -1.1374817695468664e-03 + 0 -1 691 2.7417289093136787e-03 - 1.6939654946327209e-01 -1.0761212557554245e-01 + 3.2166294753551483e-02 -5.6402361392974854e-01 <_> - 0 -1 731 -1.1336053721606731e-03 + 0 -1 581 -3.8205389864742756e-03 - 2.4757325649261475e-01 -7.0519238710403442e-02 + 2.5668358802795410e-01 -7.9121366143226624e-02 <_> - 0 -1 551 2.4884669110178947e-03 + 0 -1 61 -1.2516178190708160e-02 - 4.3731488287448883e-02 -4.3731775879859924e-01 + -7.0402121543884277e-01 3.2493114471435547e-02 <_> - 0 -1 693 9.1567426919937134e-02 + 0 -1 60 4.6941628679633141e-03 - -6.4225792884826660e-02 2.6794373989105225e-01 + 4.7352086752653122e-02 -4.0129581093788147e-01 <_> - 0 -1 863 8.1775393337011337e-03 + 0 -1 483 5.0501096993684769e-03 - -6.9729812443256378e-02 2.7086481451988220e-01 + -1.0563907027244568e-01 2.3647888004779816e-01 <_> - 0 -1 539 -3.1169723719358444e-02 + 0 -1 497 1.5111428685486317e-02 - -5.1539027690887451e-01 4.1658539324998856e-02 + -6.7443214356899261e-02 2.7579694986343384e-01 <_> - 0 -1 589 -1.8694017082452774e-02 + 0 -1 423 7.4835181236267090e-02 - 2.1681772172451019e-01 -8.8622607290744781e-02 + -6.2918186187744141e-02 3.6493194103240967e-01 <_> - 0 -1 472 5.7301642373204231e-03 + 0 -1 498 1.3086002320051193e-02 - -7.2939246892929077e-02 2.3475584387779236e-01 + 2.9699811711907387e-02 -7.4420636892318726e-01 <_> - 0 -1 890 1.6503074439242482e-03 + 0 -1 778 -5.4838880896568298e-03 - 6.9048069417476654e-02 -2.8440928459167480e-01 + 2.2497597336769104e-01 -8.8018722832202911e-02 <_> - 0 -1 191 -7.0378202944993973e-03 + 0 -1 261 3.3699360210448503e-03 - -4.7214046120643616e-01 3.5182151943445206e-02 + -6.9213069975376129e-02 2.9263094067573547e-01 <_> - 0 -1 591 -2.3838514462113380e-03 + 0 -1 118 7.7881952747702599e-03 - 1.9753867387771606e-01 -8.9424118399620056e-02 + 5.8034870773553848e-02 -3.9803403615951538e-01 <_> - 0 -1 349 7.9844584688544273e-03 + 0 -1 421 -1.9298251718282700e-02 - -7.4890352785587311e-02 2.3181028664112091e-01 + 2.1273820102214813e-01 -9.6075013279914856e-02 <_> - 0 -1 124 1.3400901807472110e-03 + 0 -1 440 1.3059679418802261e-02 - -1.0847068578004837e-01 1.9428721070289612e-01 + 4.0989801287651062e-02 -4.9787399172782898e-01 <_> - 0 -1 123 -2.9489169828593731e-03 + 0 -1 510 -2.2303011268377304e-02 - -4.0673759579658508e-01 4.7985706478357315e-02 + -6.5915608406066895e-01 2.7258813381195068e-02 <_> - 0 -1 952 -5.9452969580888748e-03 + 0 -1 260 -5.2872681990265846e-03 - -4.5123618841171265e-01 3.6464843899011612e-02 + 2.9461637139320374e-01 -6.9564543664455414e-02 <_> - 0 -1 659 2.3310778196901083e-03 + 0 -1 464 6.0780980857089162e-04 - -8.0826595425605774e-02 2.1532072126865387e-01 + -9.5468334853649139e-02 2.0951601862907410e-01 <_> - 0 -1 54 -1.9684966653585434e-02 + 0 -1 444 4.8917778767645359e-03 - 2.3020596802234650e-01 -8.1534743309020996e-02 + 3.9317954331636429e-02 -5.3803342580795288e-01 <_> - 0 -1 723 -1.6875991132110357e-03 + 0 -1 238 -1.0402110219001770e-01 - 2.3354543745517731e-01 -7.0870727300643921e-02 + 5.4199391603469849e-01 -3.9763871580362320e-02 <_> - 0 -1 697 -1.5521588502451777e-03 + 0 -1 687 3.8908584974706173e-03 - 1.7072069644927979e-01 -1.0233023017644882e-01 + 3.8185238838195801e-02 -5.3280067443847656e-01 <_> - 0 -1 667 -3.8005404174327850e-02 + 0 -1 353 8.0125425010919571e-03 - -6.0487842559814453e-01 2.8272373601794243e-02 + -7.8310973942279816e-02 2.4926608800888062e-01 <_> - 0 -1 624 -2.1617640741169453e-03 + 0 -1 954 -3.4356187097728252e-03 - -5.5644184350967407e-01 2.5939555838704109e-02 + 2.3415692150592804e-01 -9.2279240489006042e-02 <_> - 0 -1 653 -2.6441088411957026e-03 + 0 -1 896 -5.2030328661203384e-03 - -4.4886007905006409e-01 3.1817246228456497e-02 + -5.0255048274993896e-01 4.4738721102476120e-02 <_> - 0 -1 214 -7.3187379166483879e-04 + 0 -1 555 -5.5568795651197433e-03 - 2.2164805233478546e-01 -7.6915167272090912e-02 + 2.8329169750213623e-01 -7.0860259234905243e-02 <_> - 0 -1 532 -3.4191065933555365e-03 + 0 -1 627 -7.6205702498555183e-03 - -4.4704499840736389e-01 3.5689469426870346e-02 + 2.5350978970527649e-01 -7.2612494230270386e-02 <_> - 0 -1 597 1.4393313322216272e-03 + 0 -1 309 2.7379104495048523e-01 - -8.1237293779850006e-02 2.0022353529930115e-01 + -5.6398060172796249e-02 3.6085364222526550e-01 <_> - 0 -1 352 1.0892877355217934e-02 + 0 -1 622 7.3067229241132736e-03 - -5.9532187879085541e-02 2.6124969124794006e-01 + -6.2759615480899811e-02 3.1996127963066101e-01 <_> - 0 -1 250 2.5800592266023159e-03 + 0 -1 415 3.2574313227087259e-03 - 5.3012363612651825e-02 -3.0210506916046143e-01 + 4.1181974112987518e-02 -4.9355933070182800e-01 <_> - 0 -1 873 -3.7106748204678297e-03 + 0 -1 57 -1.2764024734497070e-01 - -3.7514480948448181e-01 4.0868300944566727e-02 + 2.5147503614425659e-01 -7.5440123677253723e-02 <_> - 0 -1 291 -8.9250775054097176e-03 + 0 -1 530 -3.2227888703346252e-02 - 1.8222920596599579e-01 -8.4776028990745544e-02 + 3.9548832178115845e-01 -4.7284111380577087e-02 <_> - 0 -1 211 -4.4729106128215790e-02 + 0 -1 764 2.3350853472948074e-02 - 2.5505220890045166e-01 -6.6192351281642914e-02 + -7.2977773845195770e-02 2.5172060728073120e-01 <_> - 0 -1 64 -1.0527699440717697e-01 + 0 -1 26 2.7610745746642351e-05 - -4.8529133200645447e-01 3.4933239221572876e-02 + -1.3625738024711609e-01 1.3250400125980377e-01 <_> - 0 -1 411 -6.5371848642826080e-02 + 0 -1 808 6.9611091166734695e-03 - 3.7187507748603821e-01 -5.8592520654201508e-02 + 2.9794082045555115e-02 -5.8855760097503662e-01 <_> - 0 -1 99 5.1612589508295059e-02 + 0 -1 210 -9.9057564511895180e-04 - -7.6325275003910065e-02 2.1536968648433685e-01 + 2.5895762443542480e-01 -7.1211874485015869e-02 <_> - 0 -1 511 4.2564887553453445e-03 + 0 -1 218 -3.7965672090649605e-03 - -7.7395483851432800e-02 2.1907977759838104e-01 + -6.4451014995574951e-01 3.5450231283903122e-02 <_> - 0 -1 671 -3.5104658454656601e-03 + 0 -1 346 3.9518065750598907e-03 - -4.1962492465972900e-01 4.1911821812391281e-02 + -6.3615679740905762e-02 3.0333930253982544e-01 <_> - 0 -1 746 -9.5827406039461493e-04 + 0 -1 282 -5.4976264946162701e-03 - 1.7163562774658203e-01 -1.0379400104284286e-01 + -4.3285435438156128e-01 4.7526597976684570e-02 <_> - 0 -1 886 -3.3416904509067535e-02 + 0 -1 721 7.1266246959567070e-03 - -5.5419611930847168e-01 3.4831445664167404e-02 + -6.6810697317123413e-02 2.8491511940956116e-01 <_> - 0 -1 406 7.4058589525520802e-03 + 0 -1 912 -3.0366722494363785e-03 - -6.6642671823501587e-02 2.6589548587799072e-01 + -4.3046197295188904e-01 4.4313102960586548e-02 <_> - 0 -1 304 -7.3020011186599731e-03 + 0 -1 714 -1.7097850795835257e-03 - 1.7654685676097870e-01 -8.7743707001209259e-02 + 2.5873449444770813e-01 -7.3857538402080536e-02 <_> - 0 -1 505 -4.5689288526773453e-03 + 0 -1 702 -4.4310283847153187e-03 - 1.9193352758884430e-01 -8.0177433788776398e-02 + 2.1451152861118317e-01 -8.7626561522483826e-02 <_> - 0 -1 740 -8.1814359873533249e-03 + 0 -1 47 -3.9760642684996128e-03 - 2.3826718330383301e-01 -6.4945526421070099e-02 + -4.6889033913612366e-01 3.8441929966211319e-02 <_> - 0 -1 404 4.5117912814021111e-03 + 0 -1 683 -2.9741778969764709e-02 - 3.0824853107333183e-02 -5.3869700431823730e-01 + -5.5860131978988647e-01 3.0309556052088737e-02 <_> - 0 -1 502 2.8812256641685963e-03 + 0 -1 13 1.3289751112461090e-01 - -9.6859149634838104e-02 1.6199249029159546e-01 + 2.8634676709771156e-02 -5.6014162302017212e-01 <_> - 0 -1 845 2.4804673157632351e-03 + 0 -1 386 -1.1272695846855640e-03 - 2.1523499861359596e-02 -7.0121616125106812e-01 + 1.7104774713516235e-01 -1.0818520933389664e-01 + + <_> + 83 + -1.2789946794509888e+00 + <_> - 0 -1 640 6.8080224096775055e-02 + 0 -1 649 1.3820428401231766e-02 - 2.1451909095048904e-02 -6.2823659181594849e-01 + -1.0330537706613541e-01 4.5001628994941711e-01 <_> - 0 -1 428 3.8525110576301813e-03 + 0 -1 834 -1.0161036625504494e-02 - -8.2842335104942322e-02 1.9410280883312225e-01 + 3.2188063859939575e-01 -1.5805941820144653e-01 <_> - 0 -1 904 -2.5594229809939861e-03 + 0 -1 398 -3.8372592534869909e-03 - 1.9102296233177185e-01 -8.5406452417373657e-02 + 3.2943242788314819e-01 -1.1501405388116837e-01 <_> - 0 -1 929 5.3212735801935196e-03 + 0 -1 769 3.4624878317117691e-02 - -7.8593194484710693e-02 2.2497585415840149e-01 + -9.8698168992996216e-02 5.4050970077514648e-01 <_> - 0 -1 235 3.1688171438872814e-03 + 0 -1 437 5.7967011816799641e-03 - 3.6922473460435867e-02 -4.5733535289764404e-01 + -1.1608023941516876e-01 2.8170758485794067e-01 <_> - 0 -1 848 1.5939949080348015e-02 + 0 -1 754 4.7825248911976814e-03 - 3.7862829864025116e-02 -3.9459064602851868e-01 + -1.3033217191696167e-01 2.4669390916824341e-01 <_> - 0 -1 634 2.3682378232479095e-03 + 0 -1 74 7.1141775697469711e-04 - 3.5111214965581894e-02 -4.3085646629333496e-01 + -2.0435671508312225e-01 1.1761441081762314e-01 <_> - 0 -1 741 1.2975309044122696e-02 + 0 -1 22 -2.9168082401156425e-02 - -7.1412295103073120e-02 2.1616001427173615e-01 + -6.2692928314208984e-01 5.5113222450017929e-02 <_> - 0 -1 960 -9.9381525069475174e-03 + 0 -1 796 2.1553519181907177e-03 - 2.7434283494949341e-01 -5.9007227420806885e-02 + 5.3858544677495956e-02 -4.2096143960952759e-01 <_> - 0 -1 14 -4.4495373964309692e-02 + 0 -1 894 -2.1254396997392178e-03 - -5.7859867811203003e-01 2.8963629156351089e-02 + 4.2603659629821777e-01 -5.0405498594045639e-02 <_> - 0 -1 457 1.0330894030630589e-02 + 0 -1 894 8.4234733367338777e-04 - -6.5200082957744598e-02 2.6670095324516296e-01 + -9.3583315610885620e-02 2.6316204667091370e-01 <_> - 0 -1 745 -4.2830477468669415e-03 + 0 -1 948 -1.6576268244534731e-03 - -5.2546054124832153e-01 3.3751774579286575e-02 + -3.5802370309829712e-01 6.8603202700614929e-02 <_> - 0 -1 899 1.5691295266151428e-02 + 0 -1 554 6.5620511770248413e-02 - 2.9164802283048630e-02 -4.8206093907356262e-01 + -6.4758449792861938e-02 3.8339248299598694e-01 <_> - 0 -1 903 -1.2077906867489219e-03 + 0 -1 361 -1.8485928885638714e-03 - 2.4997046589851379e-01 -6.1069376766681671e-02 + 1.7337062954902649e-01 -1.3676019012928009e-01 <_> - 0 -1 220 6.6226916387677193e-03 + 0 -1 305 -1.8170465528964996e-01 - 4.8671871423721313e-02 -3.4221932291984558e-01 + 4.0350264310836792e-01 -5.3196940571069717e-02 <_> - 0 -1 236 -5.1539484411478043e-03 + 0 -1 848 -3.4317909739911556e-03 - -3.5398313403129578e-01 4.2696069926023483e-02 + -5.2157330513000488e-01 4.6489212661981583e-02 <_> - 0 -1 74 -2.4832391645759344e-03 + 0 -1 800 -2.7482535224407911e-03 - 2.0646870136260986e-01 -7.5708754360675812e-02 + -5.1078474521636963e-01 4.3557438999414444e-02 <_> - 0 -1 891 3.0503068119287491e-03 + 0 -1 731 -4.7894287854433060e-03 - 2.1991817280650139e-02 -6.9251579046249390e-01 + 3.4981805086135864e-01 -6.5036587417125702e-02 <_> - 0 -1 514 9.2179588973522186e-03 + 0 -1 706 -3.3211666159331799e-03 - 1.7923980951309204e-02 -7.2638368606567383e-01 + 2.1143883466720581e-01 -1.1754662543535233e-01 <_> - 0 -1 776 3.7863249890506268e-03 + 0 -1 677 3.5642951726913452e-02 - -6.6987045109272003e-02 2.2602997720241547e-01 + 3.7131600081920624e-02 -6.2165355682373047e-01 + <_> + + 0 -1 481 -3.1561930663883686e-03 + + -4.2197883129119873e-01 4.7645546495914459e-02 + <_> + + 0 -1 872 5.2224877290427685e-03 + + -1.0117106884717941e-01 2.1957167983055115e-01 + <_> + + 0 -1 140 2.5758458301424980e-02 + + -9.6981137990951538e-02 3.0423089861869812e-01 + <_> + + 0 -1 567 2.8883803170174360e-03 + + 4.4947806745767593e-02 -5.5540132522583008e-01 + <_> + + 0 -1 484 2.6014349423348904e-03 + + 4.5947834849357605e-02 -4.1711980104446411e-01 + <_> + + 0 -1 257 -7.8792509157210588e-04 + + 1.5732656419277191e-01 -1.2769798934459686e-01 + <_> + + 0 -1 252 4.2199464514851570e-03 + + -9.4008974730968475e-02 2.6868444681167603e-01 + <_> + + 0 -1 571 -2.4246796965599060e-03 + + -4.9610009789466858e-01 4.6141009777784348e-02 + <_> + + 0 -1 465 -1.8996626604348421e-03 + + 2.6260954141616821e-01 -8.5721127688884735e-02 + <_> + + 0 -1 945 1.8048105994239450e-03 + + 7.1231566369533539e-02 -3.2751160860061646e-01 + <_> + + 0 -1 249 -5.6593962945044041e-03 + + -5.0264769792556763e-01 4.0275387465953827e-02 + <_> + + 0 -1 940 -3.4701074473559856e-03 + + -4.9033272266387939e-01 3.6995064467191696e-02 + <_> + + 0 -1 766 1.1992279905825853e-03 + + -9.3982182443141937e-02 2.2527951002120972e-01 + <_> + + 0 -1 528 -3.3614276908338070e-03 + + 1.5591301023960114e-01 -1.3875743746757507e-01 + <_> + + 0 -1 758 9.2923380434513092e-03 + + 2.8368480503559113e-02 -6.3946157693862915e-01 + <_> + + 0 -1 98 -1.6806223988533020e-01 + + -6.3519150018692017e-01 2.4432161822915077e-02 + <_> + + 0 -1 614 -1.5483988681808114e-03 + + -4.9389392137527466e-01 3.4452050924301147e-02 + <_> + + 0 -1 961 7.9401559196412563e-04 + + -1.6395612061023712e-01 1.1427336186170578e-01 + <_> + + 0 -1 245 -5.3670424968004227e-03 + + -5.4615026712417603e-01 3.2274313271045685e-02 + <_> + + 0 -1 923 -5.1019818056374788e-04 + + 1.4040225744247437e-01 -1.2673649191856384e-01 + <_> + + 0 -1 846 -9.6546392887830734e-04 + + 2.3117446899414062e-01 -7.7826015651226044e-02 + <_> + + 0 -1 994 -9.7423873376101255e-04 + + -4.0673121809959412e-01 4.6749390661716461e-02 + <_> + + 0 -1 970 -4.7841384075582027e-03 + + -5.0288796424865723e-01 3.4186109900474548e-02 + <_> + + 0 -1 89 6.8537802435457706e-03 + + 5.0501946359872818e-02 -3.5414797067642212e-01 + <_> + + 0 -1 651 4.1695050895214081e-03 + + -6.8471699953079224e-02 2.8334242105484009e-01 + <_> + + 0 -1 391 2.6521178369875997e-05 + + -1.7646598815917969e-01 1.0057727992534637e-01 + <_> + + 0 -1 674 -1.8193974392488599e-03 + + -5.2059328556060791e-01 3.4266594797372818e-02 + <_> + + 0 -1 284 1.1680822353810072e-03 + + -7.5169444084167480e-02 2.3740953207015991e-01 + <_> + + 0 -1 284 -5.8111123507842422e-04 + + 2.4673853814601898e-01 -8.9036554098129272e-02 + <_> + + 0 -1 789 5.5753946304321289e-02 + + -4.8898559063673019e-02 3.7110447883605957e-01 + <_> + + 0 -1 388 -6.0947462916374207e-03 + + -4.8019152879714966e-01 3.6990296095609665e-02 + <_> + + 0 -1 988 3.3249799162149429e-03 + + 3.2017692923545837e-02 -4.8544195294380188e-01 + <_> + + 0 -1 586 -1.1994136497378349e-02 + + 2.7767661213874817e-01 -6.2677264213562012e-02 + <_> + + 0 -1 940 1.9462420605123043e-03 + + 5.7167824357748032e-02 -3.2460683584213257e-01 + <_> + + 0 -1 482 -3.5742400214076042e-03 + + 2.1856486797332764e-01 -7.7333562076091766e-02 + <_> + + 0 -1 543 3.4013153053820133e-03 + + -9.4114005565643311e-02 2.3269242048263550e-01 + <_> + + 0 -1 859 6.4494553953409195e-03 + + 3.4765381366014481e-02 -5.1627504825592041e-01 + <_> + + 0 -1 163 -1.2767435982823372e-02 + + 2.5566741824150085e-01 -6.7411571741104126e-02 + <_> + + 0 -1 230 2.2043818607926369e-03 + + -1.3278621435165405e-01 1.7942063510417938e-01 + <_> + + 0 -1 229 -4.0757502429187298e-03 + + -3.8042715191841125e-01 4.4863421469926834e-02 + <_> + + 0 -1 730 2.2066584788262844e-03 + + -7.0331946015357971e-02 2.5572371482849121e-01 + <_> + + 0 -1 700 2.2714279592037201e-02 + + 4.1653785854578018e-02 -4.4101753830909729e-01 + <_> + + 0 -1 749 -1.1373223736882210e-02 + + 3.2443967461585999e-01 -5.8059785515069962e-02 + <_> + + 0 -1 835 1.8165379296988249e-03 + + -7.2351627051830292e-02 2.2953742742538452e-01 + <_> + + 0 -1 235 -2.8745923191308975e-03 + + -3.9090758562088013e-01 4.6148840337991714e-02 + <_> + + 0 -1 673 -5.7676057331264019e-03 + + 2.4503223598003387e-01 -7.2128646075725555e-02 + <_> + + 0 -1 177 1.2852130457758904e-02 + + -1.1143829673528671e-01 1.6758553683757782e-01 + <_> + + 0 -1 141 -4.2651765048503876e-02 + + 2.3846423625946045e-01 -7.9255387187004089e-02 + <_> + + 0 -1 24 -6.8766735494136810e-03 + + -3.9145267009735107e-01 5.2240811288356781e-02 + <_> + + 0 -1 15 -1.5351611375808716e-01 + + -5.4598790407180786e-01 2.9950620606541634e-02 + <_> + + 0 -1 280 -1.7586871981620789e-02 + + 2.4160921573638916e-01 -7.7404774725437164e-02 + <_> + + 0 -1 557 2.8469474054872990e-03 + + -7.1562752127647400e-02 2.3895153403282166e-01 + <_> + + 0 -1 493 -2.6379337534308434e-02 + + 2.7370086312294006e-01 -6.5483018755912781e-02 + <_> + + 0 -1 759 -6.6346197854727507e-04 + + 1.7174075543880463e-01 -1.0841262340545654e-01 + <_> + + 0 -1 736 1.4637422282248735e-03 + + -1.1365657299757004e-01 1.6123561561107635e-01 + <_> + + 0 -1 569 -1.3798776781186461e-03 + + 2.3192690312862396e-01 -7.5626462697982788e-02 + <_> + + 0 -1 516 -6.8256547674536705e-03 + + 2.4984428286552429e-01 -7.2457753121852875e-02 + <_> + + 0 -1 312 -9.0181883424520493e-03 + + 2.0358866453170776e-01 -9.5499873161315918e-02 + <_> + + 0 -1 218 3.1383798923343420e-03 + + 4.0804021060466766e-02 -4.9618390202522278e-01 + <_> + + 0 -1 171 -1.8526764586567879e-02 + + 2.2743205726146698e-01 -8.6628310382366180e-02 + <_> + + 0 -1 594 -2.2562327794730663e-03 + + -3.2850387692451477e-01 5.9250634163618088e-02 + <_> + + 0 -1 432 -4.1183121502399445e-03 + + -5.0281947851181030e-01 3.2455049455165863e-02 + <_> + + 0 -1 96 4.8136096447706223e-03 + + 3.1708184629678726e-02 -4.9248033761978149e-01 + + <_> + 90 + -1.2794928550720215e+00 + + <_> + + 0 -1 568 -4.7569684684276581e-03 + + 4.4339472055435181e-01 -1.0486443340778351e-01 + <_> + + 0 -1 795 -2.5423073675483465e-03 + + 3.9922216534614563e-01 -1.0431514680385590e-01 + <_> + + 0 -1 649 1.1162508279085159e-02 + + -1.5686489641666412e-01 2.3129878938198090e-01 + <_> + + 0 -1 847 1.7287035007029772e-03 + + -1.5123696625232697e-01 2.9676723480224609e-01 + <_> + + 0 -1 265 2.5025676935911179e-02 + + -5.1661748439073563e-02 4.8509848117828369e-01 + <_> + + 0 -1 78 1.2561861425638199e-02 + + -1.1817755550146103e-01 2.6937758922576904e-01 + <_> + + 0 -1 812 4.6598571352660656e-03 + + -1.3565555214881897e-01 2.1206009387969971e-01 + <_> + + 0 -1 434 7.4310216587036848e-04 + + -1.7020516097545624e-01 1.5990819036960602e-01 + <_> + + 0 -1 231 1.0259399190545082e-02 + + -1.4796857535839081e-01 1.8798792362213135e-01 + <_> + + 0 -1 278 -1.2777388095855713e-02 + + -5.4041445255279541e-01 4.8501875251531601e-02 + <_> + + 0 -1 489 -1.1427352204918861e-02 + + -5.1071381568908691e-01 4.8088576644659042e-02 + <_> + + 0 -1 819 2.8340169592411257e-05 + + -2.0961570739746094e-01 1.0582420229911804e-01 + <_> + + 0 -1 325 -6.4714960753917694e-03 + + -5.0862830877304077e-01 4.8812258988618851e-02 + <_> + + 0 -1 367 1.3540303334593773e-02 + + 2.7134107425808907e-02 -7.1317195892333984e-01 + <_> + + 0 -1 210 1.8916794797405601e-03 + + -6.2187314033508301e-02 3.6233416199684143e-01 + <_> + + 0 -1 51 1.0457850992679596e-02 + + 4.0487006306648254e-02 -5.3173840045928955e-01 + <_> + + 0 -1 893 -9.0822251513600349e-04 + + 2.0090451836585999e-01 -1.0807146877050400e-01 + <_> + + 0 -1 535 -1.9299473613500595e-02 + + -6.4914399385452271e-01 4.0790289640426636e-02 + <_> + + 0 -1 663 -8.2283990923315287e-04 + + 1.5708251297473907e-01 -1.3143004477024078e-01 + <_> + + 0 -1 523 3.7520762998610735e-03 + + 3.8761712610721588e-02 -4.9775493144989014e-01 + <_> + + 0 -1 762 8.2424264401197433e-03 + + 3.6369498819112778e-02 -5.1153117418289185e-01 + <_> + + 0 -1 805 -1.1945937294512987e-03 + + 1.3862735033035278e-01 -1.3917639851570129e-01 + <_> + + 0 -1 985 -1.0589268989861012e-02 + + 3.2981950044631958e-01 -7.6042778789997101e-02 + <_> + + 0 -1 128 2.6780981570482254e-02 + + 4.6954374760389328e-02 -4.5390221476554871e-01 + <_> + + 0 -1 705 5.2458671852946281e-03 + + -4.7804936766624451e-02 4.0361502766609192e-01 + <_> + + 0 -1 729 1.0518019553273916e-03 + + -1.0052871704101562e-01 1.9928459823131561e-01 + <_> + + 0 -1 407 3.9210864342749119e-03 + + 3.6381114274263382e-02 -5.4954099655151367e-01 + <_> + + 0 -1 873 -1.5182888135313988e-02 + + 2.8286656737327576e-01 -7.6106920838356018e-02 + <_> + + 0 -1 279 2.7552489191293716e-03 + + -1.2027227133512497e-01 2.0814672112464905e-01 + <_> + + 0 -1 869 1.3051946647465229e-02 + + 3.6561664193868637e-02 -6.8296074867248535e-01 + <_> + + 0 -1 849 4.4104140251874924e-03 + + 2.9448021203279495e-02 -5.9994471073150635e-01 + <_> + + 0 -1 799 2.3885946720838547e-03 + + 3.9816807955503464e-02 -4.6116915345191956e-01 + <_> + + 0 -1 551 2.3683100007474422e-03 + + 4.9801617860794067e-02 -3.9546611905097961e-01 + <_> + + 0 -1 707 -4.1178334504365921e-03 + + 1.6903834044933319e-01 -1.1102814227342606e-01 + <_> + + 0 -1 466 -2.7111368253827095e-03 + + 2.0166625082492828e-01 -9.3054622411727905e-02 + <_> + + 0 -1 360 -2.4442467838525772e-03 + + 1.3419428467750549e-01 -1.4021472632884979e-01 + <_> + + 0 -1 104 -6.9398069754242897e-03 + + -4.7041961550712585e-01 3.8327444344758987e-02 + <_> + + 0 -1 14 -7.5376339256763458e-02 + + 3.5196593403816223e-01 -5.8293107897043228e-02 + <_> + + 0 -1 270 -7.3061959119513631e-04 + + 2.0563322305679321e-01 -9.7862586379051208e-02 + <_> + + 0 -1 339 -4.4864090159535408e-03 + + -4.3219071626663208e-01 4.6815373003482819e-02 + <_> + + 0 -1 679 -3.3369990997016430e-03 + + -5.7968968152999878e-01 3.2250367105007172e-02 + <_> + + 0 -1 636 -5.7756435126066208e-03 + + -6.3823670148849487e-01 2.6716385036706924e-02 + <_> + + 0 -1 352 3.8174313958734274e-03 + + -7.8204549849033356e-02 2.4104152619838715e-01 + <_> + + 0 -1 414 3.9163082838058472e-03 + + 4.0961768478155136e-02 -4.2656800150871277e-01 + <_> + + 0 -1 670 -3.7615487817674875e-03 + + 2.0846015214920044e-01 -8.6097449064254761e-02 + <_> + + 0 -1 371 -9.5803234726190567e-03 + + -7.0837384462356567e-01 2.8397833928465843e-02 + <_> + + 0 -1 93 1.4632595703005791e-02 + + 1.8669826909899712e-02 -7.4236363172531128e-01 + <_> + + 0 -1 234 5.3799869492650032e-03 + + 3.0915707349777222e-02 -4.7074958682060242e-01 + <_> + + 0 -1 701 -2.4318110663443804e-03 + + 3.0304560065269470e-01 -5.6169599294662476e-02 + <_> + + 0 -1 641 3.8594864308834076e-02 + + 2.5472542271018028e-02 -6.8472218513488770e-01 + <_> + + 0 -1 125 1.6673290729522705e-01 + + -5.9959251433610916e-02 2.9591250419616699e-01 + <_> + + 0 -1 854 -5.0129964947700500e-03 + + 1.9718486070632935e-01 -9.4902090728282928e-02 + <_> + + 0 -1 960 -9.3115903437137604e-03 + + 2.8306549787521362e-01 -6.8168632686138153e-02 + <_> + + 0 -1 804 -2.7176579460501671e-03 + + 2.4883794784545898e-01 -7.3830418288707733e-02 + <_> + + 0 -1 787 6.9358374457806349e-04 + + -1.2474948167800903e-01 1.6316886246204376e-01 + <_> + + 0 -1 783 1.3523821253329515e-03 + + -7.3475763201713562e-02 3.0120497941970825e-01 + <_> + + 0 -1 532 -2.6339504867792130e-02 + + 4.7823980450630188e-01 -3.9222836494445801e-02 + <_> + + 0 -1 866 3.3510509878396988e-02 + + -3.8013227283954620e-02 4.1955846548080444e-01 + <_> + + 0 -1 694 -2.8097369067836553e-05 + + 1.2249568104743958e-01 -1.4184975624084473e-01 + <_> + + 0 -1 988 -4.0141213685274124e-03 + + -4.5551317930221558e-01 3.6903131753206253e-02 + <_> + + 0 -1 934 5.7984986342489719e-03 + + 3.9383981376886368e-02 -4.0305584669113159e-01 + <_> + + 0 -1 753 7.5392555445432663e-03 + + -9.3996182084083557e-02 1.8520636856555939e-01 + <_> + + 0 -1 943 4.5007485896348953e-03 + + 4.2565450072288513e-02 -4.0628531575202942e-01 + <_> + + 0 -1 500 5.0333794206380844e-03 + + -6.7051678895950317e-02 2.5224363803863525e-01 + <_> + + 0 -1 511 8.7359821191057563e-04 + + -9.5469102263450623e-02 1.7292767763137817e-01 + <_> + + 0 -1 771 3.0778967775404453e-03 + + -6.1908006668090820e-02 2.5266119837760925e-01 + <_> + + 0 -1 835 -2.2874618880450726e-03 + + 1.9187310338020325e-01 -8.5145145654678345e-02 + <_> + + 0 -1 634 4.0947222150862217e-03 + + 3.0908439308404922e-02 -5.5290663242340088e-01 + <_> + + 0 -1 488 2.1358881145715714e-02 + + 4.0033571422100067e-02 -3.8174301385879517e-01 + <_> + + 0 -1 159 -4.5840246602892876e-03 + + -5.2027910947799683e-01 3.0034648254513741e-02 + <_> + + 0 -1 232 9.8655056208372116e-03 + + 2.1588459610939026e-02 -6.3089925050735474e-01 + <_> + + 0 -1 223 2.5678081437945366e-03 + + -1.1046713590621948e-01 1.4713281393051147e-01 + <_> + + 0 -1 688 -2.6078277733176947e-03 + + 2.7103677392005920e-01 -5.9257075190544128e-02 + <_> + + 0 -1 355 2.6908484287559986e-03 + + 2.7514556422829628e-02 -6.3733005523681641e-01 + <_> + + 0 -1 715 -1.3983637327328324e-03 + + 1.5699537098407745e-01 -1.0462216287851334e-01 + <_> + + 0 -1 433 1.0498151183128357e-01 + + 3.0471364036202431e-02 -4.9990084767341614e-01 + <_> + + 0 -1 491 -1.4592260122299194e-01 + + 3.2007977366447449e-01 -5.2097231149673462e-02 + <_> + + 0 -1 825 7.8754723072052002e-03 + + -6.7778728902339935e-02 2.8044930100440979e-01 + <_> + + 0 -1 262 -5.3792521357536316e-03 + + 2.1354769170284271e-01 -8.2902953028678894e-02 + <_> + + 0 -1 420 -1.0021779686212540e-02 + + 2.5685080885887146e-01 -7.3165819048881531e-02 + <_> + + 0 -1 1 -4.2762188240885735e-03 + + 1.7162682116031647e-01 -9.7696490585803986e-02 + <_> + + 0 -1 67 1.0965526103973389e-02 + + -7.5053967535495758e-02 2.3615135252475739e-01 + <_> + + 0 -1 328 -4.4276113621890545e-03 + + 2.5747051835060120e-01 -6.3898853957653046e-02 + <_> + + 0 -1 276 -8.6840223520994186e-03 + + -4.7478455305099487e-01 3.6790292710065842e-02 + <_> + + 0 -1 938 2.8339526616036892e-03 + + 4.0944386273622513e-02 -3.6514538526535034e-01 + <_> + + 0 -1 790 7.6391562819480896e-02 + + -4.9489263445138931e-02 3.4142583608627319e-01 + <_> + + 0 -1 148 1.9103729864582419e-03 + + -5.6329321116209030e-02 2.9177185893058777e-01 + <_> + + 0 -1 304 5.2499733865261078e-02 + + 2.8848636895418167e-02 -5.9306102991104126e-01 + <_> + + 0 -1 956 -5.0793914124369621e-03 + + -5.0588577985763550e-01 2.8303196653723717e-02 + <_> + + 0 -1 967 -7.1491668932139874e-03 + + -6.2660187482833862e-01 2.3113224655389786e-02 + + <_> + 88 + -1.2153301239013672e+00 + + <_> + + 0 -1 803 3.5730558447539806e-03 + + -4.2218949645757675e-02 5.5067819356918335e-01 + <_> + + 0 -1 520 1.0531613603234291e-02 + + -1.0848262906074524e-01 4.2079353332519531e-01 + <_> + + 0 -1 570 -2.8240748215466738e-03 + + 1.5155430138111115e-01 -2.2742147743701935e-01 + <_> + + 0 -1 384 -1.6008135862648487e-03 + + 2.9879093170166016e-01 -1.0573560744524002e-01 + <_> + + 0 -1 90 -1.2082614004611969e-02 + + 2.5803449749946594e-01 -1.1197961121797562e-01 + <_> + + 0 -1 746 9.8490377422422171e-04 + + -1.8312133848667145e-01 1.3942104578018188e-01 + <_> + + 0 -1 347 1.3184763491153717e-02 + + -1.0306112468242645e-01 2.5403776764869690e-01 + <_> + + 0 -1 143 2.5388993322849274e-02 + + 6.4101323485374451e-02 -4.2444714903831482e-01 + <_> + + 0 -1 196 7.8083951957523823e-03 + + -7.8133262693881989e-02 3.2170715928077698e-01 + <_> + + 0 -1 921 1.2125947978347540e-03 + + -1.4831624925136566e-01 1.6055701673030853e-01 + <_> + + 0 -1 920 -5.7722916826605797e-03 + + -6.2254351377487183e-01 4.7926213592290878e-02 + <_> + + 0 -1 987 -6.7740413360297680e-03 + + -6.4991837739944458e-01 1.9058052450418472e-02 + <_> + + 0 -1 291 -2.8847754001617432e-03 + + -5.1574712991714478e-01 4.2939033359289169e-02 + <_> + + 0 -1 922 -5.1092512905597687e-02 + + -7.1794927120208740e-01 3.0500946566462517e-02 + <_> + + 0 -1 303 -3.0863287393003702e-03 + + -5.1027435064315796e-01 3.7360988557338715e-02 + <_> + + 0 -1 593 -3.1833123648539186e-04 + + 1.1626140773296356e-01 -1.7245446145534515e-01 + <_> + + 0 -1 210 1.2636608444154263e-03 + + -7.4942886829376221e-02 2.7081242203712463e-01 + <_> + + 0 -1 693 -2.7436314150691032e-02 + + -5.7718968391418457e-01 3.3168055117130280e-02 + <_> + + 0 -1 342 -1.8837231909856200e-03 + + -3.0960574746131897e-01 6.1044581234455109e-02 + <_> + + 0 -1 797 3.2289433293044567e-03 + + -6.8203814327716827e-02 2.9658797383308411e-01 + <_> + + 0 -1 503 -3.6236688029021025e-03 + + -4.9605649709701538e-01 4.2492914944887161e-02 + <_> + + 0 -1 135 -1.3776571722701192e-03 + + 1.3447758555412292e-01 -1.3678476214408875e-01 + <_> + + 0 -1 579 2.9051192104816437e-03 + + -1.2944447994232178e-01 1.4306847751140594e-01 + <_> + + 0 -1 722 4.4553354382514954e-03 + + 3.8421813398599625e-02 -4.5035859942436218e-01 + <_> + + 0 -1 622 1.0964765213429928e-02 + + -4.8769049346446991e-02 3.9813303947448730e-01 + <_> + + 0 -1 682 2.8863823972642422e-03 + + 5.1313977688550949e-02 -3.6272794008255005e-01 + <_> + + 0 -1 283 8.8652484118938446e-03 + + -9.4886533915996552e-02 2.1068450808525085e-01 + <_> + + 0 -1 333 -1.9646657630801201e-02 + + 2.2927023470401764e-01 -1.0384474694728851e-01 + <_> + + 0 -1 684 -2.3328745737671852e-03 + + -3.0931735038757324e-01 6.4516365528106689e-02 + <_> + + 0 -1 8 -4.0204055607318878e-02 + + 2.7381995320320129e-01 -7.6448827981948853e-02 + <_> + + 0 -1 100 1.9051276147365570e-02 + + 4.9466736614704132e-02 -3.6089882254600525e-01 + <_> + + 0 -1 936 1.1553505435585976e-02 + + -7.4454858899116516e-02 2.5223839282989502e-01 + <_> + + 0 -1 76 6.0810474678874016e-03 + + 4.9583721905946732e-02 -3.6660569906234741e-01 + <_> + + 0 -1 212 5.4147411137819290e-03 + + 3.2274514436721802e-02 -4.9895319342613220e-01 + <_> + + 0 -1 544 4.6544210053980350e-03 + + 2.5989409536123276e-02 -6.1053085327148438e-01 + <_> + + 0 -1 166 2.4446439929306507e-03 + + -1.2073440849781036e-01 1.4529803395271301e-01 + <_> + + 0 -1 698 4.6318914974108338e-04 + + -1.0553400218486786e-01 1.7337696254253387e-01 + <_> + + 0 -1 642 -3.7485856562852859e-02 + + -4.0581890940666199e-01 4.1759915649890900e-02 + <_> + + 0 -1 529 -2.0438145846128464e-02 + + 2.9171264171600342e-01 -6.6287793219089508e-02 + <_> + + 0 -1 524 -3.8345486391335726e-03 + + 1.5750087797641754e-01 -1.2569475173950195e-01 + <_> + + 0 -1 884 8.8059913832694292e-04 + + -1.0610871762037277e-01 1.7642241716384888e-01 + <_> + + 0 -1 33 2.0514219067990780e-03 + + 3.4303460270166397e-02 -5.5235451459884644e-01 + <_> + + 0 -1 851 -3.5282317548990250e-03 + + -5.3414058685302734e-01 3.0512372031807899e-02 + <_> + + 0 -1 506 6.1051873490214348e-03 + + -8.4812760353088379e-02 1.9969700276851654e-01 + <_> + + 0 -1 137 -6.4141638576984406e-03 + + -4.0772309899330139e-01 4.3864764273166656e-02 + <_> + + 0 -1 823 1.7272554337978363e-02 + + 2.1965105086565018e-02 -6.9809681177139282e-01 + <_> + + 0 -1 512 -1.9691141787916422e-03 + + 1.8511210381984711e-01 -9.0554594993591309e-02 + <_> + + 0 -1 59 -5.5513512343168259e-03 + + -4.2040807008743286e-01 4.0062893182039261e-02 + <_> + + 0 -1 626 -1.1905157566070557e-01 + + -6.4312189817428589e-01 2.3472266271710396e-02 + <_> + + 0 -1 290 4.0823101997375488e-02 + + -7.3068141937255859e-02 2.4851579964160919e-01 + <_> + + 0 -1 119 -8.1011475995182991e-03 + + 2.2747313976287842e-01 -7.5412914156913757e-02 + <_> + + 0 -1 87 4.7750310041010380e-03 + + -7.8901365399360657e-02 2.3182301223278046e-01 + <_> + + 0 -1 404 -2.7586806565523148e-02 + + -6.4926701784133911e-01 2.5375340133905411e-02 + <_> + + 0 -1 907 4.3069543316960335e-03 + + 2.4360222741961479e-02 -5.7372909784317017e-01 + <_> + + 0 -1 385 -6.1931653181090951e-04 + + 2.2557340562343597e-01 -7.5787223875522614e-02 + <_> + + 0 -1 50 -1.1459679901599884e-01 + + 3.0668416619300842e-01 -5.2840072661638260e-02 + <_> + + 0 -1 239 3.1560026109218597e-02 + + -9.5666781067848206e-02 1.7659574747085571e-01 + <_> + + 0 -1 871 1.5142546035349369e-03 + + -9.2694908380508423e-02 2.0833927392959595e-01 + <_> + + 0 -1 731 4.7312509268522263e-03 + + -4.9851816147565842e-02 3.4422698616981506e-01 + <_> + + 0 -1 253 -5.9051956050097942e-03 + + -4.6798244118690491e-01 3.6009732633829117e-02 + <_> + + 0 -1 703 3.3569703809916973e-03 + + -5.1445800811052322e-02 3.3950069546699524e-01 + <_> + + 0 -1 966 -1.1821147799491882e-01 + + 4.6877983212471008e-01 -3.2708466053009033e-02 + <_> + + 0 -1 363 -8.8651233818382025e-04 + + 1.5177871286869049e-01 -1.0880727320909500e-01 + <_> + + 0 -1 680 -2.5330238044261932e-02 + + 1.7184022068977356e-01 -9.8979160189628601e-02 + <_> + + 0 -1 770 5.5901473388075829e-03 + + -7.1004293859004974e-02 2.7359166741371155e-01 + <_> + + 0 -1 189 1.2344302609562874e-02 + + 3.2738436013460159e-02 -5.2876019477844238e-01 + <_> + + 0 -1 348 -7.4871592223644257e-03 + + -5.1955360174179077e-01 2.7597136795520782e-02 + <_> + + 0 -1 646 -2.6753707788884640e-03 + + -4.7180628776550293e-01 3.1411368399858475e-02 + <_> + + 0 -1 168 -3.2419776543974876e-03 + + 1.5980260074138641e-01 -9.5776490867137909e-02 + <_> + + 0 -1 169 8.8083129376173019e-03 + + -8.2104682922363281e-02 2.0850872993469238e-01 + <_> + + 0 -1 58 2.7282098308205605e-03 + + 6.1908718198537827e-02 -2.6338595151901245e-01 + <_> + + 0 -1 671 5.0587565638124943e-03 + + -8.2083821296691895e-02 1.9557759165763855e-01 + <_> + + 0 -1 708 -2.1199107170104980e-02 + + -5.0425887107849121e-01 3.0914928764104843e-02 + <_> + + 0 -1 723 3.4958114847540855e-03 + + -8.2294017076492310e-02 1.9164223968982697e-01 + <_> + + 0 -1 842 1.5914414543658495e-03 + + -6.9352962076663971e-02 2.1474194526672363e-01 + <_> + + 0 -1 193 -5.0045788288116455e-02 + + 2.4582423269748688e-01 -6.2959901988506317e-02 + <_> + + 0 -1 19 -4.1983526200056076e-02 + + -6.3210010528564453e-01 2.5985429063439369e-02 + <_> + + 0 -1 402 -6.9432961754500866e-04 + + 2.2444137930870056e-01 -7.0591680705547333e-02 + <_> + + 0 -1 540 6.0177911072969437e-03 + + 3.7622205913066864e-02 -4.1375440359115601e-01 + <_> + + 0 -1 492 4.7936867922544479e-03 + + -9.0203136205673218e-02 1.7498855292797089e-01 + <_> + + 0 -1 390 -4.7484524548053741e-03 + + -3.9998278021812439e-01 3.8966752588748932e-02 + <_> + + 0 -1 620 -7.7324017882347107e-02 + + -4.8634868860244751e-01 2.9687402769923210e-02 + <_> + + 0 -1 417 1.1184449307620525e-02 + + -4.9598570913076401e-02 3.2780852913856506e-01 + <_> + + 0 -1 132 -1.0921864770352840e-02 + + 1.7756749689579010e-01 -8.5219532251358032e-02 + <_> + + 0 -1 357 4.5135535299777985e-02 + + 2.8995228931307793e-02 -5.3758519887924194e-01 + <_> + + 0 -1 341 -1.1866749264299870e-03 + + 1.8304300308227539e-01 -8.5605643689632416e-02 + <_> + + 0 -1 609 2.0626676268875599e-03 + + 2.5438303127884865e-02 -5.9883767366409302e-01 + <_> + + 0 -1 251 2.7453177608549595e-05 + + -1.3831512629985809e-01 1.0590004175901413e-01 + + <_> + 98 + -1.2823635339736938e+00 + + <_> + + 0 -1 840 -8.7535101920366287e-03 + + 3.7845414876937866e-01 -1.2724789977073669e-01 + <_> + + 0 -1 376 -5.7867290452122688e-03 + + 4.6451708674430847e-01 -1.0028645396232605e-01 + <_> + + 0 -1 467 -1.5636831521987915e-02 + + 2.7137696743011475e-01 -1.3237486779689789e-01 + <_> + + 0 -1 743 7.9419813118875027e-04 + + -2.2457434237003326e-01 1.8765783309936523e-01 + <_> + + 0 -1 511 9.8101666662842035e-04 + + -1.1674020439386368e-01 2.3788549005985260e-01 + <_> + + 0 -1 148 -1.1779682245105505e-03 + + 2.5913080573081970e-01 -8.3949849009513855e-02 + <_> + + 0 -1 330 9.6748135983943939e-03 + + -8.3296068012714386e-02 3.4700453281402588e-01 + <_> + + 0 -1 307 2.9431451112031937e-03 + + 4.6826824545860291e-02 -5.1865130662918091e-01 + <_> + + 0 -1 918 -1.0496248723939061e-03 + + -2.9976195096969604e-01 6.9594070315361023e-02 + <_> + + 0 -1 697 -1.6385620459914207e-02 + + 2.1480703353881836e-01 -9.7807772457599640e-02 + <_> + + 0 -1 910 4.9830954521894455e-03 + + 2.2837642580270767e-02 -7.7743059396743774e-01 + <_> + + 0 -1 796 -3.1421617604792118e-03 + + -5.6898134946823120e-01 3.6988433450460434e-02 + <_> + + 0 -1 901 1.6069117933511734e-02 + + -1.0548119246959686e-01 1.9650301337242126e-01 + <_> + + 0 -1 751 1.5043821185827255e-02 + + -1.0749972611665726e-01 2.0178599655628204e-01 + <_> + + 0 -1 295 6.8444460630416870e-03 + + 5.0306834280490875e-02 -4.3162798881530762e-01 + <_> + + 0 -1 827 1.1850953102111816e-02 + + 3.2905589789152145e-02 -5.1617246866226196e-01 + <_> + + 0 -1 831 2.1246306598186493e-02 + + -6.3726536929607391e-02 3.0544599890708923e-01 + <_> + + 0 -1 256 1.1852337047457695e-02 + + -8.9553833007812500e-02 2.9359081387519836e-01 + <_> + + 0 -1 323 -2.5085010565817356e-03 + + 2.2805334627628326e-01 -9.5263637602329254e-02 + <_> + + 0 -1 752 7.5797801837325096e-03 + + 3.8756053894758224e-02 -5.7552194595336914e-01 + <_> + + 0 -1 86 5.4980744607746601e-03 + + 4.6144284307956696e-02 -3.6506399512290955e-01 + <_> + + 0 -1 208 -3.0190458055585623e-03 + + -2.9709556698799133e-01 7.5851216912269592e-02 + <_> + + 0 -1 552 -7.0441095158457756e-03 + + 1.6086654365062714e-01 -1.1914677917957306e-01 + <_> + + 0 -1 364 -6.9178184494376183e-03 + + -4.1069602966308594e-01 4.4916272163391113e-02 + <_> + + 0 -1 351 5.0740875303745270e-03 + + -7.4677795171737671e-02 2.4945564568042755e-01 + <_> + + 0 -1 121 -1.0403880849480629e-02 + + -5.3336864709854126e-01 3.9480298757553101e-02 + <_> + + 0 -1 323 2.3738082963973284e-03 + + -7.8084513545036316e-02 2.3774850368499756e-01 + <_> + + 0 -1 391 2.7033074729843065e-05 + + -1.8558554351329803e-01 9.6640095114707947e-02 + <_> + + 0 -1 167 2.9049259610474110e-03 + + 4.6409133821725845e-02 -3.9720407128334045e-01 + <_> + + 0 -1 181 -5.6298477575182915e-03 + + -4.5908093452453613e-01 3.7730857729911804e-02 + <_> + + 0 -1 638 5.0751655362546444e-03 + + 2.3507807403802872e-02 -6.4602053165435791e-01 + <_> + + 0 -1 909 -7.5826002284884453e-04 + + 1.2444372475147247e-01 -1.3639765977859497e-01 + <_> + + 0 -1 11 -9.7201213240623474e-02 + + 3.9986947178840637e-01 -4.4366274029016495e-02 + <_> + + 0 -1 496 -2.3840454220771790e-01 + + -5.3094118833541870e-01 3.8410611450672150e-02 + <_> + + 0 -1 114 -1.3428549282252789e-02 + + 2.2794343531131744e-01 -7.7827021479606628e-02 + <_> + + 0 -1 64 -5.0623202696442604e-04 + + 1.5778008103370667e-01 -1.2732668220996857e-01 + <_> + + 0 -1 931 -8.6578715126961470e-04 + + 1.4809772372245789e-01 -1.1785575747489929e-01 + <_> + + 0 -1 544 -2.7892580255866051e-03 + + -4.2324438691139221e-01 4.1194166988134384e-02 + <_> + + 0 -1 654 2.9110969044268131e-03 + + -1.2145258486270905e-01 1.4758351445198059e-01 + <_> + + 0 -1 122 -1.7908504605293274e-01 + + 4.0684828162193298e-01 -4.6298943459987640e-02 + <_> + + 0 -1 894 4.2685694643296301e-04 + + -9.4548642635345459e-02 1.8615303933620453e-01 + <_> + + 0 -1 72 1.9871112704277039e-01 + + -5.6818448007106781e-02 3.2197028398513794e-01 + <_> + + 0 -1 892 1.2496551498770714e-03 + + -7.0664338767528534e-02 2.5729593634605408e-01 + <_> + + 0 -1 447 1.6119793057441711e-02 + + -5.0713617354631424e-02 3.9684635400772095e-01 + <_> + + 0 -1 964 -2.5047704111784697e-03 + + -3.5733562707901001e-01 4.9460943788290024e-02 + <_> + + 0 -1 672 5.2866833284497261e-03 + + 3.2510578632354736e-02 -4.4326359033584595e-01 + <_> + + 0 -1 633 -3.4677600488066673e-03 + + 2.3254001140594482e-01 -7.3516972362995148e-02 + <_> + + 0 -1 600 -3.3557973802089691e-03 + + 2.3221854865550995e-01 -6.9719336926937103e-02 + <_> + + 0 -1 801 -6.3276281580328941e-03 + + -4.0112924575805664e-01 4.3525256216526031e-02 + <_> + + 0 -1 218 -4.3456726707518101e-03 + + -6.8020933866500854e-01 1.9806224852800369e-02 + <_> + + 0 -1 604 6.2400596216320992e-03 + + 1.8352568149566650e-02 -7.0223194360733032e-01 + <_> + + 0 -1 979 3.3795731142163277e-03 + + 4.3487045913934708e-02 -3.0831974744796753e-01 + <_> + + 0 -1 937 1.3499217107892036e-02 + + -4.4923197478055954e-02 3.2624542713165283e-01 + <_> + + 0 -1 408 -1.0585743002593517e-03 + + 1.6033367812633514e-01 -9.8465800285339355e-02 + <_> + + 0 -1 405 -5.3765797056257725e-03 + + 2.6544988155364990e-01 -6.7050188779830933e-02 + <_> + + 0 -1 980 -2.4880110286176205e-03 + + -2.9397118091583252e-01 5.4097402840852737e-02 + <_> + + 0 -1 505 -2.1792344748973846e-02 + + -7.2506862878799438e-01 1.9187789410352707e-02 + <_> + + 0 -1 714 4.7056311741471291e-03 + + -5.2215453237295151e-02 3.1615570187568665e-01 + <_> + + 0 -1 669 -4.2645912617444992e-03 + + 2.3567616939544678e-01 -6.8938009440898895e-02 + <_> + + 0 -1 774 5.8556320145726204e-03 + + 4.2000979185104370e-02 -4.6045160293579102e-01 + <_> + + 0 -1 926 1.3632343616336584e-03 + + -6.5663956105709076e-02 2.3397234082221985e-01 + <_> + + 0 -1 895 -6.0495175421237946e-03 + + -4.3943586945533752e-01 3.6742802709341049e-02 + <_> + + 0 -1 308 6.7223357036709785e-03 + + 1.9922675564885139e-02 -6.8767511844635010e-01 + <_> + + 0 -1 917 -5.1960002630949020e-02 + + -7.5993520021438599e-01 1.5627101063728333e-02 + <_> + + 0 -1 542 3.3762669190764427e-03 + + -7.7943108975887299e-02 1.9545321166515350e-01 + <_> + + 0 -1 582 -1.8302195239812136e-03 + + 1.9154363870620728e-01 -9.4946600496768951e-02 + <_> + + 0 -1 71 -4.3824277818202972e-03 + + -5.3172159194946289e-01 2.8438575565814972e-02 + <_> + + 0 -1 107 4.8605538904666901e-03 + + 1.8084224313497543e-02 -7.0419138669967651e-01 + <_> + + 0 -1 289 -5.0755832344293594e-03 + + 1.3961549103260040e-01 -1.0557857155799866e-01 + <_> + + 0 -1 349 9.0303886681795120e-03 + + -5.6681722402572632e-02 3.0537691712379456e-01 + <_> + + 0 -1 52 1.7635107040405273e-01 + + -3.5581633448600769e-02 3.9358299970626831e-01 + <_> + + 0 -1 728 1.1068049352616072e-03 + + -9.6729792654514313e-02 1.6677951812744141e-01 + <_> + + 0 -1 162 1.1059102602303028e-02 + + 2.9283966869115829e-02 -5.1121145486831665e-01 + <_> + + 0 -1 236 -5.0462923943996429e-02 + + -4.2722624540328979e-01 3.1082244589924812e-02 + <_> + + 0 -1 316 -3.8071773014962673e-03 + + 2.9747742414474487e-01 -5.1289469003677368e-02 + <_> + + 0 -1 373 -1.5183673240244389e-03 + + 1.8215130269527435e-01 -1.0301912575960159e-01 + <_> + + 0 -1 258 2.1069757640361786e-02 + + 2.4503789842128754e-02 -5.8991265296936035e-01 + <_> + + 0 -1 68 6.6435593180358410e-03 + + 4.3313629925251007e-02 -3.1504327058792114e-01 + <_> + + 0 -1 574 -8.2504414021968842e-03 + + -4.7998124361038208e-01 3.0433293431997299e-02 + <_> + + 0 -1 617 -1.0892231017351151e-02 + + 3.1449675559997559e-01 -5.2475348114967346e-02 + <_> + + 0 -1 213 8.1554818898439407e-03 + + 3.9224579930305481e-02 -3.8470247387886047e-01 + <_> + + 0 -1 838 -5.4475883953273296e-03 + + -6.5578418970108032e-01 2.0117431879043579e-02 + <_> + + 0 -1 487 -2.6005427935160697e-04 + + 1.4328984916210175e-01 -9.8999619483947754e-02 + <_> + + 0 -1 461 1.3821206521242857e-03 + + -5.2590593695640564e-02 2.7557003498077393e-01 + <_> + + 0 -1 445 -1.1740636080503464e-02 + + 2.7564841508865356e-01 -5.9799015522003174e-02 + <_> + + 0 -1 941 2.7866149321198463e-03 + + 5.0002526491880417e-02 -3.5232934355735779e-01 + <_> + + 0 -1 962 6.6179647110402584e-03 + + -6.3348092138767242e-02 2.3150660097599030e-01 + <_> + + 0 -1 297 -1.3244405854493380e-03 + + -2.6642721891403198e-01 5.5936500430107117e-02 + <_> + + 0 -1 485 1.1830568313598633e-02 + + -6.9061063230037689e-02 2.1172530949115753e-01 + <_> + + 0 -1 644 2.5925931986421347e-03 + + 1.9716180860996246e-02 -7.7208590507507324e-01 + <_> + + 0 -1 748 -2.8010653331875801e-03 + + 1.3846111297607422e-01 -9.7015053033828735e-02 + <_> + + 0 -1 144 -4.7637272626161575e-02 + + 2.1245625615119934e-01 -7.0445045828819275e-02 + <_> + + 0 -1 197 1.3677144888788462e-03 + + -8.5676178336143494e-02 1.9613882899284363e-01 + <_> + + 0 -1 556 -1.3261453807353973e-01 + + 4.3639957904815674e-01 -3.4653130918741226e-02 + <_> + + 0 -1 69 7.1225965023040771e-01 + + 1.9474601373076439e-02 -8.7232232093811035e-01 + <_> + + 0 -1 149 -5.9057516045868397e-03 + + -3.7135502696037292e-01 3.5206548869609833e-02 + <_> + + 0 -1 971 3.5532126203179359e-03 + + -6.6334858536720276e-02 2.3531165719032288e-01 + <_> + + 0 -1 31 -1.9724387675523758e-02 + + 2.5173032283782959e-01 -5.7575348764657974e-02 + + <_> + 100 + -1.3067311048507690e+00 + + <_> + + 0 -1 458 8.1832958385348320e-03 + + -1.1180391162633896e-01 3.9526882767677307e-01 + <_> + + 0 -1 717 -5.5650249123573303e-03 + + 3.3437621593475342e-01 -1.2654128670692444e-01 + <_> + + 0 -1 577 8.1406952813267708e-04 + + -1.7086146771907806e-01 1.8384252488613129e-01 + <_> + + 0 -1 113 -2.0645279437303543e-03 + + 1.7057111859321594e-01 -1.7103828489780426e-01 + <_> + + 0 -1 864 1.9037863239645958e-03 + + -1.6791534423828125e-01 1.5749432146549225e-01 + <_> + + 0 -1 242 1.1136581189930439e-02 + + 4.0173061192035675e-02 -3.7364640831947327e-01 + <_> + + 0 -1 228 5.6379067245870829e-04 + + -1.6792711615562439e-01 1.4207355678081512e-01 + <_> + + 0 -1 797 -3.3720356877893209e-03 + + 2.5698736310005188e-01 -7.5178287923336029e-02 + <_> + + 0 -1 710 -1.7311582341790199e-02 + + -5.2065086364746094e-01 4.7350786626338959e-02 + <_> + + 0 -1 845 -3.3407085575163364e-03 + + -4.5184752345085144e-01 3.2597322016954422e-02 + <_> + + 0 -1 661 -3.4317255020141602e-02 + + 2.5700893998146057e-01 -8.3455510437488556e-02 + <_> + + 0 -1 423 -6.8267658352851868e-02 + + 2.8288829326629639e-01 -7.8631594777107239e-02 + <_> + + 0 -1 951 2.8722581191686913e-05 + + -1.8466357886791229e-01 1.1576397716999054e-01 + <_> + + 0 -1 267 9.9579263478517532e-03 + + -6.3400641083717346e-02 3.6796927452087402e-01 + <_> + + 0 -1 733 -1.8424488604068756e-02 + + 2.4584248661994934e-01 -9.4283707439899445e-02 + <_> + + 0 -1 837 6.8876314908266068e-03 + + -9.9725127220153809e-02 2.8111982345581055e-01 + <_> + + 0 -1 657 -2.2637452930212021e-03 + + -4.1033151745796204e-01 6.1188895255327225e-02 + <_> + + 0 -1 191 -8.5531552031170577e-05 + + 1.1543370783329010e-01 -1.6276736557483673e-01 + <_> + + 0 -1 32 3.3203132450580597e-02 + + 4.8811107873916626e-02 -3.7535405158996582e-01 + <_> + + 0 -1 929 5.1993243396282196e-03 + + 3.9811953902244568e-02 -4.8758861422538757e-01 + <_> + + 0 -1 365 4.8818998038768768e-03 + + 2.4118293076753616e-02 -6.7809182405471802e-01 + <_> + + 0 -1 82 -7.2956003248691559e-02 + + 1.8825025856494904e-01 -9.5193333923816681e-02 + <_> + + 0 -1 836 9.4123989343643188e-02 + + -7.2761356830596924e-02 2.7999758720397949e-01 + <_> + + 0 -1 718 1.0472428984940052e-03 + + -7.4624419212341309e-02 2.4220877885818481e-01 + <_> + + 0 -1 446 8.0979522317647934e-03 + + -5.4950036108493805e-02 3.0833497643470764e-01 + <_> + + 0 -1 463 -2.8517602477222681e-03 + + 3.2442548871040344e-01 -7.1306072175502777e-02 + <_> + + 0 -1 63 3.7457090802490711e-03 + + 5.7812750339508057e-02 -3.3119776844978333e-01 + <_> + + 0 -1 217 -3.9520347490906715e-03 + + -4.3750977516174316e-01 3.9293695241212845e-02 + <_> + + 0 -1 865 -5.8175362646579742e-03 + + 2.0937338471412659e-01 -8.1724949181079865e-02 + <_> + + 0 -1 878 7.8594256192445755e-03 + + 4.8747915774583817e-02 -4.1596582531929016e-01 + <_> + + 0 -1 913 -6.7130924435332417e-04 + + 1.4715777337551117e-01 -1.2916122376918793e-01 + <_> + + 0 -1 62 -4.2964564636349678e-03 + + -3.5870963335037231e-01 4.8831127583980560e-02 + <_> + + 0 -1 868 -3.8814521394670010e-03 + + -4.7464737296104431e-01 3.4466378390789032e-02 + <_> + + 0 -1 950 -1.8017216352745891e-03 + + -3.5517925024032593e-01 4.9101348966360092e-02 + <_> + + 0 -1 813 7.7566690742969513e-03 + + 2.7035165578126907e-02 -5.5951416492462158e-01 + <_> + + 0 -1 886 1.9125882536172867e-03 + + -6.3309118151664734e-02 2.5223699212074280e-01 + <_> + + 0 -1 886 -9.9804997444152832e-04 + + 2.4349449574947357e-01 -8.9007876813411713e-02 + <_> + + 0 -1 97 -7.5093598570674658e-04 + + 1.3702079653739929e-01 -1.2293258309364319e-01 + <_> + + 0 -1 7 1.0788314975798130e-02 + + -7.3592424392700195e-02 2.3694764077663422e-01 + <_> + + 0 -1 428 -1.2814668007194996e-03 + + 1.7014959454536438e-01 -9.3263216316699982e-02 + <_> + + 0 -1 851 3.5997035447508097e-03 + + 2.4880735203623772e-02 -5.7666695117950439e-01 + <_> + + 0 -1 410 5.9913634322583675e-03 + + -6.6571407020092010e-02 2.3750782012939453e-01 + <_> + + 0 -1 299 3.7381309084594250e-03 + + 3.7266705185174942e-02 -4.3619966506958008e-01 + <_> + + 0 -1 372 8.8815446943044662e-03 + + 3.0544634908437729e-02 -4.6924960613250732e-01 + <_> + + 0 -1 243 -3.1860180199146271e-02 + + -4.8059463500976562e-01 3.1165035441517830e-02 + <_> + + 0 -1 881 -5.4914336651563644e-03 + + 1.7584608495235443e-01 -9.0091012418270111e-02 + <_> + + 0 -1 821 -1.2325609102845192e-02 + + 3.4678825736045837e-01 -5.6969922035932541e-02 + <_> + + 0 -1 281 5.8694169856607914e-03 + + 3.9381653070449829e-02 -4.6237498521804810e-01 + <_> + + 0 -1 207 -5.0925426185131073e-03 + + -4.0191245079040527e-01 4.1170045733451843e-02 + <_> + + 0 -1 636 4.5132841914892197e-03 + + 2.7933681383728981e-02 -4.8419687151908875e-01 + <_> + + 0 -1 665 2.2130757570266724e-02 + + 2.1358741447329521e-02 -6.0434627532958984e-01 + <_> + + 0 -1 597 -1.8624030053615570e-03 + + 1.9556084275245667e-01 -7.8905813395977020e-02 + <_> + + 0 -1 599 3.2466566190123558e-03 + + -8.3141714334487915e-02 2.5859814882278442e-01 + <_> + + 0 -1 575 1.9641252234578133e-02 + + 2.1901637315750122e-02 -7.2247391939163208e-01 + <_> + + 0 -1 271 1.2722628191113472e-02 + + -4.9173772335052490e-02 3.1656193733215332e-01 + <_> + + 0 -1 210 -3.9457585080526769e-04 + + 1.7969387769699097e-01 -1.0087045282125473e-01 + <_> + + 0 -1 88 -3.0111533123999834e-04 + + 1.2916654348373413e-01 -1.5019074082374573e-01 + <_> + + 0 -1 84 -4.1901473887264729e-03 + + 1.6727919876575470e-01 -9.4101771712303162e-02 + <_> + + 0 -1 186 -2.9096096754074097e-02 + + 2.4397623538970947e-01 -6.5033406019210815e-02 + <_> + + 0 -1 815 -3.0687432736158371e-02 + + -5.3695982694625854e-01 3.6870311945676804e-02 + <_> + + 0 -1 596 8.9634142816066742e-02 + + -4.5044522732496262e-02 3.7668040394783020e-01 + <_> + + 0 -1 765 -1.8486939370632172e-02 + + -4.5869186520576477e-01 3.6696173250675201e-02 + <_> + + 0 -1 561 -2.0481455139815807e-03 + + 1.9705456495285034e-01 -8.1085532903671265e-02 + <_> + + 0 -1 160 7.9915560781955719e-03 + + 2.6794398203492165e-02 -6.0658437013626099e-01 + <_> + + 0 -1 368 -4.5167207717895508e-03 + + -3.5664665699005127e-01 4.1606105864048004e-02 + <_> + + 0 -1 429 -8.8896900415420532e-03 + + -5.6794744729995728e-01 2.4264462292194366e-02 + <_> + + 0 -1 601 -2.7863893657922745e-02 + + -6.6293621063232422e-01 1.7915287986397743e-02 + <_> + + 0 -1 153 1.9837494473904371e-03 + + -5.5686347186565399e-02 2.7396288514137268e-01 + <_> + + 0 -1 624 -2.9144049622118473e-03 + + -4.3623712658882141e-01 3.1940482556819916e-02 + <_> + + 0 -1 924 -1.1720246402546763e-03 + + 1.5299941599369049e-01 -8.8886320590972900e-02 + <_> + + 0 -1 927 2.1249109413474798e-03 + + -7.1360021829605103e-02 2.0698173344135284e-01 + <_> + + 0 -1 602 4.6013649553060532e-03 + + 2.5328675284981728e-02 -5.1310408115386963e-01 + <_> + + 0 -1 644 -9.4112986698746681e-04 + + -2.9404127597808838e-01 4.4868268072605133e-02 + <_> + + 0 -1 719 5.2681900560855865e-03 + + -6.4163528382778168e-02 2.2999708354473114e-01 + <_> + + 0 -1 652 1.4232876710593700e-03 + + -7.8037962317466736e-02 1.9061613082885742e-01 + <_> + + 0 -1 858 -1.0191567242145538e-02 + + -5.7409489154815674e-01 2.2581731900572777e-02 + <_> + + 0 -1 547 -4.9564028158783913e-03 + + 2.4646909534931183e-01 -5.9094201773405075e-02 + <_> + + 0 -1 545 2.2057720925658941e-03 + + -9.8776444792747498e-02 1.9191808998584747e-01 + <_> + + 0 -1 809 -4.7279503196477890e-03 + + -2.9638877511024475e-01 4.7132529318332672e-02 + <_> + + 0 -1 905 1.8900397699326277e-03 + + -1.2390431761741638e-01 1.2199163436889648e-01 + <_> + + 0 -1 692 -3.9616838330402970e-04 + + -2.0177872478961945e-01 6.7829817533493042e-02 + <_> + + 0 -1 378 1.5198520850390196e-03 + + -5.0418090075254440e-02 2.8014704585075378e-01 + <_> + + 0 -1 377 -3.0729006975889206e-03 + + 1.6384753584861755e-01 -9.6394442021846771e-02 + <_> + + 0 -1 637 3.3707641065120697e-02 + + 3.3062599599361420e-02 -4.3530252575874329e-01 + <_> + + 0 -1 993 -2.7547087520360947e-03 + + -6.2498420476913452e-01 2.0407166332006454e-02 + <_> + + 0 -1 993 1.0800797026604414e-03 + + 4.3235320597887039e-02 -3.1784874200820923e-01 + <_> + + 0 -1 981 -2.4060246068984270e-03 + + 1.3923163712024689e-01 -9.8239123821258545e-02 + <_> + + 0 -1 727 4.6191983856260777e-03 + + 2.3523205891251564e-02 -6.0865134000778198e-01 + <_> + + 0 -1 284 2.1874131634831429e-03 + + -4.4655255973339081e-02 3.2406413555145264e-01 + <_> + + 0 -1 137 7.9257078468799591e-03 + + 2.8643675148487091e-02 -5.0231784582138062e-01 + <_> + + 0 -1 340 9.6561573445796967e-03 + + -6.7481219768524170e-02 2.0780794322490692e-01 + <_> + + 0 -1 180 -4.3771188706159592e-02 + + 2.0091144740581512e-01 -8.7350860238075256e-02 + <_> + + 0 -1 28 -3.9570517838001251e-02 + + -6.9823634624481201e-01 2.2996466606855392e-02 + <_> + + 0 -1 517 -7.4827047064900398e-03 + + -3.2485857605934143e-01 4.2747449129819870e-02 + <_> + + 0 -1 863 -9.5894857076928020e-04 + + 1.3692225515842438e-01 -1.0624063760042191e-01 + <_> + + 0 -1 495 -5.6482471525669098e-02 + + 2.7130955457687378e-01 -5.5133864283561707e-02 + <_> + + 0 -1 526 -5.5641448125243187e-03 + + -6.5910613536834717e-01 2.6108600199222565e-02 + <_> + + 0 -1 833 4.5432001352310181e-03 + + -1.0277131199836731e-01 1.4715240895748138e-01 + <_> + + 0 -1 804 -1.9441416952759027e-03 + + 1.7929133772850037e-01 -7.8247167170047760e-02 + <_> + + 0 -1 615 1.5584268840029836e-03 + + 5.2101351320743561e-02 -2.7727204561233521e-01 + <_> + + <_> + 0 0 6 1 -1. + <_> + 3 0 3 1 2. + 0 <_> <_> @@ -5651,6 +6128,13 @@ <_> 4 0 4 1 2. 0 + <_> + + <_> + 0 0 8 2 -1. + <_> + 4 0 4 2 2. + 0 <_> <_> @@ -5660,6 +6144,22 @@ <_> 4 3 4 3 2. 0 + <_> + + <_> + 0 0 8 12 -1. + <_> + 0 0 4 6 2. + <_> + 4 6 4 6 2. + 0 + <_> + + <_> + 0 0 10 1 -1. + <_> + 5 0 5 1 2. + 0 <_> <_> @@ -5672,18 +6172,34 @@ <_> <_> - 0 0 24 5 -1. + 0 0 24 1 -1. <_> - 6 0 12 5 2. + 6 0 12 1 2. 0 <_> <_> - 0 0 16 6 -1. + 0 0 24 2 -1. <_> - 0 0 8 3 2. + 6 0 12 2 2. + 0 + <_> + <_> - 8 3 8 3 2. + 0 0 14 8 -1. + <_> + 0 0 7 4 2. + <_> + 7 4 7 4 2. + 0 + <_> + + <_> + 0 0 16 8 -1. + <_> + 0 0 8 4 2. + <_> + 8 4 8 4 2. 0 <_> @@ -5704,98 +6220,59 @@ <_> <_> - 0 0 24 12 -1. + 0 0 13 10 -1. <_> - 0 0 12 6 2. - <_> - 12 6 12 6 2. + 0 5 13 5 2. 0 <_> <_> - 0 1 8 10 -1. + 0 1 16 10 -1. <_> - 0 1 4 5 2. + 0 1 8 5 2. <_> - 4 6 4 5 2. + 8 6 8 5 2. 0 <_> <_> - 0 1 10 2 -1. + 0 1 13 15 -1. <_> - 5 1 5 2 2. + 0 6 13 5 3. 0 <_> <_> - 0 1 10 6 -1. + 0 2 8 12 -1. <_> - 0 1 5 3 2. + 0 2 4 6 2. <_> - 5 4 5 3 2. + 4 8 4 6 2. 0 <_> <_> - 0 1 10 10 -1. + 0 2 10 4 -1. <_> - 0 1 5 5 2. + 0 2 5 2 2. <_> - 5 6 5 5 2. + 5 4 5 2 2. 0 <_> <_> - 0 1 24 2 -1. + 0 4 24 2 -1. <_> - 0 1 12 1 2. + 0 4 12 1 2. <_> - 12 2 12 1 2. + 12 5 12 1 2. 0 <_> <_> - 0 2 18 9 -1. + 0 5 4 9 -1. <_> - 0 5 18 3 3. - 0 - <_> - - <_> - 0 3 6 9 -1. - <_> - 0 6 6 3 3. - 0 - <_> - - <_> - 0 3 24 2 -1. - <_> - 0 3 12 1 2. - <_> - 12 4 12 1 2. - 0 - <_> - - <_> - 0 4 16 15 -1. - <_> - 0 9 16 5 3. - 0 - <_> - - <_> - 0 4 22 6 -1. - <_> - 0 6 22 2 3. - 0 - <_> - - <_> - 0 4 24 6 -1. - <_> - 0 6 24 2 3. + 0 8 4 3 3. 0 <_> @@ -5806,6 +6283,29 @@ <_> 12 6 12 1 2. 0 + <_> + + <_> + 0 5 24 4 -1. + <_> + 0 5 12 2 2. + <_> + 12 7 12 2 2. + 0 + <_> + + <_> + 0 6 5 8 -1. + <_> + 0 8 5 4 2. + 0 + <_> + + <_> + 0 6 22 17 -1. + <_> + 11 6 11 17 2. + 0 <_> <_> @@ -5818,50 +6318,51 @@ <_> <_> - 0 6 24 3 -1. + 0 6 14 8 -1. <_> - 0 7 24 1 3. + 0 10 14 4 2. 0 <_> <_> - 0 7 8 2 -1. + 0 7 2 3 -1. <_> - 0 7 4 1 2. - <_> - 4 8 4 1 2. + 0 8 2 1 3. 0 <_> <_> - 0 7 24 1 -1. + 0 7 6 16 -1. <_> - 8 7 8 1 3. + 3 7 3 16 2. 0 <_> <_> - 0 7 24 4 -1. + 0 7 4 9 -1. <_> - 0 7 12 2 2. - <_> - 12 9 12 2 2. + 0 10 4 3 3. 0 <_> <_> - 0 7 22 4 -1. + 0 7 8 17 -1. <_> - 0 8 22 2 2. + 4 7 4 17 2. 0 <_> <_> - 0 8 24 4 -1. + 0 7 24 2 -1. <_> - 0 8 12 2 2. + 6 7 12 2 2. + 0 + <_> + <_> - 12 10 12 2 2. + 0 8 4 16 -1. + <_> + 2 8 2 16 2. 0 <_> @@ -5875,25 +6376,9 @@ <_> <_> - 0 8 24 8 -1. + 0 9 1 3 -1. <_> - 0 8 12 4 2. - <_> - 12 12 12 4 2. - 0 - <_> - - <_> - 0 9 4 3 -1. - <_> - 0 10 4 1 3. - 0 - <_> - - <_> - 0 9 4 8 -1. - <_> - 0 11 4 4 2. + 0 10 1 1 3. 0 <_> @@ -5905,11 +6390,9 @@ <_> <_> - 0 9 20 2 -1. + 0 9 8 2 -1. <_> - 0 9 10 1 2. - <_> - 10 10 10 1 2. + 0 10 8 1 2. 0 <_> @@ -5923,20 +6406,11 @@ <_> <_> - 0 9 22 4 -1. + 0 9 24 2 -1. <_> - 0 9 11 2 2. + 0 9 12 1 2. <_> - 11 11 11 2 2. - 0 - <_> - - <_> - 0 9 22 10 -1. - <_> - 0 9 11 5 2. - <_> - 11 14 11 5 2. + 12 10 12 1 2. 0 <_> @@ -5950,9 +6424,39 @@ <_> <_> - 0 10 3 3 -1. + 0 10 2 2 -1. <_> - 0 11 3 1 3. + 0 11 2 1 2. + 0 + <_> + + <_> + 0 10 4 10 -1. + <_> + 2 10 2 10 2. + 0 + <_> + + <_> + 0 10 4 3 -1. + <_> + 0 11 4 1 3. + 0 + <_> + + <_> + 0 10 5 3 -1. + <_> + 0 11 5 1 3. + 0 + <_> + + <_> + 0 10 22 2 -1. + <_> + 0 10 11 1 2. + <_> + 11 11 11 1 2. 0 <_> @@ -5963,6 +6467,29 @@ <_> 12 11 12 1 2. 0 + <_> + + <_> + 0 10 24 4 -1. + <_> + 0 10 12 2 2. + <_> + 12 12 12 2 2. + 0 + <_> + + <_> + 0 10 24 14 -1. + <_> + 12 10 12 14 2. + 0 + <_> + + <_> + 0 11 3 3 -1. + <_> + 0 12 3 1 3. + 0 <_> <_> @@ -5975,111 +6502,99 @@ <_> <_> - 0 11 24 2 -1. + 0 11 24 4 -1. <_> - 0 11 12 1 2. + 0 11 12 2 2. <_> - 12 12 12 1 2. + 12 13 12 2 2. 0 <_> <_> - 0 11 24 7 -1. + 0 12 18 7 -1. <_> - 12 11 12 7 2. + 9 12 9 7 2. 0 <_> <_> - 0 12 6 10 -1. + 0 12 22 2 -1. <_> - 3 12 3 10 2. + 0 12 11 1 2. + <_> + 11 13 11 1 2. 0 <_> <_> - 0 13 22 10 -1. + 0 12 24 6 -1. <_> - 11 13 11 10 2. + 12 12 12 6 2. 0 <_> <_> - 0 14 8 6 -1. + 0 13 24 3 -1. <_> - 4 14 4 6 2. + 6 13 12 3 2. 0 <_> <_> - 0 15 18 7 -1. + 0 14 8 7 -1. <_> - 9 15 9 7 2. + 4 14 4 7 2. 0 <_> <_> - 0 16 10 3 -1. + 0 14 12 10 -1. <_> - 5 16 5 3 2. + 0 14 6 5 2. + <_> + 6 19 6 5 2. 0 <_> <_> - 0 17 3 3 -1. + 0 14 18 8 -1. <_> - 1 17 1 3 3. + 6 14 6 8 3. 0 <_> <_> - 0 17 3 4 -1. + 0 14 20 10 -1. <_> - 1 17 1 4 3. + 10 14 10 10 2. 0 <_> <_> - 0 18 6 4 -1. + 0 15 3 8 -1. <_> - 3 18 3 4 2. + 1 15 1 8 3. 0 <_> <_> - 0 18 10 4 -1. + 0 16 3 7 -1. <_> - 5 18 5 4 2. + 1 16 1 7 3. 0 <_> <_> - 0 18 9 3 -1. + 0 19 6 3 -1. <_> - 0 19 9 1 3. + 0 20 6 1 3. 0 <_> <_> - 0 18 18 6 -1. + 0 19 9 3 -1. <_> - 0 18 9 3 2. - <_> - 9 21 9 3 2. - 0 - <_> - - <_> - 0 19 3 5 -1. - <_> - 1 19 1 5 3. - 0 - <_> - - <_> - 0 20 24 2 -1. - <_> - 6 20 12 2 2. + 0 20 9 1 3. 0 <_> @@ -6091,9 +6606,16 @@ <_> <_> - 1 0 6 1 -1. + 0 21 7 3 -1. <_> - 4 0 3 1 2. + 0 22 7 1 3. + 0 + <_> + + <_> + 1 0 1 4 -1. + <_> + 1 2 1 2 2. 0 <_> @@ -6105,87 +6627,48 @@ <_> <_> - 1 0 8 1 -1. + 1 0 8 6 -1. <_> - 5 0 4 1 2. + 1 0 4 3 2. + <_> + 5 3 4 3 2. 0 <_> <_> - 1 0 20 1 -1. + 1 0 8 4 -1. <_> - 6 0 10 1 2. + 5 0 4 4 2. 0 <_> <_> - 1 0 14 4 -1. + 1 0 22 2 -1. <_> - 1 0 7 2 2. + 1 0 11 1 2. <_> - 8 2 7 2 2. + 12 1 11 1 2. 0 <_> <_> - 1 0 14 8 -1. + 1 3 21 15 -1. <_> - 1 0 7 4 2. - <_> - 8 4 7 4 2. + 8 8 7 5 9. 0 <_> <_> - 1 0 14 10 -1. + 1 3 11 3 -1. <_> - 1 0 7 5 2. - <_> - 8 5 7 5 2. + 1 4 11 1 3. 0 <_> <_> - 1 3 22 21 -1. + 1 5 3 3 -1. <_> - 12 3 11 21 2. - 0 - <_> - - <_> - 1 3 14 12 -1. - <_> - 1 6 14 6 2. - 0 - <_> - - <_> - 1 4 5 3 -1. - <_> - 1 5 5 1 3. - 0 - <_> - - <_> - 1 4 9 3 -1. - <_> - 1 5 9 1 3. - 0 - <_> - - <_> - 1 4 22 2 -1. - <_> - 1 4 11 1 2. - <_> - 12 5 11 1 2. - 0 - <_> - - <_> - 1 4 22 18 -1. - <_> - 12 4 11 18 2. + 1 6 3 1 3. 0 <_> @@ -6210,6 +6693,13 @@ <_> 1 7 4 1 3. 0 + <_> + + <_> + 1 6 5 3 -1. + <_> + 1 7 5 1 3. + 0 <_> <_> @@ -6222,18 +6712,16 @@ <_> <_> - 1 6 13 8 -1. + 1 6 22 17 -1. <_> - 1 10 13 4 2. + 12 6 11 17 2. 0 <_> <_> - 1 7 6 2 -1. + 1 6 20 3 -1. <_> - 1 7 3 1 2. - <_> - 4 8 3 1 2. + 1 7 20 1 3. 0 <_> @@ -6245,32 +6733,50 @@ <_> <_> - 1 7 4 9 -1. + 1 7 8 6 -1. <_> - 1 10 4 3 3. + 1 9 8 2 3. 0 <_> <_> - 1 7 21 2 -1. + 1 7 20 4 -1. <_> - 1 8 21 1 2. + 1 7 10 2 2. + <_> + 11 9 10 2 2. 0 <_> <_> - 1 8 20 4 -1. + 1 7 22 12 -1. <_> - 1 8 10 2 2. - <_> - 11 10 10 2 2. + 1 11 22 4 3. 0 <_> <_> - 1 8 23 3 -1. + 1 8 8 2 -1. <_> - 1 9 23 1 3. + 1 8 4 1 2. + <_> + 5 9 4 1 2. + 0 + <_> + + <_> + 1 8 9 3 -1. + <_> + 1 9 9 1 3. + 0 + <_> + + <_> + 1 8 22 4 -1. + <_> + 1 8 11 2 2. + <_> + 12 10 11 2 2. 0 <_> @@ -6284,27 +6790,16 @@ <_> <_> - 1 9 20 6 -1. + 1 10 4 3 -1. <_> - 1 9 10 3 2. - <_> - 11 12 10 3 2. + 3 10 2 3 2. 0 <_> <_> - 1 9 22 2 -1. + 1 10 4 4 -1. <_> - 1 9 11 1 2. - <_> - 12 10 11 1 2. - 0 - <_> - - <_> - 1 10 4 1 -1. - <_> - 3 10 2 1 2. + 1 11 4 2 2. 0 <_> @@ -6318,59 +6813,23 @@ <_> <_> - 1 12 8 1 -1. + 1 10 21 4 -1. <_> - 3 12 4 1 2. + 1 11 21 2 2. 0 <_> <_> - 1 12 8 12 -1. + 1 11 3 13 -1. <_> - 1 12 4 6 2. - <_> - 5 18 4 6 2. + 2 11 1 13 3. 0 <_> <_> - 1 12 20 2 -1. + 1 13 3 10 -1. <_> - 1 12 10 1 2. - <_> - 11 13 10 1 2. - 0 - <_> - - <_> - 1 13 3 11 -1. - <_> - 2 13 1 11 3. - 0 - <_> - - <_> - 1 13 22 4 -1. - <_> - 1 13 11 2 2. - <_> - 12 15 11 2 2. - 0 - <_> - - <_> - 1 13 19 4 -1. - <_> - 1 15 19 2 2. - 0 - <_> - - <_> - 1 14 10 10 -1. - <_> - 1 14 5 5 2. - <_> - 6 19 5 5 2. + 2 13 1 10 3. 0 <_> @@ -6381,13 +6840,6 @@ <_> 12 15 11 1 2. 0 - <_> - - <_> - 1 15 3 8 -1. - <_> - 2 15 1 8 3. - 0 <_> <_> @@ -6398,23 +6850,30 @@ <_> <_> - 1 16 3 3 -1. + 1 17 4 1 -1. <_> - 2 16 1 3 3. - 0 - <_> - - <_> - 1 17 3 1 -1. - <_> - 2 18 1 1 3. + 2 18 2 1 2. 1 <_> <_> - 1 17 3 7 -1. + 1 19 4 1 -1. <_> - 2 17 1 7 3. + 2 20 2 1 2. + 1 + <_> + + <_> + 2 0 4 1 -1. + <_> + 4 0 2 1 2. + 0 + <_> + + <_> + 2 0 12 14 -1. + <_> + 6 0 4 14 3. 0 <_> @@ -6423,15 +6882,6 @@ <_> 7 0 10 1 2. 0 - <_> - - <_> - 2 0 14 12 -1. - <_> - 2 0 7 6 2. - <_> - 9 6 7 6 2. - 0 <_> <_> @@ -6442,9 +6892,27 @@ <_> <_> - 2 3 10 3 -1. + 2 2 22 2 -1. <_> - 2 4 10 1 3. + 2 2 11 1 2. + <_> + 13 3 11 1 2. + 0 + <_> + + <_> + 2 2 22 10 -1. + <_> + 2 2 11 5 2. + <_> + 13 7 11 5 2. + 0 + <_> + + <_> + 2 3 20 1 -1. + <_> + 7 3 10 1 2. 0 <_> @@ -6474,25 +6942,9 @@ <_> <_> - 2 4 22 18 -1. + 2 5 2 3 -1. <_> - 13 4 11 18 2. - 0 - <_> - - <_> - 2 5 1 3 -1. - <_> - 2 6 1 1 3. - 0 - <_> - - <_> - 2 5 2 2 -1. - <_> - 2 5 1 1 2. - <_> - 3 6 1 1 2. + 2 6 2 1 3. 0 <_> @@ -6503,13 +6955,6 @@ <_> 12 6 10 1 2. 0 - <_> - - <_> - 2 6 3 3 -1. - <_> - 2 7 3 1 3. - 0 <_> <_> @@ -6522,27 +6967,25 @@ <_> <_> - 2 6 22 2 -1. + 2 6 21 18 -1. <_> - 2 6 11 1 2. - <_> - 13 7 11 1 2. + 2 15 21 9 2. 0 <_> <_> - 2 6 22 6 -1. + 2 7 6 2 -1. <_> - 2 6 11 3 2. + 2 7 3 1 2. <_> - 13 9 11 3 2. + 5 8 3 1 2. 0 <_> <_> - 2 6 19 3 -1. + 2 7 9 6 -1. <_> - 2 7 19 1 3. + 5 9 3 2 9. 0 <_> @@ -6554,9 +6997,16 @@ <_> <_> - 2 7 7 4 -1. + 2 7 18 2 -1. <_> - 2 8 7 2 2. + 2 8 18 1 2. + 0 + <_> + + <_> + 2 7 18 3 -1. + <_> + 2 8 18 1 3. 0 <_> @@ -6568,79 +7018,33 @@ <_> <_> - 2 7 21 6 -1. + 2 8 4 2 -1. <_> - 2 9 21 2 3. + 4 8 2 2 2. 0 <_> <_> - 2 8 5 2 -1. + 2 8 22 2 -1. <_> - 2 8 5 1 2. + 2 8 11 1 2. + <_> + 13 9 11 1 2. + 0 + <_> + + <_> + 2 9 7 2 -1. + <_> + 2 9 7 1 2. 1 <_> <_> - 2 8 20 3 -1. + 2 9 20 3 -1. <_> - 2 9 20 1 3. + 2 10 20 1 3. 0 - <_> - - <_> - 2 9 20 8 -1. - <_> - 2 9 10 4 2. - <_> - 12 13 10 4 2. - 0 - <_> - - <_> - 2 9 22 2 -1. - <_> - 2 9 11 1 2. - <_> - 13 10 11 1 2. - 0 - <_> - - <_> - 2 9 19 3 -1. - <_> - 2 10 19 1 3. - 0 - <_> - - <_> - 2 10 3 1 -1. - <_> - 3 11 1 1 3. - 1 - <_> - - <_> - 2 10 4 1 -1. - <_> - 4 10 2 1 2. - 0 - <_> - - <_> - 2 10 22 2 -1. - <_> - 2 10 11 1 2. - <_> - 13 11 11 1 2. - 0 - <_> - - <_> - 2 11 3 1 -1. - <_> - 3 12 1 1 3. - 1 <_> <_> @@ -6653,122 +7057,115 @@ <_> <_> - 2 11 11 2 -1. + 2 12 22 7 -1. <_> - 2 11 11 1 2. + 13 12 11 7 2. + 0 + <_> + + <_> + 2 12 19 10 -1. + <_> + 2 17 19 5 2. + 0 + <_> + + <_> + 2 13 3 8 -1. + <_> + 3 13 1 8 3. + 0 + <_> + + <_> + 2 13 20 10 -1. + <_> + 12 13 10 10 2. + 0 + <_> + + <_> + 2 15 6 2 -1. + <_> + 5 15 3 2 2. + 0 + <_> + + <_> + 2 15 6 3 -1. + <_> + 5 15 3 3 2. + 0 + <_> + + <_> + 2 15 20 4 -1. + <_> + 2 15 10 2 2. + <_> + 12 17 10 2 2. + 0 + <_> + + <_> + 2 16 6 6 -1. + <_> + 2 16 3 3 2. + <_> + 5 19 3 3 2. + 0 + <_> + + <_> + 2 17 3 1 -1. + <_> + 3 18 1 1 3. 1 <_> <_> - 2 11 18 3 -1. + 2 18 3 5 -1. <_> - 2 12 18 1 3. + 3 18 1 5 3. 0 <_> <_> - 2 13 20 4 -1. + 2 21 12 3 -1. <_> - 2 13 10 2 2. - <_> - 12 15 10 2 2. + 8 21 6 3 2. 0 <_> <_> - 2 15 3 7 -1. + 3 2 20 1 -1. <_> - 3 15 1 7 3. - 0 - <_> - - <_> - 2 16 4 1 -1. - <_> - 3 17 2 1 2. + 3 2 10 1 2. 1 <_> <_> - 2 17 3 5 -1. + 3 3 8 6 -1. <_> - 3 17 1 5 3. + 5 3 4 6 2. 0 <_> <_> - 3 0 9 16 -1. + 3 4 6 4 -1. <_> - 6 0 3 16 3. + 3 4 3 2 2. + <_> + 6 6 3 2 2. 0 <_> <_> - 3 0 18 3 -1. + 3 4 18 2 -1. <_> - 3 0 9 3 2. - 1 - <_> - + 3 4 9 1 2. <_> - 3 2 18 2 -1. - <_> - 3 2 9 1 2. - <_> - 12 3 9 1 2. - 0 - <_> - - <_> - 3 3 12 1 -1. - <_> - 6 3 6 1 2. - 0 - <_> - - <_> - 3 3 20 3 -1. - <_> - 8 3 10 3 2. - 0 - <_> - - <_> - 3 3 18 2 -1. - <_> - 3 3 9 1 2. - <_> - 12 4 9 1 2. - 0 - <_> - - <_> - 3 4 1 3 -1. - <_> - 3 5 1 1 3. - 0 - <_> - - <_> - 3 4 5 16 -1. - <_> - 3 8 5 8 2. - 0 - <_> - - <_> - 3 4 18 8 -1. - <_> - 3 4 9 4 2. - <_> - 12 8 9 4 2. - 0 - <_> - - <_> - 3 4 20 19 -1. - <_> - 13 4 10 19 2. + 12 5 9 1 2. 0 <_> @@ -6782,90 +7179,71 @@ <_> <_> - 3 5 16 9 -1. + 3 5 20 6 -1. <_> - 3 8 16 3 3. + 3 5 10 3 2. + <_> + 13 8 10 3 2. 0 <_> <_> - 3 5 20 9 -1. + 3 6 3 3 -1. <_> - 3 8 20 3 3. + 3 7 3 1 3. 0 <_> <_> - 3 6 2 3 -1. + 3 6 16 8 -1. <_> - 3 7 2 1 3. + 3 8 16 4 2. 0 <_> <_> - 3 6 18 2 -1. + 3 6 19 6 -1. <_> - 3 6 9 1 2. - <_> - 12 7 9 1 2. + 3 8 19 2 3. 0 <_> <_> - 3 7 3 1 -1. + 3 7 5 4 -1. <_> - 4 7 1 1 3. + 3 8 5 2 2. 0 <_> <_> - 3 7 3 2 -1. + 3 7 18 6 -1. <_> - 3 8 3 1 2. + 3 7 9 3 2. + <_> + 12 10 9 3 2. 0 <_> <_> - 3 7 9 6 -1. + 3 7 17 6 -1. <_> - 6 9 3 2 9. + 3 9 17 2 3. 0 <_> <_> - 3 7 20 2 -1. + 3 7 19 2 -1. <_> - 8 7 10 2 2. + 3 8 19 1 2. 0 <_> <_> - 3 7 6 2 -1. + 3 8 18 4 -1. <_> - 3 8 6 1 2. - 0 - <_> - + 3 8 9 2 2. <_> - 3 7 7 3 -1. - <_> - 3 8 7 1 3. - 0 - <_> - - <_> - 3 7 18 4 -1. - <_> - 3 7 9 2 2. - <_> - 12 9 9 2 2. - 0 - <_> - - <_> - 3 7 19 12 -1. - <_> - 3 11 19 4 3. + 12 10 9 2 2. 0 <_> @@ -6886,18 +7264,16 @@ <_> <_> - 3 9 6 3 -1. + 3 9 3 3 -1. <_> - 3 10 6 1 3. - 0 + 4 10 1 3 3. + 1 <_> <_> - 3 9 16 2 -1. + 3 9 8 9 -1. <_> - 3 9 8 1 2. - <_> - 11 10 8 1 2. + 3 12 8 3 3. 0 <_> @@ -6911,11 +7287,16 @@ <_> <_> - 3 9 20 12 -1. + 3 9 19 9 -1. <_> - 3 9 10 6 2. + 3 12 19 3 3. + 0 + <_> + <_> - 13 15 10 6 2. + 3 10 3 1 -1. + <_> + 4 10 1 1 3. 0 <_> @@ -6934,16 +7315,25 @@ <_> <_> - 3 10 15 3 -1. + 3 10 2 4 -1. <_> - 3 11 15 1 3. + 3 11 2 2 2. 0 <_> <_> - 3 10 20 8 -1. + 3 10 8 3 -1. <_> - 3 12 20 4 2. + 3 11 8 1 3. + 0 + <_> + + <_> + 3 10 18 4 -1. + <_> + 3 10 9 2 2. + <_> + 12 12 9 2 2. 0 <_> @@ -6952,152 +7342,142 @@ <_> 4 12 1 1 3. 1 - <_> - - <_> - 3 11 3 3 -1. - <_> - 4 11 1 3 3. - 0 - <_> - - <_> - 3 11 3 4 -1. - <_> - 4 11 1 4 3. - 0 - <_> - - <_> - 3 11 3 7 -1. - <_> - 4 11 1 7 3. - 0 - <_> - - <_> - 3 11 6 2 -1. - <_> - 3 11 3 1 2. - <_> - 6 12 3 1 2. - 0 <_> <_> 3 11 3 8 -1. <_> - 3 15 3 4 2. + 4 11 1 8 3. 0 <_> <_> - 3 11 7 8 -1. + 3 11 4 8 -1. <_> - 3 15 7 4 2. + 3 15 4 4 2. 0 <_> <_> - 3 11 20 2 -1. + 3 11 18 2 -1. <_> - 3 11 10 1 2. + 3 11 9 1 2. <_> - 13 12 10 1 2. + 12 12 9 1 2. 0 <_> <_> - 3 11 20 8 -1. + 3 11 10 2 -1. <_> - 13 11 10 8 2. - 0 - <_> - - <_> - 3 12 4 8 -1. - <_> - 5 12 2 8 2. - 0 - <_> - - <_> - 3 12 3 8 -1. - <_> - 3 16 3 4 2. - 0 - <_> - - <_> - 3 12 18 8 -1. - <_> - 3 16 18 4 2. - 0 - <_> - - <_> - 3 13 3 3 -1. - <_> - 4 13 1 3 3. - 0 - <_> - - <_> - 3 13 19 6 -1. - <_> - 3 16 19 3 2. - 0 - <_> - - <_> - 3 14 6 10 -1. - <_> - 3 14 3 5 2. - <_> - 6 19 3 5 2. - 0 - <_> - - <_> - 3 15 6 2 -1. - <_> - 6 15 3 2 2. - 0 - <_> - - <_> - 3 16 4 1 -1. - <_> - 4 17 2 1 2. + 3 11 10 1 2. 1 <_> <_> - 3 20 3 3 -1. + 3 12 3 2 -1. <_> - 4 20 1 3 3. - 0 - <_> - - <_> - 4 0 16 20 -1. - <_> - 4 10 16 10 2. - 0 - <_> - - <_> - 4 2 8 13 -1. - <_> - 6 2 4 13 2. - 0 - <_> - - <_> - 4 2 16 1 -1. - <_> - 4 2 8 1 2. + 4 13 1 2 3. 1 + <_> + + <_> + 3 12 8 12 -1. + <_> + 3 16 8 4 3. + 0 + <_> + + <_> + 3 15 4 3 -1. + <_> + 5 15 2 3 2. + 0 + <_> + + <_> + 3 16 3 1 -1. + <_> + 4 17 1 1 3. + 1 + <_> + + <_> + 3 16 6 4 -1. + <_> + 3 16 3 2 2. + <_> + 6 18 3 2 2. + 0 + <_> + + <_> + 3 16 8 6 -1. + <_> + 3 16 4 3 2. + <_> + 7 19 4 3 2. + 0 + <_> + + <_> + 3 20 3 4 -1. + <_> + 4 20 1 4 3. + 0 + <_> + + <_> + 4 0 6 4 -1. + <_> + 6 2 2 4 3. + 1 + <_> + + <_> + 4 2 3 2 -1. + <_> + 5 2 1 2 3. + 0 + <_> + + <_> + 4 2 16 2 -1. + <_> + 4 2 8 1 2. + <_> + 12 3 8 1 2. + 0 + <_> + + <_> + 4 3 6 1 -1. + <_> + 6 3 2 1 3. + 0 + <_> + + <_> + 4 3 9 3 -1. + <_> + 7 3 3 3 3. + 0 + <_> + + <_> + 4 3 16 2 -1. + <_> + 4 3 8 1 2. + <_> + 12 4 8 1 2. + 0 + <_> + + <_> + 4 3 9 6 -1. + <_> + 4 6 9 3 2. + 0 <_> <_> @@ -7108,10 +7488,17 @@ <_> <_> - 4 4 2 4 -1. + 4 4 1 4 -1. <_> - 4 6 2 2 2. + 4 6 1 2 2. 0 + <_> + + <_> + 4 4 9 4 -1. + <_> + 7 7 3 4 3. + 1 <_> <_> @@ -7124,46 +7511,39 @@ <_> <_> - 4 4 18 2 -1. + 4 4 18 6 -1. <_> - 4 4 9 1 2. - <_> - 13 5 9 1 2. + 4 6 18 2 3. 0 <_> <_> - 4 4 10 6 -1. + 4 4 20 6 -1. <_> - 4 7 10 3 2. + 4 6 20 2 3. 0 <_> <_> - 4 4 17 6 -1. + 4 5 4 5 -1. <_> - 4 7 17 3 2. + 6 5 2 5 2. 0 <_> <_> - 4 5 1 3 -1. + 4 5 16 6 -1. <_> - 4 6 1 1 3. + 4 5 8 3 2. + <_> + 12 8 8 3 2. 0 <_> <_> - 4 5 3 3 -1. + 4 5 15 6 -1. <_> - 5 6 1 3 3. - 1 - <_> - - <_> - 4 5 17 6 -1. - <_> - 4 8 17 3 2. + 4 7 15 2 3. 0 <_> @@ -7179,6 +7559,13 @@ <_> 4 7 2 1 3. 0 + <_> + + <_> + 4 6 6 2 -1. + <_> + 6 6 2 2 3. + 0 <_> <_> @@ -7189,85 +7576,25 @@ <_> <_> - 4 6 4 9 -1. + 4 6 6 2 -1. <_> - 4 9 4 3 3. + 4 6 3 1 2. + <_> + 7 7 3 1 2. 0 <_> <_> - 4 6 16 2 -1. + 4 7 4 3 -1. <_> - 4 6 8 1 2. - <_> - 12 7 8 1 2. + 4 8 4 1 3. 0 <_> <_> - 4 6 16 6 -1. + 4 7 15 6 -1. <_> - 4 6 8 3 2. - <_> - 12 9 8 3 2. - 0 - <_> - - <_> - 4 6 20 18 -1. - <_> - 14 6 10 18 2. - 0 - <_> - - <_> - 4 6 15 6 -1. - <_> - 4 8 15 2 3. - 0 - <_> - - <_> - 4 6 16 4 -1. - <_> - 4 7 16 2 2. - 0 - <_> - - <_> - 4 6 16 4 -1. - <_> - 4 8 16 2 2. - 0 - <_> - - <_> - 4 7 6 6 -1. - <_> - 6 9 2 2 9. - 0 - <_> - - <_> - 4 7 5 4 -1. - <_> - 3 8 5 2 2. - 1 - <_> - - <_> - 4 7 5 6 -1. - <_> - 4 9 5 2 3. - 0 - <_> - - <_> - 4 7 16 6 -1. - <_> - 4 7 8 3 2. - <_> - 12 10 8 3 2. + 4 9 15 2 3. 0 <_> @@ -7279,25 +7606,9 @@ <_> <_> - 4 7 17 6 -1. + 4 7 17 3 -1. <_> - 4 9 17 2 3. - 0 - <_> - - <_> - 4 7 18 2 -1. - <_> - 4 8 18 1 2. - 0 - <_> - - <_> - 4 8 2 2 -1. - <_> - 4 8 1 1 2. - <_> - 5 9 1 1 2. + 4 8 17 1 3. 0 <_> @@ -7316,48 +7627,25 @@ <_> <_> - 4 8 4 4 -1. + 4 8 5 4 -1. <_> - 3 9 4 2 2. - 1 - <_> - - <_> - 4 8 14 2 -1. - <_> - 4 8 7 1 2. - <_> - 11 9 7 1 2. + 4 9 5 2 2. 0 <_> <_> - 4 8 7 4 -1. + 4 8 18 4 -1. <_> - 3 9 7 2 2. - 1 - <_> - + 4 8 9 2 2. <_> - 4 8 16 2 -1. - <_> - 4 8 8 1 2. - <_> - 12 9 8 1 2. + 13 10 9 2 2. 0 <_> <_> - 4 8 9 4 -1. + 4 9 2 1 -1. <_> - 4 8 9 2 2. - 1 - <_> - - <_> - 4 8 19 12 -1. - <_> - 4 12 19 4 3. + 5 9 1 1 2. 0 <_> @@ -7378,23 +7666,34 @@ <_> <_> - 4 9 2 2 -1. + 4 9 2 4 -1. <_> - 5 9 1 2 2. + 4 9 1 2 2. + <_> + 5 11 1 2 2. 0 <_> <_> 4 9 3 2 -1. <_> - 5 10 1 2 3. + 4 9 3 1 2. 1 <_> <_> - 4 9 4 6 -1. + 4 9 6 6 -1. <_> - 4 11 4 2 3. + 4 9 3 3 2. + <_> + 7 12 3 3 2. + 0 + <_> + + <_> + 4 9 16 1 -1. + <_> + 8 9 8 1 2. 0 <_> @@ -7405,6 +7704,22 @@ <_> 12 10 8 1 2. 0 + <_> + + <_> + 4 9 18 2 -1. + <_> + 4 9 9 1 2. + <_> + 13 10 9 1 2. + 0 + <_> + + <_> + 4 9 11 4 -1. + <_> + 4 9 11 2 2. + 1 <_> <_> @@ -7431,10 +7746,10 @@ <_> <_> - 4 10 4 4 -1. + 4 10 3 14 -1. <_> - 3 11 4 2 2. - 1 + 5 10 1 14 3. + 0 <_> <_> @@ -7449,6 +7764,20 @@ <_> 4 10 10 2 2. 1 + <_> + + <_> + 4 10 16 6 -1. + <_> + 4 12 16 2 3. + 0 + <_> + + <_> + 4 11 3 1 -1. + <_> + 5 12 1 1 3. + 1 <_> <_> @@ -7459,17 +7788,10 @@ <_> <_> - 4 11 3 6 -1. + 4 11 3 4 -1. <_> - 5 11 1 6 3. + 5 11 1 4 3. 0 - <_> - - <_> - 4 11 3 2 -1. - <_> - 4 11 3 1 2. - 1 <_> <_> @@ -7477,79 +7799,68 @@ <_> 4 16 3 5 2. 0 - <_> - - <_> - 4 11 7 2 -1. - <_> - 4 11 7 1 2. - 1 - <_> - - <_> - 4 11 9 4 -1. - <_> - 4 11 9 2 2. - 1 <_> <_> 4 12 3 1 -1. <_> - 5 12 1 1 3. + 5 13 1 1 3. + 1 + <_> + + <_> + 4 12 3 2 -1. + <_> + 5 12 1 2 3. 0 <_> <_> - 4 12 3 3 -1. + 4 12 1 6 -1. <_> - 5 12 1 3 3. + 4 15 1 3 2. 0 <_> <_> - 4 12 2 6 -1. + 4 12 2 8 -1. <_> - 4 15 2 3 2. + 4 16 2 4 2. 0 <_> <_> - 4 12 16 2 -1. + 4 13 3 1 -1. <_> - 4 12 8 1 2. - <_> - 12 13 8 1 2. + 5 13 1 1 3. 0 <_> <_> - 4 13 4 4 -1. + 4 13 4 3 -1. <_> - 6 13 2 4 2. + 6 13 2 3 2. 0 <_> <_> - 4 13 10 10 -1. + 4 13 9 5 -1. <_> - 4 13 5 5 2. - <_> - 9 18 5 5 2. + 7 13 3 5 3. 0 <_> <_> - 4 14 4 2 -1. + 4 14 4 1 -1. <_> - 6 14 2 2 2. + 6 14 2 1 2. 0 <_> <_> - 4 14 5 4 -1. + 4 15 3 2 -1. <_> - 3 15 5 2 2. + 5 16 1 2 3. 1 <_> @@ -7561,30 +7872,93 @@ <_> <_> - 4 19 3 4 -1. + 4 15 9 4 -1. <_> - 5 19 1 4 3. + 7 15 3 4 3. 0 <_> <_> - 5 0 14 1 -1. + 4 15 4 4 -1. <_> - 12 0 7 1 2. + 4 16 4 2 2. 0 <_> <_> - 5 1 10 8 -1. + 4 17 3 1 -1. <_> - 5 5 10 4 2. + 5 18 1 1 3. + 1 + <_> + + <_> + 4 18 3 6 -1. + <_> + 5 18 1 6 3. 0 <_> <_> - 5 1 12 10 -1. + 4 20 3 4 -1. <_> - 5 6 12 5 2. + 5 20 1 4 3. + 0 + <_> + + <_> + 5 0 6 18 -1. + <_> + 7 0 2 18 3. + 0 + <_> + + <_> + 5 2 4 12 -1. + <_> + 7 2 2 12 2. + 0 + <_> + + <_> + 5 2 14 2 -1. + <_> + 5 2 7 2 2. + 1 + <_> + + <_> + 5 2 15 6 -1. + <_> + 5 5 15 3 2. + 0 + <_> + + <_> + 5 3 1 3 -1. + <_> + 4 4 1 1 3. + 1 + <_> + + <_> + 5 3 2 3 -1. + <_> + 4 4 2 1 3. + 1 + <_> + + <_> + 5 3 4 9 -1. + <_> + 7 3 2 9 2. + 0 + <_> + + <_> + 5 3 9 3 -1. + <_> + 8 4 3 1 9. 0 <_> @@ -7598,41 +7972,18 @@ <_> <_> - 5 3 7 4 -1. + 5 4 2 3 -1. <_> - 4 4 7 2 2. + 4 5 2 1 3. 1 <_> <_> - 5 4 2 2 -1. + 5 4 16 2 -1. <_> - 5 4 2 1 2. - 1 - <_> - + 5 4 8 1 2. <_> - 5 4 14 6 -1. - <_> - 5 4 7 3 2. - <_> - 12 7 7 3 2. - 0 - <_> - - <_> - 5 4 9 4 -1. - <_> - 4 5 9 2 2. - 1 - <_> - - <_> - 5 4 18 8 -1. - <_> - 5 4 9 4 2. - <_> - 14 8 9 4 2. + 13 5 8 1 2. 0 <_> @@ -7641,6 +7992,13 @@ <_> 4 6 1 1 3. 1 + <_> + + <_> + 5 5 4 9 -1. + <_> + 5 8 4 3 3. + 0 <_> <_> @@ -7653,39 +8011,53 @@ <_> <_> - 5 5 14 4 -1. + 5 5 15 6 -1. <_> - 5 5 7 2 2. - <_> - 12 7 7 2 2. + 5 7 15 2 3. 0 <_> <_> - 5 5 14 6 -1. + 5 6 1 2 -1. <_> - 5 7 14 2 3. + 5 7 1 1 2. 0 <_> <_> - 5 5 14 9 -1. + 5 6 4 4 -1. <_> - 5 8 14 3 3. + 5 7 4 2 2. 0 <_> <_> - 5 6 15 8 -1. + 5 6 14 2 -1. <_> - 5 8 15 4 2. + 5 6 7 1 2. + <_> + 12 7 7 1 2. 0 <_> <_> - 5 6 16 6 -1. + 5 6 14 4 -1. <_> - 5 8 16 2 3. + 5 7 14 2 2. + 0 + <_> + + <_> + 5 6 14 6 -1. + <_> + 5 8 14 2 3. + 0 + <_> + + <_> + 5 6 15 4 -1. + <_> + 5 7 15 2 2. 0 <_> @@ -7697,16 +8069,23 @@ <_> <_> - 5 7 3 6 -1. + 5 7 4 15 -1. <_> - 6 9 1 2 9. + 6 7 2 15 2. 0 <_> <_> - 5 7 6 7 -1. + 5 7 4 1 -1. <_> - 7 7 2 7 3. + 7 7 2 1 2. + 0 + <_> + + <_> + 5 7 3 2 -1. + <_> + 5 8 3 1 2. 0 <_> @@ -7715,6 +8094,13 @@ <_> 5 8 3 1 3. 0 + <_> + + <_> + 5 7 3 4 -1. + <_> + 5 8 3 2 2. + 0 <_> <_> @@ -7722,6 +8108,13 @@ <_> 5 9 3 2 3. 0 + <_> + + <_> + 5 7 4 4 -1. + <_> + 5 9 4 2 2. + 0 <_> <_> @@ -7732,16 +8125,25 @@ <_> <_> - 5 7 5 4 -1. + 5 7 16 4 -1. <_> - 4 8 5 2 2. - 1 + 5 7 8 2 2. + <_> + 13 9 8 2 2. + 0 <_> <_> - 5 7 15 6 -1. + 5 7 14 2 -1. <_> - 5 9 15 2 3. + 5 8 14 1 2. + 0 + <_> + + <_> + 5 7 16 6 -1. + <_> + 5 9 16 2 3. 0 <_> @@ -7766,6 +8168,13 @@ <_> 4 9 3 1 3. 1 + <_> + + <_> + 5 8 3 4 -1. + <_> + 4 9 3 2 2. + 1 <_> <_> @@ -7792,16 +8201,18 @@ <_> <_> - 5 8 13 2 -1. + 5 8 16 2 -1. <_> - 5 9 13 1 2. + 5 8 8 1 2. + <_> + 13 9 8 1 2. 0 <_> <_> - 5 8 15 4 -1. + 5 8 13 16 -1. <_> - 5 9 15 2 2. + 5 12 13 8 2. 0 <_> @@ -7813,10 +8224,17 @@ <_> <_> - 5 9 15 2 -1. + 5 9 4 3 -1. <_> - 10 9 5 2 3. + 5 10 4 1 3. 0 + <_> + + <_> + 5 9 4 4 -1. + <_> + 5 9 4 2 2. + 1 <_> <_> @@ -7826,15 +8244,6 @@ <_> 12 10 7 1 2. 0 - <_> - - <_> - 5 9 14 6 -1. - <_> - 5 9 7 3 2. - <_> - 12 12 7 3 2. - 0 <_> <_> @@ -7844,6 +8253,13 @@ <_> 13 10 8 1 2. 0 + <_> + + <_> + 5 9 15 3 -1. + <_> + 5 10 15 1 3. + 0 <_> <_> @@ -7856,9 +8272,23 @@ <_> <_> - 5 10 2 4 -1. + 5 10 3 1 -1. <_> - 6 10 1 4 2. + 6 11 1 1 3. + 1 + <_> + + <_> + 5 10 3 14 -1. + <_> + 6 10 1 14 3. + 0 + <_> + + <_> + 5 10 4 3 -1. + <_> + 7 10 2 3 2. 0 <_> @@ -7870,23 +8300,23 @@ <_> <_> - 5 10 17 4 -1. + 5 10 14 3 -1. <_> - 5 11 17 2 2. + 5 11 14 1 3. 0 <_> <_> - 5 11 3 3 -1. + 5 10 16 8 -1. <_> - 6 11 1 3 3. + 5 12 16 4 2. 0 <_> <_> - 5 11 2 2 -1. + 5 11 3 2 -1. <_> - 5 12 2 1 2. + 6 11 1 2 3. 0 <_> @@ -7898,79 +8328,62 @@ <_> <_> - 5 14 3 3 -1. + 5 12 3 2 -1. <_> - 6 15 1 1 9. + 6 12 1 2 3. 0 <_> <_> - 5 15 4 2 -1. + 5 12 14 2 -1. <_> - 6 16 2 2 2. - 1 - <_> - + 5 12 7 1 2. <_> - 5 15 8 5 -1. - <_> - 7 15 4 5 2. + 12 13 7 1 2. 0 <_> <_> - 5 15 5 3 -1. + 5 13 14 2 -1. <_> - 4 16 5 1 3. - 1 - <_> - + 5 13 7 1 2. <_> - 5 16 4 3 -1. - <_> - 5 17 4 1 3. + 12 14 7 1 2. 0 <_> <_> - 5 16 6 2 -1. + 5 13 14 10 -1. <_> - 5 16 6 1 2. - 1 - <_> - - <_> - 5 17 3 1 -1. - <_> - 6 18 1 1 3. - 1 - <_> - - <_> - 5 20 3 1 -1. - <_> - 6 21 1 1 3. - 1 - <_> - - <_> - 5 20 3 3 -1. - <_> - 6 20 1 3 3. + 5 18 14 5 2. 0 <_> <_> - 5 20 8 3 -1. + 5 15 4 1 -1. <_> - 9 20 4 3 2. + 6 16 2 1 2. + 1 + <_> + + <_> + 5 15 3 2 -1. + <_> + 6 16 1 2 3. + 1 + <_> + + <_> + 5 19 3 4 -1. + <_> + 6 19 1 4 3. 0 <_> <_> - 6 0 10 4 -1. + 5 20 3 4 -1. <_> - 6 1 10 2 2. + 6 20 1 4 3. 0 <_> @@ -7991,10 +8404,31 @@ <_> <_> - 6 2 7 8 -1. + 6 2 1 3 -1. <_> - 6 6 7 4 2. - 0 + 5 3 1 1 3. + 1 + <_> + + <_> + 6 2 4 6 -1. + <_> + 6 2 4 3 2. + 1 + <_> + + <_> + 6 2 12 6 -1. + <_> + 6 2 6 6 2. + 1 + <_> + + <_> + 6 3 1 2 -1. + <_> + 6 3 1 1 2. + 1 <_> <_> @@ -8002,13 +8436,6 @@ <_> 5 4 1 1 3. 1 - <_> - - <_> - 6 3 4 1 -1. - <_> - 7 4 2 1 2. - 1 <_> <_> @@ -8019,10 +8446,38 @@ <_> <_> - 6 4 3 4 -1. + 6 3 18 21 -1. <_> - 6 4 3 2 2. + 15 3 9 21 2. + 0 + <_> + + <_> + 6 4 1 3 -1. + <_> + 5 5 1 1 3. 1 + <_> + + <_> + 6 4 4 3 -1. + <_> + 6 5 4 1 3. + 0 + <_> + + <_> + 6 4 5 4 -1. + <_> + 5 5 5 2 2. + 1 + <_> + + <_> + 6 4 6 3 -1. + <_> + 6 5 6 1 3. + 0 <_> <_> @@ -8040,9 +8495,9 @@ <_> <_> - 6 5 2 9 -1. + 6 5 3 3 -1. <_> - 6 8 2 3 3. + 7 5 1 3 3. 0 <_> @@ -8056,25 +8511,32 @@ <_> <_> - 6 6 3 3 -1. + 6 6 10 2 -1. <_> - 5 7 3 1 3. - 1 - <_> - + 6 6 5 1 2. <_> - 6 6 12 2 -1. - <_> - 6 6 6 1 2. - <_> - 12 7 6 1 2. + 11 7 5 1 2. 0 <_> <_> - 6 6 15 4 -1. + 6 6 5 3 -1. <_> - 6 7 15 2 2. + 5 7 5 1 3. + 1 + <_> + + <_> + 6 7 1 3 -1. + <_> + 6 8 1 1 3. + 0 + <_> + + <_> + 6 7 1 6 -1. + <_> + 6 9 1 2 3. 0 <_> @@ -8090,6 +8552,13 @@ <_> 6 8 2 1 3. 0 + <_> + + <_> + 6 7 3 6 -1. + <_> + 6 9 3 2 3. + 0 <_> <_> @@ -8102,17 +8571,10 @@ <_> <_> - 6 7 9 12 -1. + 6 8 3 1 -1. <_> - 6 13 9 6 2. - 0 - <_> - - <_> - 6 7 13 15 -1. - <_> - 6 12 13 5 3. - 0 + 7 9 1 1 3. + 1 <_> <_> @@ -8120,6 +8582,34 @@ <_> 6 9 2 1 3. 0 + <_> + + <_> + 6 8 2 3 -1. + <_> + 5 9 2 1 3. + 1 + <_> + + <_> + 6 8 3 4 -1. + <_> + 6 9 3 2 2. + 0 + <_> + + <_> + 6 8 3 3 -1. + <_> + 5 9 3 1 3. + 1 + <_> + + <_> + 6 8 12 3 -1. + <_> + 9 8 6 3 2. + 0 <_> <_> @@ -8132,9 +8622,9 @@ <_> <_> - 6 8 12 12 -1. + 6 8 13 6 -1. <_> - 6 11 12 6 2. + 6 10 13 2 3. 0 <_> @@ -8143,27 +8633,6 @@ <_> 6 9 1 2 2. 1 - <_> - - <_> - 6 9 3 6 -1. - <_> - 7 10 1 6 3. - 1 - <_> - - <_> - 6 9 2 3 -1. - <_> - 6 10 2 1 3. - 0 - <_> - - <_> - 6 9 2 4 -1. - <_> - 6 10 2 2 2. - 0 <_> <_> @@ -8204,9 +8673,9 @@ <_> <_> - 6 10 1 2 -1. + 6 9 12 3 -1. <_> - 6 11 1 1 2. + 6 10 12 1 3. 0 <_> @@ -8218,23 +8687,16 @@ <_> <_> - 6 10 3 1 -1. + 6 10 2 3 -1. <_> - 7 11 1 1 3. - 1 - <_> - - <_> - 6 10 2 2 -1. - <_> - 7 10 1 2 2. + 7 10 1 3 2. 0 <_> <_> - 6 10 2 3 -1. + 6 10 2 4 -1. <_> - 7 10 1 3 2. + 7 10 1 4 2. 0 <_> @@ -8243,6 +8705,20 @@ <_> 6 11 2 1 3. 0 + <_> + + <_> + 6 10 2 4 -1. + <_> + 6 11 2 2 2. + 0 + <_> + + <_> + 6 10 3 3 -1. + <_> + 6 11 3 1 3. + 0 <_> <_> @@ -8250,20 +8726,6 @@ <_> 9 10 6 1 2. 0 - <_> - - <_> - 6 10 9 4 -1. - <_> - 9 10 3 4 3. - 0 - <_> - - <_> - 6 10 4 6 -1. - <_> - 4 12 4 2 3. - 1 <_> <_> @@ -8273,6 +8735,27 @@ <_> 12 11 6 1 2. 0 + <_> + + <_> + 6 10 13 3 -1. + <_> + 6 11 13 1 3. + 0 + <_> + + <_> + 6 11 2 3 -1. + <_> + 6 12 2 1 3. + 0 + <_> + + <_> + 6 11 3 2 -1. + <_> + 6 12 3 1 2. + 0 <_> <_> @@ -8283,23 +8766,30 @@ <_> <_> - 6 11 12 6 -1. + 6 11 13 3 -1. <_> - 9 11 6 6 2. + 6 12 13 1 3. 0 <_> <_> - 6 11 13 2 -1. + 6 13 7 4 -1. <_> - 6 12 13 1 2. + 6 13 7 2 2. + 1 + <_> + + <_> + 6 14 1 3 -1. + <_> + 6 15 1 1 3. 0 <_> <_> - 6 14 6 4 -1. + 6 15 3 4 -1. <_> - 5 15 6 2 2. + 7 16 1 4 3. 1 <_> @@ -8311,52 +8801,31 @@ <_> <_> - 6 15 5 4 -1. + 6 18 3 1 -1. <_> - 5 16 5 2 2. + 7 19 1 1 3. 1 <_> <_> - 6 16 3 3 -1. + 6 19 3 5 -1. <_> - 7 17 1 1 9. + 7 19 1 5 3. 0 <_> <_> - 6 16 11 8 -1. + 7 0 3 4 -1. <_> - 6 18 11 4 2. - 0 - <_> - - <_> - 6 17 4 2 -1. - <_> - 7 18 2 2 2. + 7 0 3 2 2. 1 <_> <_> - 6 19 3 3 -1. + 7 0 4 2 -1. <_> - 7 19 1 3 3. - 0 - <_> - - <_> - 6 20 3 1 -1. - <_> - 7 21 1 1 3. + 7 0 4 1 2. 1 - <_> - - <_> - 6 20 7 4 -1. - <_> - 6 22 7 2 2. - 0 <_> <_> @@ -8367,23 +8836,18 @@ <_> <_> - 7 0 9 10 -1. + 7 1 2 6 -1. <_> - 7 5 9 5 2. + 7 1 1 3 2. + <_> + 8 4 1 3 2. 0 <_> <_> - 7 1 9 12 -1. + 7 1 10 1 -1. <_> - 10 5 3 4 9. - 0 - <_> - - <_> - 7 2 1 3 -1. - <_> - 7 3 1 1 3. + 12 1 5 1 2. 0 <_> @@ -8395,9 +8859,30 @@ <_> <_> - 7 2 11 10 -1. + 7 2 1 4 -1. <_> - 7 7 11 5 2. + 6 3 1 2 2. + 1 + <_> + + <_> + 7 2 3 4 -1. + <_> + 6 3 3 2 2. + 1 + <_> + + <_> + 7 2 6 3 -1. + <_> + 7 3 6 1 3. + 0 + <_> + + <_> + 7 2 13 10 -1. + <_> + 7 7 13 5 2. 0 <_> @@ -8409,10 +8894,24 @@ <_> <_> - 7 3 1 6 -1. + 7 3 2 4 -1. <_> - 5 5 1 2 3. + 6 4 2 2 2. 1 + <_> + + <_> + 7 3 4 2 -1. + <_> + 7 3 4 1 2. + 1 + <_> + + <_> + 7 4 3 3 -1. + <_> + 8 4 1 3 3. + 0 <_> <_> @@ -8429,13 +8928,6 @@ <_> 8 5 1 2 3. 0 - <_> - - <_> - 7 5 2 3 -1. - <_> - 8 5 1 3 2. - 0 <_> <_> @@ -8446,30 +8938,30 @@ <_> <_> - 7 5 3 6 -1. + 7 5 3 5 -1. <_> - 8 5 1 6 3. + 8 5 1 5 3. 0 <_> <_> - 7 5 9 17 -1. + 7 6 3 1 -1. <_> - 10 5 3 17 3. + 8 6 1 1 3. 0 <_> <_> - 7 5 4 4 -1. + 7 6 1 4 -1. <_> - 6 6 4 2 2. + 7 6 1 2 2. 1 <_> <_> - 7 5 5 3 -1. + 7 6 6 10 -1. <_> - 7 6 5 1 3. + 9 6 2 10 3. 0 <_> @@ -8480,6 +8972,13 @@ <_> 12 7 5 1 2. 0 + <_> + + <_> + 7 6 5 3 -1. + <_> + 6 7 5 1 3. + 1 <_> <_> @@ -8490,37 +8989,25 @@ <_> <_> - 7 7 4 4 -1. + 7 7 1 3 -1. <_> - 8 8 2 4 2. - 1 - <_> - - <_> - 7 7 2 4 -1. - <_> - 7 9 2 2 2. + 7 8 1 1 3. 0 <_> <_> - 7 7 5 6 -1. + 7 7 2 2 -1. <_> - 5 9 5 2 3. - 1 + 7 7 1 1 2. + <_> + 8 8 1 1 2. + 0 <_> <_> - 7 7 6 4 -1. + 7 8 1 3 -1. <_> - 6 8 6 2 2. - 1 - <_> - - <_> - 7 7 6 12 -1. - <_> - 7 13 6 6 2. + 7 9 1 1 3. 0 <_> @@ -8534,16 +9021,16 @@ <_> <_> - 7 8 4 4 -1. + 7 8 2 2 -1. <_> - 8 8 2 4 2. - 0 + 7 8 1 2 2. + 1 <_> <_> - 7 8 2 4 -1. + 7 8 12 7 -1. <_> - 7 9 2 2 2. + 11 8 4 7 3. 0 <_> @@ -8564,9 +9051,16 @@ <_> <_> - 7 9 6 3 -1. + 7 9 2 3 -1. <_> - 9 9 2 3 3. + 7 9 1 3 2. + 1 + <_> + + <_> + 7 9 2 3 -1. + <_> + 7 10 2 1 3. 0 <_> @@ -8577,13 +9071,6 @@ <_> 10 14 3 5 2. 0 - <_> - - <_> - 7 9 12 2 -1. - <_> - 11 9 4 2 3. - 0 <_> <_> @@ -8593,15 +9080,6 @@ <_> 12 10 5 1 2. 0 - <_> - - <_> - 7 9 10 4 -1. - <_> - 7 9 5 2 2. - <_> - 12 11 5 2 2. - 0 <_> <_> @@ -8616,13 +9094,6 @@ <_> 7 11 1 1 3. 0 - <_> - - <_> - 7 10 4 3 -1. - <_> - 8 10 2 3 2. - 0 <_> <_> @@ -8633,32 +9104,16 @@ <_> <_> - 7 10 4 4 -1. + 7 10 6 5 -1. <_> - 9 10 2 4 2. + 9 10 2 5 3. 0 <_> <_> - 7 10 6 4 -1. + 7 10 9 4 -1. <_> - 9 10 2 4 3. - 0 - <_> - - <_> - 7 10 6 8 -1. - <_> - 7 10 3 4 2. - <_> - 10 14 3 4 2. - 0 - <_> - - <_> - 7 10 12 5 -1. - <_> - 11 10 4 5 3. + 10 10 3 4 3. 0 <_> @@ -8672,24 +9127,38 @@ <_> <_> - 7 11 3 12 -1. + 7 11 1 2 -1. <_> - 8 11 1 12 3. + 7 12 1 1 2. 0 <_> <_> - 7 13 9 3 -1. + 7 15 5 4 -1. <_> - 10 13 3 3 3. - 0 + 6 16 5 2 2. + 1 <_> <_> - 7 14 1 3 -1. + 7 16 6 2 -1. <_> - 7 15 1 1 3. - 0 + 9 18 2 2 3. + 1 + <_> + + <_> + 7 16 4 2 -1. + <_> + 7 16 4 1 2. + 1 + <_> + + <_> + 7 16 4 4 -1. + <_> + 6 17 4 2 2. + 1 <_> <_> @@ -8700,9 +9169,23 @@ <_> <_> - 7 17 4 2 -1. + 7 17 1 4 -1. <_> - 8 18 2 2 2. + 7 19 1 2 2. + 0 + <_> + + <_> + 7 17 3 6 -1. + <_> + 7 20 3 3 2. + 0 + <_> + + <_> + 7 17 4 3 -1. + <_> + 6 18 4 1 3. 1 <_> @@ -8714,9 +9197,23 @@ <_> <_> - 7 18 3 6 -1. + 7 18 3 1 -1. <_> - 8 18 1 6 3. + 8 19 1 1 3. + 1 + <_> + + <_> + 7 19 3 1 -1. + <_> + 8 20 1 1 3. + 1 + <_> + + <_> + 7 19 3 5 -1. + <_> + 8 19 1 5 3. 0 <_> @@ -8728,23 +9225,53 @@ <_> <_> - 7 20 7 4 -1. + 7 20 9 4 -1. <_> - 7 22 7 2 2. + 7 22 9 2 2. 0 <_> <_> - 8 0 5 4 -1. + 7 20 10 4 -1. <_> - 8 2 5 2 2. + 7 21 10 2 2. 0 <_> <_> - 8 0 7 10 -1. + 7 20 10 4 -1. <_> - 8 5 7 5 2. + 7 22 10 2 2. + 0 + <_> + + <_> + 8 0 8 1 -1. + <_> + 12 0 4 1 2. + 0 + <_> + + <_> + 8 0 7 4 -1. + <_> + 8 2 7 2 2. + 0 + <_> + + <_> + 8 0 16 6 -1. + <_> + 8 0 8 3 2. + <_> + 16 3 8 3 2. + 0 + <_> + + <_> + 8 0 8 10 -1. + <_> + 8 5 8 5 2. 0 <_> @@ -8758,11 +9285,9 @@ <_> <_> - 8 0 16 12 -1. + 8 0 9 4 -1. <_> - 8 0 8 6 2. - <_> - 16 6 8 6 2. + 8 1 9 2 2. 0 <_> @@ -8774,53 +9299,44 @@ <_> <_> - 8 1 3 6 -1. + 8 1 8 8 -1. <_> - 8 1 3 3 2. - 1 - <_> - - <_> - 8 1 8 2 -1. - <_> - 12 1 4 2 2. + 8 5 8 4 2. 0 <_> <_> - 8 1 16 6 -1. + 8 1 12 10 -1. <_> - 6 3 16 2 3. - 1 - <_> - - <_> - 8 2 8 2 -1. - <_> - 8 2 4 1 2. - <_> - 12 3 4 1 2. + 8 6 12 5 2. 0 <_> <_> - 8 3 2 6 -1. + 8 2 3 3 -1. <_> - 6 5 2 2 3. - 1 - <_> - - <_> - 8 4 3 9 -1. - <_> - 9 4 1 9 3. + 9 2 1 3 3. 0 <_> <_> - 8 4 4 3 -1. + 8 2 2 4 -1. <_> - 8 5 4 1 3. + 7 3 2 2 2. + 1 + <_> + + <_> + 8 2 2 6 -1. + <_> + 6 4 2 2 3. + 1 + <_> + + <_> + 8 3 3 8 -1. + <_> + 9 3 1 8 3. 0 <_> @@ -8831,6 +9347,13 @@ <_> 12 5 4 1 2. 0 + <_> + + <_> + 8 4 7 15 -1. + <_> + 8 9 7 5 3. + 0 <_> <_> @@ -8841,30 +9364,16 @@ <_> <_> - 8 5 2 2 -1. + 8 5 3 2 -1. <_> - 9 5 1 2 2. + 9 5 1 2 3. 0 <_> <_> - 8 5 4 3 -1. + 8 5 2 5 -1. <_> - 9 5 2 3 2. - 0 - <_> - - <_> - 8 5 3 4 -1. - <_> - 9 5 1 4 3. - 0 - <_> - - <_> - 8 5 3 5 -1. - <_> - 9 5 1 5 3. + 9 5 1 5 2. 0 <_> @@ -8892,8 +9401,22 @@ <_> 8 5 3 7 -1. <_> - 9 5 1 7 3. + 9 6 1 7 3. + 1 + <_> + + <_> + 8 5 3 8 -1. + <_> + 9 5 1 8 3. 0 + <_> + + <_> + 8 5 3 6 -1. + <_> + 8 5 3 3 2. + 1 <_> <_> @@ -8901,6 +9424,15 @@ <_> 6 7 4 2 3. 1 + <_> + + <_> + 8 5 10 2 -1. + <_> + 8 5 5 1 2. + <_> + 13 6 5 1 2. + 0 <_> <_> @@ -8911,18 +9443,23 @@ <_> <_> - 8 6 4 2 -1. + 8 6 3 6 -1. <_> - 8 6 2 1 2. - <_> - 10 7 2 1 2. + 9 6 1 6 3. 0 + <_> + + <_> + 8 6 3 4 -1. + <_> + 7 7 3 2 2. + 1 <_> <_> 8 6 4 2 -1. <_> - 8 6 2 2 2. + 8 6 4 1 2. 1 <_> @@ -8938,20 +9475,15 @@ <_> 7 7 4 2 2. 1 - <_> - - <_> - 8 6 5 4 -1. - <_> - 7 7 5 2 2. - 1 <_> <_> 8 6 10 2 -1. <_> - 8 6 10 1 2. - 1 + 8 6 5 1 2. + <_> + 13 7 5 1 2. + 0 <_> <_> @@ -8966,6 +9498,20 @@ <_> 7 8 3 2 2. 1 + <_> + + <_> + 8 7 9 5 -1. + <_> + 11 10 3 5 3. + 1 + <_> + + <_> + 8 7 9 8 -1. + <_> + 11 10 3 8 3. + 1 <_> <_> @@ -8990,46 +9536,25 @@ <_> <_> - 8 7 8 4 -1. + 8 7 8 2 -1. <_> - 7 8 8 2 2. + 8 7 8 1 2. 1 + <_> + + <_> + 8 7 10 12 -1. + <_> + 8 13 10 6 2. + 0 <_> <_> 8 8 2 2 -1. <_> - 8 8 1 2 2. - 1 - <_> - + 8 8 1 1 2. <_> - 8 8 2 3 -1. - <_> - 7 9 2 1 3. - 1 - <_> - - <_> - 8 8 8 5 -1. - <_> - 10 10 4 5 2. - 1 - <_> - - <_> - 8 9 3 3 -1. - <_> - 9 9 1 3 3. - 0 - <_> - - <_> - 8 9 10 2 -1. - <_> - 8 9 5 1 2. - <_> - 13 10 5 1 2. + 9 9 1 1 2. 0 <_> @@ -9045,6 +9570,15 @@ <_> 9 10 1 1 3. 0 + <_> + + <_> + 8 10 2 2 -1. + <_> + 8 10 1 1 2. + <_> + 9 11 1 1 2. + 0 <_> <_> @@ -9052,6 +9586,13 @@ <_> 9 10 1 2 2. 0 + <_> + + <_> + 8 10 3 2 -1. + <_> + 9 10 1 2 3. + 0 <_> <_> @@ -9073,26 +9614,47 @@ <_> <_> - 8 11 6 5 -1. + 8 10 15 12 -1. <_> - 10 11 2 5 3. + 13 14 5 4 9. 0 <_> <_> - 8 11 4 10 -1. + 8 11 2 2 -1. <_> - 8 11 2 5 2. + 8 11 1 1 2. <_> - 10 16 2 5 2. + 9 12 1 1 2. 0 <_> <_> - 8 13 7 4 -1. + 8 13 9 3 -1. <_> - 8 13 7 2 2. - 1 + 11 13 3 3 3. + 0 + <_> + + <_> + 8 15 9 6 -1. + <_> + 11 15 3 6 3. + 0 + <_> + + <_> + 8 15 8 6 -1. + <_> + 8 17 8 2 3. + 0 + <_> + + <_> + 8 16 8 2 -1. + <_> + 10 16 4 2 2. + 0 <_> <_> @@ -9103,44 +9665,16 @@ <_> <_> - 8 16 9 3 -1. + 8 17 3 3 -1. <_> - 11 16 3 3 3. - 0 + 9 18 1 3 3. + 1 <_> <_> - 8 17 3 7 -1. + 8 17 8 3 -1. <_> - 9 17 1 7 3. - 0 - <_> - - <_> - 8 17 8 2 -1. - <_> - 10 17 4 2 2. - 0 - <_> - - <_> - 8 17 9 1 -1. - <_> - 11 17 3 1 3. - 0 - <_> - - <_> - 8 17 9 7 -1. - <_> - 11 17 3 7 3. - 0 - <_> - - <_> - 8 17 8 6 -1. - <_> - 8 20 8 3 2. + 10 17 4 3 2. 0 <_> @@ -9149,13 +9683,6 @@ <_> 8 19 9 2 3. 0 - <_> - - <_> - 8 18 3 2 -1. - <_> - 9 19 1 2 3. - 1 <_> <_> @@ -9163,13 +9690,6 @@ <_> 9 18 1 6 3. 0 - <_> - - <_> - 8 18 8 6 -1. - <_> - 8 20 8 2 3. - 0 <_> <_> @@ -9180,30 +9700,67 @@ <_> <_> - 8 19 8 3 -1. + 8 19 3 4 -1. <_> - 8 20 8 1 3. + 9 19 1 4 3. 0 <_> <_> - 8 20 8 4 -1. + 8 19 7 3 -1. <_> - 8 21 8 2 2. + 8 20 7 1 3. 0 <_> <_> - 9 0 2 2 -1. + 8 19 9 4 -1. <_> - 9 1 2 1 2. + 8 20 9 2 2. 0 <_> <_> - 9 0 6 1 -1. + 8 20 3 3 -1. <_> - 12 0 3 1 2. + 9 20 1 3 3. + 0 + <_> + + <_> + 8 20 16 4 -1. + <_> + 8 20 8 2 2. + <_> + 16 22 8 2 2. + 0 + <_> + + <_> + 8 21 3 3 -1. + <_> + 9 21 1 3 3. + 0 + <_> + + <_> + 9 0 1 2 -1. + <_> + 9 1 1 1 2. + 0 + <_> + + <_> + 9 0 3 6 -1. + <_> + 7 2 3 2 3. + 1 + <_> + + <_> + 9 0 6 3 -1. + <_> + 12 0 3 3 2. 0 <_> @@ -9215,55 +9772,53 @@ <_> <_> - 9 0 6 2 -1. + 9 0 8 9 -1. <_> - 9 1 6 1 2. + 9 0 4 9 2. + 1 + <_> + + <_> + 9 0 5 4 -1. + <_> + 9 2 5 2 2. 0 <_> <_> - 9 0 6 8 -1. + 9 0 5 8 -1. <_> - 9 4 6 4 2. + 9 4 5 4 2. 0 <_> <_> - 9 0 7 4 -1. + 9 0 14 12 -1. <_> - 9 2 7 2 2. + 9 0 7 6 2. + <_> + 16 6 7 6 2. 0 <_> <_> - 9 0 11 4 -1. + 9 0 8 10 -1. <_> - 9 1 11 2 2. + 9 5 8 5 2. 0 <_> <_> - 9 1 2 3 -1. + 9 0 15 18 -1. <_> - 10 1 1 3 2. + 9 6 15 6 3. 0 <_> <_> - 9 1 2 6 -1. + 9 1 2 8 -1. <_> - 9 1 1 3 2. - <_> - 10 4 1 3 2. - 0 - <_> - - <_> - 9 1 6 2 -1. - <_> - 9 1 3 1 2. - <_> - 12 2 3 1 2. + 9 5 2 4 2. 0 <_> @@ -9275,40 +9830,89 @@ <_> <_> - 9 2 2 4 -1. + 9 2 2 2 -1. <_> - 10 2 1 4 2. + 10 2 1 2 2. 0 <_> <_> - 9 2 6 8 -1. + 9 2 1 6 -1. <_> - 11 2 2 8 3. + 9 5 1 3 2. 0 <_> <_> - 9 3 1 6 -1. + 9 2 3 10 -1. <_> - 7 5 1 2 3. + 10 2 1 10 3. + 0 + <_> + + <_> + 9 2 8 4 -1. + <_> + 11 4 4 4 2. 1 <_> <_> - 9 4 2 9 -1. + 9 2 6 2 -1. <_> - 10 4 1 9 2. + 9 2 3 1 2. + <_> + 12 3 3 1 2. 0 <_> <_> - 9 4 8 2 -1. + 9 2 7 8 -1. <_> - 9 4 4 1 2. - <_> - 13 5 4 1 2. + 9 6 7 4 2. 0 + <_> + + <_> + 9 3 3 7 -1. + <_> + 10 4 1 7 3. + 1 + <_> + + <_> + 9 3 3 12 -1. + <_> + 10 3 1 12 3. + 0 + <_> + + <_> + 9 3 6 7 -1. + <_> + 11 3 2 7 3. + 0 + <_> + + <_> + 9 3 12 3 -1. + <_> + 13 4 4 1 9. + 0 + <_> + + <_> + 9 3 11 4 -1. + <_> + 8 4 11 2 2. + 1 + <_> + + <_> + 9 4 3 8 -1. + <_> + 10 5 1 8 3. + 1 <_> <_> @@ -9326,10 +9930,24 @@ <_> <_> - 9 5 3 9 -1. + 9 5 3 6 -1. <_> - 10 6 1 9 3. - 1 + 10 5 1 6 3. + 0 + <_> + + <_> + 9 5 6 4 -1. + <_> + 11 5 2 4 3. + 0 + <_> + + <_> + 9 5 3 3 -1. + <_> + 9 6 3 1 3. + 0 <_> <_> @@ -9337,6 +9955,13 @@ <_> 8 6 4 1 3. 1 + <_> + + <_> + 9 6 3 2 -1. + <_> + 10 7 1 2 3. + 1 <_> <_> @@ -9347,23 +9972,23 @@ <_> <_> - 9 6 3 3 -1. + 9 6 4 3 -1. <_> - 9 7 3 1 3. + 9 7 4 1 3. 0 <_> <_> - 9 7 1 2 -1. + 9 6 4 3 -1. <_> - 9 7 1 1 2. + 8 7 4 1 3. 1 <_> <_> - 9 7 2 2 -1. + 9 7 2 3 -1. <_> - 9 7 1 2 2. + 9 7 1 3 2. 1 <_> @@ -9375,16 +10000,18 @@ <_> <_> - 9 7 2 4 -1. + 9 7 6 2 -1. <_> - 8 8 2 2 2. - 1 + 9 7 3 1 2. + <_> + 12 8 3 1 2. + 0 <_> <_> - 9 7 3 3 -1. + 9 8 2 3 -1. <_> - 8 8 3 1 3. + 8 9 2 1 3. 1 <_> @@ -9403,74 +10030,90 @@ <_> <_> - 9 9 2 7 -1. + 9 8 9 9 -1. <_> - 10 9 1 7 2. + 12 8 3 9 3. 0 <_> <_> - 9 9 2 3 -1. + 9 9 2 12 -1. <_> - 9 10 2 1 3. + 9 9 1 6 2. + <_> + 10 15 1 6 2. 0 <_> <_> - 9 9 15 2 -1. + 9 9 6 3 -1. <_> - 9 10 15 1 2. + 11 11 2 3 3. + 1 + <_> + + <_> + 9 9 6 4 -1. + <_> + 11 11 2 4 3. + 1 + <_> + + <_> + 9 9 3 3 -1. + <_> + 9 10 3 1 3. 0 <_> <_> - 9 10 4 8 -1. + 9 9 6 4 -1. <_> - 10 10 2 8 2. + 12 9 3 4 2. 0 <_> <_> - 9 11 4 3 -1. + 9 10 3 3 -1. <_> - 9 12 4 1 3. + 9 11 3 1 3. 0 <_> <_> - 9 12 4 8 -1. + 9 10 5 3 -1. <_> - 9 12 2 4 2. - <_> - 11 16 2 4 2. + 9 11 5 1 3. 0 <_> <_> - 9 12 9 4 -1. + 9 10 14 3 -1. <_> - 12 12 3 4 3. + 9 11 14 1 3. 0 <_> <_> - 9 16 4 1 -1. + 9 13 4 6 -1. <_> - 11 16 2 1 2. + 9 13 2 3 2. + <_> + 11 16 2 3 2. 0 <_> <_> - 9 16 6 4 -1. + 9 13 9 4 -1. <_> - 11 16 2 4 3. + 12 13 3 4 3. 0 <_> <_> - 9 16 6 4 -1. + 9 16 6 5 -1. <_> - 9 17 6 2 2. + 11 16 2 5 3. 0 <_> @@ -9496,37 +10139,30 @@ <_> <_> - 9 19 3 5 -1. + 9 19 6 3 -1. <_> - 10 19 1 5 3. + 9 20 6 1 3. 0 <_> <_> - 9 19 6 4 -1. + 9 19 7 3 -1. <_> - 9 20 6 2 2. + 9 20 7 1 3. 0 <_> <_> - 9 20 3 1 -1. + 9 20 3 3 -1. <_> - 10 21 1 1 3. - 1 - <_> - - <_> - 9 20 5 4 -1. - <_> - 9 21 5 2 2. + 10 20 1 3 3. 0 <_> <_> - 9 20 5 4 -1. + 9 20 5 3 -1. <_> - 9 22 5 2 2. + 9 21 5 1 3. 0 <_> @@ -9535,13 +10171,6 @@ <_> 9 21 6 1 3. 0 - <_> - - <_> - 9 20 12 2 -1. - <_> - 15 20 6 2 2. - 0 <_> <_> @@ -9554,7 +10183,7 @@ <_> 9 20 7 4 -1. <_> - 9 21 7 2 2. + 9 22 7 2 2. 0 <_> @@ -9566,47 +10195,31 @@ <_> <_> - 9 21 4 3 -1. + 9 21 8 2 -1. <_> - 10 21 2 3 2. + 9 22 8 1 2. 0 <_> <_> - 9 22 3 2 -1. + 10 0 4 1 -1. <_> - 10 22 1 2 3. + 12 0 2 1 2. 0 <_> <_> - 10 0 1 2 -1. + 10 0 3 12 -1. <_> - 10 0 1 1 2. - 1 - <_> - - <_> - 10 0 4 2 -1. - <_> - 10 0 2 1 2. - <_> - 12 1 2 1 2. + 10 4 3 4 3. 0 <_> <_> - 10 0 6 8 -1. + 10 0 4 8 -1. <_> - 12 2 2 8 3. - 1 - <_> - - <_> - 10 0 6 10 -1. - <_> - 10 0 3 10 2. - 1 + 10 4 4 4 2. + 0 <_> <_> @@ -9619,74 +10232,23 @@ <_> <_> - 10 1 4 1 -1. + 10 2 4 6 -1. <_> - 12 1 2 1 2. + 11 2 2 6 2. 0 <_> <_> - 10 1 9 9 -1. + 10 2 6 10 -1. <_> - 13 4 3 9 3. + 10 2 3 10 2. 1 <_> <_> - 10 1 12 2 -1. + 10 3 2 5 -1. <_> - 14 1 4 2 3. - 0 - <_> - - <_> - 10 1 14 8 -1. - <_> - 10 1 7 4 2. - <_> - 17 5 7 4 2. - 0 - <_> - - <_> - 10 2 1 6 -1. - <_> - 8 4 1 2 3. - 1 - <_> - - <_> - 10 2 10 10 -1. - <_> - 10 7 10 5 2. - 0 - <_> - - <_> - 10 3 2 12 -1. - <_> - 11 3 1 12 2. - 0 - <_> - - <_> - 10 3 9 3 -1. - <_> - 13 4 3 1 9. - 0 - <_> - - <_> - 10 3 14 2 -1. - <_> - 17 3 7 2 2. - 0 - <_> - - <_> - 10 4 3 4 -1. - <_> - 11 4 1 4 3. + 11 3 1 5 2. 0 <_> @@ -9698,129 +10260,66 @@ <_> <_> - 10 4 3 6 -1. + 10 4 4 19 -1. <_> - 11 4 1 6 3. + 12 4 2 19 2. 0 <_> <_> - 10 4 4 10 -1. + 10 5 1 2 -1. <_> - 12 4 2 10 2. - 0 - <_> - - <_> - 10 4 9 3 -1. - <_> - 13 4 3 3 3. - 0 - <_> - - <_> - 10 5 2 6 -1. - <_> - 11 5 1 6 2. - 0 - <_> - - <_> - 10 5 6 3 -1. - <_> - 10 6 6 1 3. - 0 - <_> - - <_> - 10 5 14 9 -1. - <_> - 10 8 14 3 3. - 0 - <_> - - <_> - 10 6 3 3 -1. - <_> - 11 6 1 3 3. - 0 - <_> - - <_> - 10 6 2 4 -1. - <_> - 11 6 1 4 2. - 0 - <_> - - <_> - 10 6 2 3 -1. - <_> - 10 7 2 1 3. - 0 - <_> - - <_> - 10 6 3 3 -1. - <_> - 10 7 3 1 3. - 0 - <_> - - <_> - 10 6 3 4 -1. - <_> - 10 6 3 2 2. + 10 5 1 1 2. 1 <_> <_> - 10 6 6 7 -1. + 10 5 4 3 -1. <_> - 13 6 3 7 2. + 11 5 2 3 2. 0 <_> <_> - 10 6 4 3 -1. + 10 5 3 3 -1. <_> - 10 7 4 1 3. + 10 6 3 1 3. 0 <_> <_> - 10 7 2 3 -1. + 10 6 1 3 -1. <_> - 10 8 2 1 3. + 10 7 1 1 3. 0 <_> <_> - 10 7 6 6 -1. + 10 6 4 6 -1. <_> - 12 9 2 6 3. + 12 6 2 6 2. + 0 + <_> + + <_> + 10 7 4 3 -1. + <_> + 10 8 4 1 3. + 0 + <_> + + <_> + 10 8 1 2 -1. + <_> + 10 8 1 1 2. 1 <_> <_> - 10 7 3 3 -1. + 10 8 2 2 -1. <_> - 10 8 3 1 3. + 10 9 2 1 2. 0 - <_> - - <_> - 10 8 6 4 -1. - <_> - 12 10 2 4 3. - 1 - <_> - - <_> - 10 8 6 10 -1. - <_> - 12 10 2 10 3. - 1 <_> <_> @@ -9831,9 +10330,25 @@ <_> <_> - 10 9 2 7 -1. + 10 9 2 3 -1. <_> - 11 9 1 7 2. + 11 9 1 3 2. + 0 + <_> + + <_> + 10 9 2 12 -1. + <_> + 10 9 1 6 2. + <_> + 11 15 1 6 2. + 0 + <_> + + <_> + 10 9 2 3 -1. + <_> + 10 10 2 1 3. 0 <_> @@ -9842,48 +10357,6 @@ <_> 9 10 2 1 3. 1 - <_> - - <_> - 10 9 8 6 -1. - <_> - 12 9 4 6 2. - 0 - <_> - - <_> - 10 9 4 3 -1. - <_> - 10 10 4 1 3. - 0 - <_> - - <_> - 10 10 1 3 -1. - <_> - 10 11 1 1 3. - 0 - <_> - - <_> - 10 10 4 5 -1. - <_> - 11 11 2 5 2. - 1 - <_> - - <_> - 10 10 2 3 -1. - <_> - 10 11 2 1 3. - 0 - <_> - - <_> - 10 10 6 7 -1. - <_> - 12 12 2 7 3. - 1 <_> <_> @@ -9894,23 +10367,46 @@ <_> <_> - 10 15 4 2 -1. + 10 11 5 3 -1. <_> - 11 15 2 2 2. + 10 12 5 1 3. 0 <_> <_> - 10 15 6 3 -1. + 10 12 14 3 -1. <_> - 12 15 2 3 3. + 10 13 14 1 3. 0 <_> <_> - 10 15 5 3 -1. + 10 17 4 2 -1. <_> - 10 16 5 1 3. + 11 17 2 2 2. + 0 + <_> + + <_> + 10 17 2 6 -1. + <_> + 10 17 1 3 2. + <_> + 11 20 1 3 2. + 0 + <_> + + <_> + 10 17 3 3 -1. + <_> + 10 18 3 1 3. + 0 + <_> + + <_> + 10 17 6 2 -1. + <_> + 13 17 3 2 2. 0 <_> @@ -9922,9 +10418,16 @@ <_> <_> - 10 19 4 4 -1. + 10 19 5 4 -1. <_> - 10 20 4 2 2. + 10 20 5 2 2. + 0 + <_> + + <_> + 10 19 6 3 -1. + <_> + 10 20 6 1 3. 0 <_> @@ -9936,30 +10439,46 @@ <_> <_> - 10 20 3 4 -1. + 10 20 6 4 -1. <_> - 10 21 3 2 2. + 12 20 2 4 3. 0 <_> <_> - 10 20 7 4 -1. + 10 20 5 4 -1. <_> - 10 22 7 2 2. + 10 21 5 2 2. 0 <_> <_> - 10 21 3 1 -1. + 10 20 5 4 -1. <_> - 11 21 1 1 3. + 10 22 5 2 2. 0 <_> <_> - 10 22 3 1 -1. + 10 20 14 4 -1. <_> - 11 22 1 1 3. + 10 20 7 2 2. + <_> + 17 22 7 2 2. + 0 + <_> + + <_> + 10 21 3 3 -1. + <_> + 11 21 1 3 3. + 0 + <_> + + <_> + 10 21 5 2 -1. + <_> + 10 22 5 1 2. 0 <_> @@ -9978,88 +10497,86 @@ <_> <_> - 11 0 12 10 -1. + 11 0 1 2 -1. <_> - 11 0 6 5 2. + 11 0 1 1 2. + 1 + <_> + <_> - 17 5 6 5 2. + 11 0 1 4 -1. + <_> + 10 1 1 2 2. + 1 + <_> + + <_> + 11 0 4 1 -1. + <_> + 13 0 2 1 2. 0 <_> <_> - 11 1 3 6 -1. + 11 1 1 2 -1. <_> - 12 1 1 6 3. + 11 1 1 1 2. + 1 + <_> + + <_> + 11 2 8 9 -1. + <_> + 13 4 4 9 2. + 1 + <_> + + <_> + 11 3 3 3 -1. + <_> + 12 3 1 3 3. 0 <_> <_> - 11 1 6 1 -1. + 11 3 3 4 -1. <_> - 13 1 2 1 3. + 12 3 1 4 3. 0 <_> <_> - 11 1 7 10 -1. + 11 4 3 4 -1. <_> - 11 6 7 5 2. + 12 4 1 4 3. 0 <_> <_> - 11 2 3 4 -1. + 11 4 3 5 -1. <_> - 12 2 1 4 3. + 12 4 1 5 3. 0 <_> <_> - 11 2 2 11 -1. + 11 4 3 7 -1. <_> - 12 2 1 11 2. + 12 5 1 7 3. + 1 + <_> + + <_> + 11 4 4 1 -1. + <_> + 13 4 2 1 2. 0 <_> <_> - 11 2 4 14 -1. + 11 4 2 3 -1. <_> - 13 2 2 14 2. - 0 - <_> - - <_> - 11 2 4 22 -1. - <_> - 13 2 2 22 2. - 0 - <_> - - <_> - 11 3 3 5 -1. - <_> - 12 3 1 5 3. - 0 - <_> - - <_> - 11 3 2 3 -1. - <_> - 11 4 2 1 3. - 0 - <_> - - <_> - 11 3 6 9 -1. - <_> - 13 6 2 3 9. - 0 - <_> - - <_> - 11 4 3 3 -1. - <_> - 11 5 3 1 3. + 11 5 2 1 3. 0 <_> @@ -10071,30 +10588,16 @@ <_> <_> - 11 4 4 8 -1. + 11 5 3 1 -1. <_> - 11 4 4 4 2. - 1 - <_> - - <_> - 11 5 3 2 -1. - <_> - 12 5 1 2 3. + 12 5 1 1 3. 0 <_> <_> - 11 5 4 6 -1. + 11 5 4 11 -1. <_> - 12 5 2 6 2. - 0 - <_> - - <_> - 11 6 4 5 -1. - <_> - 12 6 2 5 2. + 13 5 2 11 2. 0 <_> @@ -10110,27 +10613,6 @@ <_> 11 7 4 1 3. 0 - <_> - - <_> - 11 6 4 8 -1. - <_> - 11 6 4 4 2. - 1 - <_> - - <_> - 11 6 5 3 -1. - <_> - 11 7 5 1 3. - 0 - <_> - - <_> - 11 6 6 3 -1. - <_> - 11 7 6 1 3. - 0 <_> <_> @@ -10148,10 +10630,24 @@ <_> <_> - 11 7 6 9 -1. + 11 7 2 6 -1. <_> - 13 7 2 9 3. + 11 7 2 3 2. + 1 + <_> + + <_> + 11 7 3 3 -1. + <_> + 11 8 3 1 3. 0 + <_> + + <_> + 11 7 3 8 -1. + <_> + 11 7 3 4 2. + 1 <_> <_> @@ -10169,45 +10665,40 @@ <_> <_> - 11 8 6 9 -1. + 11 9 3 3 -1. <_> - 13 10 2 9 3. + 11 10 3 1 3. + 0 + <_> + + <_> + 11 10 4 5 -1. + <_> + 12 11 2 5 2. 1 <_> <_> - 11 8 3 2 -1. + 11 10 6 3 -1. <_> - 11 9 3 1 2. + 13 10 2 3 3. 0 <_> <_> - 11 8 3 3 -1. + 11 10 6 8 -1. <_> - 11 9 3 1 3. + 11 10 3 4 2. + <_> + 14 14 3 4 2. 0 <_> <_> - 11 9 1 3 -1. + 11 10 8 6 -1. <_> - 11 10 1 1 3. - 0 - <_> - - <_> - 11 10 6 4 -1. - <_> - 13 10 2 4 3. - 0 - <_> - - <_> - 11 10 4 3 -1. - <_> - 11 11 4 1 3. - 0 + 9 12 8 2 3. + 1 <_> <_> @@ -10218,60 +10709,16 @@ <_> <_> - 11 12 9 9 -1. + 11 14 3 3 -1. <_> - 14 15 3 3 9. - 0 + 10 15 3 1 3. + 1 <_> <_> - 11 14 4 2 -1. + 11 16 3 3 -1. <_> - 13 14 2 2 2. - 0 - <_> - - <_> - 11 16 4 8 -1. - <_> - 11 18 4 4 2. - 0 - <_> - - <_> - 11 18 12 6 -1. - <_> - 11 18 6 3 2. - <_> - 17 21 6 3 2. - 0 - <_> - - <_> - 11 20 3 1 -1. - <_> - 12 20 1 1 3. - 0 - <_> - - <_> - 11 20 3 4 -1. - <_> - 12 20 1 4 3. - 0 - <_> - - <_> - 11 20 4 4 -1. - <_> - 11 22 4 2 2. - 0 - <_> - - <_> - 11 21 3 1 -1. - <_> - 12 21 1 1 3. + 11 17 3 1 3. 0 <_> @@ -10283,61 +10730,45 @@ <_> <_> - 11 22 4 2 -1. + 11 22 3 2 -1. <_> - 12 22 2 2 2. + 12 22 1 2 3. 0 <_> <_> - 12 0 12 2 -1. + 12 0 9 17 -1. <_> - 15 0 6 2 2. + 15 0 3 17 3. 0 <_> <_> - 12 0 6 6 -1. + 12 2 2 14 -1. <_> - 12 0 3 6 2. - 1 - <_> - - <_> - 12 0 12 10 -1. - <_> - 12 0 6 5 2. - <_> - 18 5 6 5 2. + 13 2 1 14 2. 0 <_> <_> - 12 1 4 10 -1. + 12 3 6 1 -1. <_> - 13 1 2 10 2. - 0 - <_> - - <_> - 12 2 2 3 -1. - <_> - 12 3 2 1 3. + 14 3 2 1 3. 0 <_> <_> 12 3 8 3 -1. <_> - 14 3 4 3 2. + 12 4 8 1 3. 0 <_> <_> - 12 3 9 3 -1. + 12 3 12 6 -1. <_> - 12 4 9 1 3. - 0 + 10 5 12 2 3. + 1 <_> <_> @@ -10348,45 +10779,31 @@ <_> <_> - 12 5 2 2 -1. + 12 4 9 3 -1. <_> - 13 5 1 2 2. + 15 5 3 1 9. 0 <_> <_> - 12 5 3 2 -1. + 12 5 3 5 -1. <_> - 13 5 1 2 3. + 13 5 1 5 3. 0 <_> <_> - 12 5 2 5 -1. + 12 5 3 3 -1. <_> - 13 5 1 5 2. + 12 6 3 1 3. 0 <_> <_> - 12 5 4 6 -1. + 12 5 9 8 -1. <_> - 13 5 2 6 2. + 15 5 3 8 3. 0 - <_> - - <_> - 12 5 6 7 -1. - <_> - 14 5 2 7 3. - 0 - <_> - - <_> - 12 5 3 8 -1. - <_> - 12 5 3 4 2. - 1 <_> <_> @@ -10397,31 +10814,17 @@ <_> <_> - 12 6 1 4 -1. + 12 6 2 8 -1. <_> - 12 7 1 2 2. - 0 - <_> - - <_> - 12 6 1 8 -1. - <_> - 12 6 1 4 2. + 12 6 2 4 2. 1 <_> <_> - 12 6 2 10 -1. + 12 6 3 3 -1. <_> - 13 6 1 10 2. + 12 7 3 1 3. 0 - <_> - - <_> - 12 6 8 1 -1. - <_> - 12 6 4 1 2. - 1 <_> <_> @@ -10432,16 +10835,30 @@ <_> <_> - 12 7 2 3 -1. + 12 7 1 8 -1. <_> - 12 8 2 1 3. - 0 + 12 7 1 4 2. + 1 <_> <_> - 12 7 4 3 -1. + 12 7 2 6 -1. <_> - 12 8 4 1 3. + 12 7 2 3 2. + 1 + <_> + + <_> + 12 7 2 8 -1. + <_> + 12 7 2 4 2. + 1 + <_> + + <_> + 12 7 3 3 -1. + <_> + 12 8 3 1 3. 0 <_> @@ -10457,22 +10874,6 @@ <_> 12 9 2 1 3. 0 - <_> - - <_> - 12 8 6 8 -1. - <_> - 12 8 3 4 2. - <_> - 15 12 3 4 2. - 0 - <_> - - <_> - 12 9 1 3 -1. - <_> - 12 10 1 1 3. - 0 <_> <_> @@ -10480,6 +10881,13 @@ <_> 12 10 2 1 3. 0 + <_> + + <_> + 12 10 6 4 -1. + <_> + 14 10 2 4 3. + 0 <_> <_> @@ -10489,13 +10897,6 @@ <_> 14 15 2 5 2. 0 - <_> - - <_> - 12 10 3 3 -1. - <_> - 12 11 3 1 3. - 0 <_> <_> @@ -10508,30 +10909,53 @@ <_> <_> - 12 16 4 4 -1. + 12 13 4 3 -1. <_> - 14 16 2 4 2. + 13 13 2 3 2. 0 <_> <_> - 12 17 6 6 -1. + 12 14 3 2 -1. <_> - 12 20 6 3 2. + 13 15 1 2 3. + 1 + <_> + + <_> + 12 15 2 4 -1. + <_> + 12 15 1 2 2. + <_> + 13 17 1 2 2. 0 <_> <_> - 12 18 3 4 -1. + 12 15 4 5 -1. <_> - 12 19 3 2 2. + 14 15 2 5 2. 0 <_> <_> - 12 19 3 4 -1. + 12 16 6 2 -1. <_> - 13 19 1 4 3. + 14 16 2 2 3. + 0 + <_> + + <_> + 12 19 3 5 -1. + <_> + 13 19 1 5 3. + 0 + <_> + + <_> + 12 21 3 2 -1. + <_> + 13 21 1 2 3. 0 <_> @@ -10540,6 +10964,43 @@ <_> 13 21 1 3 3. 0 + <_> + + <_> + 13 0 2 10 -1. + <_> + 13 0 1 5 2. + <_> + 14 5 1 5 2. + 0 + <_> + + <_> + 13 0 4 12 -1. + <_> + 14 0 2 12 2. + 0 + <_> + + <_> + 13 0 6 10 -1. + <_> + 15 0 2 10 3. + 0 + <_> + + <_> + 13 0 11 8 -1. + <_> + 11 2 11 4 2. + 1 + <_> + + <_> + 13 1 6 8 -1. + <_> + 15 1 2 8 3. + 0 <_> <_> @@ -10550,88 +11011,74 @@ <_> <_> - 13 2 2 6 -1. + 13 3 2 4 -1. <_> - 13 2 1 3 2. + 13 3 1 2 2. <_> - 14 5 1 3 2. + 14 5 1 2 2. 0 <_> <_> - 13 2 2 10 -1. + 13 3 6 3 -1. <_> - 14 2 1 10 2. + 15 4 2 1 9. 0 <_> <_> - 13 2 2 14 -1. + 13 4 4 7 -1. <_> - 14 2 1 14 2. + 14 4 2 7 2. 0 <_> <_> - 13 2 8 6 -1. + 13 4 3 8 -1. <_> - 15 2 4 6 2. + 14 4 1 8 3. 0 <_> <_> - 13 2 6 7 -1. + 13 5 3 2 -1. <_> - 15 2 2 7 3. + 14 5 1 2 3. 0 <_> <_> - 13 3 4 8 -1. + 13 5 3 5 -1. <_> - 14 3 2 8 2. + 14 5 1 5 3. 0 <_> <_> - 13 4 3 7 -1. + 13 5 3 6 -1. <_> - 14 4 1 7 3. + 14 5 1 6 3. 0 <_> <_> - 13 4 8 2 -1. + 13 5 3 8 -1. <_> - 15 4 4 2 2. + 14 5 1 8 3. 0 <_> <_> - 13 4 4 3 -1. + 13 5 6 1 -1. <_> - 13 5 4 1 3. + 15 5 2 1 3. 0 <_> <_> - 13 5 6 6 -1. + 13 6 7 4 -1. <_> - 15 5 2 6 3. - 0 - <_> - - <_> - 13 6 1 3 -1. - <_> - 13 7 1 1 3. - 0 - <_> - - <_> - 13 6 6 6 -1. - <_> - 15 6 2 6 3. + 13 7 7 2 2. 0 <_> @@ -10643,10 +11090,12 @@ <_> <_> - 13 7 1 8 -1. + 13 7 4 8 -1. <_> - 13 7 1 4 2. - 1 + 13 7 2 4 2. + <_> + 15 11 2 4 2. + 0 <_> <_> @@ -10664,9 +11113,23 @@ <_> <_> - 13 8 6 5 -1. + 13 7 8 1 -1. <_> - 15 8 2 5 3. + 13 7 4 1 2. + 1 + <_> + + <_> + 13 8 2 3 -1. + <_> + 13 9 2 1 3. + 0 + <_> + + <_> + 13 8 9 3 -1. + <_> + 16 9 3 1 9. 0 <_> @@ -10680,16 +11143,30 @@ <_> <_> - 13 9 3 3 -1. + 13 9 2 3 -1. <_> - 14 9 1 3 3. + 13 10 2 1 3. 0 <_> <_> - 13 9 2 3 -1. + 13 9 6 4 -1. <_> - 13 10 2 1 3. + 15 9 2 4 3. + 0 + <_> + + <_> + 13 9 10 2 -1. + <_> + 13 10 10 1 2. + 0 + <_> + + <_> + 13 10 3 1 -1. + <_> + 14 10 1 1 3. 0 <_> @@ -10701,46 +11178,32 @@ <_> <_> - 13 11 4 8 -1. + 13 11 2 3 -1. <_> - 13 11 2 4 2. - <_> - 15 15 2 4 2. + 13 12 2 1 3. 0 <_> <_> - 13 12 8 5 -1. + 13 13 2 6 -1. <_> - 15 12 4 5 2. + 13 13 1 3 2. + <_> + 14 16 1 3 2. 0 <_> <_> - 13 13 7 3 -1. + 13 13 4 6 -1. <_> - 13 14 7 1 3. - 0 + 14 14 2 6 2. + 1 <_> <_> - 13 14 4 1 -1. + 13 20 3 4 -1. <_> - 14 14 2 1 2. - 0 - <_> - - <_> - 13 17 3 7 -1. - <_> - 14 17 1 7 3. - 0 - <_> - - <_> - 13 21 3 3 -1. - <_> - 14 21 1 3 3. + 14 20 1 4 3. 0 <_> @@ -10749,6 +11212,27 @@ <_> 14 22 1 2 3. 0 + <_> + + <_> + 13 23 3 1 -1. + <_> + 14 23 1 1 3. + 0 + <_> + + <_> + 14 0 3 11 -1. + <_> + 15 1 1 11 3. + 1 + <_> + + <_> + 14 0 2 3 -1. + <_> + 14 1 2 1 3. + 0 <_> <_> @@ -10770,51 +11254,62 @@ <_> <_> - 14 0 10 9 -1. + 14 1 10 6 -1. <_> - 11 3 10 3 3. + 14 1 5 3 2. + <_> + 19 4 5 3 2. + 0 + <_> + + <_> + 14 2 1 2 -1. + <_> + 14 2 1 1 2. 1 <_> <_> - 14 1 1 8 -1. + 14 2 3 8 -1. <_> - 14 5 1 4 2. + 15 2 1 8 3. 0 <_> <_> - 14 2 10 2 -1. + 14 2 6 7 -1. <_> - 19 2 5 2 2. + 16 2 2 7 3. 0 <_> <_> - 14 3 2 8 -1. + 14 3 2 4 -1. <_> - 15 3 1 8 2. + 14 3 1 2 2. + <_> + 15 5 1 2 2. 0 <_> <_> - 14 4 3 3 -1. + 14 3 2 7 -1. <_> - 15 4 1 3 3. + 15 3 1 7 2. 0 <_> <_> - 14 4 3 4 -1. + 14 5 3 2 -1. <_> - 15 4 1 4 3. + 15 5 1 2 3. 0 <_> <_> - 14 4 8 3 -1. + 14 5 2 3 -1. <_> - 14 5 8 1 3. + 15 5 1 3 2. 0 <_> @@ -10833,30 +11328,30 @@ <_> <_> - 14 6 3 5 -1. + 14 5 2 7 -1. <_> - 15 6 1 5 3. + 15 5 1 7 2. 0 <_> <_> - 14 6 6 17 -1. + 14 5 6 4 -1. <_> - 16 6 2 17 3. + 16 5 2 4 3. 0 <_> <_> - 14 6 8 2 -1. + 14 6 6 3 -1. <_> - 14 6 4 2 2. + 14 6 3 3 2. 1 <_> <_> - 14 7 4 3 -1. + 14 7 4 16 -1. <_> - 15 7 2 3 2. + 15 7 2 16 2. 0 <_> @@ -10868,38 +11363,26 @@ <_> <_> - 14 8 6 3 -1. + 14 7 6 16 -1. <_> - 16 9 2 1 9. + 16 7 2 16 3. 0 <_> <_> - 14 8 6 1 -1. + 14 7 9 4 -1. <_> - 14 8 3 1 2. - 1 - <_> - - <_> - 14 8 6 2 -1. - <_> - 14 8 3 2 2. - 1 - <_> - - <_> - 14 9 4 1 -1. - <_> - 16 9 2 1 2. + 14 8 9 2 2. 0 <_> <_> - 14 9 6 6 -1. + 14 9 2 4 -1. <_> - 12 11 6 2 3. - 1 + 14 9 1 2 2. + <_> + 15 11 1 2 2. + 0 <_> <_> @@ -10917,70 +11400,94 @@ <_> <_> - 14 10 2 6 -1. + 14 10 3 3 -1. <_> - 14 10 1 3 2. - <_> - 15 13 1 3 2. + 15 10 1 3 3. 0 <_> <_> - 14 15 1 2 -1. + 14 12 2 1 -1. <_> - 14 15 1 1 2. + 15 12 1 1 2. + 0 + <_> + + <_> + 14 14 3 4 -1. + <_> + 15 15 1 4 3. 1 <_> <_> - 14 16 8 8 -1. + 14 14 5 3 -1. <_> - 14 16 4 4 2. - <_> - 18 20 4 4 2. + 14 15 5 1 3. 0 <_> <_> - 14 17 9 3 -1. + 14 15 3 3 -1. <_> - 14 18 9 1 3. - 0 - <_> - - <_> - 14 20 3 4 -1. - <_> - 15 20 1 4 3. - 0 - <_> - - <_> - 15 0 3 1 -1. - <_> - 16 1 1 1 3. + 15 16 1 3 3. 1 <_> <_> - 15 0 4 13 -1. + 14 19 3 5 -1. <_> - 16 1 2 13 2. - 1 - <_> - - <_> - 15 1 3 4 -1. - <_> - 15 3 3 2 2. + 15 19 1 5 3. 0 <_> <_> - 15 3 2 2 -1. + 14 21 10 1 -1. <_> - 15 3 2 1 2. + 19 21 5 1 2. + 0 + <_> + + <_> + 15 0 2 2 -1. + <_> + 15 0 1 2 2. 1 + <_> + + <_> + 15 0 4 2 -1. + <_> + 16 1 2 2 2. + 1 + <_> + + <_> + 15 3 6 3 -1. + <_> + 15 4 6 1 3. + 0 + <_> + + <_> + 15 4 2 3 -1. + <_> + 15 5 2 1 3. + 0 + <_> + + <_> + 15 5 2 1 -1. + <_> + 15 5 1 1 2. + 1 + <_> + + <_> + 15 5 2 2 -1. + <_> + 16 5 1 2 2. + 0 <_> <_> @@ -10998,39 +11505,16 @@ <_> <_> - 15 5 2 7 -1. + 15 7 4 4 -1. <_> - 16 5 1 7 2. + 15 9 4 2 2. 0 <_> <_> - 15 5 4 2 -1. + 15 7 4 6 -1. <_> - 15 5 2 1 2. - <_> - 17 6 2 1 2. - 0 - <_> - - <_> - 15 5 5 6 -1. - <_> - 15 7 5 2 3. - 0 - <_> - - <_> - 15 6 3 2 -1. - <_> - 16 7 1 2 3. - 1 - <_> - - <_> - 15 6 3 5 -1. - <_> - 16 6 1 5 3. + 15 9 4 2 3. 0 <_> @@ -11048,6 +11532,27 @@ <_> 16 9 1 1 2. 0 + <_> + + <_> + 15 8 2 1 -1. + <_> + 15 8 1 1 2. + 1 + <_> + + <_> + 15 8 1 12 -1. + <_> + 15 14 1 6 2. + 0 + <_> + + <_> + 15 8 6 2 -1. + <_> + 15 8 3 2 2. + 1 <_> <_> @@ -11058,9 +11563,9 @@ <_> <_> - 15 8 4 4 -1. + 15 8 5 4 -1. <_> - 15 9 4 2 2. + 15 9 5 2 2. 0 <_> @@ -11076,20 +11581,6 @@ <_> 16 10 1 1 3. 1 - <_> - - <_> - 15 9 1 10 -1. - <_> - 15 14 1 5 2. - 0 - <_> - - <_> - 15 10 2 1 -1. - <_> - 16 10 1 1 2. - 0 <_> <_> @@ -11097,6 +11588,22 @@ <_> 16 10 1 1 3. 0 + <_> + + <_> + 15 10 2 2 -1. + <_> + 15 10 1 1 2. + <_> + 16 11 1 1 2. + 0 + <_> + + <_> + 15 10 2 2 -1. + <_> + 16 10 1 2 2. + 0 <_> <_> @@ -11107,81 +11614,55 @@ <_> <_> - 15 10 4 4 -1. + 15 10 3 4 -1. <_> - 14 11 4 2 2. + 14 11 3 2 2. 1 <_> <_> - 15 11 7 4 -1. + 15 10 5 4 -1. <_> - 14 12 7 2 2. + 15 11 5 2 2. + 0 + <_> + + <_> + 15 10 5 4 -1. + <_> + 14 11 5 2 2. 1 <_> <_> - 15 12 6 6 -1. + 15 15 8 3 -1. <_> - 17 14 2 6 3. - 1 - <_> - - <_> - 15 13 3 4 -1. - <_> - 16 14 1 4 3. - 1 - <_> - - <_> - 15 13 3 11 -1. - <_> - 16 13 1 11 3. + 19 15 4 3 2. 0 <_> <_> - 15 13 2 3 -1. + 15 15 8 8 -1. <_> - 15 14 2 1 3. + 15 15 4 4 2. + <_> + 19 19 4 4 2. 0 <_> <_> - 15 14 1 8 -1. + 15 16 5 3 -1. <_> - 15 16 1 4 2. + 15 17 5 1 3. 0 <_> <_> - 15 14 8 10 -1. + 15 18 8 6 -1. <_> - 15 14 4 5 2. + 15 18 4 3 2. <_> - 19 19 4 5 2. - 0 - <_> - - <_> - 15 15 4 3 -1. - <_> - 15 16 4 1 3. - 0 - <_> - - <_> - 15 16 8 2 -1. - <_> - 19 16 4 2 2. - 0 - <_> - - <_> - 15 16 6 3 -1. - <_> - 15 17 6 1 3. + 19 21 4 3 2. 0 <_> @@ -11215,15 +11696,6 @@ <_> 20 4 4 4 2. 0 - <_> - - <_> - 16 0 8 16 -1. - <_> - 16 0 4 8 2. - <_> - 20 8 4 8 2. - 0 <_> <_> @@ -11234,9 +11706,30 @@ <_> <_> - 16 1 6 2 -1. + 16 1 2 1 -1. <_> - 18 3 2 2 3. + 16 1 1 1 2. + 1 + <_> + + <_> + 16 2 1 2 -1. + <_> + 16 3 1 1 2. + 0 + <_> + + <_> + 16 2 3 3 -1. + <_> + 17 3 1 1 9. + 0 + <_> + + <_> + 16 2 4 2 -1. + <_> + 17 3 2 2 2. 1 <_> @@ -11248,30 +11741,51 @@ <_> <_> - 16 2 4 3 -1. + 16 3 4 12 -1. <_> - 16 3 4 1 3. + 17 4 2 12 2. + 1 + <_> + + <_> + 16 4 6 3 -1. + <_> + 15 5 6 1 3. + 1 + <_> + + <_> + 16 5 1 2 -1. + <_> + 16 5 1 1 2. + 1 + <_> + + <_> + 16 5 3 2 -1. + <_> + 17 5 1 2 3. 0 <_> <_> - 16 2 4 8 -1. + 16 5 3 9 -1. <_> - 14 4 4 4 2. + 16 8 3 3 3. + 0 + <_> + + <_> + 16 6 6 2 -1. + <_> + 18 8 2 2 3. 1 <_> <_> - 16 6 3 3 -1. + 16 7 1 6 -1. <_> - 17 7 1 3 3. - 1 - <_> - - <_> - 16 6 4 4 -1. - <_> - 18 6 2 4 2. + 16 9 1 2 3. 0 <_> @@ -11280,13 +11794,6 @@ <_> 16 8 2 1 3. 0 - <_> - - <_> - 16 7 2 4 -1. - <_> - 16 8 2 2 2. - 0 <_> <_> @@ -11294,15 +11801,6 @@ <_> 16 7 2 1 2. 1 - <_> - - <_> - 16 7 4 10 -1. - <_> - 16 7 2 5 2. - <_> - 18 12 2 5 2. - 0 <_> <_> @@ -11313,10 +11811,10 @@ <_> <_> - 16 7 3 3 -1. + 16 7 3 2 -1. <_> - 16 8 3 1 3. - 0 + 16 7 3 1 2. + 1 <_> <_> @@ -11327,9 +11825,30 @@ <_> <_> - 16 7 4 6 -1. + 16 7 6 4 -1. <_> - 16 9 4 2 3. + 16 7 3 4 2. + 1 + <_> + + <_> + 16 7 4 3 -1. + <_> + 16 8 4 1 3. + 0 + <_> + + <_> + 16 7 5 3 -1. + <_> + 16 8 5 1 3. + 0 + <_> + + <_> + 16 7 5 6 -1. + <_> + 16 9 5 2 3. 0 <_> @@ -11341,9 +11860,16 @@ <_> <_> - 16 7 7 4 -1. + 16 7 7 8 -1. <_> - 16 8 7 2 2. + 14 9 7 4 2. + 1 + <_> + + <_> + 16 7 8 6 -1. + <_> + 16 9 8 2 3. 0 <_> @@ -11359,6 +11885,15 @@ <_> 16 9 1 2 2. 0 + <_> + + <_> + 16 8 2 2 -1. + <_> + 16 8 1 1 2. + <_> + 17 9 1 1 2. + 0 <_> <_> @@ -11369,9 +11904,9 @@ <_> <_> - 16 8 3 1 -1. + 16 8 2 1 -1. <_> - 17 9 1 1 3. + 16 8 1 1 2. 1 <_> @@ -11383,32 +11918,23 @@ <_> <_> - 16 8 2 4 -1. + 16 8 5 6 -1. <_> - 16 9 2 2 2. - 0 + 14 10 5 2 3. + 1 <_> <_> - 16 8 3 4 -1. + 16 8 7 8 -1. <_> - 16 9 3 2 2. - 0 + 14 10 7 4 2. + 1 <_> <_> - 16 8 3 16 -1. + 16 9 3 1 -1. <_> - 16 12 3 8 2. - 0 - <_> - - <_> - 16 8 8 2 -1. - <_> - 16 8 4 1 2. - <_> - 20 9 4 1 2. + 17 9 1 1 3. 0 <_> @@ -11420,37 +11946,16 @@ <_> <_> - 16 9 3 6 -1. + 16 9 5 3 -1. <_> - 14 11 3 2 3. - 1 + 16 10 5 1 3. + 0 <_> <_> - 16 9 5 6 -1. + 16 9 8 2 -1. <_> - 14 11 5 2 3. - 1 - <_> - - <_> - 16 9 6 6 -1. - <_> - 14 11 6 2 3. - 1 - <_> - - <_> - 16 9 8 6 -1. - <_> - 14 11 8 2 3. - 1 - <_> - - <_> - 16 10 1 2 -1. - <_> - 16 11 1 1 2. + 16 10 8 1 2. 0 <_> @@ -11459,6 +11964,13 @@ <_> 16 11 1 1 3. 0 + <_> + + <_> + 16 10 2 2 -1. + <_> + 17 10 1 2 2. + 0 <_> <_> @@ -11469,23 +11981,16 @@ <_> <_> - 16 10 3 3 -1. + 16 10 6 6 -1. <_> - 16 11 3 1 3. - 0 + 14 12 6 2 3. + 1 <_> <_> - 16 10 5 2 -1. + 16 11 3 1 -1. <_> - 16 11 5 1 2. - 0 - <_> - - <_> - 16 10 6 8 -1. - <_> - 16 12 6 4 2. + 17 11 1 1 3. 0 <_> @@ -11494,6 +11999,13 @@ <_> 17 11 1 2 3. 0 + <_> + + <_> + 16 11 3 13 -1. + <_> + 17 11 1 13 3. + 0 <_> <_> @@ -11504,39 +12016,37 @@ <_> <_> - 16 11 3 2 -1. + 16 11 2 3 -1. <_> - 16 12 3 1 2. + 16 12 2 1 3. 0 <_> <_> - 16 14 8 10 -1. + 16 11 3 3 -1. <_> - 16 14 4 5 2. - <_> - 20 19 4 5 2. + 16 12 3 1 3. 0 <_> <_> - 16 16 8 2 -1. + 16 14 4 2 -1. <_> - 20 16 4 2 2. + 18 14 2 2 2. 0 <_> <_> - 16 18 3 6 -1. + 16 14 6 3 -1. <_> - 17 18 1 6 3. + 19 14 3 3 2. 0 <_> <_> - 16 18 8 3 -1. + 16 19 3 5 -1. <_> - 20 18 4 3 2. + 17 19 1 5 3. 0 <_> @@ -11548,59 +12058,73 @@ <_> <_> - 16 20 1 3 -1. + 16 19 8 3 -1. <_> - 15 21 1 1 3. - 1 - <_> - - <_> - 17 1 6 2 -1. - <_> - 17 1 3 2 2. - 1 - <_> - - <_> - 17 3 3 1 -1. - <_> - 18 3 1 1 3. + 16 20 8 1 3. 0 <_> <_> - 17 3 2 3 -1. + 17 0 6 15 -1. <_> - 17 4 2 1 3. - 0 - <_> - - <_> - 17 3 6 3 -1. - <_> - 19 5 2 3 3. + 19 2 2 15 3. 1 <_> <_> - 17 3 3 3 -1. + 17 0 6 1 -1. <_> - 17 4 3 1 3. + 20 0 3 1 2. 0 <_> <_> - 17 3 7 3 -1. + 17 0 6 2 -1. <_> - 17 4 7 1 3. + 20 0 3 2 2. 0 <_> <_> - 17 4 4 2 -1. + 17 2 3 3 -1. <_> - 18 5 2 2 2. + 18 3 1 1 9. + 0 + <_> + + <_> + 17 3 3 2 -1. + <_> + 18 3 1 2 3. + 0 + <_> + + <_> + 17 3 3 9 -1. + <_> + 18 6 1 3 9. + 0 + <_> + + <_> + 17 3 6 2 -1. + <_> + 19 5 2 2 3. 1 + <_> + + <_> + 17 3 3 8 -1. + <_> + 15 5 3 4 2. + 1 + <_> + + <_> + 17 3 5 3 -1. + <_> + 17 4 5 1 3. + 0 <_> <_> @@ -11610,20 +12134,6 @@ <_> 18 7 1 3 2. 0 - <_> - - <_> - 17 4 6 5 -1. - <_> - 19 6 2 5 3. - 1 - <_> - - <_> - 17 4 7 16 -1. - <_> - 17 8 7 8 2. - 0 <_> <_> @@ -11641,10 +12151,24 @@ <_> <_> - 17 6 1 9 -1. + 17 5 6 2 -1. <_> - 17 9 1 3 3. - 0 + 17 5 3 2 2. + 1 + <_> + + <_> + 17 5 7 3 -1. + <_> + 16 6 7 1 3. + 1 + <_> + + <_> + 17 6 2 3 -1. + <_> + 17 6 1 3 2. + 1 <_> <_> @@ -11652,13 +12176,6 @@ <_> 18 7 1 4 3. 1 - <_> - - <_> - 17 6 6 3 -1. - <_> - 19 8 2 3 3. - 1 <_> <_> @@ -11666,6 +12183,13 @@ <_> 17 7 3 1 3. 0 + <_> + + <_> + 17 6 6 1 -1. + <_> + 17 6 3 1 2. + 1 <_> <_> @@ -11673,6 +12197,13 @@ <_> 17 8 1 1 3. 0 + <_> + + <_> + 17 7 1 3 -1. + <_> + 16 8 1 1 3. + 1 <_> <_> @@ -11680,6 +12211,27 @@ <_> 17 9 1 2 3. 0 + <_> + + <_> + 17 7 3 6 -1. + <_> + 18 9 1 2 9. + 0 + <_> + + <_> + 17 7 3 2 -1. + <_> + 18 8 1 2 3. + 1 + <_> + + <_> + 17 7 2 3 -1. + <_> + 17 7 1 3 2. + 1 <_> <_> @@ -11690,68 +12242,17 @@ <_> <_> - 17 7 4 5 -1. + 17 7 2 3 -1. <_> - 18 8 2 5 2. + 17 8 2 1 3. + 0 + <_> + + <_> + 17 7 6 9 -1. + <_> + 14 10 6 3 3. 1 - <_> - - <_> - 17 7 4 9 -1. - <_> - 18 8 2 9 2. - 1 - <_> - - <_> - 17 7 2 2 -1. - <_> - 17 8 2 1 2. - 0 - <_> - - <_> - 17 7 3 2 -1. - <_> - 17 8 3 1 2. - 0 - <_> - - <_> - 17 7 3 3 -1. - <_> - 17 8 3 1 3. - 0 - <_> - - <_> - 17 7 3 2 -1. - <_> - 17 7 3 1 2. - 1 - <_> - - <_> - 17 7 5 2 -1. - <_> - 17 8 5 1 2. - 0 - <_> - - <_> - 17 7 5 4 -1. - <_> - 17 8 5 2 2. - 0 - <_> - - <_> - 17 8 2 2 -1. - <_> - 17 8 1 1 2. - <_> - 18 9 1 1 2. - 0 <_> <_> @@ -11762,23 +12263,73 @@ <_> <_> - 17 8 6 9 -1. + 17 8 2 4 -1. <_> - 20 8 3 9 2. + 17 8 1 2 2. + <_> + 18 10 1 2 2. 0 <_> <_> - 17 8 7 8 -1. + 17 8 2 8 -1. <_> - 15 10 7 4 2. + 17 8 1 4 2. + <_> + 18 12 1 4 2. + 0 + <_> + + <_> + 17 8 3 4 -1. + <_> + 18 9 1 4 3. 1 <_> <_> - 17 9 3 3 -1. + 17 8 4 6 -1. <_> - 18 10 1 1 9. + 15 10 4 2 3. + 1 + <_> + + <_> + 17 9 3 1 -1. + <_> + 18 9 1 1 3. + 0 + <_> + + <_> + 17 9 2 6 -1. + <_> + 17 9 1 3 2. + <_> + 18 12 1 3 2. + 0 + <_> + + <_> + 17 9 6 10 -1. + <_> + 17 9 3 5 2. + <_> + 20 14 3 5 2. + 0 + <_> + + <_> + 17 9 7 2 -1. + <_> + 17 10 7 1 2. + 0 + <_> + + <_> + 17 10 3 1 -1. + <_> + 18 10 1 1 3. 0 <_> @@ -11790,44 +12341,25 @@ <_> <_> - 17 10 4 1 -1. + 17 10 2 3 -1. <_> - 19 10 2 1 2. + 18 10 1 3 2. 0 <_> <_> 17 10 2 4 -1. <_> - 17 11 2 2 2. + 18 10 1 4 2. 0 <_> <_> - 17 10 2 2 -1. + 17 10 4 2 -1. <_> - 17 10 2 1 2. - 1 - <_> - + 17 10 2 1 2. <_> - 17 10 4 4 -1. - <_> - 17 11 4 2 2. - 0 - <_> - - <_> - 17 10 4 8 -1. - <_> - 17 12 4 4 2. - 0 - <_> - - <_> - 17 11 2 2 -1. - <_> - 18 11 1 2 2. + 19 11 2 1 2. 0 <_> @@ -11853,67 +12385,123 @@ <_> <_> - 17 14 1 3 -1. + 17 12 6 2 -1. <_> - 17 15 1 1 3. + 20 12 3 2 2. 0 <_> <_> - 17 14 2 2 -1. + 17 15 2 3 -1. <_> - 17 14 1 1 2. - <_> - 18 15 1 1 2. + 17 16 2 1 3. 0 <_> <_> - 17 14 4 4 -1. + 17 15 4 3 -1. <_> - 19 14 2 4 2. + 19 15 2 3 2. 0 <_> <_> - 17 15 4 2 -1. + 17 15 4 4 -1. <_> - 19 15 2 2 2. - 0 - <_> - - <_> - 17 17 2 4 -1. - <_> - 17 17 2 2 2. + 17 15 2 4 2. 1 <_> <_> - 18 0 4 1 -1. + 17 18 2 4 -1. <_> - 20 0 2 1 2. + 16 19 2 2 2. + 1 + <_> + + <_> + 17 18 5 3 -1. + <_> + 17 19 5 1 3. 0 <_> <_> - 18 3 3 1 -1. + 17 19 1 3 -1. + <_> + 16 20 1 1 3. + 1 + <_> + + <_> + 17 20 1 3 -1. + <_> + 16 21 1 1 3. + 1 + <_> + + <_> + 17 20 3 4 -1. + <_> + 18 20 1 4 3. + 0 + <_> + + <_> + 18 0 2 2 -1. + <_> + 18 0 1 2 2. + 1 + <_> + + <_> + 18 0 6 1 -1. + <_> + 21 0 3 1 2. + 0 + <_> + + <_> + 18 0 6 5 -1. + <_> + 21 0 3 5 2. + 0 + <_> + + <_> + 18 0 6 12 -1. + <_> + 18 0 3 6 2. + <_> + 21 6 3 6 2. + 0 + <_> + + <_> + 18 2 3 1 -1. <_> 19 3 1 1 3. - 0 - <_> - - <_> - 18 4 6 5 -1. - <_> - 20 6 2 5 3. 1 <_> <_> - 18 4 6 19 -1. + 18 2 4 1 -1. <_> - 21 4 3 19 2. + 19 3 2 1 2. + 1 + <_> + + <_> + 18 2 4 3 -1. + <_> + 19 3 2 3 2. + 1 + <_> + + <_> + 18 4 4 3 -1. + <_> + 18 5 4 1 3. 0 <_> @@ -11925,23 +12513,16 @@ <_> <_> - 18 5 4 9 -1. + 18 6 2 3 -1. <_> - 19 6 2 9 2. + 18 6 1 3 2. 1 <_> <_> - 18 6 2 4 -1. + 18 6 4 3 -1. <_> - 18 6 1 4 2. - 1 - <_> - - <_> - 18 6 3 4 -1. - <_> - 19 7 1 4 3. + 19 7 2 3 2. 1 <_> @@ -11953,44 +12534,51 @@ <_> <_> - 18 6 4 5 -1. + 18 6 2 5 -1. <_> - 19 7 2 5 2. + 18 6 1 5 2. + 1 + <_> + + <_> + 18 6 4 6 -1. + <_> + 19 7 2 6 2. 1 <_> <_> 18 6 2 3 -1. <_> - 17 7 2 1 3. + 18 7 2 1 3. + 0 + <_> + + <_> + 18 6 4 1 -1. + <_> + 18 6 2 1 2. 1 <_> <_> - 18 6 3 3 -1. + 18 6 5 3 -1. <_> - 18 7 3 1 3. + 18 7 5 1 3. 0 <_> <_> - 18 6 4 3 -1. + 18 6 6 3 -1. <_> - 18 7 4 1 3. + 18 7 6 1 3. 0 <_> <_> - 18 7 1 3 -1. + 18 7 3 2 -1. <_> - 18 8 1 1 3. - 0 - <_> - - <_> - 18 7 3 4 -1. - <_> - 19 8 1 4 3. + 19 8 1 2 3. 1 <_> @@ -12002,30 +12590,16 @@ <_> <_> - 18 7 3 6 -1. + 18 8 1 3 -1. <_> - 19 8 1 6 3. - 1 - <_> - - <_> - 18 7 2 3 -1. - <_> - 18 8 2 1 3. + 18 9 1 1 3. 0 <_> <_> - 18 7 2 2 -1. + 18 8 2 3 -1. <_> - 18 7 2 1 2. - 1 - <_> - - <_> - 18 7 3 3 -1. - <_> - 18 8 3 1 3. + 18 9 2 1 3. 0 <_> @@ -12034,20 +12608,6 @@ <_> 18 8 2 1 2. 1 - <_> - - <_> - 18 8 3 9 -1. - <_> - 15 11 3 3 3. - 1 - <_> - - <_> - 18 8 6 5 -1. - <_> - 21 8 3 5 2. - 0 <_> <_> @@ -12058,9 +12618,32 @@ <_> <_> - 18 9 6 2 -1. + 18 9 2 2 -1. <_> - 18 10 6 1 2. + 18 9 1 1 2. + <_> + 19 10 1 1 2. + 0 + <_> + + <_> + 18 9 3 2 -1. + <_> + 19 9 1 2 3. + 0 + <_> + + <_> + 18 9 2 4 -1. + <_> + 18 11 2 2 2. + 0 + <_> + + <_> + 18 9 6 9 -1. + <_> + 21 9 3 9 2. 0 <_> @@ -12069,6 +12652,13 @@ <_> 18 10 6 1 3. 0 + <_> + + <_> + 18 10 2 1 -1. + <_> + 19 10 1 1 2. + 0 <_> <_> @@ -12088,30 +12678,37 @@ <_> <_> - 18 10 3 5 -1. + 18 10 6 2 -1. <_> - 19 10 1 5 3. + 18 11 6 1 2. 0 <_> <_> - 18 11 4 8 -1. + 18 11 3 4 -1. <_> - 18 15 4 4 2. + 19 11 1 4 3. 0 <_> <_> - 18 12 2 6 -1. + 18 11 3 13 -1. <_> - 18 15 2 3 2. + 19 11 1 13 3. 0 <_> <_> - 18 12 2 8 -1. + 18 11 2 8 -1. <_> - 18 16 2 4 2. + 18 15 2 4 2. + 0 + <_> + + <_> + 18 11 6 1 -1. + <_> + 21 11 3 1 2. 0 <_> @@ -12123,46 +12720,37 @@ <_> <_> - 18 12 6 8 -1. + 18 12 3 8 -1. <_> - 18 12 3 4 2. - <_> - 21 16 3 4 2. + 18 16 3 4 2. 0 <_> <_> - 18 14 2 4 -1. + 18 13 2 4 -1. <_> - 19 14 1 4 2. + 18 15 2 2 2. 0 <_> <_> - 18 15 1 3 -1. + 18 14 4 4 -1. <_> - 18 16 1 1 3. + 18 16 4 2 2. 0 <_> <_> 18 15 4 5 -1. <_> - 18 15 2 5 2. - 1 + 20 15 2 5 2. + 0 <_> <_> - 18 15 3 6 -1. + 18 16 2 4 -1. <_> - 16 17 3 2 3. - 1 - <_> - - <_> - 18 17 2 4 -1. - <_> - 18 17 1 4 2. + 18 16 2 2 2. 1 <_> @@ -12188,10 +12776,10 @@ <_> <_> - 19 0 3 1 -1. + 19 0 2 3 -1. <_> - 20 0 1 1 3. - 0 + 19 0 1 3 2. + 1 <_> <_> @@ -12199,6 +12787,13 @@ <_> 20 3 1 1 3. 1 + <_> + + <_> + 19 2 4 3 -1. + <_> + 20 3 2 3 2. + 1 <_> <_> @@ -12209,12 +12804,24 @@ <_> <_> - 19 4 2 2 -1. + 19 4 1 2 -1. <_> - 19 4 1 1 2. + 19 4 1 1 2. + 1 + <_> + <_> - 20 5 1 1 2. - 0 + 19 4 3 1 -1. + <_> + 20 5 1 1 3. + 1 + <_> + + <_> + 19 4 1 3 -1. + <_> + 18 5 1 1 3. + 1 <_> <_> @@ -12225,9 +12832,9 @@ <_> <_> - 19 4 2 3 -1. + 19 4 5 9 -1. <_> - 19 5 2 1 3. + 19 7 5 3 3. 0 <_> @@ -12246,30 +12853,58 @@ <_> <_> - 19 6 1 6 -1. + 19 6 1 3 -1. <_> - 19 6 1 3 2. + 18 7 1 1 3. 1 <_> <_> - 19 6 3 3 -1. + 19 6 2 3 -1. <_> - 19 7 3 1 3. + 19 7 2 1 3. + 0 + <_> + + <_> + 19 6 5 9 -1. + <_> + 19 9 5 3 3. + 0 + <_> + + <_> + 19 7 1 3 -1. + <_> + 19 8 1 1 3. + 0 + <_> + + <_> + 19 7 3 4 -1. + <_> + 20 7 1 4 3. + 0 + <_> + + <_> + 19 7 2 4 -1. + <_> + 19 7 2 2 2. + 1 + <_> + + <_> + 19 8 1 3 -1. + <_> + 19 9 1 1 3. 0 <_> <_> 19 8 3 3 -1. <_> - 20 9 1 3 3. - 1 - <_> - - <_> - 19 8 4 11 -1. - <_> - 21 8 2 11 2. + 20 8 1 3 3. 0 <_> @@ -12281,65 +12916,74 @@ <_> <_> - 19 10 2 4 -1. + 19 9 2 2 -1. <_> - 19 12 2 2 2. + 19 9 2 1 2. + 1 + <_> + + <_> + 19 10 2 2 -1. + <_> + 19 10 1 1 2. + <_> + 20 11 1 1 2. 0 <_> <_> - 19 11 3 13 -1. + 19 10 3 4 -1. <_> - 20 11 1 13 3. + 19 11 3 2 2. 0 <_> <_> 19 12 4 8 -1. <_> - 19 12 2 8 2. + 20 13 2 8 2. 1 <_> <_> - 19 13 3 8 -1. + 19 12 3 10 -1. <_> - 20 13 1 8 3. + 20 12 1 10 3. 0 <_> <_> - 19 13 4 7 -1. + 19 12 3 12 -1. <_> - 19 13 2 7 2. + 20 12 1 12 3. + 0 + <_> + + <_> + 19 13 3 9 -1. + <_> + 20 13 1 9 3. + 0 + <_> + + <_> + 19 14 4 6 -1. + <_> + 20 15 2 6 2. 1 <_> <_> - 19 15 4 5 -1. + 19 15 3 6 -1. <_> - 20 16 2 5 2. + 20 16 1 6 3. 1 <_> <_> - 19 17 3 6 -1. + 19 17 1 3 -1. <_> - 20 17 1 6 3. - 0 - <_> - - <_> - 19 17 3 7 -1. - <_> - 20 17 1 7 3. - 0 - <_> - - <_> - 19 17 3 4 -1. - <_> - 18 18 3 2 2. + 18 18 1 1 3. 1 <_> @@ -12358,17 +13002,52 @@ <_> <_> - 20 0 2 2 -1. + 19 19 1 4 -1. <_> - 20 0 1 2 2. + 18 20 1 2 2. 1 <_> <_> - 20 3 1 4 -1. + 19 20 1 3 -1. <_> - 19 4 1 2 2. + 18 21 1 1 3. 1 + <_> + + <_> + 19 21 5 3 -1. + <_> + 19 22 5 1 3. + 0 + <_> + + <_> + 20 0 4 4 -1. + <_> + 19 1 4 2 2. + 1 + <_> + + <_> + 20 3 3 1 -1. + <_> + 21 4 1 1 3. + 1 + <_> + + <_> + 20 3 3 2 -1. + <_> + 21 4 1 2 3. + 1 + <_> + + <_> + 20 4 1 3 -1. + <_> + 20 5 1 1 3. + 0 <_> <_> @@ -12383,13 +13062,6 @@ <_> 21 5 1 2 3. 1 - <_> - - <_> - 20 4 2 3 -1. - <_> - 20 5 2 1 3. - 0 <_> <_> @@ -12400,38 +13072,31 @@ <_> <_> - 20 8 1 4 -1. + 20 6 4 3 -1. <_> - 20 8 1 2 2. - 1 - <_> - - <_> - 20 8 4 3 -1. - <_> - 21 9 2 3 2. - 1 - <_> - - <_> - 20 8 3 4 -1. - <_> - 21 9 1 4 3. - 1 - <_> - - <_> - 20 8 4 4 -1. - <_> - 21 9 2 4 2. - 1 - <_> - - <_> - 20 8 4 6 -1. - <_> - 20 10 4 2 3. + 20 7 4 1 3. 0 + <_> + + <_> + 20 8 3 2 -1. + <_> + 21 9 1 2 3. + 1 + <_> + + <_> + 20 8 3 3 -1. + <_> + 21 9 1 3 3. + 1 + <_> + + <_> + 20 9 3 2 -1. + <_> + 21 10 1 2 3. + 1 <_> <_> @@ -12439,13 +13104,6 @@ <_> 20 9 2 10 2. 1 - <_> - - <_> - 20 9 4 3 -1. - <_> - 19 10 4 1 3. - 1 <_> <_> @@ -12456,45 +13114,45 @@ <_> <_> - 20 10 4 3 -1. + 20 10 2 2 -1. <_> - 21 11 2 3 2. + 20 10 2 1 2. 1 <_> <_> - 20 10 3 10 -1. + 20 11 4 9 -1. <_> - 21 10 1 10 3. - 0 - <_> - - <_> - 20 12 4 8 -1. - <_> - 21 13 2 8 2. + 20 11 2 9 2. 1 <_> <_> - 20 13 3 8 -1. + 20 14 4 6 -1. <_> - 21 13 1 8 3. - 0 - <_> - - <_> - 20 15 4 5 -1. - <_> - 21 16 2 5 2. + 21 15 2 6 2. 1 <_> <_> - 20 15 4 4 -1. + 20 14 2 7 -1. <_> - 22 15 2 4 2. - 0 + 20 14 1 7 2. + 1 + <_> + + <_> + 20 15 3 4 -1. + <_> + 19 16 3 2 2. + 1 + <_> + + <_> + 20 16 4 4 -1. + <_> + 21 17 2 4 2. + 1 <_> <_> @@ -12502,27 +13160,6 @@ <_> 21 17 1 5 3. 0 - <_> - - <_> - 20 18 3 1 -1. - <_> - 21 18 1 1 3. - 0 - <_> - - <_> - 20 18 1 3 -1. - <_> - 19 19 1 1 3. - 1 - <_> - - <_> - 20 19 3 4 -1. - <_> - 21 19 1 4 3. - 0 <_> <_> @@ -12533,10 +13170,24 @@ <_> <_> - 21 2 3 16 -1. + 20 20 4 3 -1. <_> - 21 2 3 8 2. + 20 21 4 1 3. + 0 + <_> + + <_> + 21 1 2 16 -1. + <_> + 21 1 2 8 2. 1 + <_> + + <_> + 21 1 3 4 -1. + <_> + 21 2 3 2 2. + 0 <_> <_> @@ -12547,23 +13198,9 @@ <_> <_> - 21 8 3 3 -1. + 21 4 3 3 -1. <_> - 22 9 1 3 3. - 1 - <_> - - <_> - 21 8 3 5 -1. - <_> - 22 9 1 5 3. - 1 - <_> - - <_> - 21 9 3 3 -1. - <_> - 20 10 3 1 3. + 22 5 1 3 3. 1 <_> @@ -12575,38 +13212,31 @@ <_> <_> - 21 10 2 5 -1. + 21 10 2 2 -1. <_> - 21 10 1 5 2. + 21 10 1 2 2. 1 <_> <_> - 21 10 3 3 -1. + 21 10 3 4 -1. <_> - 21 11 3 1 3. + 21 11 3 2 2. 0 <_> <_> - 21 11 1 3 -1. + 21 11 1 2 -1. <_> - 20 12 1 1 3. + 21 11 1 1 2. 1 <_> <_> - 21 15 1 3 -1. + 21 15 2 3 -1. <_> - 20 16 1 1 3. + 20 16 2 1 3. 1 - <_> - - <_> - 21 15 3 6 -1. - <_> - 22 15 1 6 3. - 0 <_> <_> @@ -12617,16 +13247,30 @@ <_> <_> - 21 16 3 7 -1. + 21 16 3 8 -1. <_> - 22 16 1 7 3. + 22 16 1 8 3. 0 <_> <_> - 21 16 3 8 -1. + 21 16 2 3 -1. <_> - 22 16 1 8 3. + 20 17 2 1 3. + 1 + <_> + + <_> + 21 17 1 3 -1. + <_> + 20 18 1 1 3. + 1 + <_> + + <_> + 21 17 3 7 -1. + <_> + 22 17 1 7 3. 0 <_> @@ -12638,16 +13282,23 @@ <_> <_> - 21 22 3 2 -1. + 22 1 2 4 -1. <_> - 22 22 1 2 3. - 0 + 21 2 2 2 2. + 1 <_> <_> - 22 2 1 18 -1. + 22 2 1 16 -1. <_> - 22 2 1 9 2. + 22 2 1 8 2. + 1 + <_> + + <_> + 22 9 2 4 -1. + <_> + 22 9 1 4 2. 1 <_> @@ -12656,6 +13307,20 @@ <_> 21 11 1 1 3. 1 + <_> + + <_> + 22 10 2 7 -1. + <_> + 22 10 1 7 2. + 1 + <_> + + <_> + 22 10 2 3 -1. + <_> + 22 11 2 1 3. + 0 <_> <_> @@ -12673,58 +13338,30 @@ <_> <_> - 22 11 2 6 -1. + 22 12 1 3 -1. <_> - 22 11 1 6 2. + 21 13 1 1 3. 1 <_> <_> - 22 11 2 9 -1. + 22 13 1 3 -1. <_> - 22 11 1 9 2. + 21 14 1 1 3. 1 <_> <_> - 22 12 2 3 -1. + 22 16 1 3 -1. <_> - 21 13 2 1 3. + 21 17 1 1 3. 1 <_> <_> - 22 13 2 9 -1. + 23 7 1 3 -1. <_> - 22 13 1 9 2. - 1 - <_> - - <_> - 22 13 2 8 -1. - <_> - 20 15 2 4 2. - 1 - <_> - - <_> - 22 17 1 4 -1. - <_> - 21 18 1 2 2. - 1 - <_> - - <_> - 22 18 1 4 -1. - <_> - 21 19 1 2 2. - 1 - <_> - - <_> - 23 9 1 3 -1. - <_> - 23 10 1 1 3. + 23 8 1 1 3. 0 <_> @@ -12733,6 +13370,13 @@ <_> 23 11 1 1 3. 0 + <_> + + <_> + 23 11 1 2 -1. + <_> + 23 12 1 1 2. + 0 <_> <_> @@ -12743,8 +13387,8 @@ <_> <_> - 23 12 1 3 -1. + 23 15 1 4 -1. <_> - 22 13 1 1 3. + 22 16 1 2 2. 1 diff --git a/data/lbpcascades/lbpcascade_frontalcatface.xml b/data/lbpcascades/lbpcascade_frontalcatface.xml index 4d8d829931..3b4b1bf426 100644 --- a/data/lbpcascades/lbpcascade_frontalcatface.xml +++ b/data/lbpcascades/lbpcascade_frontalcatface.xml @@ -21,15 +21,20 @@ KNOWN LIMITATIONS: - Sometimes, the detector mistakenly thinks that a human face is a cat face. In - situations where either a human or a cat might be encountered, use both a - human face detector and a cat face detector. Then, if a detected human face - and a detected cat face intersect, reject the cat face. - An upright subject is assumed. In situations where the cat's face might be sideways or upside down (e.g. the cat is rolling over), try various rotations of the input image. + CHANGELOG: + + 2016-08-06: Re-trained with more negative samples and more stages. False + positives are much rarer now. If you tailored your code for the cascade's + previous version, now you should re-adjust the arguments of + CascadeClassifier::detectMultiScale. For example, decrease the value of the + minNeighbors argument. You do not need to use a human face detector to + cross-check the positives anymore. + 2014-04-25: First release (at https://bitbucket.org/Joe_Howse/angora-blue) + ////////////////////////////////////////////////////////////////////////// | Contributors License Agreement | IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. @@ -38,7 +43,7 @@ | If you do not agree to this license, do not download, install, | copy or use the software. | - | Copyright (c) 2014, Joseph Howse (Nummist Media Corporation Limited, + | Copyright (c) 2014-2016, Joseph Howse (Nummist Media Corporation Limited, | Halifax, Nova Scotia, Canada). All rights reserved. | | Redistribution and use in source and binary forms, with or without @@ -76,7 +81,7 @@ 24 GAB - 9.9900001287460327e-01 + 9.9500000476837158e-01 5.0000000000000000e-01 9.4999999999999996e-01 1 @@ -84,2325 +89,2674 @@ 256 1 - 15 + 20 <_> - 12 - -1.7687875032424927e+00 + 9 + -1.5429834127426147e+00 <_> - 0 -1 102 391095182 -138018897 -1311235414 -134348801 - -10637363 1363472332 -168428565 -170000676 + 0 -1 104 1599056782 -3801105 836281000 -134348801 -10616883 + 1430585292 -33555461 -170000676 - -3.8902848958969116e-01 7.1630239486694336e-01 + -5.4490309953689575e-01 5.6734609603881836e-01 <_> - 0 -1 266 135269620 1065172957 761273949 1068766640 - -285409281 -1075109889 -1073808385 -1073741825 + 0 -1 294 204479732 1065172189 790634493 1060117940 + -289603585 -1075077121 -1092617217 -1073741825 - -5.0905084609985352e-01 4.4736129045486450e-01 + -5.6601214408874512e-01 3.9540845155715942e-01 <_> - 0 -1 248 -882714626 -11077637 -2105857 -5255203 1594642431 - -536896039 -540028929 266295295 + 0 -1 71 -547356836 1566019389 -77856769 -551952545 + -539172900 -10560035 -52600869 994540299 - -4.0175846219062805e-01 4.7943404316902161e-01 + -4.4183051586151123e-01 4.4477555155754089e-01 <_> - 0 -1 5 -617089137 -547883529 1911919584 -2239534 1530067199 - 1140914475 -1092824836 1892022980 + 0 -1 148 -620691696 486545936 825237297 521165584 436288155 + 536422827 1026760619 523727735 - -4.2830348014831543e-01 4.3316614627838135e-01 + -4.9225500226020813e-01 3.4415841102600098e-01 <_> - 0 -1 103 251265151 2145342812 1501453661 1046368729 - -1975908196 -1105592134 -1897996802 -88470342 + 0 -1 8 2065692655 -539494441 1911927792 -2108480 455801071 + 67664201 -1084369169 1926622918 - -3.9837184548377991e-01 4.3966090679168701e-01 + -4.0782809257507324e-01 3.7964683771133423e-01 <_> - 0 -1 249 653255651 -1427184958 -736368649 -1052429 - 1722766161 -455896464 1155912595 -167811855 + 0 -1 343 791362869 -1075233419 -573079553 -33596427 + -1610973955 -262147 1026375359 -1107337903 - -3.9872139692306519e-01 3.9076396822929382e-01 + -4.4104734063148499e-01 3.3767992258071899e-01 <_> - 0 -1 98 -147601648 452990736 522407185 1599686417 1169689768 - 407507112 -1762308210 1599803223 + 0 -1 247 -770966446 -10095278 -717226475 1462226875 + 1326402382 -70331239 1175244766 1326179231 - -4.5285862684249878e-01 3.3382070064544678e-01 + -3.6573803424835205e-01 4.1576108336448669e-01 <_> - 0 -1 300 805836816 1351616140 -1629160611 -1696006160 - 2133143824 -1418430667 -1093085224 -91160647 + 0 -1 137 -1898553987 -42050596 -1074372609 -38388009 + -50700804 -268436101 -352819484 -1163887504 - -5.1765918731689453e-01 2.8637027740478516e-01 + -4.2117568850517273e-01 3.3924096822738647e-01 <_> - 0 -1 206 771753813 1072999924 -637907073 1072594908 - 1022435188 -1073874507 -1076936836 -1141628556 + 0 -1 188 -321131994 712703979 -1157694222 586350586 + 1085998084 1281738876 -403229068 -925369374 - -4.5144259929656982e-01 3.3236411213874817e-01 - <_> - - 0 -1 188 -1493176369 712675187 -55120016 -1570308126 - 1845183255 -34048033 -1090533504 -386469418 - - -3.6836385726928711e-01 4.1354060173034668e-01 - <_> - - 0 -1 84 1876927247 -103435857 821334050 -202379046 - -607136374 354198146 1878387370 -455740474 - - -3.8681995868682861e-01 3.9221677184104919e-01 - <_> - - 0 -1 85 70388767 580795691 -83467 1051082410 -287417474 - -1076176594 -57439237 -1430597793 - - -4.1789534687995911e-01 3.5533955693244934e-01 + -5.1358664035797119e-01 2.6718941330909729e-01 <_> - 13 - -1.3504111766815186e+00 + 12 + -1.2918862104415894e+00 <_> - 0 -1 52 -582353192 453631753 -1189740547 490856223 - -1064974120 -1927684129 1413925631 151519071 + 0 -1 54 1397073902 2013244398 -177098006 -201331986 + 2002780074 1006612398 -1110 -67132758 - -2.2373910248279572e-01 6.7752838134765625e-01 + -4.0280899405479431e-01 5.0070983171463013e-01 <_> - 0 -1 213 -576729857 454575443 -1996943617 536547583 - 206047452 -1088734277 210521343 264241151 + 0 -1 80 -16823041 -41857 205806847 509368831 -1431699272 + -130942 167828670 -635806469 - -3.7819463014602661e-01 5.2549731731414795e-01 + -3.7250527739524841e-01 4.8033073544502258e-01 <_> - 0 -1 275 -249562832 -1181502479 -174589519 -1112427119 - -1189167448 -1081345300 -1534158677 -1431310669 + 0 -1 228 -866136833 419433907 182275839 536546047 201854172 + 28121467 214781439 268402175 - -3.6486798524856567e-01 4.7923672199249268e-01 + -4.5891678333282471e-01 3.6297130584716797e-01 <_> - 0 -1 125 -1405482952 -15924365 -1147527681 -10535319 - -1345282310 -1103133 698354938 -1073790989 + 0 -1 270 -1561337117 -1426066718 -1010829325 -38805262 + 1202713555 -324545872 1441789815 -134233869 - -4.9668836593627930e-01 3.3489266037940979e-01 + -3.5680472850799561e-01 4.3237748742103577e-01 <_> - 0 -1 82 2135911182 -553255561 -1835761112 -744206088 - 1443360719 1427151980 -208273409 -136971281 + 0 -1 259 -597278700 268435458 -550058223 855800610 149425288 + 775302951 -118555396 -272630117 - -4.9673599004745483e-01 2.9186215996742249e-01 + -4.8106637597084045e-01 2.9466137290000916e-01 <_> - 0 -1 64 750650461 -1141224741 228524031 1066678329 - -392530945 -1119829 -389633282 -1909948481 + 0 -1 327 -1111901448 1023973552 253008120 500562168 -5242881 + -1156710915 1340989437 -536879105 - -4.4474920630455017e-01 3.3087861537933350e-01 + -3.2977777719497681e-01 4.3013024330139160e-01 <_> - 0 -1 80 -8364 961050640 -337450 -170150085 -4518372 - 1480613384 -270925857 -203948193 + 0 -1 77 -537179120 521143296 -21635309 2134891643 1350441722 + -632386648 -1129300294 -263173 - -3.6774283647537231e-01 3.8125535845756531e-01 + -3.6992338299751282e-01 3.5658127069473267e-01 <_> - 0 -1 304 -1279559723 488853328 894958865 523048208 - -1111801861 -1113625095 -1410843652 -1615113099 + 0 -1 164 -1362153945 741281595 -1496274305 720813755 + 2088729719 2146431455 -251775916 -185278474 - -3.8107365369796753e-01 3.7617510557174683e-01 + -4.7965702414512634e-01 2.5329035520553589e-01 <_> - 0 -1 27 -1038891372 866262272 -1124866827 -7307515 2556056 - -1947784189 145625549 -537934001 + 0 -1 129 2009068661 286465811 -1714126495 320044919 + -321273376 1216088341 -187041632 276299767 - -3.3774635195732117e-01 4.1467228531837463e-01 + -4.0860968828201294e-01 3.0382931232452393e-01 <_> - 0 -1 214 1313841735 674152170 -1368464720 -1597048870 - 759309825 -295860621 1709856085 -587729545 + 0 -1 222 70785877 1041800816 -75508353 1071923196 2113290236 + -1074941012 -1075086339 -1351740304 - -4.4100293517112732e-01 3.1954705715179443e-01 + -3.9227196574211121e-01 3.2063353061676025e-01 <_> - 0 -1 310 -1432731787 -1219055176 -42533035 -1126253868 - -2038280772 -55715078 -2000923144 -1936931520 + 0 -1 52 -733166882 -44852481 -145568001 -15114497 -924915460 + -33678721 -88592641 1063732851 - -4.3541839718818665e-01 3.1401738524436951e-01 + -3.7047380208969116e-01 3.1812894344329834e-01 <_> - 0 -1 180 232552309 -537305729 -3104297 -67617446 -1211085572 - -20391173 -1968567044 -1392871087 + 0 -1 32 -2097737981 1148364791 -1210636301 -1330585805 + 123014973 2113833983 -32925 -236603423 - -3.7881413102149963e-01 3.5767501592636108e-01 - <_> - - 0 -1 46 -36984309 904630143 823414970 -188744006 1900770270 - 1399711367 -473188378 1969748707 - - -4.0620720386505127e-01 3.2759186625480652e-01 + -4.2788907885551453e-01 2.8403493762016296e-01 <_> - 19 - -1.3998974561691284e+00 + 13 + -1.3729060888290405e+00 <_> - 0 -1 128 -236980233 16777207 -520752904 15793139 -168428203 - 1979187191 -33554947 -251920389 + 0 -1 316 1058750395 -1080312336 -1078198785 -3 -1145389058 + -1078318408 -1079328769 -1077958496 - -1.7629407346248627e-01 6.5313565731048584e-01 + -2.5900188088417053e-01 6.1616760492324829e-01 <_> - 0 -1 230 -871825409 -580752385 -713042433 -540061189 - 1549092351 -587761733 1607687679 1577014783 + 0 -1 151 -201887221 1915747883 -218104097 3145727 -92571030 + -117772190 -88408321 -1566377217 - -3.1553706526756287e-01 4.9262753129005432e-01 + -3.7379077076911926e-01 4.5426961779594421e-01 <_> - 0 -1 79 -545306406 -547422721 474111600 -570360321 -507816 - 1599364180 -11379845 -12845089 + 0 -1 96 386868111 1607319551 2145227774 -81921 2136981469 + 1564794828 -3277827 -171573810 - -3.5872745513916016e-01 4.0607807040214539e-01 + -3.5450288653373718e-01 4.5893719792366028e-01 <_> - 0 -1 123 -252337502 -658267397 7348400 821935103 1377280435 - 47000107 -169347101 939467707 + 0 -1 2 -551362576 -73215120 -364212554 -11998256 71434372 + -1616176195 209715400 -840182021 - -5.1070415973663330e-01 2.8583043813705444e-01 + -4.2596518993377686e-01 3.3351564407348633e-01 <_> - 0 -1 45 645859107 708031411 -168346241 -1330581136 81734679 - 783767351 -45193 -34341517 + 0 -1 82 247336735 586821439 -134217729 1056866239 + -1090551809 -9217 -33628162 -1430597650 - -4.4308465719223022e-01 2.9009637236595154e-01 + -3.8904032111167908e-01 3.6951214075088501e-01 <_> - 0 -1 241 -154214396 268437506 -680474855 864167714 684199820 - 204876327 -52122180 -262209 + 0 -1 249 -672137222 -74448921 -21891587 -136323721 + 1322253791 -822281795 1565482863 1465906911 - -4.1140288114547729e-01 2.9478433728218079e-01 + -3.2322180271148682e-01 4.2339357733726501e-01 <_> - 0 -1 265 -1365070662 -380938 -1139629826 -35735556 49021040 - 1020949984 219416278 -293 + 0 -1 319 -1347239947 1069203248 -2097163 -1610678308 + -1879052295 -268437506 -1934079492 -1935110672 - -3.9993125200271606e-01 2.9704034328460693e-01 + -4.0132158994674683e-01 3.3234956860542297e-01 <_> - 0 -1 295 217001265 -1346379851 1862205053 -1342447907 - 30277700 -1360008036 -1988349004 -287317952 + 0 -1 37 -1068709308 -1102522849 1644484342 -268379409 + 1443710532 -11090094 -213845121 -12059649 - -3.9956006407737732e-01 2.8518736362457275e-01 + -4.2390203475952148e-01 2.9791557788848877e-01 <_> - 0 -1 72 290390927 534606847 534719466 -100668033 1607942091 - 1499327373 -101712435 -187324532 + 0 -1 202 -285495441 -1427182081 -290198603 -527241618 + -419467196 -855709209 -268509632 -922957372 - -3.0478826165199280e-01 3.7477290630340576e-01 + -3.6988914012908936e-01 3.4229919314384460e-01 <_> - 0 -1 136 -285336459 2110655990 -2013274145 2143051605 - -1124443700 -9506961 -604210584 -1161806512 + 0 -1 43 -18449 1073711035 -1319386462 -203620626 2070804431 + 854521820 -134545716 1442310948 - -4.0837058424949646e-01 2.7444043755531311e-01 + -4.0420171618461609e-01 3.0070811510086060e-01 <_> - 0 -1 55 -62093618 -581362746 -141373441 -10940834 -840543755 - -638181765 1859448799 996361303 + 0 -1 205 225460085 1069170549 -1213441 -268681410 536639980 + -272859906 -1344397956 -1090621548 - -3.7610772252082825e-01 3.0961802601814270e-01 + -4.0233635902404785e-01 3.1345960497856140e-01 <_> - 0 -1 110 -404233212 134685696 -2016460609 -1379932177 - -540018825 -2163729 806790835 607646519 + 0 -1 65 1347781250 -252185797 18161683 335127199 -918162925 + -68564231 1079360443 1080539939 - -4.3601146340370178e-01 2.5886246562004089e-01 + -4.4784346222877502e-01 2.6452672481536865e-01 <_> - 0 -1 288 -907025790 1474249959 -806494209 -10763 -283444824 - -364917254 -828244229 -1968201565 + 0 -1 40 138021973 914534260 -1628242049 179970033 2088664692 + -279028579 -285573707 -1431115148 - -2.6032009720802307e-01 4.3652611970901489e-01 - <_> - - 0 -1 229 -18370769 -757680277 788372142 -2072580242 - -273678553 745365463 -134222107 -229310606 - - -3.0938607454299927e-01 3.5719990730285645e-01 - <_> - - 0 -1 14 -1603048865 578088863 -390533121 140676846 - -495489499 -42082971 -4194586 -26017865 - - -3.1977957487106323e-01 3.4310647845268250e-01 - <_> - - 0 -1 249 1643111394 -1211240000 1172894578 -641010466 - 1181712375 -2068614428 1433624934 -671119917 - - -3.3919364213943481e-01 3.4504517912864685e-01 - <_> - - 0 -1 164 1606136599 587595301 -21521312 1079307891 62912316 - 2136471350 -285346140 -201854089 - - -3.1577944755554199e-01 3.4307131171226501e-01 - <_> - - 0 -1 152 785525471 1052180799 1060533999 2120755670 - 1316621908 -270833354 -73736274 -361439920 - - -3.4840318560600281e-01 3.2924604415893555e-01 - <_> - - 0 -1 47 1824524292 1056221828 -268623876 -1615033532 - -2092452655 144493033 502744181 -571159100 - - -4.5537719130516052e-01 2.4885603785514832e-01 + -4.6739324927330017e-01 2.6337191462516785e-01 <_> - 17 - -1.6478537321090698e+00 + 15 + -1.3434195518493652e+00 <_> - 0 -1 99 1126020910 939511791 -137494546 -134218002 928378510 - 667815688 -131090 -21878 + 0 -1 312 1594941436 -539099137 1597374397 2136866813 + 2133434303 -2359299 -180801 532360959 - -1.9173553586006165e-01 6.1490827798843384e-01 + -3.9849624037742615e-01 4.3070858716964722e-01 <_> - 0 -1 277 1066647483 -1078215472 -1078199809 -515 -1078280194 - -1079276888 -1112801281 -1077956952 + 0 -1 107 -1687737718 -136351793 819208354 -201466130 + -304104530 1430290438 -74187782 -254479670 - -2.5890102982521057e-01 6.0596489906311035e-01 + -5.2847045660018921e-01 2.9759022593498230e-01 <_> - 0 -1 280 -1347239939 -1078263848 -6291491 -1073954860 - -1883246595 -1075838997 -1346850307 -1393015372 + 0 -1 106 1593187583 -57860 494558719 1568543997 -1430627078 + -17168194 -22085633 -17167126 - -3.5419720411300659e-01 3.9201220870018005e-01 + -3.2349127531051636e-01 4.4297724962234497e-01 <_> - 0 -1 148 -16582767 990936848 -15337711 1024534289 522275741 - 530061615 1786740027 2132761183 + 0 -1 233 -289936401 719515647 1894970098 -67961857 + 1429694295 1079178739 1417049205 -235416077 - -4.0790781378746033e-01 3.3604335784912109e-01 + -4.0733993053436279e-01 3.3705353736877441e-01 <_> - 0 -1 33 -1024790785 -33673381 -715534345 -5787889 -721957121 - -17850629 -654587205 -27048190 + 0 -1 338 -804225008 -1130847023 -1644863659 -626985985 + -1151011816 -67830287 -1090585640 -72811781 - -3.0084383487701416e-01 4.4991242885589600e-01 + -4.0251138806343079e-01 3.1045806407928467e-01 <_> - 0 -1 173 779038223 578498431 -26263553 -1430717601 - 1426011767 1870118397 -726064396 -184550929 + 0 -1 30 1325133735 -235668011 -4196493 -1297076240 37159747 + -1078198341 -5247041 -17338573 - -4.3469619750976562e-01 2.9388919472694397e-01 + -3.5516351461410522e-01 3.3867400884628296e-01 <_> - 0 -1 207 11804501 -1074249744 2143289343 -1359077380 - 2074886065 -262692 -1075003396 -1431820272 + 0 -1 61 1563885570 990015234 1715350066 -1612515566 + 2121997646 -562425 -1460130098 -2 - -4.1263562440872192e-01 2.8357046842575073e-01 + -3.6495906114578247e-01 3.1801441311836243e-01 <_> - 0 -1 263 -620104768 -83232282 -548406795 -1074143767 - -828717122 -21770245 251698105 68943602 + 0 -1 35 -486805761 -30385 -164631585 -67393017 -662962177 + -269484302 -302258246 -298365693 - -3.8648277521133423e-01 3.0467325448989868e-01 + -2.5626540184020996e-01 4.6705508232116699e-01 <_> - 0 -1 161 1391411790 41936415 -228930992 1892677067 - 1987802112 1480885434 -1362 -219942962 + 0 -1 242 582106997 -1375949832 -2097155 -1611859716 + -1078984707 -71372812 -1174471336 -1364685600 - -3.7596645951271057e-01 3.1412878632545471e-01 + -3.4055373072624207e-01 3.2303497195243835e-01 <_> - 0 -1 308 248452913 1071429554 -251663105 -538972499 - -1928628395 -1346437645 -1745150348 -33596064 + 0 -1 213 1857005319 651918339 -1159732176 -294652937 + 2146914899 1349774535 -2097404 -50856010 - -3.9380916953086853e-01 2.8952071070671082e-01 + -3.3969157934188843e-01 3.1695431470870972e-01 <_> - 0 -1 182 626985985 930297719 -286325569 -147866829 - -692197027 2138802865 -117701012 -118164992 + 0 -1 292 -1364537606 -1925122 -36259590 -102826180 + -2098986320 243153064 -1515278601 -137380105 - -3.5818240046501160e-01 3.2363671064376831e-01 + -3.3688172698020935e-01 3.2412472367286682e-01 <_> - 0 -1 60 -1361623937 -1149491078 5825754 508056955 -88210408 - -655077264 -1174209542 -33408130 + 0 -1 211 -824758745 174632251 -469831961 -1428162053 + 1157038145 213857255 -186772236 -185273869 - -3.4054177999496460e-01 3.2592311501502991e-01 + -4.0657189488410950e-01 2.5756362080574036e-01 <_> - 0 -1 184 1311738415 -1375274001 1726672390 -829228034 - 2070837764 1208920803 -67308591 -419954764 + 0 -1 110 -16884641 -36276290 -160105525 -659501198 -652220 + -295070 -2176776 -15009184 - -3.7184986472129822e-01 2.8876912593841553e-01 + -2.8538039326667786e-01 3.6766386032104492e-01 <_> - 0 -1 1 -566173704 -81765536 -328487245 -545227007 8650948 - -1342492099 8915104 -307505157 + 0 -1 90 -792331710 -1069030682 13697279 -2057320217 + -175702061 -60841468 -222841601 1783605027 - -3.2362362742424011e-01 3.4028744697570801e-01 + -3.4717887639999390e-01 2.9574045538902283e-01 <_> - 0 -1 223 787644405 1052643324 -671622145 1060113936 - -1543669260 -621052931 497506684 -1094759403 + 0 -1 234 749378744 935105716 -1397302147 1001388025 + 255328920 -1799926224 -1397966593 -1074790917 - -3.8580575585365295e-01 2.8625565767288208e-01 - <_> - - 0 -1 90 -754941560 -598092101 -1244290303 281751211 - 1463866633 1153550863 -806946917 38740739 - - -4.4092047214508057e-01 2.5595286488533020e-01 - <_> - - 0 -1 167 184294525 -9037826 -21186597 -1497857980 - -1372058532 -1233225231 -341673474 -1099675796 - - -3.7506091594696045e-01 2.9585087299346924e-01 + -3.7167704105377197e-01 2.8397652506828308e-01 <_> - 21 - -1.4008288383483887e+00 + 15 + -1.2288014888763428e+00 <_> - 0 -1 233 -814746846 -2111111254 -553913104 -2097922 - 2004869959 1141046786 1970763104 -134744334 + 0 -1 271 -290784257 -542572545 -167807627 -2061 209652223 + -1093158913 1157580031 1173837303 - -2.1097929775714874e-01 5.7671958208084106e-01 + -3.3414435386657715e-01 4.7178736329078674e-01 <_> - 0 -1 75 -8396836 -538976473 -16384001 -10879489 -8397857 - -10498599 -45416465 1595899679 + 0 -1 317 -2098253 -1146358896 1476391185 -704777743 + -1140850693 -1415582030 -7696 -640683845 - -3.1942996382713318e-01 4.6969848871231079e-01 + -2.5055918097496033e-01 5.2570897340774536e-01 <_> - 0 -1 4 -824512541 -524299 -344077 -72323247 206048519 - -1409589837 -84975873 -805875917 + 0 -1 132 -100663299 272629759 -789195536 544341979 + -167781039 1966601201 -515 -234881025 - -3.0280569195747375e-01 4.2180880904197693e-01 + -3.5798946022987366e-01 3.6239877343177795e-01 <_> - 0 -1 290 -1086615304 956872912 223108216 496889077 - -1097860099 956429808 1601034749 -538976769 + 0 -1 48 -2105507696 -1366759952 -1126500363 -570630416 + -317934356 -33619969 -36643332 -2304812 - -3.5371550917625427e-01 3.6481952667236328e-01 + -3.9822307229042053e-01 2.8633421659469604e-01 <_> - 0 -1 146 -85985781 1914665473 1351604943 269482959 - -118967717 -264571342 -71633409 -1574764609 + 0 -1 74 -792677742 -101713185 7352369 298695163 -1761297729 + 6029312 -25184257 1608465947 - -3.5075160861015320e-01 3.4602758288383484e-01 + -4.2175698280334473e-01 2.4120111763477325e-01 <_> - 0 -1 81 -579450864 489695248 -568994533 -671905287 - 1484394168 -21040594 -1132978498 -4358 + 0 -1 223 169615221 -1174487300 -281051137 -1090642276 + -4703305 -33558539 1073692156 -1359214592 - -3.6514815688133240e-01 3.3418157696723938e-01 + -3.8317176699638367e-01 2.8932854533195496e-01 <_> - 0 -1 300 -1071640576 -1794071852 -589571267 -622299971 - -128680624 -107152175 -1128604712 -93782371 + 0 -1 75 -102806438 -9703431 1045568568 503377755 -547864488 + 1534349686 1867669466 -82706561 - -4.3749809265136719e-01 2.3641848564147949e-01 + -3.8330292701721191e-01 2.9036629199981689e-01 <_> - 0 -1 43 1347789474 278788859 1078009887 1450704633 755482275 - -890279806 1601682923 1145430595 + 0 -1 332 784272181 -1073742539 -554188937 -67127948 + 938153105 -1091568641 -1917947412 -2140908 - -4.5889991521835327e-01 2.1458856761455536e-01 + -3.4002754092216492e-01 3.1559377908706665e-01 <_> - 0 -1 58 -67811136 507778012 2090770170 940627838 -547680164 - -564395008 -1507362 -15533189 + 0 -1 214 256847367 707514298 -1090536922 -286331166 + 1877943126 258930467 -52826284 -50858080 - -3.4613710641860962e-01 2.9729354381561279e-01 + -4.0559005737304688e-01 2.5587162375450134e-01 <_> - 0 -1 40 708451453 915939127 2086399799 -1364049961 - -111247856 -278977 -562528515 -1432293672 + 0 -1 210 -176953385 839001603 -118293121 -46662093 + -928341523 783159107 1824812218 -294654113 - -4.1620507836341858e-01 2.4089127779006958e-01 + -2.2742739319801331e-01 4.4131305813789368e-01 <_> - 0 -1 279 -1423966541 177905074 -199210 -1914114123 - 1966529760 -2068908586 -574294864 -841165576 + 0 -1 291 -292556917 -268603344 -882511881 -142650156 + -1955672434 -84524073 -941787305 -807451567 - -3.1373840570449829e-01 3.2040333747863770e-01 + -2.8523033857345581e-01 3.5285699367523193e-01 <_> - 0 -1 198 1848585743 -1940984369 1618804030 -285289836 - 1994084869 67912305 -4262128 -303498266 + 0 -1 86 -1006633234 -8464643 -1800132448 -126160132 + 1597972294 2137374137 2130142532 -67635593 - -3.6098247766494751e-01 2.7308923006057739e-01 + -3.6786875128746033e-01 2.6055160164833069e-01 <_> - 0 -1 83 -34593 -42134437 83156217 534796439 -206958426 - -542489456 -301270341 -1910021 + 0 -1 347 809435409 188951103 -1134973121 -1196245185 + 926905404 -2113948 -1122058375 -93651077 - -2.1900075674057007e-01 4.6534782648086548e-01 + -3.1239312887191772e-01 3.1785130500793457e-01 <_> - 0 -1 255 -732498730 808132612 -1694705650 637674514 - -856846932 790002977 -1523128100 -5768257 + 0 -1 47 -242549308 -1693329125 2124733233 857453163 + -233386788 -69871665 -1055992678 173495071 - -3.0635869503021240e-01 3.2308223843574524e-01 + -3.7436348199844360e-01 2.9003840684890747e-01 <_> - 0 -1 142 -272658653 -2039881873 -1093759223 -295772198 - 316478038 1219928242 1542411604 -523960875 + 0 -1 88 1543496623 -1277707265 1375580878 -1141900354 + -202408001 1073719014 -20973842 -454167574 - -4.1005435585975647e-01 2.4376337230205536e-01 - <_> - - 0 -1 314 -1886651248 233035768 -579887888 -644481803 - -1924527808 72215888 -813972012 -838860849 - - -3.2710522413253784e-01 3.0177840590476990e-01 - <_> - - 0 -1 109 -626385315 -541893255 -289637249 -2982538 - -285318128 -335644678 -934750724 -1937614 - - -3.0264344811439514e-01 3.4333297610282898e-01 - <_> - - 0 -1 127 -675308008 858262544 -546392130 -86565344 889738476 - 1024209296 -539034113 -17892421 - - -3.0164864659309387e-01 3.2610884308815002e-01 - <_> - - 0 -1 76 289874895 1574889454 356325874 -1257339986 - 2013148111 1523362314 -209587256 -51584276 - - -3.0728715658187866e-01 3.2666257023811340e-01 - <_> - - 0 -1 191 207364212 -1629723097 -69798913 180098791 445713016 - -1342538933 -112443395 -1436022512 - - -4.8653569817543030e-01 2.1469378471374512e-01 - <_> - - 0 -1 316 -1891992271 534502897 -709725931 -1133905467 - -1625325679 -1098169635 -1377993223 -1175556795 - - -3.6775574088096619e-01 2.6944977045059204e-01 + -2.5309252738952637e-01 3.8837322592735291e-01 <_> - 20 - -1.6370692253112793e+00 + 17 + -1.3014856576919556e+00 <_> - 0 -1 246 -544546902 -40378434 1166794751 -553126475 - 1124863438 -6684681 252464271 252663279 + 0 -1 56 -16777228 1343290737 -73730 1979579903 -167772964 + 1145364445 -1 1969225695 - -1.7677198350429535e-01 5.9283459186553955e-01 + -3.7386018037796021e-01 4.0434870123863220e-01 <_> - 0 -1 105 -1688231254 -136322578 542408738 -167781650 - -284181590 88186882 -74646534 -254480182 + 0 -1 329 -1078722575 -1078454128 991133557 -4369067 + -1079247105 -1145394016 522813437 -1080337223 - -4.8250266909599304e-01 3.2293373346328735e-01 + -3.0502972006797791e-01 4.3909499049186707e-01 <_> - 0 -1 291 -1087113223 -1153788752 923893117 -40019499 - -1444151361 -1145394000 520297981 -7610887 + 0 -1 252 -806361310 -492110674 -268445968 -1049642 + 2002778951 1024456291 2012705892 -135792649 - -2.7269113063812256e-01 4.6762999892234802e-01 + -4.1819226741790771e-01 2.9456692934036255e-01 <_> - 0 -1 163 1431698391 477399807 5291197 215258107 2097218267 - 1070271552 1347764095 1497759739 + 0 -1 279 -52962084 805379072 -99820514 1040191240 -857961316 + -1164230721 -318841633 -1185 - -3.6439743638038635e-01 3.3937779068946838e-01 + -3.2393226027488708e-01 3.5176092386245728e-01 <_> - 0 -1 49 -494878000 -1408572168 -1216184843 -570753839 - -1385631492 -1572929 -37698091 -140075 + 0 -1 131 -148956144 992812800 463421370 920482344 + -1626551044 512506296 -8586248 -4198469 - -3.4019106626510620e-01 3.2104432582855225e-01 + -4.0920355916023254e-01 2.6287314295768738e-01 <_> - 0 -1 101 -15196934 2140689563 1546672602 1591347871 - 1544035576 488135152 2142261182 -4259841 + 0 -1 67 -1947229405 577929191 -1142967369 819199477 + 1610560307 1002176493 -268443355 -185204747 - -3.7342280149459839e-01 2.8317087888717651e-01 + -3.9257824420928955e-01 2.6880934834480286e-01 <_> - 0 -1 195 -357586129 70201151 -292424585 -1468006937 - 1163158101 45494091 -492310284 -184618257 + 0 -1 173 2136997887 492685274 610548733 501067503 1428159743 + 139549608 1843232763 1146223423 - -4.2928436398506165e-01 2.4182404577732086e-01 + -2.6709714531898499e-01 3.5500597953796387e-01 <_> - 0 -1 219 -346034385 -1509510400 -590396300 -56691898 - -2013314811 -11148442 -790137804 -17301901 + 0 -1 323 -173546237 2012723003 -208685715 1965110275 + -1648389341 -1207969861 -1532023285 -2068848597 - -3.2902050018310547e-01 3.1380781531333923e-01 + -2.9938983917236328e-01 3.2542988657951355e-01 <_> - 0 -1 276 51573280 869252567 856020959 2136817673 -1825854798 - 1786292453 1863958011 51070032 + 0 -1 72 -1025850814 -226835760 -10485921 -537564929 + 1390123691 -201328836 -1152983169 -229685189 - -4.4989612698554993e-01 2.3105476796627045e-01 + -2.8262135386466980e-01 3.3869415521621704e-01 <_> - 0 -1 239 221945781 -1351824656 -369627303 -1616906768 - 180205816 -1398111810 986511580 -2002860624 + 0 -1 300 186646459 772435664 -277088299 -811293964 510621556 + -2003902767 768513520 -858982156 - -3.3374428749084473e-01 3.0387389659881592e-01 + -3.5066390037536621e-01 2.6261052489280701e-01 <_> - 0 -1 88 -12577 1384049145 -1464090918 -265274512 1423314444 - -330608884 -134684970 -95228557 + 0 -1 277 -1901527179 -1079583240 1608384509 -1214321156 + -1475544131 -1618224659 -1350140680 -1343693700 - -2.9424193501472473e-01 3.4667330980300903e-01 + -3.1748643517494202e-01 2.9679971933364868e-01 <_> - 0 -1 215 -349179217 304152230 -725813534 -44849422 206658671 - 1343674791 1143817582 1414000887 + 0 -1 57 -1370792705 -151110594 137920254 505970139 -16908198 + -119123852 2113992958 -27118721 - -3.5459104180335999e-01 2.8464645147323608e-01 + -2.9851835966110229e-01 3.1736648082733154e-01 <_> - 0 -1 44 2135942447 398828943 961557154 -85264382 -9441329 - 191609019 -135559186 1155988198 + 0 -1 34 -421870864 -121460494 -69399301 -37695628 1854146044 + -572886810 -1662657067 -2754955 - -3.9276805520057678e-01 2.5532895326614380e-01 + -3.1197559833526611e-01 2.9238173365592957e-01 <_> - 0 -1 322 792354069 -1442292348 -725922817 -1075650752 - -1345299339 -270808291 1585978709 -1363456899 + 0 -1 20 -395053825 -1172089085 -20972641 -36479168 16188668 + 170858277 1862209791 -43004073 - -4.0223011374473572e-01 2.3934543132781982e-01 + -2.6653704047203064e-01 3.6648163199424744e-01 <_> - 0 -1 51 -963985190 526195161 -632047017 -13433768 -170216210 - -584509261 -1147462405 2122007633 + 0 -1 162 -876099570 -1028677841 346016622 -791218210 + -798236064 1141175622 -19929374 -733615388 - -3.5836115479469299e-01 2.7841308712959290e-01 + -3.3825182914733887e-01 2.6917472481727600e-01 <_> - 0 -1 69 1282640527 -221028405 -1115770991 -1312815327 - 518459295 -5010698 -8421409 -52340448 + 0 -1 314 268538656 1006620135 2070388735 2065690825 + -1156937026 -1545866585 -350495013 193696921 - -3.0360385775566101e-01 3.3305782079696655e-01 + -3.5214114189147949e-01 2.6037210226058960e-01 <_> - 0 -1 63 240090463 1543015448 1657994909 1376934782 - 2121953054 -3393448 774963198 -364875945 + 0 -1 344 649287281 -1970393800 -524355 1006436977 + -1880457436 -1364230690 -575458832 -1711323724 - -3.1514179706573486e-01 3.1063860654830933e-01 - <_> - - 0 -1 149 -117441008 272437552 -2011728848 808844177 - -115035003 901066096 -392587048 829815772 - - -4.1897901892662048e-01 2.3548045754432678e-01 - <_> - - 0 -1 41 -285250029 -1342531469 -1337688454 76061301 - 2140621344 -26490526 -230505742 -498673325 - - -3.7328067421913147e-01 2.7277800440788269e-01 - <_> - - 0 -1 186 197109511 113539807 -1663738276 652405614 - 2079664708 -1381909716 -83887277 -340414799 - - -3.5890376567840576e-01 2.7977034449577332e-01 + -3.5447227954864502e-01 2.6205524802207947e-01 <_> - 24 - -1.3530069589614868e+00 + 19 + -1.5306358337402344e+00 <_> - 0 -1 231 -607125512 -203956738 -146407939 -549587593 - 2106032085 -7015967 1296916047 1465901007 + 0 -1 325 -14630984 -4473090 -1074397189 -33964034 -72302598 + -1074020356 -1073741825 798731006 - -1.2551400065422058e-01 6.0037857294082642e-01 + -3.5602328181266785e-01 4.2827311158180237e-01 <_> - 0 -1 126 -12041 289127191 -1961178373 858913587 -452995643 - -573056619 -184946437 811859443 + 0 -1 130 -551551009 486645509 1899748147 355677975 222889183 + -1073921969 -8405249 863993727 - -3.1659016013145447e-01 4.0386086702346802e-01 + -3.4908288717269897e-01 3.5527125000953674e-01 <_> - 0 -1 305 -4456453 -1079345488 1601271281 1566430416 - -1145044997 -1363497544 -807547663 -846209539 + 0 -1 98 1599900924 -103183170 2077315071 -8544581 2147076347 + -348676 -6751554 1039993019 - -2.4047850072383881e-01 4.9467754364013672e-01 + -4.1958260536193848e-01 2.6830750703811646e-01 <_> - 0 -1 205 -422843738 730826189 -93007646 -1561338070 - 1156254860 82792447 -359691576 -318767125 + 0 -1 341 -551306566 -1928790024 409301104 -570567172 + 155380464 201374866 1307966709 -840957953 - -4.0942522883415222e-01 2.8118029236793518e-01 + -2.9362049698829651e-01 3.5112550854682922e-01 <_> - 0 -1 130 286242991 1430640951 -1315388758 -5384739 - 1897658847 1435892732 -241122312 -190447622 + 0 -1 159 -25168073 792404277 -1048577 -1077938185 -50397955 + -1125161865 -118697795 -17040197 - -3.6675310134887695e-01 2.7747273445129395e-01 + -2.4668307602405548e-01 4.3156060576438904e-01 <_> - 0 -1 155 -360711817 1044065557 -202645505 -1078462473 - -554253058 -123796300 -991681292 -117447077 + 0 -1 102 -254483728 -134352193 1078993009 -438445569 + -145493001 236195840 2010188607 803207983 - -2.2938863933086395e-01 4.3152013421058655e-01 + -4.0355175733566284e-01 2.2437272965908051e-01 <_> - 0 -1 33 -486546689 -38568697 -114385161 -1078244605 - -1398768130 -16859405 -387455605 -95221245 + 0 -1 270 543941090 32109282 -158607600 -539249547 1450174403 + -2037673760 1430348867 -706789133 - -2.5292310118675232e-01 4.0669292211532593e-01 + -3.8295698165893555e-01 2.4519409239292145e-01 <_> - 0 -1 197 -347108861 707787566 -271712714 -286066182 - 1660625669 23327763 -118368650 -16781581 + 0 -1 194 1820081525 1073508181 -237185025 -1627884305 + -1208341124 -1549315 786959612 -1360889776 - -3.2693040370941162e-01 2.9912397265434265e-01 + -3.9130604267120361e-01 2.4020861089229584e-01 <_> - 0 -1 48 44773155 -1400496480 -2013315201 -2130179 1928269391 - 2146108387 1871512017 -2109991 + 0 -1 123 -126746406 -16910241 1317990340 2140139227 + -152170248 -665943862 -494767108 -1308598001 - -3.1153312325477600e-01 3.0730357766151428e-01 + -3.3991897106170654e-01 2.5616830587387085e-01 <_> - 0 -1 277 817397681 -4651712 -1074593921 -4489223 -1464975366 - -1080350544 1068207931 -1414856608 + 0 -1 169 -25173426 1157590007 -1462405486 9141882 1563902020 + 1986233998 -121111822 1375206347 - -2.7505692839622498e-01 3.4677764773368835e-01 + -3.9309167861938477e-01 2.3203048110008240e-01 <_> - 0 -1 158 -805311870 -1362548369 -186736224 -220270666 - 1742698308 1147947264 -251792176 -789512618 + 0 -1 119 -2109765118 -1549312122 1974331919 -15794219 + -68435067 -10513465 -203437628 -207886460 - -3.9942753314971924e-01 2.4047489464282990e-01 + -3.2824972271919250e-01 2.5953757762908936e-01 <_> - 0 -1 65 -700036014 -675626240 648044818 -69944464 -389395237 - -215288017 -1719763715 -12588054 + 0 -1 293 532419764 -2413864 1004477621 931662384 -1970602497 + -1095996537 -839968773 -1411438117 - -3.1749448180198669e-01 3.0149078369140625e-01 + -4.1732871532440186e-01 2.0762878656387329e-01 <_> - 0 -1 319 765664309 -1401170476 -22282241 -1880818860 - -1688316571 -52824373 -1730200112 -889291499 + 0 -1 139 1857947903 1492633971 -1101013025 975886606 + 1350846468 -121757915 -130875788 -869224848 - -3.5558241605758667e-01 2.6557549834251404e-01 + -3.4800508618354797e-01 2.4446432292461395e-01 <_> - 0 -1 272 -1164201800 -1716289100 -378039852 -1409579788 - -1121338919 -1880520559 932112367 -1869871980 + 0 -1 103 -2466598 -4662086 -978313286 -784675555 454565560 + 487593980 1603337147 -7147781 - -3.6485251784324646e-01 2.5734969973564148e-01 + -2.7047672867774963e-01 3.1779998540878296e-01 <_> - 0 -1 22 -21049601 -25866473 325725 1043995470 1592678894 - -269259937 -971837858 -8913089 + 0 -1 109 -1561869790 120520547 1657708544 -1898513430 + -1614825521 2092432685 1538717248 -289931533 - -2.2092992067337036e-01 4.2716163396835327e-01 + -4.0362039208412170e-01 2.1034663915634155e-01 <_> - 0 -1 138 763233167 2004741991 -277961986 -35997914 897543679 - 1741158903 -50331667 -1578882304 + 0 -1 180 1084531215 -707808258 -1210116245 -439570458 + 897553343 1907884029 -135266566 -188437888 - -3.0084916949272156e-01 3.0936580896377563e-01 + -2.8848439455032349e-01 2.9848706722259521e-01 <_> - 0 -1 92 66036611 -2133412515 2136683646 -184645734 - 1604280073 202711897 -1379383 -186590399 + 0 -1 70 -526324565 -2473047 -1752530953 -720765307 + -829754181 -88588561 725799882 -1423966207 - -3.7059250473976135e-01 2.4178710579872131e-01 + -2.9072195291519165e-01 2.8631457686424255e-01 <_> - 0 -1 196 -326382376 361846096 -2045590179 1068964371 - 705563792 -1156488704 1208497115 994048507 + 0 -1 186 -1035688188 -2075351177 1742138910 -1361646049 + 2038259221 1281666845 -10016229 -927864043 - -3.2299432158470154e-01 2.8366291522979736e-01 + -4.0738871693611145e-01 2.1433149278163910e-01 <_> - 0 -1 70 -412097022 -1568018524 -1342448718 -1253932 - -1260185663 1258275150 -2067820288 -138937659 + 0 -1 111 -193049515 -579904651 -1078067337 -1125110406 + 657196408 -308999 -269432520 -1626310360 - -3.5679051280021667e-01 2.6213440299034119e-01 - <_> - - 0 -1 193 -714615533 270672129 -306258157 -1758339253 - 47808742 -1902768889 -1941903362 -893526249 - - -2.5351437926292419e-01 3.6361116170883179e-01 - <_> - - 0 -1 165 -318796273 1227399022 -1369769360 -675875878 - -344383672 1582766693 -86017024 -344793116 - - -3.1456202268600464e-01 3.0873265862464905e-01 - <_> - - 0 -1 93 -1045815078 -235892117 -571835429 -3460789 - -108525848 -1332172392 -1503517894 -1300229375 - - -3.5038644075393677e-01 2.6677846908569336e-01 - <_> - - 0 -1 15 -1976677263 3726998 -392242219 214976380 -1048834204 - -44384235 -81855380 -1434428367 - - -4.1762107610702515e-01 2.1475161612033844e-01 - <_> - - 0 -1 166 209059956 2146573530 1933758719 -1670893344 - -1206231472 -538281424 -605128624 -88975308 - - -4.3403875827789307e-01 2.1460674703121185e-01 + -3.4779027104377747e-01 2.4815729260444641e-01 <_> - 26 - -1.3850060701370239e+00 + 19 + -1.5291346311569214e+00 <_> - 0 -1 250 1118499839 -796332098 -134253196 -6424581 259721215 - -1671186434 100533499 1170700287 + 0 -1 251 -13959169 -28639242 -402655813 -34537805 256249855 + -568918017 1146377727 1413838847 - -1.3170924782752991e-01 5.9910702705383301e-01 + -3.0813953280448914e-01 4.0832179784774780e-01 <_> - 0 -1 94 1570566140 2106702270 -577478657 -9625925 -36328709 - -75449636 -394325 1071454459 + 0 -1 58 -2117889 -6785 -88080641 -1078673830 1592918250 + -130866 -28588321 -67420082 - -3.8424813747406006e-01 3.6834198236465454e-01 + -2.4101538956165314e-01 4.6791258454322815e-01 <_> - 0 -1 278 -136315975 -1187792752 1568109937 -571788877 - -86048838 -1433673030 -1190563400 -1984968261 + 0 -1 104 63906446 1607320575 -243471634 -35783681 + -1106396194 1430561736 -201721409 -168502531 - -2.4970491230487823e-01 4.7245621681213379e-01 + -4.4818142056465149e-01 2.3805019259452820e-01 <_> - 0 -1 155 -25692619 573911103 -1090519553 -1074266633 - -1124204292 -1199619017 -387151619 -1363171157 + 0 -1 313 -201338603 -10642115 1604312349 -1120184061 + -570443331 -16641 -588542516 -1936978931 - -2.7256563305854797e-01 4.0413850545883179e-01 + -2.7106782793998718e-01 3.9553779363632202e-01 <_> - 0 -1 299 270536720 -82027755 -542052353 -744834006 - -172433515 -36839897 -2048335877 -1356137589 + 0 -1 42 -1358982349 -1862229200 -537145985 -1122992815 + 178914341 -1439598077 1593789951 -272634817 - -3.7769773602485657e-01 2.3510186374187469e-01 + -3.2034155726432800e-01 3.0296289920806885e-01 <_> - 0 -1 102 133774 1573843455 290464424 -173151905 771865036 - 1430562872 -109382744 -246039832 + 0 -1 318 -1440743437 235588504 -10494472 -1887027976 + -1288767504 -1398099527 -843000652 -863175440 - -4.7037139534950256e-01 2.0533446967601776e-01 + -3.0287060141563416e-01 3.1029415130615234e-01 <_> - 0 -1 127 -618460144 -1256386552 -1618575940 1972721552 - 469800920 504635776 -846791686 -69254485 + 0 -1 292 -555045126 -361514 762749686 -139778 235667694 + -1093395212 -11471106 -6309889 - -3.5127875208854675e-01 2.5741419196128845e-01 + -3.0765682458877563e-01 3.1880700588226318e-01 <_> - 0 -1 85 150343455 40910711 -1248068641 -1430372421 - -1895949361 -21272033 -331755522 -1431642114 + 0 -1 196 250872917 -68273685 -1078051329 -1082508571 + -1091283460 -1168712 -1417288 -1363666432 - -3.7984871864318848e-01 2.3182238638401031e-01 + -3.3388796448707581e-01 2.7029579877853394e-01 <_> - 0 -1 286 -13916067 -237157163 1069283741 -7496371 - -1771992641 -17192227 -1383805025 -2004252467 + 0 -1 219 -290476795 -465649810 -35918852 -289735302 + -34138796 -84935682 -318770912 -857082906 - -2.1929037570953369e-01 3.8296228647232056e-01 + -3.2501670718193054e-01 2.7079197764396667e-01 <_> - 0 -1 206 9705301 508957948 -71469059 431911901 2041834229 - -1141023756 -38047748 -1432742364 + 0 -1 351 255542577 -1383080455 -134234123 -35669132 + 225794545 -1073809475 501579485 -43919 - -3.4404903650283813e-01 2.3727993667125702e-01 + -3.1916373968124390e-01 2.6903003454208374e-01 <_> - 0 -1 162 -28187574 1457201967 -1799949806 542855772 - -22592508 347566595 -86051214 -254279713 + 0 -1 133 215553112 -1107551056 251485533 -1117840291 + -23183686 -1157685096 148380684 -1359280118 - -3.3773353695869446e-01 2.3899486660957336e-01 + -3.4327763319015503e-01 2.6013481616973877e-01 <_> - 0 -1 78 1353317010 -353449217 14955059 233737419 1113314227 - 1272002592 2140215167 200230499 + 0 -1 229 1781507627 11182978 -1532302414 -453707565 + 2112190021 1230535507 1940017765 -723454538 - -3.5864931344985962e-01 2.1981315314769745e-01 + -4.0361833572387695e-01 2.0124079287052155e-01 <_> - 0 -1 50 -592281584 1487966200 -1782854276 -34165307 - -911392552 -588393496 -86945955 -302569115 + 0 -1 35 1659037435 -1074583282 -585441281 -1142706330 + -487432961 -50689038 -752619781 2119369219 - -2.9026558995246887e-01 2.8104048967361450e-01 + -2.8866782784461975e-01 2.8524476289749146e-01 <_> - 0 -1 301 -14053072 -2064062200 -928567823 -983051523 - 201916593 150423153 -1859132687 -1929383993 + 0 -1 5 -277098501 -426275 -537657353 -80707839 148375995 + -1443515977 -1360028481 -290306189 - -3.2115238904953003e-01 2.5486564636230469e-01 + -2.2325216233730316e-01 4.0045592188835144e-01 <_> - 0 -1 79 -607531822 2133030428 1045592120 922799991 - -1958080364 -631876516 -551887109 -116138161 + 0 -1 342 -12845061 -1146450256 1643999573 -578956079 + -1430327361 -1364660568 1068039673 -826557192 - -2.5716596841812134e-01 3.1999784708023071e-01 + -1.7625236511230469e-01 4.5335152745246887e-01 <_> - 0 -1 7 -1897370238 2088280021 -27542220 955523029 143789824 - -1732421377 -270311431 -319465097 + 0 -1 246 -5334 16170343 -1563618650 -559235090 -213913050 + 543944397 -82347060 -186319018 - -3.7310892343521118e-01 2.2297158837318420e-01 + -3.3681878447532654e-01 2.5925871729850769e-01 <_> - 0 -1 151 2117994623 -596493511 -42869249 2123389533 - -102873516 -1194255940 -1077870956 -1369933454 + 0 -1 200 706711043 240052095 -1057817422 -288572133 + 2104128000 107326306 -142977008 -184549550 - -3.2065725326538086e-01 2.5838941335678101e-01 + -4.0993413329124451e-01 1.9274616241455078e-01 <_> - 0 -1 141 -402659162 81777018 894353956 -1095917410 - 1470100164 1429538625 -675679616 22405077 + 0 -1 207 678842645 -554033765 -299117059 -2195490 787765744 + -85783809 801398270 -1342553048 - -3.9470222592353821e-01 2.1365866065025330e-01 + -3.0899345874786377e-01 2.7749294042587280e-01 <_> - 0 -1 306 371408657 -1390197839 -610304075 -1084394735 - 740911518 -1442850385 1025329500 -1085287308 + 0 -1 239 -352653541 -1464975560 -1711377924 1006431154 + -1914849861 -1997605505 -723791652 -2005992518 - -3.5310438275337219e-01 2.2878694534301758e-01 - <_> - - 0 -1 96 1411399848 1607023650 2118667161 2115963630 - 825267416 -1300086616 866705067 1593838595 - - -3.7212049961090088e-01 2.1682462096214294e-01 - <_> - - 0 -1 236 -1023751505 1654647882 654289424 -221611870 - 1142643327 2865238 1353434162 -218116589 - - -3.0895259976387024e-01 2.7360698580741882e-01 - <_> - - 0 -1 25 263714691 -1500250442 -572970029 1029922655 - 461194497 -1384691616 902512981 -831890189 - - -2.8019675612449646e-01 2.8230005502700806e-01 - <_> - - 0 -1 157 -1009275158 703439343 1881063906 1407643120 - 1357622212 1698779727 -175905592 -799737222 - - -3.0597987771034241e-01 2.6828068494796753e-01 - <_> - - 0 -1 24 -655102849 1007864659 -1544094705 -1540313220 - -574699 -47065227 -1091975362 -278732953 - - -2.5672450661659241e-01 3.1667667627334595e-01 - <_> - - 0 -1 103 347621596 1037305260 358617181 753140063 -61713220 - -610393186 -1106322953 -1350956022 - - -3.4445220232009888e-01 2.3471401631832123e-01 - <_> - - 0 -1 36 -923349290 256096042 219291806 -1155987134 - 2086406828 1508909094 -2007541485 1887403703 - - -3.4530115127563477e-01 2.3805907368659973e-01 + -2.7373707294464111e-01 3.1265005469322205e-01 <_> - 25 - -1.2224140167236328e+00 + 20 + -1.2624083757400513e+00 <_> - 0 -1 252 -22088450 -5325374 -33282 -258 12993776 67429556 - 1976988926 2005923583 + 0 -1 152 -536896171 528166667 -89134213 863190787 -10787 + -42746009 -135004165 861372191 - -1.9573126733303070e-01 5.5536717176437378e-01 + -3.0395314097404480e-01 4.0150311589241028e-01 <_> - 0 -1 216 -941896961 288549683 -965260547 1902502507 - 1287981311 723742655 1157582079 1173354239 + 0 -1 316 1058061817 1069530432 1072045437 -779 -1079460102 + -1078220624 -1086607877 -1347745096 - -3.0669313669204712e-01 3.6197665333747864e-01 + -3.1513056159019470e-01 3.4505581855773926e-01 <_> - 0 -1 62 -571494657 -2099490 -25243649 -1082480054 2115633354 - -130996 -329130274 -67419570 + 0 -1 231 -681586977 321007414 1157254391 -135793561 + 1280068831 961635295 1153779199 1107294463 - -2.4500623345375061e-01 4.3682980537414551e-01 + -3.4076648950576782e-01 2.9044425487518311e-01 <_> - 0 -1 19 -704647185 2113917365 -428522838 -141168226 - 2123362255 2006664827 -254348594 1459088068 + 0 -1 281 13565963 -1605663761 -1068499969 -1551382549 + -957611569 -88150085 -486669105 -489698353 - -3.4159252047538757e-01 2.9353541135787964e-01 + -2.9677531123161316e-01 3.0763381719589233e-01 <_> - 0 -1 285 -138414285 -168045645 -550635909 -240708569 - -36728913 -33554641 -890270582 -2069142366 + 0 -1 326 -1053826398 -721436430 -280231937 -975176521 + -409225541 -71593733 -6291717 -1413486341 - -2.8817924857139587e-01 3.4106674790382385e-01 + -2.8983283042907715e-01 3.1503608822822571e-01 <_> - 0 -1 77 -220544510 -184926009 2147213135 -209757985 - -1177821558 -139002180 845151099 -8701317 + 0 -1 183 1163896751 1977614331 671051643 -138674226 + 2144851967 1470987751 -58725393 -188420220 - -2.2831186652183533e-01 3.8085940480232239e-01 + -2.0130541920661926e-01 3.9263197779655457e-01 <_> - 0 -1 256 12976195 569051735 -1044464777 -2131832853 - -1863693873 -889525281 -1060633090 -1024468017 + 0 -1 38 -16788225 -25265109 -1172116865 974286447 -18980838 + -2269836 -349111681 -30245109 - -3.4035223722457886e-01 2.4870637059211731e-01 + -2.6475778222084045e-01 3.2654273509979248e-01 <_> - 0 -1 225 243431285 -1342397538 -1074439183 -198404 - -1147339787 -1950366979 -1176535299 -1346857836 + 0 -1 84 1433881682 1597703946 1291197240 -9438094 1526162906 + -394281474 -50917514 -414 - -2.9916274547576904e-01 2.7878564596176147e-01 + -2.9093095660209656e-01 2.9709726572036743e-01 <_> - 0 -1 188 -389107962 -1496674445 -1433293856 1650520822 - -808004780 -340166498 -270808076 -327882656 + 0 -1 49 -603945842 -1315963413 -414862337 -9040081 + -925350721 -117485633 -68928293 841171459 - -3.6523097753524780e-01 2.3002453148365021e-01 + -3.6999693512916565e-01 2.1880353987216949e-01 <_> - 0 -1 249 -1561660693 -1964116758 -433068176 -674252332 - 76465114 -86789644 1441781719 -167788045 + 0 -1 335 -235151561 906503990 -6316714 948108800 -319324675 + -16843053 -603980191 -117506534 - -2.6452550292015076e-01 3.1857562065124512e-01 + -2.7334323525428772e-01 3.0180162191390991e-01 <_> - 0 -1 30 83758542 1352905533 -25477260 888412977 1174342621 - -581240613 -1877419 954559493 + 0 -1 66 -1413764333 724760368 601747389 -6095968 37694209 + -1342441059 92217889 -273154057 - -3.9430552721023560e-01 2.1380217373371124e-01 + -2.6323935389518738e-01 2.9735177755355835e-01 <_> - 0 -1 291 1060338993 -1618339632 1411411797 -1111518927 - 1038801631 -1171216200 431569585 -1627714192 + 0 -1 163 -335559766 -453021782 -323533214 1893203877 + -270539322 17588935 -186715916 -252379394 - -3.1174781918525696e-01 2.5848281383514404e-01 + -3.0761030316352844e-01 2.5141632556915283e-01 <_> - 0 -1 174 1272433155 241160959 -187054076 -1428167714 - 1656705620 178680903 -188744156 -92279086 + 0 -1 328 -13631567 -1212417327 403124577 89128053 905935803 + 805306111 455804405 -1913655045 - -3.5104271769523621e-01 2.4124261736869812e-01 + -2.4577388167381287e-01 3.1640377640724182e-01 <_> - 0 -1 100 276007552 1448970891 1624277552 1433388541 - -144262781 203467264 -747113541 1187367471 + 0 -1 338 -1805103104 -204178216 -1109225537 -645859592 + -1179295532 -17539075 -1342640193 -1085605221 - -4.3640381097793579e-01 2.0373314619064331e-01 + -2.7292105555534363e-01 2.8334984183311462e-01 <_> - 0 -1 265 514492090 -1084506382 802327294 -574652997 - -1951495942 -1115800400 -1734105369 -745080833 + 0 -1 113 184427503 2077949879 2130628607 -1972228222 + 267784191 -122913 -19677458 -87003834 - -2.6869311928749084e-01 3.1262946128845215e-01 + -2.6322066783905029e-01 2.9420077800750732e-01 <_> - 0 -1 238 975568369 -1078429260 -1073778819 -1246039248 - -566763547 -574710393 -1879731715 -1363518280 + 0 -1 81 105097999 1542832493 298852512 -33591146 -7371798 + 1171296972 -159057160 -792331574 - -2.5506082177162170e-01 3.2470330595970154e-01 + -3.1270226836204529e-01 2.4914608895778656e-01 <_> - 0 -1 116 -197130578 -69435407 25570034 -1282381057 - -736477475 1078203406 1072176808 -224107914 + 0 -1 287 -1423199312 -1691103151 -1814751664 -1613770752 + 990048439 1006682272 1472720818 -805482223 - -3.3984503149986267e-01 2.3857665061950684e-01 + -3.1640163064002991e-01 2.3388214409351349e-01 <_> - 0 -1 170 2006936207 2046780255 -906124674 -571018634 - 465548283 1995414095 -469838166 -53152636 + 0 -1 18 706367007 709894941 -1978089477 -1976242714 + 1047418708 -9413867 -8999074 -94175241 - -2.3337669670581818e-01 3.4638467431068420e-01 + -3.4782758355140686e-01 2.1951326727867126e-01 <_> - 0 -1 261 -1993607757 -1984171376 -1964620068 -1377319864 - -878651982 2100351409 -540935193 -846344047 + 0 -1 320 -1074273477 -1349648528 -26397387 -305765168 + -1750336135 -1414551302 -820448067 -1996649316 - -2.5745591521263123e-01 3.1530505418777466e-01 + -2.4355542659759521e-01 3.1015169620513916e-01 <_> - 0 -1 129 -585119904 520350737 -1602237728 387020659 - -316697172 -809628610 -341521253 1937239575 + 0 -1 151 -25443838 1937727008 -398471218 40370095 -231164274 + -1339821902 -97325926 -88867841 - -3.0576938390731812e-01 2.6786401867866516e-01 - <_> - - 0 -1 303 -48760835 -1382112048 1192391029 185356020 - 783760374 -1402171184 959454513 -1431708544 - - -2.8466665744781494e-01 3.0237734317779541e-01 - <_> - - 0 -1 321 700150833 -1366030659 -590225483 -1393138060 - -1364311531 -1142207587 2140558729 -1370849424 - - -3.7198981642723083e-01 2.3002536594867706e-01 - <_> - - 0 -1 228 -1054166 -201341212 1923367016 1916986952 - 1992519431 1213361995 1174402160 -1068174746 - - -3.4979847073554993e-01 2.4561876058578491e-01 - <_> - - 0 -1 106 -1907696549 -268565315 -1342514689 336742770 - -1439790339 -1301623122 -1342275841 -1440064298 - - -2.6577013731002808e-01 3.1544610857963562e-01 - <_> - - 0 -1 210 -257776636 1915752044 -1649103180 -1095126373 - 1422147805 210473965 2022068463 1660109363 - - -3.7758591771125793e-01 2.2004681825637817e-01 + -2.6998028159141541e-01 2.8467071056365967e-01 <_> - 28 - -1.3550500869750977e+00 + 19 + -1.3592376708984375e+00 <_> - 0 -1 273 1595195384 1608363967 1595766713 -572674083 - 1226391547 -44180227 2111155631 531574527 + 0 -1 348 -995118944 -930416974 345887952 -570558340 88531328 + -1945218639 -587737611 -570425861 - -1.6430117189884186e-01 5.4418802261352539e-01 + -2.9777532815933228e-01 4.2831858992576599e-01 <_> - 0 -1 39 -5377 -57601 538639103 -347397 -17301286 -4259105 - -79502593 -77380901 + 0 -1 253 -67110358 1893122090 1893397120 -86249774 + 1180660851 7567942 1349997680 -134220065 - -1.8002209067344666e-01 5.2194720506668091e-01 + -3.9622232317924500e-01 2.9791569709777832e-01 <_> - 0 -1 177 1566441471 2103287797 492075325 500554077 - 1998422011 -155652 192249721 1565917179 + 0 -1 75 -539240230 -648023297 469764112 1593868287 -11661110 + 1532777684 -552444965 -14942209 - -2.7448469400405884e-01 3.6767318844795227e-01 + -2.9889813065528870e-01 3.6522966623306274e-01 <_> - 0 -1 3 -524550921 -1669383407 -574620225 -33590459 143458441 - 256708119 -805314577 -6324385 + 0 -1 289 -67125368 -79955026 -2020348961 -35793731 + -1077342273 -616575495 -1089623397 497024223 - -2.3465685546398163e-01 4.0192386507987976e-01 + -3.4431287646293640e-01 2.9128664731979370e-01 <_> - 0 -1 71 -846691120 1439476212 -690689 -2237091 -67570179 - -36374787 -2105923 -143907 + 0 -1 166 1384071754 1113049038 -758590950 1895815884 + -763411890 1209352476 -89797814 -220206337 - -2.7146762609481812e-01 3.2002952694892883e-01 + -4.1682410240173340e-01 2.1082815527915955e-01 <_> - 0 -1 294 263139089 -581452515 2010774399 -2106799 477955253 - -72357417 267875276 -1097712 + 0 -1 105 -254496094 -18879841 14000245 771751931 -11010061 + 134742528 -8912901 929018859 - -3.5161617398262024e-01 2.3248630762100220e-01 + -3.7486401200294495e-01 2.4162678420543671e-01 <_> - 0 -1 302 -15214854 -1884686344 167600312 -581052707 37857013 - 202028220 1305828853 -840957953 + 0 -1 179 -654313675 742329655 -262625 1060896639 -390366980 + 74072179 -253568780 -289418469 - -2.6214873790740967e-01 3.0466583371162415e-01 + -2.5083890557289124e-01 3.3719986677169800e-01 <_> - 0 -1 169 613396271 2003697295 1738141229 -35000540 - 2147446463 2131993840 -10096690 1690603136 + 0 -1 315 -73668360 1565910264 2081358045 2146916605 + -1621517064 357571729 -1480983299 -24065 - -3.2117179036140442e-01 2.4732810258865356e-01 + -2.4764552712440491e-01 3.5451245307922363e-01 <_> - 0 -1 281 -1355025965 -1961980240 -671219723 -283264688 - -1936837383 -1952736320 -908474131 -875701004 + 0 -1 301 -811597901 -1364218069 -1648402160 -325060800 + -1976643936 -1364209682 -975732736 -856689421 - -2.4713008105754852e-01 3.1776627898216248e-01 + -2.7585402131080627e-01 3.0668458342552185e-01 <_> - 0 -1 232 -894441054 -1880167002 -853281294 -338827028 - 1348301603 877440640 1936192066 -135400158 + 0 -1 285 -16801110 1942398638 2139043338 1884201710 + 1565129044 1073771567 1927598335 1089267455 - -3.2655048370361328e-01 2.4388861656188965e-01 + -3.5849529504776001e-01 2.3467011749744415e-01 <_> - 0 -1 288 -553260894 -155221559 -13927175 -570440513 - -23332102 -93644167 -1079190789 -1431330575 + 0 -1 124 -552751172 -106362566 379098395 -619987142 + 2056910831 -256982033 -448484726 991891214 - -2.4785453081130981e-01 3.1448525190353394e-01 + -3.6114555597305298e-01 2.2252097725868225e-01 <_> - 0 -1 190 672423253 -570534469 -174826505 -1074210146 - -1158800264 -67208458 802954712 -1079507880 + 0 -1 28 -922792361 135407106 915543278 -1441729929 + -209763771 -33465743 -85987393 -79495181 - -3.1213754415512085e-01 2.4356111884117126e-01 + -2.9683136940002441e-01 2.8010207414627075e-01 <_> - 0 -1 120 -656932646 -651487779 -956164148 2064599515 - -136440708 -588512112 -1232981444 -1979159765 + 0 -1 174 -65566202 5422903 -1572145044 -617562398 -77657088 + 1967600929 854335524 -8915084 - -3.0449146032333374e-01 2.5301957130432129e-01 + -3.7435227632522583e-01 2.1536998450756073e-01 <_> - 0 -1 243 1649084931 672964650 -1105808049 713205535 - 2036285460 -666148121 -55162040 -18875393 + 0 -1 22 -487912721 -800642866 2009588683 -1392279546 + 1656090575 1071632022 -2052634693 -2044509181 - -3.4271252155303955e-01 2.1502359211444855e-01 + -3.0010569095611572e-01 2.6017066836357117e-01 <_> - 0 -1 11 -152656190 868356183 -501591426 -201146046 - -546953661 1982915527 -759837225 -751304729 + 0 -1 226 -741397974 -774903581 1081934016 -260181765 + 2068804966 -935049268 1908400875 -168901016 - -3.6129125952720642e-01 2.0629832148551941e-01 + -2.7382543683052063e-01 2.9915502667427063e-01 <_> - 0 -1 107 -537765384 1060665394 2014012895 -1179616664 - -22202433 -1074072677 -147975202 -1147076845 + 0 -1 44 1817520043 -1431149805 -35670017 848351552 + 1036462355 -1879155406 -302153961 -67637897 - -2.9889339208602905e-01 2.5862032175064087e-01 + -3.3639410138130188e-01 2.2802397608757019e-01 <_> - 0 -1 199 -328257785 -858932225 -530764942 -826874930 - -82742922 -1671853892 -218380796 -169018736 + 0 -1 311 -1330405232 -1146452984 -920726316 -1147304716 + -1089883143 -1260027579 -1255145527 -1869873152 - -3.1055119633674622e-01 2.3958165943622589e-01 + -3.6143729090690613e-01 2.2017471492290497e-01 <_> - 0 -1 154 494120195 870143859 -1647046746 -36192340 - 2139319279 803383587 -332148852 -175859072 + 0 -1 255 -488642849 338857182 1447921202 -691318883 + 1085163095 23216146 1883555028 -209735809 - -2.8900969028472900e-01 2.5575104355812073e-01 + -2.8023749589920044e-01 2.8233993053436279e-01 <_> - 0 -1 282 -811560420 827561735 -12914945 -80101505 - -1361111928 -1185616587 -1407676420 -16973965 + 0 -1 6 -857296913 -38559749 -1123606723 -1326175183 + 214765461 1826707963 1609522143 250940451 - -2.4221476912498474e-01 3.2213848829269409e-01 - <_> - - 0 -1 28 -1807515438 -1923894982 -1525713421 -149168351 - 240714426 -1418935881 419048443 426584671 - - -3.4787160158157349e-01 2.1293328702449799e-01 - <_> - - 0 -1 147 -67165120 453708801 -1303483468 895300097 - 1246742261 -70442158 -982536969 1920335427 - - -3.4275433421134949e-01 2.1697193384170532e-01 - <_> - - 0 -1 84 1234906919 2103279727 -1846517728 -34739694 - 2067706763 1171293376 -104744214 -776609560 - - -3.1936296820640564e-01 2.2989478707313538e-01 - <_> - - 0 -1 203 -148968905 1008481713 788164595 781877169 240125438 - -1348980802 1087673598 -1963666822 - - -2.6340115070343018e-01 2.8225165605545044e-01 - <_> - - 0 -1 292 1837891345 -1365117008 931935797 254075285 - 1304075707 781882527 284906609 -1998401051 - - -3.0138608813285828e-01 2.5070127844810486e-01 - <_> - - 0 -1 31 -2141011328 549559667 -576755279 -1989065165 - -1471060704 -1108160073 -825160949 47662087 - - -4.3011611700057983e-01 1.7580580711364746e-01 - <_> - - 0 -1 244 -747375089 -747702293 -219779522 1890186598 - -335684346 1718484847 1643894306 -206110753 - - -2.3109740018844604e-01 3.2786485552787781e-01 - <_> - - 0 -1 26 -1784488175 -36553927 -1031147589 -369559501 - 125374437 -1648822347 8863969 -1498451769 - - -2.3490820825099945e-01 3.1162357330322266e-01 - <_> - - 0 -1 259 -1071476830 -1095595629 -1920078129 -1444498449 - 810365109 -21630982 -290653569 -392299569 - - -2.5611433386802673e-01 2.9074308276176453e-01 + -2.9626613855361938e-01 2.7211683988571167e-01 <_> - 30 - -1.3058989048004150e+00 + 20 + -1.2654424905776978e+00 <_> - 0 -1 262 -270610434 -134359075 -811399758 -681603633 - -286489698 -45513244 -1344862513 227476639 + 0 -1 274 -152045826 -542116132 -671384098 -536871169 + 71611552 4511120 1691862270 2144334079 - -1.0025274008512497e-01 5.5719470977783203e-01 + -3.2745066285133362e-01 3.7415373325347900e-01 <_> - 0 -1 104 -2097187 353744664 -1074283233 962461525 -17042946 - 2132074456 -185611768 173014862 + 0 -1 55 -562049324 1347689172 838916858 323023775 -10528232 + 1547698176 -79496197 -16257057 - -2.9774430394172668e-01 3.4969726204872131e-01 + -3.2601267099380493e-01 3.1999495625495911e-01 <_> - 0 -1 192 -201591309 322053939 -66051 -1150042305 -1967374172 - 720309079 -1929450275 -9437249 + 0 -1 155 -150864973 823197205 855899696 1897004151 + 1359478447 239799783 -1119879173 2071721983 - -2.2600507736206055e-01 3.8218078017234802e-01 + -3.1169268488883972e-01 3.2441514730453491e-01 <_> - 0 -1 290 -1690568520 1023449340 21823732 -1646306859 - -661660161 529059241 -845261571 -536871425 + 0 -1 131 -8122216 -1694493696 1544425874 1971917534 + 1494268856 974434736 -47924226 -1081103685 - -2.8739321231842041e-01 2.8658962249755859e-01 + -3.4951829910278320e-01 2.8645709156990051e-01 <_> - 0 -1 253 -894497022 101363498 -1468636304 174491490 - 1306476909 100485583 -17240860 -50397265 + 0 -1 2 -148702222 -39652368 -926160348 -4129301 71565440 + 1002386359 4456576 -269484065 - -4.0346711874008179e-01 1.7318421602249146e-01 + -3.2985246181488037e-01 2.8976812958717346e-01 <_> - 0 -1 83 -318927617 2139044223 -1908122241 779509119 - -1159705360 -13892400 239132095 -1357193897 + 0 -1 269 -537196528 367210120 -810330341 -1611069392 + 452626939 -275337221 -1889288261 -4456709 - -2.4370998144149780e-01 3.1787887215614319e-01 + -3.6027029156684875e-01 2.2897857427597046e-01 <_> - 0 -1 240 -1372487695 -1464797736 -608961161 -539484303 - -1347732485 -1107560232 -1770177028 -1397928683 + 0 -1 46 581575179 144736896 -1511062769 771591377 13044399 + 613156333 461832575 -33602083 - -2.9030051827430725e-01 2.7010890841484070e-01 + -3.1637319922447205e-01 2.6715582609176636e-01 <_> - 0 -1 162 -77617562 1723582851 -388105926 10740970 2075870464 - 2001443802 -264144166 1912602619 + 0 -1 72 -631190908 -791476526 2102263115 -707719041 + -1824344143 -221118035 1935670155 -681895917 - -3.6183983087539673e-01 2.2234350442886353e-01 + -3.1301385164260864e-01 2.6414388418197632e-01 <_> - 0 -1 209 1737993987 575323583 570599958 -1593901402 - -537396969 800103342 -218367233 -210440396 + 0 -1 143 -395337586 1290599162 -1480586611 -1107445125 + -780276278 1222177164 1909323816 1431695206 - -3.0187138915061951e-01 2.5218242406845093e-01 + -3.1736305356025696e-01 2.5901272892951965e-01 <_> - 0 -1 115 -3692022 -33948459 -1481085416 -169476374 - -243802706 1464294676 -138677344 -135135404 + 0 -1 327 -1618216774 487712984 335544528 478095577 -16078406 + 185086393 210310393 1339020735 - -2.6393750309944153e-01 2.8237256407737732e-01 + -3.2663252949714661e-01 2.4670498073101044e-01 <_> - 0 -1 38 652099711 -1564843973 104523854 704662580 2126923816 - -548581264 -351211922 -63803885 + 0 -1 266 102918451 -821892609 49152511 -286461629 2080379763 + 2137245875 2051079551 -858486798 - -3.4199714660644531e-01 2.2430206835269928e-01 + -3.4607407450675964e-01 2.0814558863639832e-01 <_> - 0 -1 42 -1969279581 -1481414863 -1376914049 -1163909120 - 207957301 -1456248013 -347640417 -358126493 + 0 -1 115 1965030149 69155845 -270820041 -1078461449 + -136584193 762821931 -588278748 674225702 - -3.2226172089576721e-01 2.3534862697124481e-01 + -3.3318042755126953e-01 2.3290997743606567e-01 <_> - 0 -1 97 -721363152 486579872 1882454289 1434257045 - 1611566751 1289487287 996045691 1005540351 + 0 -1 181 -489698686 -2131832314 -1039863296 818323586 + -523765334 440824136 -780927062 -528941364 - -3.4691241383552551e-01 2.1465319395065308e-01 + -3.0289414525032043e-01 2.5606787204742432e-01 <_> - 0 -1 146 -613203450 1931612930 -221388928 2357067 -95798262 - -1633004965 -1206355046 -1305281858 + 0 -1 7 -1968533749 -1158234249 -1903504601 1289568835 + -2110509277 1055784827 -16777649 -1061695641 - -3.5142555832862854e-01 2.2679552435874939e-01 + -3.1121507287025452e-01 2.4493122100830078e-01 <_> - 0 -1 53 726466699 -783429313 -1320406822 -3624870 1498638047 - 293610405 -545215571 -171145013 + 0 -1 59 -1258926881 -549822406 408301535 2050653013 + -1703261576 -76779424 973269887 -98400385 - -2.8053104877471924e-01 2.5749957561492920e-01 + -2.7002063393592834e-01 2.7681529521942139e-01 <_> - 0 -1 258 -96033630 1940556686 -497037664 -252647058 - 703265613 1079474790 -142103350 1089273046 + 0 -1 272 -758193574 1389009342 -1059925886 -5881636 12990686 + 2163886 1106474407 1364714403 - -3.5805869102478027e-01 1.9770637154579163e-01 + -3.4319832921028137e-01 2.2524215281009674e-01 <_> - 0 -1 29 801058311 -1581801242 219502516 -808469412 264711475 - -2031926289 805127380 -840973936 + 0 -1 89 2010493580 1490924031 558703340 1878899615 + 2136242133 256903807 1130158729 818193091 - -3.1421071290969849e-01 2.3023897409439087e-01 + -4.1370552778244019e-01 1.7945855855941772e-01 <_> - 0 -1 172 -431184122 -2146638145 -899408814 -320144615 - -413827291 -936008940 -1376277757 -856306909 + 0 -1 306 -202440190 -738220126 82060896 -477207729 + -153700670 -570891389 -199329793 -203755569 - -3.3034646511077881e-01 2.2980070114135742e-01 + -2.5417929887771606e-01 2.9859820008277893e-01 <_> - 0 -1 296 -1934886608 -1103642657 -1616127841 2141970916 - 12401112 -606080117 -28750412 -975218195 + 0 -1 264 -221254326 1925904495 1704207914 1894699598 + -451424859 4246980 -49167940 1886450374 - -3.0468633770942688e-01 2.4846823513507843e-01 + -3.4114065766334534e-01 2.2073985636234283e-01 <_> - 0 -1 137 1828669055 -890173322 1056472031 1383623540 - -356497848 -275776488 -319784148 -45023438 + 0 -1 53 -98573686 -233458620 -1145323521 -580784361 + 1931469735 -260055489 -1291736289 -1421354481 - -2.7311590313911438e-01 2.6826277375221252e-01 - <_> - - 0 -1 9 1255206898 -1667881507 -10989766 54528930 1868912080 - 1497103356 -1096470729 195839511 - - -3.6629125475883484e-01 2.0582148432731628e-01 - <_> - - 0 -1 221 -374953039 110804926 -627248196 1059075576 - -271092824 -1449292838 -306539616 -1950680360 - - -2.7446079254150391e-01 2.6614543795585632e-01 - <_> - - 0 -1 77 1079656456 1450316376 -44560086 -86675865 821811859 - -203750610 1644870683 862142514 - - -4.1938367486000061e-01 1.8087086081504822e-01 - <_> - - 0 -1 0 -290783281 -303164749 -1470447878 -1487432078 - 916915428 -88877852 1774133328 -992512778 - - -2.6362594962120056e-01 2.8109744191169739e-01 - <_> - - 0 -1 234 -756036050 839304974 -287378334 -278205702 - 1541888379 252445922 1089229910 1534066638 - - -3.4634828567504883e-01 2.1581955254077911e-01 - <_> - - 0 -1 276 855880616 863230344 1428139679 995299387 - -1190999286 -2031656420 -1089224709 393285777 - - -3.6159241199493408e-01 2.0310276746749878e-01 - <_> - - 0 -1 311 -1512047005 -894771811 -1683823949 -598542090 - 1995129382 -1899059137 1498537061 -838863787 - - -2.8326958417892456e-01 2.6241222023963928e-01 - <_> - - 0 -1 315 -1885077515 -1147345968 765009497 190991824 - -1880224543 -1444116296 170661041 -1880099595 - - -2.7807191014289856e-01 2.6050725579261780e-01 - <_> - - 0 -1 135 -678450904 253998378 1239066322 -181932174 - 1262701314 1057893524 -413531308 -638649353 - - -3.3198201656341553e-01 2.2709015011787415e-01 - <_> - - 0 -1 34 -581179905 -1848462196 1945061311 -5371768 - -323621137 -1263209313 1589634526 -1983639545 - - -2.1172577142715454e-01 3.3727011084556580e-01 + -2.1690982580184937e-01 3.4113904833793640e-01 <_> - 28 - -1.5291974544525146e+00 + 21 + -1.2858563661575317e+00 <_> - 0 -1 118 1460139419 453084545 822327865 822292283 352929169 - 417272919 135004047 924844031 + 0 -1 288 -268513282 -170008577 -1615475234 -37777945 + -54096706 -3303955 -268497714 233768959 - -8.1135094165802002e-02 5.6568491458892822e-01 + -2.9269060492515564e-01 3.6005640029907227e-01 <_> - 0 -1 80 -715128994 1934810962 -672407682 -201597282 - -35692578 809635668 -268435489 2147483551 + 0 -1 171 2139094807 590479159 -422320014 544275186 + 1609553655 1064828726 -268463004 1979187191 - -3.0913391709327698e-01 3.3743736147880554e-01 + -3.9009553194046021e-01 2.6665380597114563e-01 <_> - 0 -1 247 1122941951 1555757531 -694977567 -540019318 - 137302463 470541003 1136607934 1306525407 + 0 -1 337 240061441 237972797 -1342754881 782424635 956105749 + -1115687441 -557891589 -1360330817 - -3.1006491184234619e-01 3.1824222207069397e-01 + -3.6515378952026367e-01 2.4825972318649292e-01 <_> - 0 -1 260 -720124792 -536901237 1570357663 -1650861895 - -552270619 -68301133 1302024703 79667599 + 0 -1 39 -20737 -21921 1387329791 -1145902337 -19250950 + -8502569 -126817537 -77082373 - -3.3839857578277588e-01 2.5523734092712402e-01 + -1.8133202195167542e-01 4.5872864127159119e-01 <_> - 0 -1 17 -8193062 -6097966 -1548746898 -379066394 143198346 - -645407521 12583050 -472923985 + 0 -1 136 -562084225 -588480681 -1099243521 506624528 + 1316756572 -84124547 -33784228 -365920720 - -2.4971115589141846e-01 3.2822373509407043e-01 + -3.9777505397796631e-01 1.8508131802082062e-01 <_> - 0 -1 237 -825768185 724487963 -390073602 -330379374 - 1107247415 83879931 -993921692 -452988933 + 0 -1 217 785362727 216853359 -402800844 -287899666 + 1395881781 1156951983 -134349248 -185271564 - -3.0709245800971985e-01 2.5717419385910034e-01 + -3.4530290961265564e-01 2.4639949202537537e-01 <_> - 0 -1 58 -824653104 303085300 -1502438950 676395390 - 1255626832 486565974 -815202689 -79167553 + 0 -1 68 -1062206256 1283745013 -34114723 -655764 1070420469 + 365214205 -805365315 -7516835 - -3.6309060454368591e-01 2.1628698706626892e-01 + -3.2642650604248047e-01 2.5048437714576721e-01 <_> - 0 -1 67 1465723394 105884335 67529631 1199566589 -1622165645 - 1811892772 1549268950 1652352758 + 0 -1 190 1474272223 1432203262 499659167 532543359 307625983 + 340797832 1059537791 1944010239 - -4.2343840003013611e-01 1.6860494017601013e-01 + -2.8207024931907654e-01 2.8570288419723511e-01 <_> - 0 -1 185 148088327 717657079 -1158484046 -2098532510 - 1870465024 1417516115 -834205 -218760204 + 0 -1 310 -48295664 -646879950 -749237799 -1153479021 + -1097202291 -33608429 -1514198007 146252931 - -3.6911985278129578e-01 2.0653814077377319e-01 + -3.7337026000022888e-01 2.1691022813320160e-01 <_> - 0 -1 300 -461242368 1477725653 -1215242820 -90145126 - 1009057732 -704735 -1141055496 -1162708353 + 0 -1 145 -54539121 1325248383 -1444411622 -1078132833 + 2097041119 1281153237 -135827344 1899100997 - -3.3464974164962769e-01 2.3336097598075867e-01 + -3.1012156605720520e-01 2.4879796802997589e-01 <_> - 0 -1 293 -1423237359 -1789315824 -574109707 -1107438219 - -1363603597 -872691976 -1657075536 -1933638287 + 0 -1 208 215618933 536625151 -537774081 -1073979708 + 1022653716 -1077149825 -1073987588 -1426440928 - -3.1273457407951355e-01 2.2250117361545563e-01 + -3.5794767737388611e-01 2.0182034373283386e-01 <_> - 0 -1 194 -144708057 1699343849 -1838157252 -177211402 - -159396385 625472608 -135793676 -521076854 + 0 -1 275 -460354046 75902886 -1114232776 144879392 + 1700742225 200101343 -20972316 -268435457 - -2.3151670396327972e-01 3.2311838865280151e-01 + -3.3210799098014832e-01 2.3649631440639496e-01 <_> - 0 -1 168 -1931608011 913325143 -171254849 266627963 - -2035524252 -69309961 -81258276 -98535933 + 0 -1 331 -1120698607 -1816316560 -1115727883 -771893903 + -1498071255 -1342570824 698559600 -1935190671 - -2.9178491234779358e-01 2.4896363914012909e-01 + -3.1769388914108276e-01 2.3492129147052765e-01 <_> - 0 -1 91 1087671428 82841500 -823391220 -1623396996 - -102804027 1314177621 -1141613796 -1074263479 + 0 -1 26 171629823 667944063 135529717 34762367 1819038997 + 1002177831 1348229755 2135252863 - -3.8546600937843323e-01 1.7542295157909393e-01 + -3.5822075605392456e-01 2.1465454995632172e-01 <_> - 0 -1 159 -933240178 -1878596882 1715175556 -1194366298 - 411894039 268454833 -470873276 719547915 + 0 -1 154 -637551088 286731008 -121898852 540119849 + -716208703 -1779023243 -386809896 1901461404 - -3.2228979468345642e-01 2.1430800855159760e-01 + -4.3143102526664734e-01 1.6342623531818390e-01 <_> - 0 -1 220 -939528673 -1404420134 -369182724 1002367802 - 15711733 -1410089155 1960793528 -2001995142 + 0 -1 184 1860151087 1929903535 1385154026 1995326315 + -186651217 1908896727 -1578172729 1690632140 - -2.3454265296459198e-01 3.0028054118156433e-01 + -3.0808129906654358e-01 2.3992852866649628e-01 <_> - 0 -1 113 536155908 470828324 -1369532674 -1364256937 - 965751798 -35376543 78916068 750088039 + 0 -1 261 -750652672 825569187 363565347 226880649 1425642663 + 1027652669 -1527280645 234220511 - -4.0617641806602478e-01 1.7761451005935669e-01 + -2.8312164545059204e-01 2.6677671074867249e-01 <_> - 0 -1 35 -2071666137 -5603018 -1985288769 -1434200 1335921899 - -1427144213 -1685518963 -1157538765 + 0 -1 283 -319861241 1113296810 -274206881 -358425573 + 2079722844 -400747690 -318934163 -10490913 - -2.4697369337081909e-01 2.9498186707496643e-01 + -2.8361973166465759e-01 2.6147827506065369e-01 <_> - 0 -1 229 -288895194 586300718 -1428684760 -123278042 - -121959099 946274053 -1125681616 1348531058 + 0 -1 100 1152141516 -134536513 1728012219 -613438294 + 289388027 -172525705 2052631547 523382314 - -4.4196075201034546e-01 1.6939437389373779e-01 + -3.5195887088775635e-01 1.9971875846385956e-01 <_> - 0 -1 21 -1431908781 2021291639 -1130434561 980837616 - 575372375 -335353565 -1127443082 -8913481 + 0 -1 250 1915726114 799985062 -863564618 -1796286242 + 1412398914 902102177 1130850167 -206571550 - -2.6150795817375183e-01 2.7675113081932068e-01 + -3.5833287239074707e-01 2.0236967504024506e-01 <_> - 0 -1 68 -1163937995 319737271 1308060341 -1120611591 - 215961812 -849912353 -825672464 -121636649 + 0 -1 95 -455700956 82848733 132951356 -67846796 -33744443 + 248862805 -1162704376 -1075833039 - -2.0028464496135712e-01 3.5346552729606628e-01 - <_> - - 0 -1 112 -1550874873 68414247 420172119 -1144260794 - -508579405 -134226281 -772565676 -204480722 - - -2.3316873610019684e-01 3.1222426891326904e-01 - <_> - - 0 -1 218 -541341454 531709016 -1735251873 1326185481 - -1933801064 801776562 1154066423 1474264822 - - -2.6953682303428650e-01 2.8109839558601379e-01 - <_> - - 0 -1 181 1280835701 -19635873 -1961789445 -282569314 - 2036092788 -1093054601 -151512323 -1347805666 - - -2.9192847013473511e-01 2.4838224053382874e-01 - <_> - - 0 -1 95 -311496552 764872328 -498934241 504728371 - -1669213988 -1084285404 -22094113 977657810 - - -3.2798394560813904e-01 2.1226845681667328e-01 - <_> - - 0 -1 309 -830243037 -455709770 -1109557600 -394303915 - 1283690960 229296318 285572161 -1936864027 - - -2.9578369855880737e-01 2.4679656326770782e-01 - <_> - - 0 -1 202 -353374409 -1910657629 -153750156 -291312600 - -824232155 -1323582188 -1830135484 -1029119357 - - -3.0753603577613831e-01 2.2499974071979523e-01 - <_> - - 0 -1 150 1861152279 336385887 -1598237261 1532541780 - 717032533 845016530 -1129812228 -567126192 - - -2.7896767854690552e-01 2.5912684202194214e-01 + -3.7909838557243347e-01 1.7440141737461090e-01 <_> - 32 - -1.3275781869888306e+00 + 24 + -1.2824541330337524e+00 <_> - 0 -1 235 -9764865 -604078086 -173773889 -2987398 1279545343 - -557388648 1149200335 1195863143 + 0 -1 80 -45825 -536920833 1280073215 495738239 -88473416 + -130820 -570238469 -71639553 - -2.8027681633830070e-02 5.9074550867080688e-01 + -1.6788482666015625e-01 4.4611564278602600e-01 <_> - 0 -1 55 -715992866 -553046580 -170277985 -572962233 - -202911505 -562080269 -271361 2136426523 + 0 -1 228 -572535553 397093339 -1062400257 1610558363 + 214714620 1068935571 68145083 532673471 - -2.9094350337982178e-01 3.2474684715270996e-01 + -3.1849989295005798e-01 2.7583411335945129e-01 <_> - 0 -1 2 -285213773 -97321424 -537973381 -1342251019 249102355 - 186786323 -1879110913 -269489669 + 0 -1 317 -1231 -1819561582 1911910833 1570722209 -1093 + -1685331270 -1076924144 -2002009685 - -2.4952219426631927e-01 3.3645749092102051e-01 + -2.7908280491828918e-01 2.8472077846527100e-01 <_> - 0 -1 274 -5251811 -46589657 -577170147 -1649982203 -147523 - -67650657 -307360312 -1945170545 + 0 -1 258 -1942309903 -1342795280 -4194443 -1073899024 + -1354893895 -1079265281 529358301 -1447062096 - -2.2803187370300293e-01 3.6403229832649231e-01 + -2.6034539937973022e-01 2.9407960176467896e-01 <_> - 0 -1 132 1587350780 -6418628 -1073864867 -604037841 - -21053701 -1195406672 784076557 -1342501334 + 0 -1 282 -486603761 538575875 2129538959 34218767 -573161380 + -70690275 -285287348 -2363473 - -2.9213908314704895e-01 2.7659067511558533e-01 + -3.4062975645065308e-01 2.0401223003864288e-01 <_> - 0 -1 176 -826544217 -1431112397 -488065488 540212786 - -722778748 1157429871 -270294508 -520884270 + 0 -1 291 -1349524722 -69233725 -1720626217 -536900587 + -2143975798 -12746304 118214239 1599029333 - -3.5402128100395203e-01 2.1517892181873322e-01 + -3.2409128546714783e-01 2.2399894893169403e-01 <_> - 0 -1 87 712975879 79833691 -1361412946 686460060 -691335585 - -125978095 -285512546 -1430258133 + 0 -1 120 -269775230 1408819148 -390615384 -8392706 -1057528 + 1464277268 -1276123648 2004090628 - -3.1391125917434692e-01 2.2734560072422028e-01 + -3.6182680726051331e-01 1.8862281739711761e-01 <_> - 0 -1 200 -976172866 286760680 6735455 198928110 1074026973 - 990905122 10809743 255401983 + 0 -1 78 521087406 894214626 828121640 -236406052 935394252 + 1426326282 -507511876 -138091528 - -3.5261881351470947e-01 2.0989060401916504e-01 + -4.3280023336410522e-01 1.7912270128726959e-01 <_> - 0 -1 224 774125429 -1154154632 -439675595 -1111523364 - 1012643517 -1454645 798207228 -1128575640 + 0 -1 349 196050803 -1364574018 2042330965 -841132080 + -1466964805 -1882464834 1636143569 -860888828 - -2.6199585199356079e-01 2.7558091282844543e-01 + -2.9185295104980469e-01 2.3511406779289246e-01 <_> - 0 -1 251 -487657822 48661756 -659241758 -135899942 - 1153834238 10993310 1170301815 1424455655 + 0 -1 19 -21018037 1783262287 -1597196625 -1442780128 + -414100906 -277852304 -355078554 -46081177 - -4.2886912822723389e-01 1.5836857259273529e-01 + -2.9949510097503662e-01 2.4424977600574493e-01 <_> - 0 -1 61 721311231 -1653716997 -1990311447 531501487 - -1965404323 -67478251 171464059 184576600 + 0 -1 12 49418002 -2003701765 -313130209 -2000720353 + 1219644673 -285278209 -872858825 1123765061 - -3.8873490691184998e-01 1.7470200359821320e-01 + -4.4975990056991577e-01 1.4456595480442047e-01 <_> - 0 -1 57 327418278 390873324 -1341550100 -1277569843 - 890828715 1352696428 762946218 871965384 + 0 -1 52 -364085048 491458118 -675123209 -541193660 + -839658244 -262730335 -604312834 2115044436 - -4.1405329108238220e-01 1.7622730135917664e-01 + -3.9896175265312195e-01 1.7343275249004364e-01 <_> - 0 -1 313 1356549140 -1631210850 -1129431843 -1204505275 - -93539215 -1074227267 -386080853 -84902083 + 0 -1 160 -470817137 156157702 -1967203869 -772802881 + -246418489 1363658693 -218633237 -245891170 - -2.7681437134742737e-01 2.4316167831420898e-01 + -2.1532715857028961e-01 3.3184850215911865e-01 <_> - 0 -1 157 -488643058 180875078 -329274718 -236520514 - -1068514035 1145270019 1940253924 1625680036 + 0 -1 175 -352409586 -1190861826 -1642823092 -71631894 + -923852796 1998658431 -399708968 -11345840 - -3.7754905223846436e-01 1.7737720906734467e-01 + -2.8774553537368774e-01 2.3346234858036041e-01 <_> - 0 -1 318 1568653099 -1486684233 -270730127 -320215680 - -1480112719 -1448552587 444420880 -859837569 + 0 -1 178 1146397583 1440677111 1789980602 -168959196 + 1607858623 1003980783 -95098146 -520838912 - -2.4140998721122742e-01 2.7932175993919373e-01 + -2.7916902303695679e-01 2.3335020244121552e-01 <_> - 0 -1 189 -17905025 1950769147 -402672769 2131932059 - 251095909 -1377736845 -268624424 1935896624 + 0 -1 352 -50332877 -1350565899 -589480591 -849224360 + -2014845531 -1930707058 -1980770927 -857737763 - -2.4894605576992035e-01 2.6565098762512207e-01 + -1.8601153790950775e-01 3.3500474691390991e-01 <_> - 0 -1 56 -229980658 1379962893 -378530289 -1286386082 - 541532620 -136587009 1094085135 657713951 + 0 -1 116 -679517179 235021312 -2015978753 -308288545 -3083 + -1148969 572941047 -1531453593 - -2.9520252346992493e-01 2.2449728846549988e-01 + -2.8746202588081360e-01 2.3165051639080048e-01 <_> - 0 -1 271 -383212128 -6160449 -283244184 -1365334076 - 762609077 1768025015 -304497187 -1344499269 + 0 -1 246 -283094 -78995521 989667876 -388040262 1269563143 + 376496915 -180422212 1906376566 - -2.8447866439819336e-01 2.4520753324031830e-01 + -3.3096152544021606e-01 1.9776308536529541e-01 <_> - 0 -1 212 -823677149 33812366 63268002 -1196492664 759909893 - 73716507 -306223978 -151718043 + 0 -1 97 -182451973 -202104337 -1497597953 -141604069 + -417856360 -236145225 -14023781 -1308484861 - -3.2939437031745911e-01 2.0377136766910553e-01 + -2.5251045823097229e-01 2.6549828052520752e-01 <_> - 0 -1 312 -1374019853 713820810 -669067463 -2043769806 - -847767619 -1963069954 1575449037 -450464140 + 0 -1 298 1873775874 -1934907533 -1096029424 -930612685 + -2068250556 -1915946543 1105810433 -977930811 - -3.0366918444633484e-01 2.2024095058441162e-01 + -4.1322487592697144e-01 1.5656088292598724e-01 <_> - 0 -1 114 -470316922 717621094 -923928028 -172110089 - -175398463 2009855399 -194461440 -243275802 + 0 -1 327 -559975688 -1098343184 56689852 -541071107 + -1096812098 -1650825224 -821928707 -570434053 - -2.6190644502639771e-01 2.6647549867630005e-01 + -2.2519363462924957e-01 2.9129114747047424e-01 <_> - 0 -1 140 1951769299 1434447053 -1336849665 -721425681 - -78677193 -2902011 2045245095 -24300714 + 0 -1 322 1760817168 2014969105 -1342718095 -115803287 + -1804093744 -249891400 -828918088 -1133191201 - -2.2465880215167999e-01 3.1657159328460693e-01 + -2.5303143262863159e-01 2.6384234428405762e-01 <_> - 0 -1 267 -861210968 688568240 -1004941864 -35890713 - -662335344 8503434 1128813796 1162868189 + 0 -1 201 -337401329 79624186 -157749454 -2107704234 + 2136683024 1450477407 -277792234 -789447723 - -4.0748140215873718e-01 1.7012281715869904e-01 + -3.5275053977966309e-01 1.8988111615180969e-01 <_> - 0 -1 8 1909956778 -958730002 73759065 117326543 -170462666 - -1638796928 -144999309 1180628626 + 0 -1 85 1483955794 880441222 1177964078 -1207814558 + 1556696189 -13904937 -805344549 -21761033 - -3.5050147771835327e-01 1.8371912837028503e-01 - <_> - - 0 -1 156 -1007695481 -1609761269 -218186094 -1297941718 - 1501545350 1348355905 -785383567 -535441850 - - -2.8428241610527039e-01 2.3429898917675018e-01 - <_> - - 0 -1 277 -1088815371 1060734832 -4223497 1069000375 - -1138325508 -23580996 -1751106129 -1447097814 - - -2.0420564711093903e-01 3.2137596607208252e-01 - <_> - - 0 -1 10 1861672606 -668397946 1208024407 1141008467 - 793079834 440603748 -705639574 -48042237 - - -2.7496239542961121e-01 2.4548499286174774e-01 - <_> - - 0 -1 283 -992769979 767790999 -48337487 2140880143 215229748 - 418870965 -320966916 1188940671 - - -2.7034837007522583e-01 2.4777430295944214e-01 - <_> - - 0 -1 254 -1532809423 -1493812843 -1351098395 -172312296 - -515160205 -1498547284 268291320 -1426238432 - - -2.8834709525108337e-01 2.2686660289764404e-01 - <_> - - 0 -1 298 -3221657 908227842 -305164460 942829106 -357061387 - -1565722789 -9463718 -360710886 - - -2.2364138066768646e-01 3.1509658694267273e-01 - <_> - - 0 -1 93 -735960950 -170126554 1909113855 -23709394 - -1542321238 -737632549 -361625941 867181313 - - -3.6416807770729065e-01 1.8943277001380920e-01 - <_> - - 0 -1 297 -1427114189 -1498618581 -224896028 -1392720912 - -1096677881 -972078302 -136092556 -1000345005 - - -3.1630918383598328e-01 2.1302369236946106e-01 + -2.9593563079833984e-01 2.2950462996959686e-01 <_> - 36 - -1.3241410255432129e+00 + 25 + -1.1346004009246826e+00 <_> - 0 -1 264 -1886982258 -671648799 -570864297 -606221228 - -1899852152 -3292975 236208719 1600077909 + 0 -1 135 248384512 -2230281 -67167425 -278721 -1430323288 + -4097 -1364709878 -1427136853 - -7.9810082912445068e-02 5.2391374111175537e-01 + -2.7531594038009644e-01 3.4290844202041626e-01 <_> - 0 -1 226 -85990657 570624531 -67109121 992976191 -386251554 - -1965159927 -83923475 -1048581 + 0 -1 192 1473642495 274004474 933182335 500809723 1997913085 + 487862028 2077977039 1608383199 - -1.8287384510040283e-01 4.4005623459815979e-01 + -2.5518363714218140e-01 3.2124108076095581e-01 <_> - 0 -1 278 -37758029 -1146357328 -206212751 -572669447 - -3147333 -1147409733 -67110471 -1714697285 + 0 -1 150 -671627180 1440067463 -55773956 -252462474 + -212729877 -1744769111 -298451490 805420943 - -2.0388080179691315e-01 4.2895537614822388e-01 + -3.4691503643989563e-01 2.3676414787769318e-01 <_> - 0 -1 145 -183247173 1023475216 1027163441 1527839249 - 1017224859 1738217629 1060840379 1065315199 + 0 -1 3 -186646854 -72960256 -822609825 -856193 5046414 + 733941519 1287603359 -129 - -3.3740916848182678e-01 2.1529236435890198e-01 + -2.4629610776901245e-01 3.0966648459434509e-01 <_> - 0 -1 103 481318143 -134278060 -1749526563 -1078064995 - -1372435270 -1162474278 -358945793 -1431173974 + 0 -1 324 -1334507507 -1115837163 -1198804579 1034753295 + -237926227 -69613103 -269694261 -2138504179 - -2.8765675425529480e-01 2.5110965967178345e-01 + -3.6555841565132141e-01 1.9017384946346283e-01 <_> - 0 -1 268 -805831759 -302189077 -591401807 -305135631 - 144606625 -1936723969 -992408563 -855769927 + 0 -1 45 0 -824089359 -278966017 -749744779 8831144 + -347413507 -1475415988 -855648819 - -2.2018201649188995e-01 3.1721305847167969e-01 + -3.4803688526153564e-01 2.1789649128913879e-01 <_> - 0 -1 20 -534756686 1380106992 -2462279 -33757488 28591869 - -456875269 -1610624779 -1051657 + 0 -1 340 1112532642 1173963979 -811315745 99566887 + -777275981 -439360269 -376451157 133893287 - -2.6303508877754211e-01 2.5412750244140625e-01 + -3.0945461988449097e-01 2.2969539463520050e-01 <_> - 0 -1 175 1342137858 36560521 -895533800 683603905 1263879488 - 1146407324 -1450126 -537788681 + 0 -1 297 185535267 790098739 711963921 -268439240 218058052 + -294925 -1396768448 -2100139 - -3.6383235454559326e-01 1.9057570397853851e-01 + -3.6581969261169434e-01 1.7462332546710968e-01 <_> - 0 -1 66 1340125183 -134742145 -692979981 -1214109056 - 1289101223 -4839633 -21061633 -369409502 + 0 -1 292 -21844242 -6605322 -1616468484 -536912933 + -1499165960 -1126293580 925141758 -20448289 - -2.0452670753002167e-01 3.3919993042945862e-01 + -2.5863876938819885e-01 2.6582530140876770e-01 <_> - 0 -1 269 193720319 100840569 -303833102 763156184 978053077 - 531299573 -839056136 -1929622308 + 0 -1 304 522433969 772063152 -1143210539 -1383027464 + -1405567063 -1431049791 221093305 -1933786908 - -2.7057421207427979e-01 2.3806059360504150e-01 + -2.9382315278053284e-01 2.4171116948127747e-01 <_> - 0 -1 73 1437966890 -129122561 1958795834 1556596447 - 1598142386 1074702522 -272384141 1205144459 + 0 -1 119 -202381694 -798150994 -5573602 -41028290 + -1178601783 -77728283 -135801400 -145231988 - -3.8338547945022583e-01 1.6122914850711823e-01 + -2.2170369327068329e-01 3.1273341178894043e-01 <_> - 0 -1 171 1115680527 115249619 895027446 -92284851 1599078213 - 1735769988 -537445018 1689910980 + 0 -1 128 -203439442 280484343 -191502652 1082521539 + 1518288386 574050238 -360088850 -84153089 - -3.6433032155036926e-01 1.7980493605136871e-01 + -3.2988098263740540e-01 2.0559535920619965e-01 <_> - 0 -1 144 1900011604 2069139451 1149891166 -1061030506 - 1967646922 -937402003 -1292100642 838974267 + 0 -1 36 -1473073466 1917855318 -364848516 1483753731 + 522944080 -1504285156 -282021901 -79439061 - -3.2297107577323914e-01 1.9990013539791107e-01 + -2.9433536529541016e-01 2.1896927058696747e-01 <_> - 0 -1 86 1216302162 1437731410 -1922152432 -586510344 - -937599750 1065827099 -621007040 -86024589 + 0 -1 185 -270062289 741719453 2088717183 -159405089 + -1063525273 -201780627 -990061324 -189792529 - -2.9406809806823730e-01 2.1769714355468750e-01 + -2.8305205702781677e-01 2.3085375130176544e-01 <_> - 0 -1 288 34597026 -688274366 1187213567 -671108889 - -1508901182 -1308638469 -559091031 247438496 + 0 -1 64 781209199 -604801249 -137056771 -1644152576 + 1425768019 -4985945 -33825329 -352630170 - -3.2822206616401672e-01 1.8776336312294006e-01 + -2.5803419947624207e-01 2.3583941161632538e-01 <_> - 0 -1 207 103046517 133606652 1733190463 -1346628911 - -1148684048 -22091807 901613945 -1460139888 + 0 -1 218 -684139841 891109289 -2146903425 497252031 + 1814861009 1063463728 69532089 1061139391 - -3.3780130743980408e-01 1.9073766469955444e-01 + -2.3609955608844757e-01 2.6694893836975098e-01 <_> - 0 -1 111 -746085629 -676994367 1095924655 -1122388257 - -212397823 -202506293 -205057719 -208672818 + 0 -1 195 1560171645 -1625665705 -1891663905 -1109320513 + -127236 -67273237 -268804357 -5614422 - -1.8210665881633759e-01 3.4192490577697754e-01 + -2.2031366825103760e-01 2.8743496537208557e-01 <_> - 0 -1 74 -425549783 -371579759 -351371857 -575060349 - -1214609473 -88295489 419684031 -1624088569 + 0 -1 289 -368723304 -1087131273 -2028144723 465693884 + 1523430298 -71370269 -1182790141 144305137 - -2.2647747397422791e-01 2.7878209948539734e-01 + -3.6453738808631897e-01 1.7253066599369049e-01 <_> - 0 -1 208 -894491986 -219288836 1075036258 -1764754717 - -573582558 -1807733298 1383817634 -196806592 + 0 -1 199 787998475 677575591 -739252480 -285290066 508918644 + 1719481202 -179306992 -51386418 - -2.9377350211143494e-01 2.1309736371040344e-01 + -3.0859819054603577e-01 2.0732647180557251e-01 <_> - 0 -1 201 -2106874097 -931096794 1687396770 -828052004 - 2015982962 -126682795 -294764796 -323961156 + 0 -1 14 -221256090 -30629334 -1778521617 -141047802 70346658 + -453359515 1744520459 -268644849 - -3.2405611872673035e-01 1.9604462385177612e-01 + -2.7200087904930115e-01 2.2423355281352997e-01 <_> - 0 -1 222 -2042653379 1051606960 500611353 1069291288 - -1453967943 -1919900749 -547038872 -1414655812 + 0 -1 142 1622928902 583970724 1109312096 1904539840 + 1969219012 1980786278 1948496000 1911025111 - -2.6115354895591736e-01 2.3542492091655731e-01 + -3.3403554558753967e-01 1.9454947113990784e-01 <_> - 0 -1 314 -588537600 -844176924 1464154596 -637687780 - 487338116 68063409 -1978163723 -840968737 + 0 -1 112 -295762925 915309558 -1095828421 1019540600 + -1141749996 -1192305118 -17631630 -903815374 - -2.7114504575729370e-01 2.3290830850601196e-01 + -3.0503559112548828e-01 2.0471774041652679e-01 <_> - 0 -1 317 120290097 -1288032431 1651243885 -76200631 - -2068365766 -1346655489 246316733 -1108265899 + 0 -1 330 1865153393 185138952 -955431147 431881140 698022290 + 142707862 1294169361 217054693 - -3.0526432394981384e-01 2.0446150004863739e-01 + -3.3315172791481018e-01 1.9509385526180267e-01 <_> - 0 -1 16 -822121865 -768454985 -352395443 -367512593 - -1091080379 -202815919 -279024202 -28119438 + 0 -1 50 1057818511 484285945 -170124612 1005093883 + -1156844547 1371617765 -69795876 -1257986355 - -2.4680423736572266e-01 2.5303974747657776e-01 + -2.9253959655761719e-01 2.2863319516181946e-01 <_> - 0 -1 39 -624497410 423430210 168884479 707847256 -901496725 - 2133000198 -1135412149 1936933458 + 0 -1 216 567255330 -707734926 -925572514 -624041174 + 1433628799 21294608 156263627 -721438458 - -3.1653416156768799e-01 2.0023956894874573e-01 - <_> - - 0 -1 242 1650942474 1345050478 886355088 1168828219 - 1112207884 1231876612 1550108076 1951460330 - - -3.2898175716400146e-01 1.8093948066234589e-01 - <_> - - 0 -1 124 369300756 891056133 -1916674564 -1374783349 - 996154237 -1145226207 -5607004 744775764 - - -3.2225444912910461e-01 1.9573701918125153e-01 - <_> - - 0 -1 211 205577554 1071184148 -1263948549 1998946051 - 1260935961 -304903199 -606843718 1677159567 - - -3.0931469798088074e-01 2.0338173210620880e-01 - <_> - - 0 -1 143 -591418226 177508317 -1342069760 -4867939 - 1927953629 272683209 -1222155904 1886512754 - - -3.4405741095542908e-01 1.8495233356952667e-01 - <_> - - 0 -1 265 -21049686 -28131359 1073478397 -34340880 - -2075882246 -1093124168 -64807690 -1243108611 - - -2.2883313894271851e-01 2.9109308123588562e-01 - <_> - - 0 -1 307 781346419 639805680 -546181353 -1174989674 - -1555551183 -893031525 -2006836811 -1392561707 - - -3.0891278386116028e-01 2.1537151932716370e-01 - <_> - - 0 -1 134 -26563529 576995058 1442217478 -1427177744 - -68769859 -1241776649 -424779152 -285805586 - - -2.3855516314506531e-01 2.6137462258338928e-01 - <_> - - 0 -1 178 -491860352 1783772447 -1761018371 989361018 - 2037451840 -988741302 2128769468 1865931536 - - -3.3605426549911499e-01 1.9781108200550079e-01 - <_> - - 0 -1 59 -1359078146 -21349537 1081098827 794979703 147593312 - -343136234 308281456 -1121813221 - - -3.4179690480232239e-01 1.8693566322326660e-01 - <_> - - 0 -1 131 -467418588 607934740 -510185553 -839002645 - 2000942967 1793376114 710533396 209909344 - - -3.9927759766578674e-01 1.5319514274597168e-01 - <_> - - 0 -1 6 -251463749 -1087866735 954640701 -1345720208 - 257393053 -1721918337 71237772 -522239782 - - -2.0329028367996216e-01 3.1257370114326477e-01 + -2.8726491332054138e-01 2.1820212900638580e-01 <_> - 36 - -1.3515049219131470e+00 + 25 + -1.2997064590454102e+00 <_> - 0 -1 121 -583157832 -41345124 -1667477754 -47472728 - -1631649861 -192782657 -1106464817 1060048799 + 0 -1 296 -1372705244 -53892 -276885633 -1880289792 + -620822785 -393217 -142745633 -268474549 - -6.6292375326156616e-02 5.3096652030944824e-01 + -2.2954036295413971e-01 3.6702767014503479e-01 <_> - 0 -1 250 -961874181 -589629441 -202714187 -33687726 - 246352127 -1125919869 1090470655 1441756927 + 0 -1 69 -10514724 -1625446526 -12058789 1028355882 + -106955041 -6565701 -146018337 1599032783 - -2.9468271136283875e-01 2.9257065057754517e-01 + -3.4712401032447815e-01 2.4896951019763947e-01 <_> - 0 -1 284 -219161456 1561959797 -1157910723 -644253203 - -37769852 -1175163461 -358812998 -1146105857 + 0 -1 76 -1430331393 -1752738851 226721247 1059010911 + 145900799 -1429468513 615153631 988436415 - -2.2191908955574036e-01 3.5355353355407715e-01 + -3.3930867910385132e-01 2.3344205319881439e-01 <_> - 0 -1 133 -1395773932 -19337 -872592385 -1082417169 - -268501000 -203988001 -1360523750 -1430265925 + 0 -1 270 -506747998 -1362439710 -745936942 -39853582 + 1334757315 -124603168 2009421779 -672148493 - -2.6642906665802002e-01 2.7330449223518372e-01 + -2.8237146139144897e-01 2.7164348959922791e-01 <_> - 0 -1 89 937245647 533051903 22876957 837784063 -113164289 - 1593942211 1207413693 1942338443 + 0 -1 321 -4203299 1360986883 -3412641 956312066 -171979299 + -315445 -1843240 -80744689 - -3.1208184361457825e-01 2.1690289676189423e-01 + -2.1301591396331787e-01 3.5703513026237488e-01 <_> - 0 -1 245 -135270614 1911454511 -694266878 1894711038 - 1380414469 1078062543 -200939772 1616172018 + 0 -1 149 -689977121 -662996513 -1725966451 2068778907 + -251700994 419184760 -93683841 -99614885 - -3.7340530753135681e-01 2.0424529910087585e-01 + -2.3296064138412476e-01 3.1665518879890442e-01 <_> - 0 -1 79 -673199910 2132653981 -1105191310 -1622098985 - -279161640 1874615084 2066898922 -82575381 + 0 -1 309 -285179488 -9441281 1043235368 -1342265362 + 874839541 2133912549 -1032021509 -1392732225 - -2.7581161260604858e-01 2.3679631948471069e-01 + -2.8806942701339722e-01 2.2282725572586060e-01 <_> - 0 -1 108 -88609193 -764250339 -21964208 1785903000 - -705804525 -281542881 -17301633 -29425689 + 0 -1 114 1475815183 2107337983 -224023574 -2176766 + 2147067887 1876795342 1818099336 1707645312 - -2.1142585575580597e-01 3.1125506758689880e-01 + -3.1313076615333557e-01 2.1244764328002930e-01 <_> - 0 -1 287 2117156824 2142892795 -1715733421 -1118208017 - 1981329130 -1132205343 -531030662 218086646 + 0 -1 329 -1657544715 -1145500528 997257077 503141457 + 763625151 -1430741832 153165617 266033296 - -3.1311789155006409e-01 2.2028388082981110e-01 + -3.0358061194419861e-01 2.2090645134449005e-01 <_> - 0 -1 217 657173799 1208409516 -304231172 -319884740 - 829234695 822389124 -1816709292 -725510 + 0 -1 177 1147035391 -50398729 -8725505 1072834859 2090734480 + -115489 -570483718 -270631374 - -3.4273931384086609e-01 1.9222305715084076e-01 + -1.8830235302448273e-01 3.3752456307411194e-01 <_> - 0 -1 270 -102301694 -135807070 -1880672401 -253298777 - -354657254 -100668629 2011055773 -155453461 + 0 -1 299 -1356597325 -1388052592 -847288592 -314052611 + -1927458391 -896273511 -1943219992 -855777356 - -2.4226696789264679e-01 2.7088710665702820e-01 + -2.6349818706512451e-01 2.4316447973251343e-01 <_> - 0 -1 191 215240020 -1148310119 -707214049 -1112003969 - 1860719544 -6638593 -4317491 -1414921888 + 0 -1 91 1683333818 -928527617 73759575 1290403503 1430371123 + -103067615 1875204903 1786229266 - -3.1184914708137512e-01 2.1366736292839050e-01 + -3.6631527543067932e-01 1.7680935561656952e-01 <_> - 0 -1 18 -873476105 -30229647 -168296643 -1682912767 - 161284371 -1972125919 -12305 -268965957 + 0 -1 75 -723572486 1398781951 2102550384 -15679489 + 1677216988 -883140642 -552403973 -619446289 - -2.1284404397010803e-01 3.0867013335227966e-01 + -2.4558630585670471e-01 2.6674869656562805e-01 <_> - 0 -1 289 -449986302 74968807 2145360303 20911369 1088274818 - 1642837031 -1026366551 53429507 + 0 -1 31 -909118669 -1568492624 -15803021 -1602693664 + 1276055058 203659013 2128997939 -285229957 - -3.2960832118988037e-01 1.9843052327632904e-01 + -3.1990760564804077e-01 1.9987310469150543e-01 <_> - 0 -1 187 -294473945 1289282231 -69736418 -366809570 - 585961254 -894112782 -352349116 -857431116 + 0 -1 153 -641211774 456884155 -371067230 828505907 + 1660797068 1414657751 -654513950 -260707437 - -3.4131202101707458e-01 1.7822383344173431e-01 + -2.5050690770149231e-01 2.5742626190185547e-01 <_> - 0 -1 117 -260075316 810653599 -307212416 -1090154618 - 1085218542 2014454434 -889360754 840974879 + 0 -1 24 -229906089 -739840258 535355359 -1513324470 + -706239233 -106463539 396649887 -2030041851 - -2.8617727756500244e-01 2.1801990270614624e-01 + -2.5204655528068542e-01 2.6508477330207825e-01 <_> - 0 -1 32 683352887 144804986 883838777 -470815534 749351701 - -1376201987 -1007927147 -269498899 + 0 -1 16 -956904237 -900393 744684798 440408308 1474759700 + 2144675413 -1203478660 -15336458 - -2.7213591337203979e-01 2.3029308021068573e-01 + -2.3463597893714905e-01 2.7154859900474548e-01 <_> - 0 -1 160 -221779237 2055449126 1356126973 1739434813 - -69756111 -78052576 -724205593 927834891 + 0 -1 245 -53498110 -768948404 114700466 -262216722 + 1751010824 1074124611 1456993248 1358295782 - -2.1148133277893066e-01 2.9901567101478577e-01 + -3.6311113834381104e-01 1.7788498103618622e-01 <_> - 0 -1 139 -327161337 -541288917 -1074706625 2069214763 - 1422886542 -570618263 1425911455 1965665867 + 0 -1 103 -2450246 -1080320589 1308138658 825785752 482925554 + 487604154 -283631617 -72380437 - -1.9790525734424591e-01 3.1719624996185303e-01 + -2.4650368094444275e-01 2.5755673646926880e-01 <_> - 0 -1 12 -286652406 -1499051796 -2055991469 557910223 - 226286607 -307013288 537285247 1340571263 + 0 -1 126 1058870580 903144469 -83886593 -1392513810 + -1611137039 -33792596 2145253024 -1402167248 - -3.5588899254798889e-01 1.8802331387996674e-01 + -2.3422972857952118e-01 2.8370600938796997e-01 <_> - 0 -1 204 -440754172 -1969605175 -11230786 -1369112738 - -164163787 -439228643 -440438364 -855854880 + 0 -1 222 70522484 -1663270860 2006973951 737044894 734095092 + 2113182189 -1113780932 -1398140368 - -3.3756810426712036e-01 1.8606249988079071e-01 + -4.2064115405082703e-01 1.4178343117237091e-01 <_> - 0 -1 54 -2103276886 1587028506 -1920974049 -382890163 - -50953603 -625169247 -75998374 847320848 + 0 -1 326 1107681440 1184465408 1697245882 -575681545 + -1209274896 -441716737 -274206977 -1497652999 - -3.3854812383651733e-01 1.8501213192939758e-01 + -2.6777487993240356e-01 2.3421689867973328e-01 <_> - 0 -1 149 -912264192 1437763456 -117442116 1477965101 - -109596288 -782313675 -520249859 -174065925 + 0 -1 238 -876378345 -2002059937 -402854058 2047008718 + -977546123 96466271 -724044704 -855902004 - -2.3874689638614655e-01 2.6692461967468262e-01 + -2.6567915081977844e-01 2.4086490273475647e-01 <_> - 0 -1 179 -74761 -1193108610 -1627717634 -1141359812 - -1350594860 -1212204947 -1900803076 -68466436 + 0 -1 215 -939802373 1936008783 249448665 -1680407978 + 1336956126 721695808 1217691803 968323227 - -1.8434369564056396e-01 3.4898519515991211e-01 + -2.6731696724891663e-01 2.3347604274749756e-01 <_> - 0 -1 320 -806388957 -1603323478 -319904391 -1889144109 - -1427144299 -1074553867 -1577597820 -822218338 + 0 -1 235 1312794114 5408 -1306041678 -1593904412 2071675925 + 373612661 1106728032 -51052590 - -1.9554206728935242e-01 3.1441712379455566e-01 + -4.5101743936538696e-01 1.3724696636199951e-01 + + <_> + 26 + -1.3585999011993408e+00 + <_> - 0 -1 13 -495530405 -1200567737 -562818530 1426283955 - -646798267 -42047966 -283939201 -15210669 + 0 -1 99 -16253125 -1862205680 924703251 353705495 18354879 + -1646443061 1061106495 521109375 - -2.0684894919395447e-01 3.0842429399490356e-01 + -2.6204770803451538e-01 3.2944434881210327e-01 <_> - 0 -1 227 -204473205 -111677525 1659697788 -168822810 - 164468462 95878471 1418323918 -705698930 + 0 -1 106 1589402879 2111243421 -1921360385 498991519 + -1430778630 -1095235424 -299958273 -1415968598 - -1.5447042882442474e-01 4.0702703595161438e-01 + -2.9923591017723083e-01 2.6061478257179260e-01 <_> - 0 -1 122 332207055 1368372207 1371537916 1541155303 - 1377022927 1195687084 -845629564 -191055413 + 0 -1 256 -269500670 -1934972022 -212386444 -340983920 + -840985607 216660013 -838930280 -855967046 - -2.6908680796623230e-01 2.3349469900131226e-01 + -3.1109735369682312e-01 2.4578146636486053e-01 <_> - 0 -1 183 2095555624 -1858958714 880848550 -1086881165 - 1278302507 2017585116 -2100032289 83174071 + 0 -1 290 -785411968 -793272784 -1244701525 -1863077704 + -252760056 -138438225 -325343096 -1934628726 - -3.3865603804588318e-01 1.8762224912643433e-01 + -3.1990429759025574e-01 2.4755740165710449e-01 <_> - 0 -1 257 -1599264894 1347540775 548331985 566406079 - -490018643 2125284619 -542620802 -507647254 + 0 -1 210 -69535757 858989363 -101122561 -1154744385 + -1426397852 787417871 -1394279747 -1049665 - -2.4964332580566406e-01 2.5305619835853577e-01 + -2.4644587934017181e-01 3.1389617919921875e-01 <_> - 0 -1 153 -928904029 -73474081 -431055591 -1365072480 - 1082731439 -1163105435 -401696790 -331068832 + 0 -1 33 44994211 548056274 1050609429 -269234960 235348991 + -1461066343 133104023 -536881691 - -2.4641251564025879e-01 2.5806349515914917e-01 + -3.0615699291229248e-01 2.1291562914848328e-01 <_> - 0 -1 261 -1551324256 227211248 -139191220 -1912739520 - 1712117749 1864425601 1605297047 232734801 + 0 -1 169 -19927354 -998541361 -1031864744 548925694 + 2058738946 1086813587 -117441590 -236978209 - -3.6956688761711121e-01 1.7259617149829865e-01 + -2.8440350294113159e-01 2.4974717199802399e-01 <_> - 0 -1 37 2062683840 -1171226870 -634334626 -42988729 - -177907627 1819501884 -1554858149 -81568901 + 0 -1 225 -403723614 -137498998 12815458 -201331990 + -143659953 -292815449 -1025137984 -146418144 - -2.8280401229858398e-01 2.3210345208644867e-01 + -2.7793189883232117e-01 2.1837951242923737e-01 <_> - 0 -1 101 -52896752 2073648803 -104703392 -1877326687 - 1482183868 486564792 -1181155586 -1078764545 + 0 -1 8 -245367841 -2134021 1724214226 -33737026 -546361345 + 2104391438 -235029522 1894053750 - -2.6182973384857178e-01 2.4921841919422150e-01 + -2.3921246826648712e-01 2.5940048694610596e-01 <_> - 0 -1 119 931876834 -1689820513 -175925869 295803187 - 1288847768 -1394638455 -527053926 -1609099725 + 0 -1 110 -50344201 2021002463 -295113026 503381792 + 1802897488 -1216649 -649569682 -29165030 - -2.8890526294708252e-01 2.2244787216186523e-01 + -2.3499047756195068e-01 2.6225870847702026e-01 <_> - 0 -1 23 674383927 640705886 -1980567045 775069703 941246324 - -1074502869 821615185 -1439559299 + 0 -1 122 -789934932 1559100927 -1917276468 -484037 + -573975107 1557186265 -1157693928 -13043150 - -3.7707689404487610e-01 1.7476500570774078e-01 + -2.7699887752532959e-01 2.1751758456230164e-01 + <_> + + 0 -1 243 -1356859599 -2071938592 -1711301131 -1108552207 + 1067300539 -1648756997 -1988182799 -2007106383 + + -2.2797892987728119e-01 2.6686671376228333e-01 + <_> + + 0 -1 100 1414807752 -136118094 1570099167 1610550975 + 1428132782 -1565038658 1393646523 59441770 + + -3.6224871873855591e-01 1.7005157470703125e-01 + <_> + + 0 -1 198 -1372390622 -1105023217 43974655 -1372390929 + 1012170358 -1352684673 229665733 1794436783 + + -3.7763473391532898e-01 1.4173112809658051e-01 + <_> + + 0 -1 316 638615286 -1109868352 524464629 -1113590375 + 964831210 -1371914704 153292152 -1346434008 + + -3.1874561309814453e-01 1.9032885134220123e-01 + <_> + + 0 -1 305 -269486329 -1908425238 -1208756943 -323096206 + -1547964669 -1433756185 -1767970460 -924320141 + + -2.5788185000419617e-01 2.3276108503341675e-01 + <_> + + 0 -1 193 918434045 498645434 798903545 -1142289332 784082164 + 1851118315 682499324 -340128680 + + -2.8957661986351013e-01 2.0316053926944733e-01 + <_> + + 0 -1 55 -905778490 67121822 -1743743400 -2012053637 + -1636832684 -917214628 -17762321 2135162719 + + -3.3608233928680420e-01 1.7717513442039490e-01 + <_> + + 0 -1 29 -1758265669 915073431 -283673347 -948315937 86215958 + -1624023241 90637669 -823733761 + + -2.1280290186405182e-01 2.7446863055229187e-01 + <_> + + 0 -1 285 -8461782 -86087006 -687954246 -521941938 -614269955 + 1611715303 -151198213 1958209278 + + -2.6345619559288025e-01 2.2300323843955994e-01 + <_> + + 0 -1 212 -1832397616 -766332258 -412702245 -1292380803 + 1220365911 -822484818 -282100849 1398793395 + + -2.9608255624771118e-01 2.0772157609462738e-01 + <_> + + 0 -1 62 -872994057 1071450172 -1104786213 -317692670 + -67746216 -50513552 -88453541 -128910506 + + -2.5465941429138184e-01 2.4114270508289337e-01 + <_> + + 0 -1 10 81939939 183556950 -539144585 -353355856 165875573 + -1782603781 -338732685 -491295903 + + -3.2701194286346436e-01 1.8006059527397156e-01 + <_> + + 0 -1 134 1886692082 -1729102165 542420273 631107582 + -546201661 1476403972 -169532509 1997277933 + + -3.5394954681396484e-01 1.6798554360866547e-01 + <_> + + 0 -1 311 -1700548176 -1715829716 -1343244964 -1155942204 + -53954163 -27257407 -1547772419 -2131951339 + + -3.2425084710121155e-01 1.8224255740642548e-01 + <_> + + 0 -1 203 -490033404 -1438717153 1991554832 -1507676246 + 801593156 -1468572866 -17199788 -391776096 + + -3.5948479175567627e-01 1.6648940742015839e-01 + + <_> + 29 + -1.1730608940124512e+00 + + <_> + + 0 -1 338 -793735168 -175047596 -35594563 -1145503875 + -99305999 -8398955 -71640065 -71630853 + + -2.0565655827522278e-01 3.6647084355354309e-01 + <_> + + 0 -1 58 -1388802 -135286154 -1154293889 689875534 + -1412562742 -2424758 -81338657 -13958585 + + -2.5342568755149841e-01 2.9973617196083069e-01 + <_> + + 0 -1 273 -424689729 1793992298 -69797944 -47701166 147718827 + 217783198 1417368059 1174403067 + + -3.0622813105583191e-01 2.2849719226360321e-01 + <_> + + 0 -1 162 -421534290 -481301273 -343938830 -202899458 + -756039285 1195863875 -218106116 -169345076 + + -2.2961020469665527e-01 2.8787249326705933e-01 + <_> + + 0 -1 334 -8389857 -2043769330 -69534958 -2010610142 + -19399681 -860957441 -40118413 -59769989 + + -2.6856726408004761e-01 2.2150200605392456e-01 + <_> + + 0 -1 342 -4194317 -1097160528 1129927121 -572583600 + -1480608773 -1388663112 1299799505 -840960547 + + -1.8076962232589722e-01 3.2131236791610718e-01 + <_> + + 0 -1 127 1407140879 -538213336 -41173601 -854589681 + -689245505 -92547849 1284158459 168487359 + + -3.0466887354850769e-01 1.9067247211933136e-01 + <_> + + 0 -1 204 -337910785 -18153601 -805309444 1917893626 + -11014155 -1074659969 -67119620 -76515328 + + -1.9108071923255920e-01 2.9606026411056519e-01 + <_> + + 0 -1 4 -1374747297 -1672142509 -690225283 -61276329 + 113970219 -1175502287 1247706719 -545947789 + + -2.3365408182144165e-01 2.5229984521865845e-01 + <_> + + 0 -1 27 -587211009 616612637 -996282177 1350760431 743900160 + -183233459 -1076131105 -546181281 + + -2.4930721521377563e-01 2.2612276673316956e-01 + <_> + + 0 -1 286 -8147552 -1625113614 1286228632 -353481008 + 822466289 1966144435 -285295617 1291708404 + + -2.7701693773269653e-01 2.1534711122512817e-01 + <_> + + 0 -1 308 490673157 1427765332 -1746674373 -1860839277 + 290395277 -1685050565 -1197556801 -1465123113 + + -2.6409074664115906e-01 2.2850526869297028e-01 + <_> + + 0 -1 125 298128335 -187922961 861671868 -33787650 + -1141802097 516205188 -270663748 -255530164 + + -2.7780425548553467e-01 2.1246871352195740e-01 + <_> + + 0 -1 141 1375730695 627907893 -51644163 -268568093 + -503710475 -23415107 2095341716 -1406671321 + + -2.1832446753978729e-01 2.5456944108009338e-01 + <_> + + 0 -1 83 1479937050 1527130690 779251298 -1753555086 + 738741914 1273777055 1391749242 -269504542 + + -3.3689221739768982e-01 1.6092190146446228e-01 + <_> + + 0 -1 227 -940593661 706414255 -1899740490 -1493243222 + -129536651 1683451935 -731306 -185673886 + + -2.9129263758659363e-01 1.9923964142799377e-01 + <_> + + 0 -1 268 1214682914 -1107497954 -50963712 -36048662 + 2122380642 -1060772926 494353798 1572299255 + + -3.1202444434165955e-01 1.9046534597873688e-01 + <_> + + 0 -1 51 -526218504 -655159201 -1651243249 -1083324983 + -1061447364 -1165127435 -1313734326 587291393 + + -3.1355553865432739e-01 1.8095606565475464e-01 + <_> + + 0 -1 138 -16841511 1409112829 -1225064449 -144016265 + -285320164 -3236505 -109781282 -16712598 + + -2.2392266988754272e-01 2.6122003793716431e-01 + <_> + + 0 -1 187 1811899910 1188020131 -427336262 681310146 + 1283408900 1086641242 -201490620 -67766399 + + -3.1929084658622742e-01 1.8652729690074921e-01 + <_> + + 0 -1 92 -1566333438 -1239270996 -1135107763 -1114249923 + -536288113 -707011874 -1302858034 -1326459420 + + -2.6035124063491821e-01 2.1769930422306061e-01 + <_> + + 0 -1 346 139396887 44502064 537054341 437190617 719719428 + -793069360 -663781634 -1368724662 + + -2.9000744223594666e-01 1.9265611469745636e-01 + <_> + + 0 -1 265 -250095070 2097181951 1243884576 263172296 + 1408750261 289431972 2143664050 754312418 + + -2.8242233395576477e-01 2.0532251894474030e-01 + <_> + + 0 -1 206 620238429 1536959391 -6758403 535174905 1047149052 + 921712776 -1362093858 -5615942 + + -2.5363510847091675e-01 2.1782724559307098e-01 + <_> + + 0 -1 340 -943787582 1390929134 2007850965 1575994853 + -1768757774 -404895814 -1244790789 -949809617 + + -2.1436288952827454e-01 2.7378448843955994e-01 + <_> + + 0 -1 21 -69011461 -6135840 -472170147 1668209188 225380825 + -1694527907 15597764 -958430977 + + -1.7761918902397156e-01 2.9578888416290283e-01 + <_> + + 0 -1 63 2145317171 -1615352016 -337285123 796003570 + 525665077 -1366597353 -286321259 -903181106 + + -2.3187226057052612e-01 2.3607331514358521e-01 + <_> + + 0 -1 191 -495277538 434272486 -501947458 526441212 + -1496864652 -1100739471 -792975140 -619624103 + + -2.5271594524383545e-01 2.1627274155616760e-01 + <_> + + 0 -1 303 -805569741 680173544 -709755055 -1378886831 + -1378621171 -1963028225 -1398473520 -2003306283 + + -2.5094878673553467e-01 2.2561351954936981e-01 + + <_> + 29 + -1.3573215007781982e+00 + + <_> + + 0 -1 348 -34622032 -173542149 -656574992 -572523139 + -1051863563 -863055138 -570565121 -572522497 + + -1.2100619077682495e-01 4.5341226458549500e-01 + <_> + + 0 -1 170 -77594885 1060339475 -2139947270 807665435 + 399475712 1041203007 -251923474 1920204539 + + -2.7747187018394470e-01 2.7045109868049622e-01 + <_> + + 0 -1 316 899790847 -4383371 -1087668481 -16941 -2034717186 + -1078292832 -1346650113 -1079270742 + + -2.1022592484951019e-01 3.3468201756477356e-01 + <_> + + 0 -1 0 -279969793 -1 -292628226 -268437778 267325424 + -880878352 216613332 -268443403 + + -2.3492383956909180e-01 2.7808070182800293e-01 + <_> + + 0 -1 68 -656374532 -590854788 -1141031683 -539111939 + -286464771 -705056771 -1611816999 -14883 + + -1.9249799847602844e-01 3.0399987101554871e-01 + <_> + + 0 -1 276 258465713 462159759 15965472 2103961046 1280627108 + -268435525 2026765496 -1025 + + -2.4311806261539459e-01 2.4972844123840332e-01 + <_> + + 0 -1 144 -419434834 1657591678 -455923284 -5386498 + -1216358521 1371620740 2013263792 1442179056 + + -2.8065973520278931e-01 2.2235853970050812e-01 + <_> + + 0 -1 73 -255016286 -723652609 1892807313 -35652917 + -568542589 1275961346 -142606437 1154327186 + + -3.2926952838897705e-01 1.6259366273880005e-01 + <_> + + 0 -1 167 3384620 904725092 -504505106 -10623284 1932031989 + -2330160 -1248468832 -1126046076 + + -2.8664493560791016e-01 2.2413903474807739e-01 + <_> + + 0 -1 284 -1026571858 -1026883601 -488570970 -492639282 + 1508886477 -1060260628 -1479752754 1962733263 + + -2.9589930176734924e-01 1.9247196614742279e-01 + <_> + + 0 -1 341 -78686238 -2027290630 -378837808 -570440104 + 1632253693 101381112 1498878421 -841095201 + + -2.3898813128471375e-01 2.4848675727844238e-01 + <_> + + 0 -1 108 -1971972962 -8706569 2096520703 594690133 + -1434911233 -341858 -1163260049 -1440077729 + + -2.8525370359420776e-01 2.0041574537754059e-01 + <_> + + 0 -1 113 1339985527 -934921 -1409937733 -895471966 + 1451110391 -1073836291 -268755217 -760410 + + -2.0745021104812622e-01 2.7934357523918152e-01 + <_> + + 0 -1 87 -1360393537 1727751901 -889274753 2081439599 + 1607743092 -67350714 -1091371394 -27240650 + + -2.3077887296676636e-01 2.4403619766235352e-01 + <_> + + 0 -1 72 -17272190 -730449666 983947743 -134882993 1883483442 + -72060809 1044905951 -211072966 + + -2.6235556602478027e-01 2.0745755732059479e-01 + <_> + + 0 -1 189 -210252097 1884165717 -50659376 860389370 -33585068 + 2132105077 -553789572 -9176254 + + -1.9577032327651978e-01 2.8605857491493225e-01 + <_> + + 0 -1 244 -12107230 1405347498 9728696 -774898706 1468220672 + 1174850371 1180713096 1409800424 + + -3.3929014205932617e-01 1.6556024551391602e-01 + <_> + + 0 -1 307 -994181088 1291627471 1262103330 -354443110 + 1962482852 1291513853 1151615436 1157370878 + + -4.2177367210388184e-01 1.3324783742427826e-01 + <_> + + 0 -1 267 -307502430 988475890 1831374754 -1645284694 + 2130962323 221299939 -582233169 -875695884 + + -2.4994827806949615e-01 2.2937348484992981e-01 + <_> + + 0 -1 278 -1916848333 -1945176701 -1778585227 -2064614508 + -122685775 -1462060545 176022580 -862585616 + + -2.7523562312126160e-01 2.1038419008255005e-01 + <_> + + 0 -1 15 1794562783 -1707697032 8965707 201493599 -1078044347 + 2071358036 -228402354 -16253105 + + -2.4676196277141571e-01 2.2217004001140594e-01 + <_> + + 0 -1 329 -570688129 -559096592 461864797 -1648504323 + -1381270595 -1162301576 748698989 -1140857537 + + -1.3901424407958984e-01 3.8346973061561584e-01 + <_> + + 0 -1 336 1356057541 815348525 -54210793 825603867 -185511716 + 2030008165 -1397949527 -105647169 + + -1.8459501862525940e-01 2.9480937123298645e-01 + <_> + + 0 -1 241 -1373456459 -1213441040 -1090789891 -1087429059 + -1397245955 -1074004547 -1883766851 -1079288824 + + -2.1159930527210236e-01 2.6970177888870239e-01 + <_> + + 0 -1 168 2001407789 335849869 -147476753 -1053743 895956974 + 2104879189 76816574 -186254656 + + -2.4863779544830322e-01 2.2415082156658173e-01 + <_> + + 0 -1 161 -1071127926 -104798275 1634638992 -201508730 + 1308444431 1370014335 -43939345 735390534 + + -2.4622464179992676e-01 2.2192895412445068e-01 + <_> + + 0 -1 260 746016303 709037870 45760155 141491407 1256916534 + 185498431 812100448 -602305968 + + -3.7083637714385986e-01 1.5087808668613434e-01 + <_> + + 0 -1 118 2084023842 2097190758 -39176271 -570569955 + -688182614 -1748393229 1173046543 1430650494 + + -2.4530048668384552e-01 2.2491128742694855e-01 + <_> + + 0 -1 23 1900052178 -1459537106 -167381666 1029895584 + -675654745 -1737122 844265207 1512783454 + + -3.1983017921447754e-01 1.8673284351825714e-01 + + <_> + 30 + -1.1131941080093384e+00 + + <_> + + 0 -1 254 -26289153 -67174410 -335742017 -272455006 + 1212186622 -20513038 172322783 1162040387 + + -2.4323463439941406e-01 3.2466232776641846e-01 + <_> + + 0 -1 48 -528449376 -101669640 -553748993 -536903943 + 1018034165 -17510413 -570626819 -10529 + + -2.5142908096313477e-01 2.8689405322074890e-01 + <_> + + 0 -1 240 -1539 -1130741968 -34078723 1032337712 -1251478531 + -1665269762 -1075314726 -1145380949 + + -1.8148881196975708e-01 3.5420870780944824e-01 + <_> + + 0 -1 280 -83887105 817571843 -1039149548 1548950080 + -1465058162 -1157678437 -1463092262 -201326609 + + -1.6771338880062103e-01 3.5687464475631714e-01 + <_> + + 0 -1 57 -532737 -35715969 135855871 -1145344385 -16888678 + -83947472 -1440547846 -15532193 + + -1.8111394345760345e-01 3.3908957242965698e-01 + <_> + + 0 -1 11 720900064 2130477023 -1412285101 955268081 + -2069885116 -55066689 -1073778857 2096463733 + + -3.9165833592414856e-01 1.3025353848934174e-01 + <_> + + 0 -1 101 -1346721094 453313040 838687891 1466900303 + -1399343880 -1362120449 -1204875206 2078743195 + + -3.0911612510681152e-01 1.8588562309741974e-01 + <_> + + 0 -1 264 -202906070 1938124526 -409308124 1894181886 + 1886745604 73722021 -169346204 1624557028 + + -3.7369936704635620e-01 1.6779878735542297e-01 + <_> + + 0 -1 315 253329560 487885008 764610172 1031107061 353634728 + 340804628 54078428 1065330931 + + -4.6387240290641785e-01 9.7853913903236389e-02 + <_> + + 0 -1 221 1018691377 213157736 -1922048203 -1935119200 + 1002285621 -1923389008 220951933 -2001869391 + + -2.8209856152534485e-01 1.9869700074195862e-01 + <_> + + 0 -1 131 -145809672 -585615056 -1115156804 1607413650 + 1024261612 944513264 -1966100738 -6315329 + + -2.5250333547592163e-01 2.1315294504165649e-01 + <_> + + 0 -1 236 -273750513 1726356523 -25760220 -1359572570 + -708967119 2113503015 1155493984 -1057490414 + + -2.9303619265556335e-01 2.0555299520492554e-01 + <_> + + 0 -1 94 323820494 491589631 963097087 -1677743793 1968422864 + 122533774 -13255752 2009905796 + + -3.3369639515876770e-01 1.6422146558761597e-01 + <_> + + 0 -1 147 -227028310 322043889 -97472590 993106459 -935679349 + 1170424128 -355628373 -1186994445 + + -2.3621979355812073e-01 2.4498730897903442e-01 + <_> + + 0 -1 302 522927795 -1425531232 -1757151367 -349047764 + 505005821 -1367184427 1026187772 -2002064200 + + -2.7412149310112000e-01 1.9911617040634155e-01 + <_> + + 0 -1 339 895166720 2111801021 1608646093 1966952754 + -270845440 -14704805 797543682 146244640 + + -3.7740421295166016e-01 1.6069526970386505e-01 + <_> + + 0 -1 157 1323192543 -699121475 -560546497 4377727 -795736016 + -617006470 -94369186 -25800110 + + -2.7069774270057678e-01 1.9588492810726166e-01 + <_> + + 0 -1 327 -818173702 520657616 646455540 -2083557932 + -75238914 420007072 1594772940 231600639 + + -3.1584987044334412e-01 1.7538470029830933e-01 + <_> + + 0 -1 1 -148176937 -22288910 -828264777 -858011334 549667459 + -104350212 83820556 -521682689 + + -1.8492446839809418e-01 2.9220038652420044e-01 + <_> + + 0 -1 123 -253231012 -573137851 -1892901128 1566408309 + -1769517004 -666343243 -1438498978 -1574952149 + + -3.1360149383544922e-01 1.7211912572383881e-01 + <_> + + 0 -1 60 170284113 586555385 1058684927 947969752 -1950608368 + -385672127 -1672070998 -1168986245 + + -3.3217278122901917e-01 1.5771922469139099e-01 + <_> + + 0 -1 248 1432934647 967738510 1321343231 -1294596018 + 1010881693 478544329 145528063 1050558707 + + -2.6398298144340515e-01 2.1170960366725922e-01 + <_> + + 0 -1 209 1165995551 424529746 -728651937 -169112117 + 1305345535 2025713070 -338894882 1081454374 + + -2.2665287554264069e-01 2.3902100324630737e-01 + <_> + + 0 -1 257 -167798992 1502279678 -537643148 2040558008 + -319819863 -1915752500 1705108696 -858081046 + + -2.0653969049453735e-01 2.7062198519706726e-01 + <_> + + 0 -1 333 800009831 1001521851 -124862633 533722757 935548439 + -1187270792 2020438516 -349479616 + + -2.8587275743484497e-01 1.8258976936340332e-01 + <_> + + 0 -1 263 -1004379104 -317547503 -1375022085 -1350509633 + -1535534960 -559793401 -1261510978 -1412440193 + + -2.5795167684555054e-01 2.0566099882125854e-01 + <_> + + 0 -1 146 465286027 242062640 1583158025 -1699742834 + 824414919 851244643 -1124620860 -795411494 + + -2.4531027674674988e-01 2.1592345833778381e-01 + <_> + + 0 -1 25 -2043693556 -725407700 793901503 -36185267 5371426 + 653472838 1473727247 129745679 + + -3.0099743604660034e-01 1.7710824310779572e-01 + <_> + + 0 -1 292 -1275032352 -23523116 1030926068 -570510472 + 33719442 719784182 96905635 -1916299537 + + -2.9368206858634949e-01 1.8733473122119904e-01 + <_> + + 0 -1 9 1373348482 -2133926229 953967473 1290797039 + -354421821 777789632 1265367830 1148839750 + + -3.7210872769355774e-01 1.5113249421119690e-01 + + <_> + 32 + -1.1860446929931641e+00 + + <_> + + 0 -1 165 1356843726 1624768255 -826079028 -286274834 + 1507794655 -722342276 -3191601 -352325921 + + -1.7216572165489197e-01 3.7796711921691895e-01 + <_> + + 0 -1 313 -780169199 2100304165 -586083043 -1123467235 + -638110531 -4406601 -274183091 201852044 + + -3.2011264562606812e-01 2.1122068166732788e-01 + <_> + + 0 -1 133 -571204388 -100720840 -1619059363 -539550628 + -19218498 -193040 -88209091 -1086649846 + + -2.5261041522026062e-01 2.6258233189582825e-01 + <_> + + 0 -1 117 -1828478207 -1843284467 -485637257 -1828588787 + -988301809 -3170571 1124595215 -206576893 + + -2.2752490639686584e-01 2.6724869012832642e-01 + <_> + + 0 -1 156 -25473825 877659895 -67700993 2077895802 -18998020 + -69575009 -640262 -21489648 + + -2.6945993304252625e-01 2.0498518645763397e-01 + <_> + + 0 -1 252 1800381322 61586570 -598811408 -805833218 + 1363795719 21154001 -790399642 -19401985 + + -2.7357041835784912e-01 2.2086700797080994e-01 + <_> + + 0 -1 13 -1601560401 -1678195249 -800754625 -819308539 + 1645503999 -1361531665 -491535701 -552874238 + + -2.4950334429740906e-01 2.1326830983161926e-01 + <_> + + 0 -1 197 -1130634113 775889725 -1098908817 -1382023297 + -252264234 -1460797259 -391364236 -1203775120 + + -2.2527810931205750e-01 2.4279835820198059e-01 + <_> + + 0 -1 350 792411409 1058027552 -110125307 2134056272 + 605163321 -1347378309 1504534524 226299985 + + -4.0245848894119263e-01 1.2799273431301117e-01 + <_> + + 0 -1 347 1050083335 406261055 -1363608721 597939991 + -146861538 -1075839447 -122225990 -73208017 + + -2.2469925880432129e-01 2.3744599521160126e-01 + <_> + + 0 -1 85 1582192403 1062343974 1627149746 -704505584 + 1569152382 -607155889 -671101020 -67379489 + + -2.4716284871101379e-01 2.0234791934490204e-01 + <_> + + 0 -1 232 -911388934 285282595 -1026079813 96171241 + -1995666022 998839072 9210339 769654523 + + -2.7387142181396484e-01 1.9601228833198547e-01 + <_> + + 0 -1 345 -1232081117 -1601765464 1841782352 -1359108881 + 206394688 214450860 -570607531 -866268431 + + -3.0001869797706604e-01 1.6920509934425354e-01 + <_> + + 0 -1 295 -4458576 -1314131792 1398469949 -1792059607 + -1345405187 -1079051090 1452237728 -1919952197 + + -1.9607956707477570e-01 2.6292434334754944e-01 + <_> + + 0 -1 79 1506257807 1575786835 -1278408030 -1253124710 + -82575398 1430293160 1930209224 -796269912 + + -2.9750382900238037e-01 1.7626072466373444e-01 + <_> + + 0 -1 237 -426011871 401504059 -655056592 -96541869 + 1174138997 83593771 1356719392 -1057033481 + + -2.6239070296287537e-01 2.0239675045013428e-01 + <_> + + 0 -1 224 528217457 -1887267120 -21899275 230954172 182253557 + -1078346768 673994781 -1465425804 + + -2.4917839467525482e-01 2.0696680247783661e-01 + <_> + + 0 -1 140 1077257734 1897370406 -259859707 1059435291 + 1506651014 -1718550481 1420667359 1969609218 + + -2.4424369633197784e-01 2.1042110025882721e-01 + <_> + + 0 -1 230 -134218838 2137809570 -218175868 -139728728 + 2147479551 1513965270 -436767017 -19926812 + + -2.1578867733478546e-01 2.3687294125556946e-01 + <_> + + 0 -1 41 1061133429 -1680215183 951637661 -1082528295 + -1722602208 -281648288 -576384764 -1426137478 + + -2.3583492636680603e-01 2.2509087622165680e-01 + <_> + + 0 -1 326 -1035541888 1145865728 -431122728 1154338362 + -692060765 -187976868 -205526277 111929518 + + -3.4106892347335815e-01 1.7086119949817657e-01 + <_> + + 0 -1 158 763361143 740787839 -1648101507 -1076559121 + -256380937 758360290 -1207635964 68200468 + + -3.1536939740180969e-01 1.5365907549858093e-01 + <_> + + 0 -1 176 -1898557315 -1344526497 1827929727 1610372479 + -2220468 -110762 -560275617 -1168483765 + + -2.1805766224861145e-01 2.4546204507350922e-01 + <_> + + 0 -1 262 -167774321 -749754393 -772349322 1946088623 -529788 + -570036402 -404621404 -202506274 + + -1.4736793935298920e-01 3.7225186824798584e-01 + <_> + + 0 -1 121 337917444 140836324 -1369830227 -1342456915 + -1175112267 2101116535 -1384838109 741831797 + + -3.9851671457290649e-01 1.3316881656646729e-01 + <_> + + 0 -1 172 -10244980 1412480785 2134521425 1932578931 + 1778322640 1063337502 1048517040 -142620803 + + -2.2908750176429749e-01 2.3318812251091003e-01 + <_> + + 0 -1 220 739784564 884511140 894928089 1065491218 122138060 + 524623529 391056888 532291626 + + -3.5874554514884949e-01 1.4738923311233521e-01 + <_> + + 0 -1 182 -1557157214 -1407349557 276451840 542158770 + -767297572 1620822855 -1963265624 -1002119198 + + -3.2322171330451965e-01 1.5725640952587128e-01 + <_> + + 0 -1 98 1561639164 -577384833 -972029477 -26394741 + 1433517817 -1145825634 2090400506 1064572985 + + -3.8865497708320618e-01 1.4794999361038208e-01 + <_> + + 0 -1 17 1785851519 234900079 -867150209 -1033437237 + -338602732 -9149625 -888193454 -33498413 + + -2.5603562593460083e-01 2.1439185738563538e-01 + <_> + + 0 -1 93 1062021007 670948845 -237027440 889116157 2002805591 + 1966188591 -1350453384 1885696686 + + -3.7720784544944763e-01 1.3390180468559265e-01 + <_> + + 0 -1 129 -239339312 255035166 -873625424 958256640 -59805472 + 1222090819 -746264190 269999815 + + -3.5460588335990906e-01 1.4317318797111511e-01 <_> 0 0 2 2 + <_> + + 0 0 2 4 <_> 0 0 3 4 <_> - 0 0 5 3 + 0 0 4 4 <_> - 0 0 5 4 + 0 0 5 7 <_> 0 0 6 3 + <_> + + 0 0 6 4 + <_> + + 0 0 6 6 <_> 0 0 8 1 <_> - 0 1 2 3 + 0 1 8 5 <_> - 0 1 6 4 + 0 3 6 2 <_> - 0 2 8 5 + 0 3 6 3 <_> - 0 7 6 2 + 0 4 6 4 + <_> + + 0 6 3 2 + <_> + + 0 8 3 1 <_> 0 9 2 2 <_> - 0 9 3 1 - <_> - - 0 9 5 3 + 0 10 2 2 <_> 0 14 3 3 @@ -2411,73 +2765,61 @@ 0 15 2 2 <_> - 0 16 1 2 + 0 17 3 2 <_> - 0 17 2 2 + 1 0 4 4 <_> - 1 0 2 4 + 1 1 2 3 <_> - 1 0 5 3 + 1 6 2 2 <_> - 1 0 7 1 + 1 6 4 3 <_> - 1 6 2 1 + 1 7 2 1 <_> - 1 9 1 1 + 1 8 2 1 <_> - 1 9 2 2 + 1 8 2 3 <_> - 1 15 1 2 + 1 12 2 1 <_> 1 16 2 2 - <_> - - 2 0 2 2 <_> 2 0 2 3 <_> - 2 0 3 4 + 2 0 5 3 <_> - 2 1 3 7 + 2 1 4 2 <_> - 2 4 1 1 - <_> - - 2 4 5 2 - <_> - - 2 4 5 4 + 2 3 5 2 <_> 2 5 1 1 + <_> + + 2 6 2 1 <_> 2 6 2 2 - <_> - - 2 7 1 1 - <_> - - 2 7 2 1 - <_> - - 2 8 3 3 <_> 2 9 1 1 + <_> + + 2 9 2 1 <_> 2 10 1 1 @@ -2489,40 +2831,31 @@ 2 15 1 2 <_> - 2 19 2 1 + 3 0 1 1 <_> - 3 0 4 3 + 3 0 3 3 <_> - 3 0 6 6 - <_> - - 3 0 7 1 + 3 0 6 1 <_> 3 2 4 2 <_> - 3 2 6 1 - <_> - - 3 4 2 2 + 3 4 1 2 <_> 3 5 1 1 + <_> + + 3 5 3 3 <_> 3 6 1 1 <_> - 3 6 2 1 - <_> - - 3 6 2 3 - <_> - - 3 6 3 3 + 3 6 2 2 <_> 3 6 6 1 @@ -2543,13 +2876,10 @@ 3 9 1 1 <_> - 3 9 1 2 + 3 9 3 1 <_> 3 10 1 1 - <_> - - 3 10 1 2 <_> 3 10 2 1 @@ -2558,34 +2888,34 @@ 3 11 1 1 <_> - 3 11 1 3 + 3 12 1 1 <_> - 3 13 3 3 + 3 13 3 2 + <_> + + 3 18 2 2 + <_> + + 4 0 2 2 <_> 4 0 4 2 <_> - 4 0 6 7 + 4 0 5 6 <_> - 4 1 1 1 + 4 2 2 2 <_> - 4 1 4 3 - <_> - - 4 4 2 1 + 4 5 3 1 <_> 4 6 1 1 <_> - 4 6 5 1 - <_> - - 4 6 5 4 + 4 6 2 3 <_> 4 7 1 1 @@ -2594,10 +2924,10 @@ 4 7 2 2 <_> - 4 7 5 1 + 4 8 1 1 <_> - 4 8 1 1 + 4 8 5 3 <_> 4 8 5 4 @@ -2606,13 +2936,16 @@ 4 9 1 1 <_> - 4 9 2 1 + 4 9 1 3 <_> 4 9 3 5 <_> 4 9 5 1 + <_> + + 4 9 6 1 <_> 4 10 1 1 @@ -2624,25 +2957,46 @@ 4 12 1 2 <_> - 4 14 3 3 + 4 12 3 3 <_> - 4 15 1 1 + 4 13 3 3 <_> - 4 18 2 1 + 4 14 2 2 <_> - 5 2 5 3 + 4 17 3 1 <_> - 5 3 4 4 + 4 21 2 1 + <_> + + 5 0 5 1 + <_> + + 5 0 5 4 + <_> + + 5 1 5 5 + <_> + + 5 1 5 6 + <_> + + 5 4 1 1 + <_> + + 5 5 5 1 + <_> + + 5 5 5 2 <_> 5 6 1 1 <_> - 5 6 4 1 + 5 6 5 1 <_> 5 7 1 1 @@ -2651,22 +3005,16 @@ 5 7 1 2 <_> - 5 7 2 2 + 5 7 3 4 <_> 5 8 1 1 <_> - 5 8 3 4 + 5 8 2 4 <_> - 5 8 3 5 - <_> - - 5 8 5 1 - <_> - - 5 8 5 3 + 5 8 5 4 <_> 5 9 1 1 @@ -2675,10 +3023,10 @@ 5 9 5 1 <_> - 5 10 1 1 + 5 9 5 3 <_> - 5 10 2 1 + 5 10 1 1 <_> 5 10 5 1 @@ -2687,13 +3035,25 @@ 5 11 1 1 <_> - 5 13 1 3 + 5 13 2 1 <_> - 5 16 1 1 + 5 17 1 1 <_> - 5 18 1 2 + 5 17 1 2 + <_> + + 5 20 1 1 + <_> + + 6 0 3 1 + <_> + + 6 0 4 1 + <_> + + 6 0 6 2 <_> 6 0 6 5 @@ -2702,10 +3062,7 @@ 6 1 1 2 <_> - 6 3 1 1 - <_> - - 6 3 6 3 + 6 3 1 2 <_> 6 4 1 1 @@ -2714,16 +3071,10 @@ 6 5 1 1 <_> - 6 5 1 2 + 6 5 6 3 <_> - 6 6 2 2 - <_> - - 6 6 2 4 - <_> - - 6 6 3 3 + 6 6 1 1 <_> 6 7 1 1 @@ -2733,75 +3084,81 @@ <_> 6 7 4 1 - <_> - - 6 7 4 4 <_> 6 7 6 1 <_> - 6 8 1 4 + 6 8 1 1 + <_> + + 6 8 2 1 <_> 6 8 2 2 + <_> + + 6 8 2 3 <_> 6 9 1 1 <_> 6 9 2 1 - <_> - - 6 9 2 2 - <_> - - 6 9 5 1 - <_> - - 6 9 6 2 <_> 6 10 1 1 + <_> + + 6 10 4 3 <_> 6 11 1 1 <_> - 6 13 1 1 - <_> - - 6 13 2 1 + 6 18 1 1 <_> 6 18 1 2 <_> - 6 20 1 1 + 6 19 1 1 <_> - 7 0 3 1 + 6 21 2 1 <_> - 7 2 1 3 + 7 0 1 4 <_> - 7 3 4 5 + 7 0 5 3 + <_> + + 7 4 1 1 + <_> + + 7 4 1 2 <_> 7 5 1 1 - <_> - - 7 5 2 1 <_> 7 6 1 1 <_> - 7 7 1 2 + 7 6 2 1 <_> - 7 7 2 4 + 7 6 2 3 + <_> + + 7 6 2 5 + <_> + + 7 7 1 1 + <_> + + 7 7 1 2 <_> 7 8 1 1 @@ -2810,31 +3167,31 @@ 7 8 1 2 <_> - 7 8 2 4 + 7 8 2 2 <_> 7 9 1 1 <_> - 7 16 1 1 + 7 9 2 3 <_> - 7 21 1 1 + 7 18 1 1 <_> - 7 21 2 1 + 7 20 2 1 <_> - 8 0 2 1 - <_> - - 8 0 3 1 + 8 0 5 1 <_> 8 0 5 3 <_> 8 3 1 1 + <_> + + 8 3 1 3 <_> 8 4 1 1 @@ -2843,67 +3200,94 @@ 8 5 1 1 <_> - 8 5 1 2 + 8 5 5 1 <_> - 8 7 3 4 + 8 6 1 2 <_> 8 8 1 1 + <_> + + 8 8 4 1 + <_> + + 8 8 4 2 <_> 8 9 1 1 <_> - 8 9 3 5 + 8 9 1 2 <_> 8 11 1 1 + <_> + + 8 12 1 2 + <_> + + 8 13 3 3 <_> 8 14 1 1 <_> - 8 19 1 1 - <_> - - 8 20 1 1 + 8 15 1 1 <_> 8 21 1 1 <_> - 9 0 2 3 + 8 21 2 1 <_> - 9 1 2 1 + 9 0 2 2 <_> - 9 5 2 1 + 9 0 5 3 + <_> + + 9 1 2 2 + <_> + + 9 2 1 1 + <_> + + 9 3 1 1 + <_> + + 9 3 2 2 + <_> + + 9 4 2 1 + <_> + + 9 4 4 1 <_> 9 5 2 3 - <_> - - 9 5 4 1 - <_> - - 9 7 1 1 <_> 9 9 1 1 <_> - 9 11 1 1 - <_> - - 9 12 2 4 + 9 10 1 1 <_> 9 15 1 1 <_> - 9 17 1 1 + 9 15 2 2 + <_> + + 9 16 1 1 + <_> + + 9 16 2 2 + <_> + + 9 18 1 1 <_> 9 18 1 2 @@ -2912,19 +3296,22 @@ 9 20 1 1 <_> - 10 0 2 2 + 9 21 1 1 <_> - 10 6 3 3 + 10 0 4 3 + <_> + + 10 4 4 2 + <_> + + 10 6 1 1 <_> 10 7 1 1 <_> 10 8 1 1 - <_> - - 10 9 1 1 <_> 10 11 1 1 @@ -2933,73 +3320,73 @@ 10 12 1 1 <_> - 10 15 1 1 + 10 14 1 1 + <_> + + 10 18 1 2 + <_> + + 10 19 1 1 <_> 10 20 1 1 <_> 10 21 1 1 + <_> + + 11 0 1 3 <_> 11 0 4 4 <_> - 11 1 4 4 + 11 2 3 2 <_> - 11 3 1 1 + 11 5 4 3 <_> - 11 4 3 1 - <_> - - 11 6 3 6 + 11 6 1 1 <_> 11 7 1 1 <_> - 11 8 1 1 + 11 7 2 4 + <_> + + 11 8 2 2 <_> 11 9 1 1 <_> - 11 9 2 3 + 11 9 2 4 <_> - 11 10 1 1 + 11 12 1 1 <_> - 11 11 1 1 + 11 18 1 1 <_> - 11 12 2 3 - <_> - - 11 13 1 1 - <_> - - 11 15 3 1 + 11 18 3 2 <_> 11 20 1 1 <_> 11 21 1 1 + <_> + + 11 21 2 1 + <_> + + 12 2 1 1 <_> 12 3 1 1 - <_> - - 12 5 1 1 - <_> - - 12 5 2 3 - <_> - - 12 5 3 3 <_> 12 6 1 1 @@ -3011,31 +3398,37 @@ 12 8 1 1 <_> - 12 8 2 2 + 12 8 2 1 <_> 12 8 2 3 <_> - 12 9 1 1 + 12 8 2 4 <_> - 12 10 2 3 + 12 9 2 1 <_> - 12 11 1 1 + 12 9 2 5 + <_> + + 12 10 1 1 + <_> + + 12 12 1 1 + <_> + + 12 13 1 1 + <_> + + 12 14 1 1 <_> 12 16 1 1 - <_> - - 12 17 1 1 <_> 12 18 1 1 - <_> - - 12 18 1 2 <_> 12 20 1 1 @@ -3044,7 +3437,7 @@ 12 21 1 1 <_> - 13 0 3 3 + 12 21 2 1 <_> 13 3 1 1 @@ -3056,13 +3449,19 @@ 13 5 1 1 <_> - 13 6 2 3 + 13 6 3 3 + <_> + + 13 7 1 4 <_> 13 7 3 2 <_> 13 8 1 1 + <_> + + 13 8 2 2 <_> 13 9 1 1 @@ -3077,40 +3476,46 @@ 13 11 1 1 <_> - 13 13 1 1 + 13 15 1 1 <_> - 13 19 1 1 + 13 16 1 1 <_> 13 20 1 1 - <_> - - 13 21 1 1 <_> 14 0 3 4 <_> - 14 3 1 2 + 14 1 2 1 <_> - 14 3 2 1 + 14 3 1 3 <_> 14 4 1 1 + <_> + + 14 4 3 2 <_> 14 5 1 1 <_> - 14 6 2 3 + 14 5 1 2 <_> - 14 7 1 3 + 14 6 2 1 <_> - 14 7 2 2 + 14 7 1 1 + <_> + + 14 7 1 2 + <_> + + 14 7 2 5 <_> 14 8 1 1 @@ -3120,6 +3525,9 @@ <_> 14 9 1 1 + <_> + + 14 9 1 2 <_> 14 9 2 1 @@ -3128,25 +3536,37 @@ 14 13 1 1 <_> - 14 21 1 1 + 14 14 2 2 + <_> + + 14 18 1 2 + <_> + + 14 21 2 1 <_> 15 0 3 4 + <_> + + 15 0 3 5 <_> 15 1 1 2 <_> - 15 2 1 2 + 15 2 2 2 + <_> + + 15 3 2 1 + <_> + + 15 4 1 1 <_> 15 5 1 1 <_> - 15 6 2 1 - <_> - - 15 6 2 2 + 15 6 1 1 <_> 15 7 1 1 @@ -3156,30 +3576,69 @@ <_> 15 7 2 2 + <_> + + 15 7 3 2 <_> 15 8 1 1 <_> 15 9 1 1 + <_> + + 15 9 1 4 <_> 15 9 1 5 <_> - 15 9 2 1 + 15 10 2 1 <_> - 15 15 3 3 + 15 11 1 1 + <_> + + 15 13 2 2 + <_> + + 15 15 3 2 + <_> + + 15 16 2 2 <_> 15 17 1 1 + <_> + + 15 17 3 2 + <_> + + 15 18 1 1 + <_> + + 15 18 3 2 + <_> + + 15 19 1 1 + <_> + + 15 21 3 1 <_> 16 4 1 1 + <_> + + 16 5 1 1 + <_> + + 16 5 2 2 <_> 16 6 1 1 + <_> + + 16 6 2 2 <_> 16 7 1 1 @@ -3191,10 +3650,10 @@ 16 7 2 1 <_> - 16 7 2 2 + 16 8 1 1 <_> - 16 8 1 1 + 16 9 1 1 <_> 16 10 1 1 @@ -3209,13 +3668,10 @@ 16 17 1 2 <_> - 16 18 1 1 + 16 19 1 1 <_> - 17 4 2 2 - <_> - - 17 5 1 1 + 17 1 2 3 <_> 17 6 2 1 @@ -3233,10 +3689,10 @@ 17 8 1 1 <_> - 17 8 2 1 + 17 9 1 1 <_> - 17 9 1 1 + 17 9 2 2 <_> 17 10 1 1 @@ -3251,86 +3707,62 @@ 17 12 1 2 <_> - 17 13 1 2 + 17 13 1 1 <_> - 17 13 1 3 - <_> - - 17 21 2 1 + 18 0 2 1 <_> 18 0 2 2 <_> - 18 4 1 2 + 18 4 2 2 + <_> + + 18 5 1 1 <_> 18 6 1 1 <_> - 18 8 2 2 + 18 6 1 2 + <_> + + 18 8 1 1 <_> 18 9 1 1 - <_> - - 18 9 1 2 - <_> - - 18 9 1 3 <_> 18 10 1 1 <_> - 18 11 1 2 + 18 11 1 3 <_> 18 12 1 1 - <_> - - 18 13 1 2 <_> 18 17 2 2 <_> - 18 18 1 2 + 19 4 1 1 <_> - 18 19 2 1 - <_> - - 19 0 1 1 - <_> - - 19 6 1 1 + 19 5 1 1 <_> 19 9 1 1 <_> - 19 9 1 2 - <_> - - 19 10 1 4 + 19 11 1 1 <_> 19 12 1 2 <_> - 20 10 1 1 + 19 15 1 2 <_> - 20 15 1 2 - <_> - - 21 10 1 1 - <_> - - 21 14 1 2 - <_> - - 21 15 1 3 + 20 10 1 1 diff --git a/doc/opencv.bib b/doc/opencv.bib index dea93f8b1f..29a2ae4512 100644 --- a/doc/opencv.bib +++ b/doc/opencv.bib @@ -457,6 +457,11 @@ title = {ROF and TV-L1 denoising with Primal-Dual algorithm}, url = {http://znah.net/rof-and-tv-l1-denoising-with-primal-dual-algorithm.html} } +@MISC{VandLec, + author = {Vandenberghe, Lieven}, + title = {QR Factorization}, + url = {http://www.seas.ucla.edu/~vandenbe/133A/lectures/qr.pdf} +} @ARTICLE{MHT2011, author = {Getreuer, Pascal}, title = {Malvar-He-Cutler Linear Image Demosaicking}, diff --git a/doc/py_tutorials/py_bindings/py_bindings_basics/py_bindings_basics.markdown b/doc/py_tutorials/py_bindings/py_bindings_basics/py_bindings_basics.markdown index e256bcea03..4f48ae7799 100644 --- a/doc/py_tutorials/py_bindings/py_bindings_basics/py_bindings_basics.markdown +++ b/doc/py_tutorials/py_bindings/py_bindings_basics/py_bindings_basics.markdown @@ -142,5 +142,6 @@ public: So these are the major extension macros available in OpenCV. Typically, a developer has to put proper macros in their appropriate positions. Rest is done by generator scripts. Sometimes, there may be an exceptional cases where generator scripts cannot create the wrappers. Such functions need -to be handled manually. But most of the time, a code written according to OpenCV coding guidelines -will be automatically wrapped by generator scripts. +to be handled manually, to do this write your own pyopencv_*.hpp extending headers and put them into +misc/python subdirectory of your module. But most of the time, a code written according to OpenCV +coding guidelines will be automatically wrapped by generator scripts. \ No newline at end of file diff --git a/doc/py_tutorials/py_feature2d/py_fast/py_fast.markdown b/doc/py_tutorials/py_feature2d/py_fast/py_fast.markdown index 1534c57ac7..191f42e0b5 100644 --- a/doc/py_tutorials/py_feature2d/py_fast/py_fast.markdown +++ b/doc/py_tutorials/py_feature2d/py_fast/py_fast.markdown @@ -105,7 +105,7 @@ fast = cv2.FastFeatureDetector_create() # find and draw the keypoints kp = fast.detect(img,None) -img2 = cv2.drawKeypoints(img, kp, color=(255,0,0)) +img2 = cv2.drawKeypoints(img, kp, None, color=(255,0,0)) # Print all default params print "Threshold: ", fast.getInt('threshold') @@ -121,7 +121,7 @@ kp = fast.detect(img,None) print "Total Keypoints without nonmaxSuppression: ", len(kp) -img3 = cv2.drawKeypoints(img, kp, color=(255,0,0)) +img3 = cv2.drawKeypoints(img, kp, None, color=(255,0,0)) cv2.imwrite('fast_false.png',img3) @endcode diff --git a/doc/py_tutorials/py_feature2d/py_orb/py_orb.markdown b/doc/py_tutorials/py_feature2d/py_orb/py_orb.markdown index c1917eb1a5..49c558a5ec 100644 --- a/doc/py_tutorials/py_feature2d/py_orb/py_orb.markdown +++ b/doc/py_tutorials/py_feature2d/py_orb/py_orb.markdown @@ -79,8 +79,8 @@ kp = orb.detect(img,None) kp, des = orb.compute(img, kp) # draw only keypoints location,not size and orientation -img2 = cv2.drawKeypoints(img,kp,color=(0,255,0), flags=0) -plt.imshow(img2),plt.show() +img2 = cv2.drawKeypoints(img, kp, None, color=(0,255,0), flags=0) +plt.imshow(img2), plt.show() @endcode See the result below: diff --git a/doc/py_tutorials/py_feature2d/py_sift_intro/py_sift_intro.markdown b/doc/py_tutorials/py_feature2d/py_sift_intro/py_sift_intro.markdown index da4b878db0..2b4b516c50 100644 --- a/doc/py_tutorials/py_feature2d/py_sift_intro/py_sift_intro.markdown +++ b/doc/py_tutorials/py_feature2d/py_sift_intro/py_sift_intro.markdown @@ -122,7 +122,7 @@ gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) sift = cv2.xfeatures2d.SIFT_create() kp = sift.detect(gray,None) -img=cv2.drawKeypoints(gray,kp) +img=cv2.drawKeypoints(gray,kp,img) cv2.imwrite('sift_keypoints.jpg',img) @endcode @@ -135,7 +135,7 @@ OpenCV also provides **cv2.drawKeyPoints()** function which draws the small circ of keypoints. If you pass a flag, **cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS** to it, it will draw a circle with size of keypoint and it will even show its orientation. See below example. @code{.py} -img=cv2.drawKeypoints(gray,kp,flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS) +img=cv2.drawKeypoints(gray,kp,img,flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS) cv2.imwrite('sift_keypoints.jpg',img) @endcode See the two results below: diff --git a/doc/tutorials/core/adding_images/adding_images.markdown b/doc/tutorials/core/adding_images/adding_images.markdown index 1565e7ed8b..012a2480fa 100644 --- a/doc/tutorials/core/adding_images/adding_images.markdown +++ b/doc/tutorials/core/adding_images/adding_images.markdown @@ -25,51 +25,13 @@ By varying \f$\alpha\f$ from \f$0 \rightarrow 1\f$ this operator can be used to *cross-dissolve* between two images or videos, as seen in slide shows and film productions (cool, eh?) -Code ----- +Source Code +----------- -As usual, after the not-so-lengthy explanation, let's go to the code: -@code{.cpp} -#include -#include +Download the source code from +[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/core/AddingImages/AddingImages.cpp). +@include cpp/tutorial_code/core/AddingImages/AddingImages.cpp -using namespace cv; - -int main( int argc, char** argv ) -{ - double alpha = 0.5; double beta; double input; - - Mat src1, src2, dst; - - /// Ask the user enter alpha - std::cout<<" Simple Linear Blender "<>input; - - /// We use the alpha provided by the user if it is between 0 and 1 - if( input >= 0.0 && input <= 1.0 ) - { alpha = input; } - - /// Read image ( same size, same type ) - src1 = imread("../../images/LinuxLogo.jpg"); - src2 = imread("../../images/WindowsLogo.jpg"); - - if( !src1.data ) { printf("Error loading src1 \n"); return -1; } - if( !src2.data ) { printf("Error loading src2 \n"); return -1; } - - /// Create Windows - namedWindow("Linear Blend", 1); - - beta = ( 1.0 - alpha ); - addWeighted( src1, alpha, src2, beta, 0.0, dst); - - imshow( "Linear Blend", dst ); - - waitKey(0); - return 0; -} -@endcode Explanation ----------- @@ -78,25 +40,21 @@ Explanation \f[g(x) = (1 - \alpha)f_{0}(x) + \alpha f_{1}(x)\f] We need two source images (\f$f_{0}(x)\f$ and \f$f_{1}(x)\f$). So, we load them in the usual way: - @code{.cpp} - src1 = imread("../../images/LinuxLogo.jpg"); - src2 = imread("../../images/WindowsLogo.jpg"); - @endcode + @snippet cpp/tutorial_code/core/AddingImages/AddingImages.cpp load + **warning** Since we are *adding* *src1* and *src2*, they both have to be of the same size (width and height) and type. --# Now we need to generate the `g(x)` image. For this, the function add_weighted:addWeighted comes quite handy: - @code{.cpp} - beta = ( 1.0 - alpha ); - addWeighted( src1, alpha, src2, beta, 0.0, dst); - @endcode +-# Now we need to generate the `g(x)` image. For this, the function @ref cv::addWeighted comes quite handy: + @snippet cpp/tutorial_code/core/AddingImages/AddingImages.cpp blend_images since @ref cv::addWeighted produces: \f[dst = \alpha \cdot src1 + \beta \cdot src2 + \gamma\f] In this case, `gamma` is the argument \f$0.0\f$ in the code above. -# Create windows, show the images and wait for the user to end the program. + @snippet cpp/tutorial_code/core/AddingImages/AddingImages.cpp display Result ------ diff --git a/doc/tutorials/core/basic_geometric_drawing/basic_geometric_drawing.markdown b/doc/tutorials/core/basic_geometric_drawing/basic_geometric_drawing.markdown index 4c68517bbc..c27e3293a4 100644 --- a/doc/tutorials/core/basic_geometric_drawing/basic_geometric_drawing.markdown +++ b/doc/tutorials/core/basic_geometric_drawing/basic_geometric_drawing.markdown @@ -48,69 +48,26 @@ Code - This code is in your OpenCV sample folder. Otherwise you can grab it from [here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/core/Matrix/Drawing_1.cpp) + @include samples/cpp/tutorial_code/core/Matrix/Drawing_1.cpp Explanation ----------- --# Since we plan to draw two examples (an atom and a rook), we have to create 02 images and two +-# Since we plan to draw two examples (an atom and a rook), we have to create two images and two windows to display them. - @code{.cpp} - /// Windows names - char atom_window[] = "Drawing 1: Atom"; - char rook_window[] = "Drawing 2: Rook"; + @snippet cpp/tutorial_code/core/Matrix/Drawing_1.cpp create_images - /// Create black empty images - Mat atom_image = Mat::zeros( w, w, CV_8UC3 ); - Mat rook_image = Mat::zeros( w, w, CV_8UC3 ); - @endcode -# We created functions to draw different geometric shapes. For instance, to draw the atom we used *MyEllipse* and *MyFilledCircle*: - @code{.cpp} - /// 1. Draw a simple atom: + @snippet cpp/tutorial_code/core/Matrix/Drawing_1.cpp draw_atom - /// 1.a. Creating ellipses - MyEllipse( atom_image, 90 ); - MyEllipse( atom_image, 0 ); - MyEllipse( atom_image, 45 ); - MyEllipse( atom_image, -45 ); - - /// 1.b. Creating circles - MyFilledCircle( atom_image, Point( w/2.0, w/2.0) ); - @endcode -# And to draw the rook we employed *MyLine*, *rectangle* and a *MyPolygon*: - @code{.cpp} - /// 2. Draw a rook + @snippet cpp/tutorial_code/core/Matrix/Drawing_1.cpp draw_rook - /// 2.a. Create a convex polygon - MyPolygon( rook_image ); - - /// 2.b. Creating rectangles - rectangle( rook_image, - Point( 0, 7*w/8.0 ), - Point( w, w), - Scalar( 0, 255, 255 ), - -1, - 8 ); - - /// 2.c. Create a few lines - MyLine( rook_image, Point( 0, 15*w/16 ), Point( w, 15*w/16 ) ); - MyLine( rook_image, Point( w/4, 7*w/8 ), Point( w/4, w ) ); - MyLine( rook_image, Point( w/2, 7*w/8 ), Point( w/2, w ) ); - MyLine( rook_image, Point( 3*w/4, 7*w/8 ), Point( 3*w/4, w ) ); - @endcode -# Let's check what is inside each of these functions: - *MyLine* - @code{.cpp} - void MyLine( Mat img, Point start, Point end ) - { - int thickness = 2; - int lineType = 8; - line( img, start, end, - Scalar( 0, 0, 0 ), - thickness, - lineType ); - } - @endcode + @snippet cpp/tutorial_code/core/Matrix/Drawing_1.cpp myline + As we can see, *MyLine* just call the function @ref cv::line , which does the following: - Draw a line from Point **start** to Point **end** @@ -120,95 +77,31 @@ Explanation - The line thickness is set to **thickness** (in this case 2) - The line is a 8-connected one (**lineType** = 8) - *MyEllipse* - @code{.cpp} - void MyEllipse( Mat img, double angle ) - { - int thickness = 2; - int lineType = 8; + @snippet cpp/tutorial_code/core/Matrix/Drawing_1.cpp myellipse - ellipse( img, - Point( w/2.0, w/2.0 ), - Size( w/4.0, w/16.0 ), - angle, - 0, - 360, - Scalar( 255, 0, 0 ), - thickness, - lineType ); - } - @endcode From the code above, we can observe that the function @ref cv::ellipse draws an ellipse such that: - The ellipse is displayed in the image **img** - - The ellipse center is located in the point **(w/2.0, w/2.0)** and is enclosed in a box - of size **(w/4.0, w/16.0)** + - The ellipse center is located in the point **(w/2, w/2)** and is enclosed in a box + of size **(w/4, w/16)** - The ellipse is rotated **angle** degrees - The ellipse extends an arc between **0** and **360** degrees - - The color of the figure will be **Scalar( 255, 0, 0)** which means blue in RGB value. + - The color of the figure will be **Scalar( 255, 0, 0)** which means blue in BGR value. - The ellipse's **thickness** is 2. - *MyFilledCircle* - @code{.cpp} - void MyFilledCircle( Mat img, Point center ) - { - int thickness = -1; - int lineType = 8; + @snippet cpp/tutorial_code/core/Matrix/Drawing_1.cpp myfilledcircle - circle( img, - center, - w/32.0, - Scalar( 0, 0, 255 ), - thickness, - lineType ); - } - @endcode Similar to the ellipse function, we can observe that *circle* receives as arguments: - The image where the circle will be displayed (**img**) - The center of the circle denoted as the Point **center** - - The radius of the circle: **w/32.0** + - The radius of the circle: **w/32** - The color of the circle: **Scalar(0, 0, 255)** which means *Red* in BGR - Since **thickness** = -1, the circle will be drawn filled. - *MyPolygon* - @code{.cpp} - void MyPolygon( Mat img ) - { - int lineType = 8; + @snippet cpp/tutorial_code/core/Matrix/Drawing_1.cpp mypolygon - /* Create some points */ - Point rook_points[1][20]; - rook_points[0][0] = Point( w/4.0, 7*w/8.0 ); - rook_points[0][1] = Point( 3*w/4.0, 7*w/8.0 ); - rook_points[0][2] = Point( 3*w/4.0, 13*w/16.0 ); - rook_points[0][3] = Point( 11*w/16.0, 13*w/16.0 ); - rook_points[0][4] = Point( 19*w/32.0, 3*w/8.0 ); - rook_points[0][5] = Point( 3*w/4.0, 3*w/8.0 ); - rook_points[0][6] = Point( 3*w/4.0, w/8.0 ); - rook_points[0][7] = Point( 26*w/40.0, w/8.0 ); - rook_points[0][8] = Point( 26*w/40.0, w/4.0 ); - rook_points[0][9] = Point( 22*w/40.0, w/4.0 ); - rook_points[0][10] = Point( 22*w/40.0, w/8.0 ); - rook_points[0][11] = Point( 18*w/40.0, w/8.0 ); - rook_points[0][12] = Point( 18*w/40.0, w/4.0 ); - rook_points[0][13] = Point( 14*w/40.0, w/4.0 ); - rook_points[0][14] = Point( 14*w/40.0, w/8.0 ); - rook_points[0][15] = Point( w/4.0, w/8.0 ); - rook_points[0][16] = Point( w/4.0, 3*w/8.0 ); - rook_points[0][17] = Point( 13*w/32.0, 3*w/8.0 ); - rook_points[0][18] = Point( 5*w/16.0, 13*w/16.0 ); - rook_points[0][19] = Point( w/4.0, 13*w/16.0) ; - - const Point* ppt[1] = { rook_points[0] }; - int npt[] = { 20 }; - - fillPoly( img, - ppt, - npt, - 1, - Scalar( 255, 255, 255 ), - lineType ); - } - @endcode To draw a filled polygon we use the function @ref cv::fillPoly . We note that: - The polygon will be drawn on **img** @@ -218,22 +111,17 @@ Explanation - The color of the polygon is defined by **Scalar( 255, 255, 255)**, which is the BGR value for *white* - *rectangle* - @code{.cpp} - rectangle( rook_image, - Point( 0, 7*w/8.0 ), - Point( w, w), - Scalar( 0, 255, 255 ), - -1, 8 ); - @endcode + @snippet cpp/tutorial_code/core/Matrix/Drawing_1.cpp rectangle + Finally we have the @ref cv::rectangle function (we did not create a special function for this guy). We note that: - The rectangle will be drawn on **rook_image** - - Two opposite vertices of the rectangle are defined by *\* Point( 0, 7*w/8.0 )*\* + - Two opposite vertices of the rectangle are defined by *\* Point( 0, 7*w/8 )*\* andPoint( w, w)*\* - The color of the rectangle is given by **Scalar(0, 255, 255)** which is the BGR value for *yellow* - - Since the thickness value is given by **-1**, the rectangle will be filled. + - Since the thickness value is given by **FILLED (-1)**, the rectangle will be filled. Result ------ diff --git a/doc/tutorials/features2d/trackingmotion/corner_subpixeles/corner_subpixeles.markdown b/doc/tutorials/features2d/trackingmotion/corner_subpixeles/corner_subpixeles.markdown index 92f3459d35..946fd77b29 100644 --- a/doc/tutorials/features2d/trackingmotion/corner_subpixeles/corner_subpixeles.markdown +++ b/doc/tutorials/features2d/trackingmotion/corner_subpixeles/corner_subpixeles.markdown @@ -17,105 +17,8 @@ Code This tutorial code's is shown lines below. You can also download it from [here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp) -@code{.cpp} -#include "opencv2/highgui.hpp" -#include "opencv2/imgproc.hpp" -#include -#include -#include +@include samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp -using namespace cv; -using namespace std; - -/// Global variables -Mat src, src_gray; - -int maxCorners = 10; -int maxTrackbar = 25; - -RNG rng(12345); -char* source_window = "Image"; - -/// Function header -void goodFeaturesToTrack_Demo( int, void* ); - -/* @function main */ -int main( int argc, char** argv ) -{ - /// Load source image and convert it to gray - src = imread( argv[1], 1 ); - cvtColor( src, src_gray, COLOR_BGR2GRAY ); - - /// Create Window - namedWindow( source_window, WINDOW_AUTOSIZE ); - - /// Create Trackbar to set the number of corners - createTrackbar( "Max corners:", source_window, &maxCorners, maxTrackbar, goodFeaturesToTrack_Demo); - - imshow( source_window, src ); - - goodFeaturesToTrack_Demo( 0, 0 ); - - waitKey(0); - return(0); -} - -/* - * @function goodFeaturesToTrack_Demo.cpp - * @brief Apply Shi-Tomasi corner detector - */ -void goodFeaturesToTrack_Demo( int, void* ) -{ - if( maxCorners < 1 ) { maxCorners = 1; } - - /// Parameters for Shi-Tomasi algorithm - vector corners; - double qualityLevel = 0.01; - double minDistance = 10; - int blockSize = 3; - bool useHarrisDetector = false; - double k = 0.04; - - /// Copy the source image - Mat copy; - copy = src.clone(); - - /// Apply corner detection - goodFeaturesToTrack( src_gray, - corners, - maxCorners, - qualityLevel, - minDistance, - Mat(), - blockSize, - useHarrisDetector, - k ); - - - /// Draw corners detected - cout<<"** Number of corners detected: "< -#include -#include +@include samples/cpp/tutorial_code/TrackingMotion/goodFeaturesToTrack_Demo.cpp -using namespace cv; -using namespace std; - -/// Global variables -Mat src, src_gray; - -int maxCorners = 23; -int maxTrackbar = 100; - -RNG rng(12345); -char* source_window = "Image"; - -/// Function header -void goodFeaturesToTrack_Demo( int, void* ); - -/* - * @function main - */ -int main( int argc, char** argv ) -{ - /// Load source image and convert it to gray - src = imread( argv[1], 1 ); - cvtColor( src, src_gray, COLOR_BGR2GRAY ); - - /// Create Window - namedWindow( source_window, WINDOW_AUTOSIZE ); - - /// Create Trackbar to set the number of corners - createTrackbar( "Max corners:", source_window, &maxCorners, maxTrackbar, goodFeaturesToTrack_Demo ); - - imshow( source_window, src ); - - goodFeaturesToTrack_Demo( 0, 0 ); - - waitKey(0); - return(0); -} - -/* - * @function goodFeaturesToTrack_Demo.cpp - * @brief Apply Shi-Tomasi corner detector - */ -void goodFeaturesToTrack_Demo( int, void* ) -{ - if( maxCorners < 1 ) { maxCorners = 1; } - - /// Parameters for Shi-Tomasi algorithm - vector corners; - double qualityLevel = 0.01; - double minDistance = 10; - int blockSize = 3; - bool useHarrisDetector = false; - double k = 0.04; - - /// Copy the source image - Mat copy; - copy = src.clone(); - - /// Apply corner detection - goodFeaturesToTrack( src_gray, - corners, - maxCorners, - qualityLevel, - minDistance, - Mat(), - blockSize, - useHarrisDetector, - k ); - - - /// Draw corners detected - cout<<"** Number of corners detected: "< -#include -#include +@include samples/cpp/tutorial_code/TrackingMotion/cornerHarris_Demo.cpp -using namespace cv; -using namespace std; - -/// Global variables -Mat src, src_gray; -int thresh = 200; -int max_thresh = 255; - -char* source_window = "Source image"; -char* corners_window = "Corners detected"; - -/// Function header -void cornerHarris_demo( int, void* ); - -/* @function main */ -int main( int argc, char** argv ) -{ - /// Load source image and convert it to gray - src = imread( argv[1], 1 ); - cvtColor( src, src_gray, COLOR_BGR2GRAY ); - - /// Create a window and a trackbar - namedWindow( source_window, WINDOW_AUTOSIZE ); - createTrackbar( "Threshold: ", source_window, &thresh, max_thresh, cornerHarris_demo ); - imshow( source_window, src ); - - cornerHarris_demo( 0, 0 ); - - waitKey(0); - return(0); -} - -/* @function cornerHarris_demo */ -void cornerHarris_demo( int, void* ) -{ - - Mat dst, dst_norm, dst_norm_scaled; - dst = Mat::zeros( src.size(), CV_32FC1 ); - - /// Detector parameters - int blockSize = 2; - int apertureSize = 3; - double k = 0.04; - - /// Detecting corners - cornerHarris( src_gray, dst, blockSize, apertureSize, k, BORDER_DEFAULT ); - - /// Normalizing - normalize( dst, dst_norm, 0, 255, NORM_MINMAX, CV_32FC1, Mat() ); - convertScaleAbs( dst_norm, dst_norm_scaled ); - - /// Drawing a circle around corners - for( int j = 0; j < dst_norm.rows ; j++ ) - { for( int i = 0; i < dst_norm.cols; i++ ) - { - if( (int) dst_norm.at(j,i) > thresh ) - { - circle( dst_norm_scaled, Point( i, j ), 5, Scalar(0), 2, 8, 0 ); - } - } - } - /// Showing the result - namedWindow( corners_window, WINDOW_AUTOSIZE ); - imshow( corners_window, dst_norm_scaled ); -} -@endcode Explanation ----------- diff --git a/doc/tutorials/highgui/trackbar/trackbar.markdown b/doc/tutorials/highgui/trackbar/trackbar.markdown index 50c13fa4af..b39572c1a8 100644 --- a/doc/tutorials/highgui/trackbar/trackbar.markdown +++ b/doc/tutorials/highgui/trackbar/trackbar.markdown @@ -4,7 +4,7 @@ Adding a Trackbar to our applications! {#tutorial_trackbar} - In the previous tutorials (about *linear blending* and the *brightness and contrast adjustments*) you might have noted that we needed to give some **input** to our programs, such as \f$\alpha\f$ and \f$beta\f$. We accomplished that by entering this data using the Terminal -- Well, it is time to use some fancy GUI tools. OpenCV provides some GUI utilities (*highgui.h*) +- Well, it is time to use some fancy GUI tools. OpenCV provides some GUI utilities (*highgui.hpp*) for you. An example of this is a **Trackbar** ![](images/Adding_Trackbars_Tutorial_Trackbar.png) @@ -24,104 +24,36 @@ Code Let's modify the program made in the tutorial @ref tutorial_adding_images. We will let the user enter the \f$\alpha\f$ value by using the Trackbar. -@code{.cpp} -#include -using namespace cv; - -/// Global Variables -const int alpha_slider_max = 100; -int alpha_slider; -double alpha; -double beta; - -/// Matrices to store images -Mat src1; -Mat src2; -Mat dst; - -/* - * @function on_trackbar - * @brief Callback for trackbar - */ -void on_trackbar( int, void* ) -{ - alpha = (double) alpha_slider/alpha_slider_max ; - beta = ( 1.0 - alpha ); - - addWeighted( src1, alpha, src2, beta, 0.0, dst); - - imshow( "Linear Blend", dst ); -} - -int main( int argc, char** argv ) -{ - /// Read image ( same size, same type ) - src1 = imread("../../images/LinuxLogo.jpg"); - src2 = imread("../../images/WindowsLogo.jpg"); - - if( !src1.data ) { printf("Error loading src1 \n"); return -1; } - if( !src2.data ) { printf("Error loading src2 \n"); return -1; } - - /// Initialize values - alpha_slider = 0; - - /// Create Windows - namedWindow("Linear Blend", 1); - - /// Create Trackbars - char TrackbarName[50]; - sprintf( TrackbarName, "Alpha x %d", alpha_slider_max ); - - createTrackbar( TrackbarName, "Linear Blend", &alpha_slider, alpha_slider_max, on_trackbar ); - - /// Show some stuff - on_trackbar( alpha_slider, 0 ); - - /// Wait until user press some key - waitKey(0); - return 0; -} -@endcode +This tutorial code's is shown lines below. You can also download it from +[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp) +@include cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp Explanation ----------- We only analyze the code that is related to Trackbar: --# First, we load 02 images, which are going to be blended. - @code{.cpp} - src1 = imread("../../images/LinuxLogo.jpg"); - src2 = imread("../../images/WindowsLogo.jpg"); - @endcode +-# First, we load two images, which are going to be blended. + @snippet cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp load + -# To create a trackbar, first we have to create the window in which it is going to be located. So: - @code{.cpp} - namedWindow("Linear Blend", 1); - @endcode + @snippet cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp window + -# Now we can create the Trackbar: - @code{.cpp} - createTrackbar( TrackbarName, "Linear Blend", &alpha_slider, alpha_slider_max, on_trackbar ); - @endcode + @snippet cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp create_trackbar + Note the following: - Our Trackbar has a label **TrackbarName** - - The Trackbar is located in the window named **"Linear Blend"** + - The Trackbar is located in the window named **Linear Blend** - The Trackbar values will be in the range from \f$0\f$ to **alpha_slider_max** (the minimum limit is always **zero**). - The numerical value of Trackbar is stored in **alpha_slider** - Whenever the user moves the Trackbar, the callback function **on_trackbar** is called -# Finally, we have to define the callback function **on_trackbar** - @code{.cpp} - void on_trackbar( int, void* ) - { - alpha = (double) alpha_slider/alpha_slider_max ; - beta = ( 1.0 - alpha ); + @snippet cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp on_trackbar - addWeighted( src1, alpha, src2, beta, 0.0, dst); - - imshow( "Linear Blend", dst ); - } - @endcode Note that: - We use the value of **alpha_slider** (integer) to get a double value for **alpha**. - **alpha_slider** is updated each time the trackbar is displaced by the user. @@ -135,7 +67,7 @@ Result ![](images/Adding_Trackbars_Tutorial_Result_0.jpg) -- As a manner of practice, you can also add 02 trackbars for the program made in +- As a manner of practice, you can also add two trackbars for the program made in @ref tutorial_basic_linear_transform. One trackbar to set \f$\alpha\f$ and another for \f$\beta\f$. The output might look like: diff --git a/doc/tutorials/imgcodecs/raster-gdal/raster_io_gdal.markdown b/doc/tutorials/imgcodecs/raster-gdal/raster_io_gdal.markdown index a511d80887..2193d26870 100644 --- a/doc/tutorials/imgcodecs/raster-gdal/raster_io_gdal.markdown +++ b/doc/tutorials/imgcodecs/raster-gdal/raster_io_gdal.markdown @@ -35,17 +35,13 @@ How to Read Raster Data using GDAL This demonstration uses the default OpenCV imread function. The primary difference is that in order to force GDAL to load the image, you must use the appropriate flag. -@code{.cpp} -cv::Mat image = cv::imread( argv[1], cv::IMREAD_LOAD_GDAL ); -@endcode +@snippet cpp/tutorial_code/imgcodecs/GDAL_IO/gdal-image.cpp load1 When loading digital elevation models, the actual numeric value of each pixel is essential and cannot be scaled or truncated. For example, with image data a pixel represented as a double with a value of 1 has an equal appearance to a pixel which is represented as an unsigned character with a value of 255. With terrain data, the pixel value represents the elevation in meters. In order to ensure that OpenCV preserves the native value, use the GDAL flag in imread with the ANYDEPTH flag. -@code{.cpp} -cv::Mat dem = cv::imread( argv[2], cv::IMREAD_LOAD_GDAL | cv::IMREAD_ANYDEPTH ); -@endcode +@snippet cpp/tutorial_code/imgcodecs/GDAL_IO/gdal-image.cpp load2 If you know beforehand the type of DEM model you are loading, then it may be a safe bet to test the Mat::type() or Mat::depth() using an assert or other mechanism. NASA or DOD specification documents can provide the input types for various elevation models. The major types, SRTM and DTED, are both diff --git a/doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.markdown b/doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.markdown index e3786e607b..444e0c4f87 100644 --- a/doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.markdown +++ b/doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.markdown @@ -71,7 +71,7 @@ Explanation - Load an image (can be BGR or grayscale) - Create two windows (one for dilation output, the other for erosion) - - Create a set of 02 Trackbars for each operation: + - Create a set of two Trackbars for each operation: - The first trackbar "Element" returns either **erosion_elem** or **dilation_elem** - The second trackbar "Kernel size" return **erosion_size** or **dilation_size** for the corresponding operation. @@ -81,23 +81,8 @@ Explanation Let's analyze these two functions: -# **erosion:** - @code{.cpp} - /* @function Erosion */ - void Erosion( int, void* ) - { - int erosion_type; - if( erosion_elem == 0 ){ erosion_type = MORPH_RECT; } - else if( erosion_elem == 1 ){ erosion_type = MORPH_CROSS; } - else if( erosion_elem == 2) { erosion_type = MORPH_ELLIPSE; } + @snippet cpp/tutorial_code/ImgProc/Morphology_1.cpp erosion - Mat element = getStructuringElement( erosion_type, - Size( 2*erosion_size + 1, 2*erosion_size+1 ), - Point( erosion_size, erosion_size ) ); - /// Apply the erosion operation - erode( src, erosion_dst, element ); - imshow( "Erosion Demo", erosion_dst ); - } - @endcode - The function that performs the *erosion* operation is @ref cv::erode . As we can see, it receives three arguments: - *src*: The source image @@ -105,11 +90,8 @@ Explanation - *element*: This is the kernel we will use to perform the operation. If we do not specify, the default is a simple `3x3` matrix. Otherwise, we can specify its shape. For this, we need to use the function cv::getStructuringElement : - @code{.cpp} - Mat element = getStructuringElement( erosion_type, - Size( 2*erosion_size + 1, 2*erosion_size+1 ), - Point( erosion_size, erosion_size ) ); - @endcode + @snippet cpp/tutorial_code/ImgProc/Morphology_1.cpp kernel + We can choose any of three shapes for our kernel: - Rectangular box: MORPH_RECT @@ -129,23 +111,7 @@ Reference for more details. The code is below. As you can see, it is completely similar to the snippet of code for **erosion**. Here we also have the option of defining our kernel, its anchor point and the size of the operator to be used. - @code{.cpp} - /* @function Dilation */ - void Dilation( int, void* ) - { - int dilation_type; - if( dilation_elem == 0 ){ dilation_type = MORPH_RECT; } - else if( dilation_elem == 1 ){ dilation_type = MORPH_CROSS; } - else if( dilation_elem == 2) { dilation_type = MORPH_ELLIPSE; } - - Mat element = getStructuringElement( dilation_type, - Size( 2*dilation_size + 1, 2*dilation_size+1 ), - Point( dilation_size, dilation_size ) ); - /// Apply the dilation operation - dilate( src, dilation_dst, element ); - imshow( "Dilation Demo", dilation_dst ); - } - @endcode + @snippet cpp/tutorial_code/ImgProc/Morphology_1.cpp dilation Results ------- diff --git a/doc/tutorials/imgproc/gausian_median_blur_bilateral_filter/gausian_median_blur_bilateral_filter.markdown b/doc/tutorials/imgproc/gausian_median_blur_bilateral_filter/gausian_median_blur_bilateral_filter.markdown index 2d17c3aade..753b368c0d 100644 --- a/doc/tutorials/imgproc/gausian_median_blur_bilateral_filter/gausian_median_blur_bilateral_filter.markdown +++ b/doc/tutorials/imgproc/gausian_median_blur_bilateral_filter/gausian_median_blur_bilateral_filter.markdown @@ -16,8 +16,7 @@ Theory ------ @note The explanation below belongs to the book [Computer Vision: Algorithms and -Applications](http://szeliski.org/Book/) by Richard Szeliski and to *LearningOpenCV* .. container:: -enumeratevisibleitemswithsquare +Applications](http://szeliski.org/Book/) by Richard Szeliski and to *LearningOpenCV* - *Smoothing*, also called *blurring*, is a simple and frequently used image processing operation. @@ -96,96 +95,7 @@ Code - **Downloadable code**: Click [here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Smoothing.cpp) - **Code at glance:** -@code{.cpp} -#include "opencv2/imgproc.hpp" -#include "opencv2/highgui.hpp" - -using namespace std; -using namespace cv; - -/// Global Variables -int DELAY_CAPTION = 1500; -int DELAY_BLUR = 100; -int MAX_KERNEL_LENGTH = 31; - -Mat src; Mat dst; -char window_name[] = "Filter Demo 1"; - -/// Function headers -int display_caption( char* caption ); -int display_dst( int delay ); - -/* - * function main - */ - int main( int argc, char** argv ) - { - namedWindow( window_name, WINDOW_AUTOSIZE ); - - /// Load the source image - src = imread( "../images/lena.jpg", 1 ); - - if( display_caption( "Original Image" ) != 0 ) { return 0; } - - dst = src.clone(); - if( display_dst( DELAY_CAPTION ) != 0 ) { return 0; } - - /// Applying Homogeneous blur - if( display_caption( "Homogeneous Blur" ) != 0 ) { return 0; } - - for ( int i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 ) - { blur( src, dst, Size( i, i ), Point(-1,-1) ); - if( display_dst( DELAY_BLUR ) != 0 ) { return 0; } } - - /// Applying Gaussian blur - if( display_caption( "Gaussian Blur" ) != 0 ) { return 0; } - - for ( int i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 ) - { GaussianBlur( src, dst, Size( i, i ), 0, 0 ); - if( display_dst( DELAY_BLUR ) != 0 ) { return 0; } } - - /// Applying Median blur - if( display_caption( "Median Blur" ) != 0 ) { return 0; } - - for ( int i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 ) - { medianBlur ( src, dst, i ); - if( display_dst( DELAY_BLUR ) != 0 ) { return 0; } } - - /// Applying Bilateral Filter - if( display_caption( "Bilateral Blur" ) != 0 ) { return 0; } - - for ( int i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 ) - { bilateralFilter ( src, dst, i, i*2, i/2 ); - if( display_dst( DELAY_BLUR ) != 0 ) { return 0; } } - - /// Wait until user press a key - display_caption( "End: Press a key!" ); - - waitKey(0); - return 0; - } - - int display_caption( char* caption ) - { - dst = Mat::zeros( src.size(), src.type() ); - putText( dst, caption, - Point( src.cols/4, src.rows/2), - FONT_HERSHEY_COMPLEX, 1, Scalar(255, 255, 255) ); - - imshow( window_name, dst ); - int c = waitKey( DELAY_CAPTION ); - if( c >= 0 ) { return -1; } - return 0; - } - - int display_dst( int delay ) - { - imshow( window_name, dst ); - int c = waitKey ( delay ); - if( c >= 0 ) { return -1; } - return 0; - } -@endcode + @include samples/cpp/tutorial_code/ImgProc/Smoothing.cpp Explanation ----------- @@ -195,11 +105,8 @@ Explanation -# **Normalized Block Filter:** OpenCV offers the function @ref cv::blur to perform smoothing with this filter. - @code{.cpp} - for ( int i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 ) - { blur( src, dst, Size( i, i ), Point(-1,-1) ); - if( display_dst( DELAY_BLUR ) != 0 ) { return 0; } } - @endcode + @snippet cpp/tutorial_code/ImgProc/Smoothing.cpp blur + We specify 4 arguments (more details, check the Reference): - *src*: Source image @@ -213,11 +120,8 @@ Explanation -# **Gaussian Filter:** It is performed by the function @ref cv::GaussianBlur : - @code{.cpp} - for ( int i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 ) - { GaussianBlur( src, dst, Size( i, i ), 0, 0 ); - if( display_dst( DELAY_BLUR ) != 0 ) { return 0; } } - @endcode + @snippet cpp/tutorial_code/ImgProc/Smoothing.cpp gaussianblur + Here we use 4 arguments (more details, check the OpenCV reference): - *src*: Source image @@ -233,11 +137,8 @@ Explanation -# **Median Filter:** This filter is provided by the @ref cv::medianBlur function: - @code{.cpp} - for ( int i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 ) - { medianBlur ( src, dst, i ); - if( display_dst( DELAY_BLUR ) != 0 ) { return 0; } } - @endcode + @snippet cpp/tutorial_code/ImgProc/Smoothing.cpp medianblur + We use three arguments: - *src*: Source image @@ -247,11 +148,8 @@ Explanation -# **Bilateral Filter** Provided by OpenCV function @ref cv::bilateralFilter - @code{.cpp} - for ( int i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 ) - { bilateralFilter ( src, dst, i, i*2, i/2 ); - if( display_dst( DELAY_BLUR ) != 0 ) { return 0; } } - @endcode + @snippet cpp/tutorial_code/ImgProc/Smoothing.cpp bilateralfilter + We use 5 arguments: - *src*: Source image diff --git a/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.markdown b/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.markdown index c7bd63ed4f..e86b16daf6 100644 --- a/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.markdown +++ b/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.markdown @@ -81,17 +81,8 @@ Explanation ----------- -# Create some needed variables: - @code{.cpp} - Mat src, src_gray; - Mat dst, detected_edges; + @snippet cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp variables - int edgeThresh = 1; - int lowThreshold; - int const max_lowThreshold = 100; - int ratio = 3; - int kernel_size = 3; - char* window_name = "Edge Map"; - @endcode Note the following: -# We establish a ratio of lower:upper threshold of 3:1 (with the variable *ratio*) @@ -100,29 +91,16 @@ Explanation -# We set a maximum value for the lower Threshold of \f$100\f$. -# Loads the source image: - @code{.cpp} - /// Load an image - src = imread( argv[1] ); + @snippet cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp load - if( !src.data ) - { return -1; } - @endcode -# Create a matrix of the same type and size of *src* (to be *dst*) - @code{.cpp} - dst.create( src.size(), src.type() ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp create_mat -# Convert the image to grayscale (using the function @ref cv::cvtColor : - @code{.cpp} - cvtColor( src, src_gray, COLOR_BGR2GRAY ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp convert_to_gray -# Create a window to display the results - @code{.cpp} - namedWindow( window_name, WINDOW_AUTOSIZE ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp create_window -# Create a Trackbar for the user to enter the lower threshold for our Canny detector: - @code{.cpp} - createTrackbar( "Min Threshold:", window_name, &lowThreshold, max_lowThreshold, CannyThreshold ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp create_trackbar Observe the following: -# The variable to be controlled by the Trackbar is *lowThreshold* with a limit of @@ -132,13 +110,9 @@ Explanation -# Let's check the *CannyThreshold* function, step by step: -# First, we blur the image with a filter of kernel size 3: - @code{.cpp} - blur( src_gray, detected_edges, Size(3,3) ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp reduce_noise -# Second, we apply the OpenCV function @ref cv::Canny : - @code{.cpp} - Canny( detected_edges, detected_edges, lowThreshold, lowThreshold*ratio, kernel_size ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp canny where the arguments are: - *detected_edges*: Source image, grayscale @@ -150,23 +124,16 @@ Explanation internally) -# We fill a *dst* image with zeros (meaning the image is completely black). - @code{.cpp} - dst = Scalar::all(0); - @endcode + @snippet cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp fill -# Finally, we will use the function @ref cv::Mat::copyTo to map only the areas of the image that are identified as edges (on a black background). - @code{.cpp} - src.copyTo( dst, detected_edges); - @endcode @ref cv::Mat::copyTo copy the *src* image onto *dst*. However, it will only copy the pixels in the locations where they have non-zero values. Since the output of the Canny detector is the edge contours on a black background, the resulting *dst* will be black in all the area but the detected edges. - + @snippet cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp copyto -# We display our result: - @code{.cpp} - imshow( window_name, dst ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp display Result ------ diff --git a/doc/tutorials/imgproc/imgtrans/copyMakeBorder/copyMakeBorder.markdown b/doc/tutorials/imgproc/imgtrans/copyMakeBorder/copyMakeBorder.markdown index dd4d785515..6b6efdf125 100644 --- a/doc/tutorials/imgproc/imgtrans/copyMakeBorder/copyMakeBorder.markdown +++ b/doc/tutorials/imgproc/imgtrans/copyMakeBorder/copyMakeBorder.markdown @@ -53,61 +53,29 @@ Explanation ----------- -# First we declare the variables we are going to use: - @code{.cpp} - Mat src, dst; - int top, bottom, left, right; - int borderType; - Scalar value; - char* window_name = "copyMakeBorder Demo"; - RNG rng(12345); - @endcode + @snippet cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp variables + Especial attention deserves the variable *rng* which is a random number generator. We use it to generate the random border color, as we will see soon. -# As usual we load our source image *src*: - @code{.cpp} - src = imread( argv[1] ); + @snippet cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp load - if( !src.data ) - { return -1; - printf(" No data entered, please enter the path to an image file \n"); - } - @endcode -# After giving a short intro of how to use the program, we create a window: - @code{.cpp} - namedWindow( window_name, WINDOW_AUTOSIZE ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp create_window -# Now we initialize the argument that defines the size of the borders (*top*, *bottom*, *left* and *right*). We give them a value of 5% the size of *src*. - @code{.cpp} - top = (int) (0.05*src.rows); bottom = (int) (0.05*src.rows); - left = (int) (0.05*src.cols); right = (int) (0.05*src.cols); - @endcode --# The program begins a *while* loop. If the user presses 'c' or 'r', the *borderType* variable + @snippet cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp init_arguments +-# The program runs in a **for** loop. If the user presses 'c' or 'r', the *borderType* variable takes the value of *BORDER_CONSTANT* or *BORDER_REPLICATE* respectively: - @code{.cpp} - while( true ) - { - c = waitKey(500); - - if( (char)c == 27 ) - { break; } - else if( (char)c == 'c' ) - { borderType = BORDER_CONSTANT; } - else if( (char)c == 'r' ) - { borderType = BORDER_REPLICATE; } - @endcode + @snippet cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp check_keypress -# In each iteration (after 0.5 seconds), the variable *value* is updated... - @code{.cpp} - value = Scalar( rng.uniform(0, 255), rng.uniform(0, 255), rng.uniform(0, 255) ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp update_value with a random value generated by the **RNG** variable *rng*. This value is a number picked randomly in the range \f$[0,255]\f$ -# Finally, we call the function @ref cv::copyMakeBorder to apply the respective padding: - @code{.cpp} - copyMakeBorder( src, dst, top, bottom, left, right, borderType, value ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp copymakeborder The arguments are: -# *src*: Source image @@ -120,9 +88,7 @@ Explanation pixels. -# We display our output image in the image created previously - @code{.cpp} - imshow( window_name, dst ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp display Results ------- diff --git a/doc/tutorials/imgproc/imgtrans/filter_2d/filter_2d.markdown b/doc/tutorials/imgproc/imgtrans/filter_2d/filter_2d.markdown index ef25b979f3..a09146419d 100644 --- a/doc/tutorials/imgproc/imgtrans/filter_2d/filter_2d.markdown +++ b/doc/tutorials/imgproc/imgtrans/filter_2d/filter_2d.markdown @@ -63,100 +63,25 @@ Code -# The tutorial code's is shown lines below. You can also download it from [here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/filter2D_demo.cpp) -@code{.cpp} -#include "opencv2/imgproc.hpp" -#include "opencv2/highgui.hpp" -#include -#include + @include cpp/tutorial_code/ImgTrans/filter2D_demo.cpp -using namespace cv; - -/* @function main */ -int main ( int argc, char** argv ) -{ - /// Declare variables - Mat src, dst; - - Mat kernel; - Point anchor; - double delta; - int ddepth; - int kernel_size; - char* window_name = "filter2D Demo"; - - int c; - - /// Load an image - src = imread( argv[1] ); - - if( !src.data ) - { return -1; } - - /// Create window - namedWindow( window_name, WINDOW_AUTOSIZE ); - - /// Initialize arguments for the filter - anchor = Point( -1, -1 ); - delta = 0; - ddepth = -1; - - /// Loop - Will filter the image with different kernel sizes each 0.5 seconds - int ind = 0; - while( true ) - { - c = waitKey(500); - /// Press 'ESC' to exit the program - if( (char)c == 27 ) - { break; } - - /// Update kernel size for a normalized box filter - kernel_size = 3 + 2*( ind%5 ); - kernel = Mat::ones( kernel_size, kernel_size, CV_32F )/ (float)(kernel_size*kernel_size); - - /// Apply filter - filter2D(src, dst, ddepth , kernel, anchor, delta, BORDER_DEFAULT ); - imshow( window_name, dst ); - ind++; - } - - return 0; -} -@endcode Explanation ----------- -# Load an image - @code{.cpp} - src = imread( argv[1] ); - - if( !src.data ) - { return -1; } - @endcode --# Create a window to display the result - @code{.cpp} - namedWindow( window_name, WINDOW_AUTOSIZE ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/filter2D_demo.cpp load -# Initialize the arguments for the linear filter - @code{.cpp} - anchor = Point( -1, -1 ); - delta = 0; - ddepth = -1; - @endcode + @snippet cpp/tutorial_code/ImgTrans/filter2D_demo.cpp init_arguments -# Perform an infinite loop updating the kernel size and applying our linear filter to the input image. Let's analyze that more in detail: -# First we define the kernel our filter is going to use. Here it is: - @code{.cpp} - kernel_size = 3 + 2*( ind%5 ); - kernel = Mat::ones( kernel_size, kernel_size, CV_32F )/ (float)(kernel_size*kernel_size); - @endcode + @snippet cpp/tutorial_code/ImgTrans/filter2D_demo.cpp update_kernel The first line is to update the *kernel_size* to odd values in the range: \f$[3,11]\f$. The second line actually builds the kernel by setting its value to a matrix filled with \f$1's\f$ and normalizing it by dividing it between the number of elements. -# After setting the kernel, we can generate the filter by using the function @ref cv::filter2D : - @code{.cpp} - filter2D(src, dst, ddepth , kernel, anchor, delta, BORDER_DEFAULT ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/filter2D_demo.cpp apply_filter The arguments denote: -# *src*: Source image diff --git a/doc/tutorials/imgproc/imgtrans/hough_circle/hough_circle.markdown b/doc/tutorials/imgproc/imgtrans/hough_circle/hough_circle.markdown index 61f83aabce..9f3951927c 100644 --- a/doc/tutorials/imgproc/imgtrans/hough_circle/hough_circle.markdown +++ b/doc/tutorials/imgproc/imgtrans/hough_circle/hough_circle.markdown @@ -48,63 +48,33 @@ Explanation ----------- -# Load an image - @code{.cpp} - src = imread( argv[1], 1 ); - - if( !src.data ) - { return -1; } - @endcode + @snippet samples/cpp/houghcircles.cpp load -# Convert it to grayscale: - @code{.cpp} - cvtColor( src, src_gray, COLOR_BGR2GRAY ); - @endcode --# Apply a Gaussian blur to reduce noise and avoid false circle detection: - @code{.cpp} - GaussianBlur( src_gray, src_gray, Size(9, 9), 2, 2 ); - @endcode + @snippet samples/cpp/houghcircles.cpp convert_to_gray +-# Apply a Median blur to reduce noise and avoid false circle detection: + @snippet samples/cpp/houghcircles.cpp reduce_noise -# Proceed to apply Hough Circle Transform: - @code{.cpp} - vector circles; - - HoughCircles( src_gray, circles, HOUGH_GRADIENT, 1, src_gray.rows/8, 200, 100, 0, 0 ); - @endcode + @snippet samples/cpp/houghcircles.cpp houghcircles with the arguments: - - *src_gray*: Input image (grayscale). + - *gray*: Input image (grayscale). - *circles*: A vector that stores sets of 3 values: \f$x_{c}, y_{c}, r\f$ for each detected circle. - *HOUGH_GRADIENT*: Define the detection method. Currently this is the only one available in OpenCV. - *dp = 1*: The inverse ratio of resolution. - - *min_dist = src_gray.rows/8*: Minimum distance between detected centers. + - *min_dist = gray.rows/16*: Minimum distance between detected centers. - *param_1 = 200*: Upper threshold for the internal Canny edge detector. - *param_2* = 100\*: Threshold for center detection. - *min_radius = 0*: Minimum radio to be detected. If unknown, put zero as default. - *max_radius = 0*: Maximum radius to be detected. If unknown, put zero as default. -# Draw the detected circles: - @code{.cpp} - for( size_t i = 0; i < circles.size(); i++ ) - { - Point center(cvRound(circles[i][0]), cvRound(circles[i][1])); - int radius = cvRound(circles[i][2]); - // circle center - circle( src, center, 3, Scalar(0,255,0), -1, 8, 0 ); - // circle outline - circle( src, center, radius, Scalar(0,0,255), 3, 8, 0 ); - } - @endcode + @snippet samples/cpp/houghcircles.cpp draw You can see that we will draw the circle(s) on red and the center(s) with a small green dot --# Display the detected circle(s): - @code{.cpp} - namedWindow( "Hough Circle Transform Demo", WINDOW_AUTOSIZE ); - imshow( "Hough Circle Transform Demo", src ); - @endcode --# Wait for the user to exit the program - @code{.cpp} - waitKey(0); - @endcode +-# Display the detected circle(s) and wait for the user to exit the program: + @snippet samples/cpp/houghcircles.cpp display Result ------ diff --git a/doc/tutorials/imgproc/imgtrans/laplace_operator/laplace_operator.markdown b/doc/tutorials/imgproc/imgtrans/laplace_operator/laplace_operator.markdown index 8976803c51..f1781706cb 100644 --- a/doc/tutorials/imgproc/imgtrans/laplace_operator/laplace_operator.markdown +++ b/doc/tutorials/imgproc/imgtrans/laplace_operator/laplace_operator.markdown @@ -58,33 +58,15 @@ Explanation ----------- -# Create some needed variables: - @code{.cpp} - Mat src, src_gray, dst; - int kernel_size = 3; - int scale = 1; - int delta = 0; - int ddepth = CV_16S; - char* window_name = "Laplace Demo"; - @endcode + @snippet cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp variables -# Loads the source image: - @code{.cpp} - src = imread( argv[1] ); - - if( !src.data ) - { return -1; } - @endcode + @snippet cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp load -# Apply a Gaussian blur to reduce noise: - @code{.cpp} - GaussianBlur( src, src, Size(3,3), 0, 0, BORDER_DEFAULT ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp reduce_noise -# Convert the image to grayscale using @ref cv::cvtColor - @code{.cpp} - cvtColor( src, src_gray, COLOR_RGB2GRAY ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp convert_to_gray -# Apply the Laplacian operator to the grayscale image: - @code{.cpp} - Laplacian( src_gray, dst, ddepth, kernel_size, scale, delta, BORDER_DEFAULT ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp laplacian where the arguments are: - *src_gray*: The input image. @@ -96,13 +78,9 @@ Explanation - *scale*, *delta* and *BORDER_DEFAULT*: We leave them as default values. -# Convert the output from the Laplacian operator to a *CV_8U* image: - @code{.cpp} - convertScaleAbs( dst, abs_dst ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp convert -# Display the result in a window: - @code{.cpp} - imshow( window_name, abs_dst ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp display Results ------- diff --git a/doc/tutorials/imgproc/imgtrans/sobel_derivatives/sobel_derivatives.markdown b/doc/tutorials/imgproc/imgtrans/sobel_derivatives/sobel_derivatives.markdown index 2d92fa0226..3112b08cd0 100644 --- a/doc/tutorials/imgproc/imgtrans/sobel_derivatives/sobel_derivatives.markdown +++ b/doc/tutorials/imgproc/imgtrans/sobel_derivatives/sobel_derivatives.markdown @@ -115,40 +115,16 @@ Explanation ----------- -# First we declare the variables we are going to use: - @code{.cpp} - Mat src, src_gray; - Mat grad; - char* window_name = "Sobel Demo - Simple Edge Detector"; - int scale = 1; - int delta = 0; - int ddepth = CV_16S; - @endcode + @snippet cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp variables -# As usual we load our source image *src*: - @code{.cpp} - src = imread( argv[1] ); - - if( !src.data ) - { return -1; } - @endcode + @snippet cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp load -# First, we apply a @ref cv::GaussianBlur to our image to reduce the noise ( kernel size = 3 ) - @code{.cpp} - GaussianBlur( src, src, Size(3,3), 0, 0, BORDER_DEFAULT ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp reduce_noise -# Now we convert our filtered image to grayscale: - @code{.cpp} - cvtColor( src, src_gray, COLOR_RGB2GRAY ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp convert_to_gray -# Second, we calculate the "*derivatives*" in *x* and *y* directions. For this, we use the function @ref cv::Sobel as shown below: - @code{.cpp} - Mat grad_x, grad_y; - Mat abs_grad_x, abs_grad_y; - - /// Gradient X - Sobel( src_gray, grad_x, ddepth, 1, 0, 3, scale, delta, BORDER_DEFAULT ); - /// Gradient Y - Sobel( src_gray, grad_y, ddepth, 0, 1, 3, scale, delta, BORDER_DEFAULT ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp sobel The function takes the following arguments: - *src_gray*: In our example, the input image. Here it is *CV_8U* @@ -162,19 +138,12 @@ Explanation \f$y_{order} = 0\f$. We do analogously for the *y* direction. -# We convert our partial results back to *CV_8U*: - @code{.cpp} - convertScaleAbs( grad_x, abs_grad_x ); - convertScaleAbs( grad_y, abs_grad_y ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp convert -# Finally, we try to approximate the *gradient* by adding both directional gradients (note that this is not an exact calculation at all! but it is good for our purposes). - @code{.cpp} - addWeighted( abs_grad_x, 0.5, abs_grad_y, 0.5, 0, grad ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp blend -# Finally, we show our result: - @code{.cpp} - imshow( window_name, grad ); - @endcode + @snippet cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp display Results ------- diff --git a/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.markdown b/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.markdown index 09331109d8..be32508afa 100644 --- a/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.markdown +++ b/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.markdown @@ -81,76 +81,7 @@ Code This tutorial code's is shown lines below. You can also download it from [here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp) -@code{.cpp} -#include "opencv2/imgproc.hpp" -#include "opencv2/highgui.hpp" -#include -#include - -using namespace cv; - -/// Global variables -Mat src, dst; - -int morph_elem = 0; -int morph_size = 0; -int morph_operator = 0; -int const max_operator = 4; -int const max_elem = 2; -int const max_kernel_size = 21; - -char* window_name = "Morphology Transformations Demo"; - -/* Function Headers */ -void Morphology_Operations( int, void* ); - -/* @function main */ -int main( int argc, char** argv ) -{ - /// Load an image - src = imread( argv[1] ); - - if( !src.data ) - { return -1; } - - /// Create window - namedWindow( window_name, WINDOW_AUTOSIZE ); - - /// Create Trackbar to select Morphology operation - createTrackbar("Operator:\n 0: Opening - 1: Closing \n 2: Gradient - 3: Top Hat \n 4: Black Hat", window_name, &morph_operator, max_operator, Morphology_Operations ); - - /// Create Trackbar to select kernel type - createTrackbar( "Element:\n 0: Rect - 1: Cross - 2: Ellipse", window_name, - &morph_elem, max_elem, - Morphology_Operations ); - - /// Create Trackbar to choose kernel size - createTrackbar( "Kernel size:\n 2n +1", window_name, - &morph_size, max_kernel_size, - Morphology_Operations ); - - /// Default start - Morphology_Operations( 0, 0 ); - - waitKey(0); - return 0; - } - - /* - * @function Morphology_Operations - */ -void Morphology_Operations( int, void* ) -{ - // Since MORPH_X : 2,3,4,5 and 6 - int operation = morph_operator + 2; - - Mat element = getStructuringElement( morph_elem, Size( 2*morph_size + 1, 2*morph_size+1 ), Point( morph_size, morph_size ) ); - - /// Apply the specified morphology operation - morphologyEx( src, dst, operation, element ); - imshow( window_name, dst ); - } -@endcode +@include cpp/tutorial_code/ImgProc/Morphology_2.cpp Explanation ----------- @@ -158,47 +89,23 @@ Explanation -# Let's check the general structure of the program: - Load an image - Create a window to display results of the Morphological operations - - Create 03 Trackbars for the user to enter parameters: - - The first trackbar **"Operator"** returns the kind of morphology operation to use + - Create three Trackbars for the user to enter parameters: + - The first trackbar **Operator** returns the kind of morphology operation to use (**morph_operator**). - @code{.cpp} - createTrackbar("Operator:\n 0: Opening - 1: Closing \n 2: Gradient - 3: Top Hat \n 4: Black Hat", - window_name, &morph_operator, max_operator, - Morphology_Operations ); - @endcode - - The second trackbar **"Element"** returns **morph_elem**, which indicates what kind of + @snippet cpp/tutorial_code/ImgProc/Morphology_2.cpp create_trackbar1 + + - The second trackbar **Element** returns **morph_elem**, which indicates what kind of structure our kernel is: - @code{.cpp} - createTrackbar( "Element:\n 0: Rect - 1: Cross - 2: Ellipse", window_name, - &morph_elem, max_elem, - Morphology_Operations ); - @endcode - - The final trackbar **"Kernel Size"** returns the size of the kernel to be used + @snippet cpp/tutorial_code/ImgProc/Morphology_2.cpp create_trackbar2 + + - The final trackbar **Kernel Size** returns the size of the kernel to be used (**morph_size**) - @code{.cpp} - createTrackbar( "Kernel size:\n 2n +1", window_name, - &morph_size, max_kernel_size, - Morphology_Operations ); - @endcode + @snippet cpp/tutorial_code/ImgProc/Morphology_2.cpp create_trackbar3 + - Every time we move any slider, the user's function **Morphology_Operations** will be called to effectuate a new morphology operation and it will update the output image based on the current trackbar values. - @code{.cpp} - /* - * @function Morphology_Operations - */ - void Morphology_Operations( int, void* ) - { - // Since MORPH_X : 2,3,4,5 and 6 - int operation = morph_operator + 2; - - Mat element = getStructuringElement( morph_elem, Size( 2*morph_size + 1, 2*morph_size+1 ), Point( morph_size, morph_size ) ); - - /// Apply the specified morphology operation - morphologyEx( src, dst, operation, element ); - imshow( window_name, dst ); - } - @endcode + @snippet cpp/tutorial_code/ImgProc/Morphology_2.cpp morphology_operations We can observe that the key function to perform the morphology transformations is @ref cv::morphologyEx . In this example we use four arguments (leaving the rest as defaults): @@ -216,9 +123,7 @@ Explanation As you can see the values range from \<2-6\>, that is why we add (+2) to the values entered by the Trackbar: - @code{.cpp} - int operation = morph_operator + 2; - @endcode + @snippet cpp/tutorial_code/ImgProc/Morphology_2.cpp operation - **element**: The kernel to be used. We use the function @ref cv::getStructuringElement to define our own structure. diff --git a/doc/tutorials/imgproc/pyramids/pyramids.markdown b/doc/tutorials/imgproc/pyramids/pyramids.markdown index 0bb5160fbb..69df1cda63 100644 --- a/doc/tutorials/imgproc/pyramids/pyramids.markdown +++ b/doc/tutorials/imgproc/pyramids/pyramids.markdown @@ -77,13 +77,7 @@ Let's check the general structure of the program: - Load an image (in this case it is defined in the program, the user does not have to enter it as an argument) - @code{.cpp} - /// Test image - Make sure it s divisible by 2^{n} - src = imread( "../images/chicky_512.jpg" ); - if( !src.data ) - { printf(" No data! -- Exiting the program \n"); - return -1; } - @endcode + @snippet cpp/tutorial_code/ImgProc/Pyramids.cpp load - Create a Mat object to store the result of the operations (*dst*) and one to save temporal results (*tmp*). @@ -95,40 +89,15 @@ Let's check the general structure of the program: @endcode - Create a window to display the result - @code{.cpp} - namedWindow( window_name, WINDOW_AUTOSIZE ); - imshow( window_name, dst ); - @endcode + @snippet cpp/tutorial_code/ImgProc/Pyramids.cpp create_window - Perform an infinite loop waiting for user input. - @code{.cpp} - while( true ) - { - int c; - c = waitKey(10); - - if( (char)c == 27 ) - { break; } - if( (char)c == 'u' ) - { pyrUp( tmp, dst, Size( tmp.cols*2, tmp.rows*2 ) ); - printf( "** Zoom In: Image x 2 \n" ); - } - else if( (char)c == 'd' ) - { pyrDown( tmp, dst, Size( tmp.cols/2, tmp.rows/2 ) ); - printf( "** Zoom Out: Image / 2 \n" ); - } - - imshow( window_name, dst ); - tmp = dst; - } - @endcode + @snippet cpp/tutorial_code/ImgProc/Pyramids.cpp infinite_loop Our program exits if the user presses *ESC*. Besides, it has two options: - **Perform upsampling (after pressing 'u')** - @code{.cpp} - pyrUp( tmp, dst, Size( tmp.cols*2, tmp.rows*2 ) - @endcode - We use the function @ref cv::pyrUp with 03 arguments: + @snippet cpp/tutorial_code/ImgProc/Pyramids.cpp pyrup + We use the function @ref cv::pyrUp with three arguments: - *tmp*: The current image, it is initialized with the *src* original image. - *dst*: The destination image (to be shown on screen, supposedly the double of the @@ -136,11 +105,8 @@ Let's check the general structure of the program: - *Size( tmp.cols*2, tmp.rows\*2 )\* : The destination size. Since we are upsampling, @ref cv::pyrUp expects a size double than the input image (in this case *tmp*). - **Perform downsampling (after pressing 'd')** - @code{.cpp} - pyrDown( tmp, dst, Size( tmp.cols/2, tmp.rows/2 ) - @endcode - Similarly as with @ref cv::pyrUp , we use the function @ref cv::pyrDown with 03 - arguments: + @snippet cpp/tutorial_code/ImgProc/Pyramids.cpp pyrdown + Similarly as with @ref cv::pyrUp , we use the function @ref cv::pyrDown with three arguments: - *tmp*: The current image, it is initialized with the *src* original image. - *dst*: The destination image (to be shown on screen, supposedly half the input @@ -151,15 +117,13 @@ Let's check the general structure of the program: both dimensions). Otherwise, an error will be shown. - Finally, we update the input image **tmp** with the current image displayed, so the subsequent operations are performed on it. - @code{.cpp} - tmp = dst; - @endcode + @snippet cpp/tutorial_code/ImgProc/Pyramids.cpp update_tmp Results ------- - After compiling the code above we can test it. The program calls an image **chicky_512.jpg** - that comes in the *tutorial_code/image* folder. Notice that this image is \f$512 \times 512\f$, + that comes in the *samples/data* folder. Notice that this image is \f$512 \times 512\f$, hence a downsample won't generate any error (\f$512 = 2^{9}\f$). The original image is shown below: ![](images/Pyramids_Tutorial_Original_Image.jpg) diff --git a/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.markdown b/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.markdown index fef66fb665..56d886d89f 100644 --- a/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.markdown +++ b/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.markdown @@ -22,6 +22,49 @@ This tutorial code's is shown lines below. You can also download it from Explanation ----------- +The main function is rather simple, as follows from the comments we do the following: +-# Open the image, convert it into grayscale and blur it to get rid of the noise. + @snippet samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp setup +-# Create a window with header "Source" and display the source file in it. + @snippet samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp createWindow +-# Create a trackbar on the source_window and assign a callback function to it + In general callback functions are used to react to some kind of signal, in our + case it's trackbar's state change. + @snippet samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp taskbar +-# Explicit one-time call of `thresh_callback` is necessary to display + the "Contours" window simultaniously with the "Source" window. + @snippet samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp callback00 +-# Wait for user to close the windows. + @snippet samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp waitForIt + + +The callback function `thresh_callback` does all the interesting job. + + +-# Writes to `threshold_output` the threshold of the grayscale picture (you can check out about thresholding @ref tutorial_threshold "here"). + @snippet samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp threshold +-# Finds contours and saves them to the vectors `contour` and `hierarchy`. + @snippet samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp findContours +-# For every found contour we now apply approximation to polygons + with accuracy +-3 and stating that the curve must me closed. + + After that we find a bounding rect for every polygon and save it to `boundRect`. + + At last we find a minimum enclosing circle for every polygon and + save it to `center` and `radius` vectors. + @snippet samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp allthework + +We found everything we need, all we have to do is to draw. + +-# Create new Mat of unsigned 8-bit chars, filled with zeros. + It will contain all the drawings we are going to make (rects and circles). + @snippet samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp zeroMat +-# For every contour: pick a random color, draw the contour, the bounding rectangle and + the minimal enclosing circle with it, + @snippet samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp forContour +-# Display the results: create a new window "Contours" and show everything we added to drawings on it. + @snippet samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp showDrawings + Result ------ diff --git a/doc/tutorials/imgproc/threshold/threshold.markdown b/doc/tutorials/imgproc/threshold/threshold.markdown index f0bc735ab6..c93650aacd 100644 --- a/doc/tutorials/imgproc/threshold/threshold.markdown +++ b/doc/tutorials/imgproc/threshold/threshold.markdown @@ -106,51 +106,23 @@ Explanation -# Let's check the general structure of the program: - Load an image. If it is BGR we convert it to Grayscale. For this, remember that we can use the function @ref cv::cvtColor : - @code{.cpp} - src = imread( argv[1], 1 ); + @snippet cpp/tutorial_code/ImgProc/Threshold.cpp load - /// Convert the image to Gray - cvtColor( src, src_gray, COLOR_BGR2GRAY ); - @endcode - Create a window to display the result - @code{.cpp} - namedWindow( window_name, WINDOW_AUTOSIZE ); - @endcode + @snippet cpp/tutorial_code/ImgProc/Threshold.cpp window + - Create \f$2\f$ trackbars for the user to enter user input: - **Type of thresholding**: Binary, To Zero, etc... - **Threshold value** - @code{.cpp} - createTrackbar( trackbar_type, - window_name, &threshold_type, - max_type, Threshold_Demo ); + @snippet cpp/tutorial_code/ImgProc/Threshold.cpp trackbar - createTrackbar( trackbar_value, - window_name, &threshold_value, - max_value, Threshold_Demo ); - @endcode - Wait until the user enters the threshold value, the type of thresholding (or until the program exits) - Whenever the user changes the value of any of the Trackbars, the function *Threshold_Demo* is called: - @code{.cpp} - /* - * @function Threshold_Demo - */ - void Threshold_Demo( int, void* ) - { - /* 0: Binary - 1: Binary Inverted - 2: Threshold Truncated - 3: Threshold to Zero - 4: Threshold to Zero Inverted - */ + @snippet cpp/tutorial_code/ImgProc/Threshold.cpp Threshold_Demo - threshold( src_gray, dst, threshold_value, max_BINARY_value,threshold_type ); - - imshow( window_name, dst ); - } - @endcode As you can see, the function @ref cv::threshold is invoked. We give \f$5\f$ parameters: - *src_gray*: Our input image diff --git a/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.markdown b/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.markdown index ec27dc2731..3953635193 100644 --- a/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.markdown +++ b/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.markdown @@ -21,92 +21,8 @@ This tutorial code's is shown lines below. You can also download it from [here](https://github.com/opencv/tree/master/samples/cpp/tutorial_code/objectDetection/objectDetection.cpp) . The second version (using LBP for face detection) can be [found here](https://github.com/opencv/tree/master/samples/cpp/tutorial_code/objectDetection/objectDetection2.cpp) -@code{.cpp} -#include "opencv2/objdetect.hpp" -#include "opencv2/highgui.hpp" -#include "opencv2/imgproc.hpp" +@include samples/cpp/tutorial_code/objectDetection/objectDetection.cpp -#include -#include - -using namespace std; -using namespace cv; - -/* Function Headers */ -void detectAndDisplay( Mat frame ); - -/* Global variables */ -String face_cascade_name = "haarcascade_frontalface_alt.xml"; -String eyes_cascade_name = "haarcascade_eye_tree_eyeglasses.xml"; -CascadeClassifier face_cascade; -CascadeClassifier eyes_cascade; -String window_name = "Capture - Face detection"; - -/* @function main */ -int main( void ) -{ - VideoCapture capture; - Mat frame; - - //-- 1. Load the cascades - if( !face_cascade.load( face_cascade_name ) ){ printf("--(!)Error loading face cascade\n"); return -1; }; - if( !eyes_cascade.load( eyes_cascade_name ) ){ printf("--(!)Error loading eyes cascade\n"); return -1; }; - - //-- 2. Read the video stream - capture.open( -1 ); - if ( ! capture.isOpened() ) { printf("--(!)Error opening video capture\n"); return -1; } - - while ( capture.read(frame) ) - { - if( frame.empty() ) - { - printf(" --(!) No captured frame -- Break!"); - break; - } - - //-- 3. Apply the classifier to the frame - detectAndDisplay( frame ); - - int c = waitKey(10); - if( (char)c == 27 ) { break; } // escape - } - return 0; -} - -/* @function detectAndDisplay */ -void detectAndDisplay( Mat frame ) -{ - std::vector faces; - Mat frame_gray; - - cvtColor( frame, frame_gray, COLOR_BGR2GRAY ); - equalizeHist( frame_gray, frame_gray ); - - //-- Detect faces - face_cascade.detectMultiScale( frame_gray, faces, 1.1, 2, 0|CASCADE_SCALE_IMAGE, Size(30, 30) ); - - for( size_t i = 0; i < faces.size(); i++ ) - { - Point center( faces[i].x + faces[i].width/2, faces[i].y + faces[i].height/2 ); - ellipse( frame, center, Size( faces[i].width/2, faces[i].height/2), 0, 0, 360, Scalar( 255, 0, 255 ), 4, 8, 0 ); - - Mat faceROI = frame_gray( faces[i] ); - std::vector eyes; - - //-- In each face, detect eyes - eyes_cascade.detectMultiScale( faceROI, eyes, 1.1, 2, 0 |CASCADE_SCALE_IMAGE, Size(30, 30) ); - - for( size_t j = 0; j < eyes.size(); j++ ) - { - Point eye_center( faces[i].x + eyes[j].x + eyes[j].width/2, faces[i].y + eyes[j].y + eyes[j].height/2 ); - int radius = cvRound( (eyes[j].width + eyes[j].height)*0.25 ); - circle( frame, eye_center, radius, Scalar( 255, 0, 0 ), 4, 8, 0 ); - } - } - //-- Show what you got - imshow( window_name, frame ); -} -@endcode Explanation ----------- diff --git a/doc/tutorials/objdetect/images/visualisation_single_stage.png b/doc/tutorials/objdetect/images/visualisation_single_stage.png new file mode 100644 index 0000000000..e87bc225fb Binary files /dev/null and b/doc/tutorials/objdetect/images/visualisation_single_stage.png differ diff --git a/doc/tutorials/objdetect/images/visualisation_video.png b/doc/tutorials/objdetect/images/visualisation_video.png new file mode 100644 index 0000000000..f3ce484d42 Binary files /dev/null and b/doc/tutorials/objdetect/images/visualisation_video.png differ diff --git a/doc/tutorials/objdetect/traincascade.markdown b/doc/tutorials/objdetect/traincascade.markdown index ff0f6048aa..4edc07bf66 100644 --- a/doc/tutorials/objdetect/traincascade.markdown +++ b/doc/tutorials/objdetect/traincascade.markdown @@ -4,66 +4,30 @@ Cascade Classifier Training {#tutorial_traincascade} Introduction ------------ -The work with a cascade classifier inlcudes two major stages: training and detection. Detection -stage is described in a documentation of objdetect module of general OpenCV documentation. -This documentation gives some basic information about cascade classifier. Current guide is describing how -to train a cascade classifier: preparation of the training data and running the training application. +Working with a boosted cascade of weak classifiers includes two major stages: the training and the detection stage. The detection stage using either HAAR or LBP based models, is described in the @ref tutorial_cascade_classifier "object detection tutorial". This documentation gives an overview of the functionality needed to train your own boosted cascade of weak classifiers. The current guide will walk through all the different stages: collecting training data, preparation of the training data and executing the actual model training. + +To support this tutorial, several official OpenCV applications will be used: [opencv_createsamples](https://github.com/opencv/opencv/tree/master/apps/createsamples), [opencv_annotation](https://github.com/opencv/opencv/tree/master/apps/annotation), [opencv_traincascade](https://github.com/opencv/opencv/tree/master/apps/traincascade) and [opencv_visualisation](https://github.com/opencv/opencv/tree/master/apps/visualisation). ### Important notes -There are two applications in OpenCV to train cascade classifier: opencv_haartraining and -opencv_traincascade. opencv_traincascade is a newer version, written in C++ in accordance to -OpenCV 2.x API. But the main difference between this two applications is that opencv_traincascade -supports both Haar @cite Viola01 and LBP (Local Binary Patterns) @cite Liao2007 features. LBP features -are integer in contrast to Haar features, so both training and detection with LBP are several times -faster then with Haar features. Regarding the LBP and Haar detection quality, it depends on -training: the quality of training dataset first of all and training parameters too. It's possible to -train a LBP-based classifier that will provide almost the same quality as Haar-based one. + - If you come accross any tutorial mentioning the old opencv_haartraining tool (which is deprecated and still using the OpenCV1.x interface), then please ignore that tutorial and stick to the opencv_traincascade tool. This tool is a newer version, written in C++ in accordance to the OpenCV 2.x and OpenCV 3.x API. The opencv_traincascade supports both HAAR like wavelet features @cite Viola01 and LBP (Local Binary Patterns) @cite Liao2007 features. LBP features yield integer precision in contrast to HAAR features, yielding floating point precision, so both training and detection with LBP are several times faster then with HAAR features. Regarding the LBP and HAAR detection quality, it mainly depends on the training data used and the training parameters selected. It's possible to train a LBP-based classifier that will provide almost the same quality as HAAR-based one, within a percentage of the training time. -opencv_traincascade and opencv_haartraining store the trained classifier in different file -formats. Note, the newer cascade detection interface (see CascadeClassifier class in objdetect -module) support both formats. opencv_traincascade can save (export) a trained cascade in the older -format. But opencv_traincascade and opencv_haartraining can not load (import) a classifier in -another format for the futher training after interruption. + - The newer cascade classifier detection interface from OpenCV 2.x and OpenCV 3.x (@ref cv::CascadeClassifier) supports working with both old and new model formats. opencv_traincascade can even save (export) a trained cascade in the older format if for some reason you are stuck using the old interface. At least training the model could then be done in the most stable interface. -Note that opencv_traincascade application can use TBB for multi-threading. To use it in multicore -mode OpenCV must be built with TBB. + - The opencv_traincascade application can use TBB for multi-threading. To use it in multicore mode OpenCV must be built with TBB support enabled. -Also there are some auxilary utilities related to the training. +Preparation of the training data +-------------------------------- -- opencv_createsamples is used to prepare a training dataset of positive and test samples. - opencv_createsamples produces dataset of positive samples in a format that is supported by - both opencv_haartraining and opencv_traincascade applications. The output is a file - with \*.vec extension, it is a binary format which contains images. -- opencv_performance may be used to evaluate the quality of classifiers, but for trained by - opencv_haartraining only. It takes a collection of marked up images, runs the classifier and - reports the performance, i.e. number of found objects, number of missed objects, number of - false alarms and other information. - -Since opencv_haartraining is an obsolete application, only opencv_traincascade will be described -futher. opencv_createsamples utility is needed to prepare a training data for opencv_traincascade, -so it will be described too. - -Training data preparation -------------------------- - -For training we need a set of samples. There are two types of samples: negative and positive. -Negative samples correspond to non-object images. Positive samples correspond to images with -detected objects. Set of negative samples must be prepared manually, whereas set of positive samples -is created using opencv_createsamples utility. +For training a boosted cascade of weak classifiers we need a set of positive samples (containing actual objects you want to detect) and a set of negative images (containing everything you do not want to detect). The set of negative samples must be prepared manually, whereas set of positive samples is created using the opencv_createsamples application. ### Negative Samples -Negative samples are taken from arbitrary images. These images must not contain detected objects. -Negative samples are enumerated in a special file. It is a text file in which each line contains an -image filename (relative to the directory of the description file) of negative sample image. This -file must be created manually. Note that negative samples and sample images are also called -background samples or background images, and are used interchangeably in this document. -Described images may be of different sizes. But each image should be (but not nessesarily) larger -than a training window size, because these images are used to subsample negative image to the -training size. +Negative samples are taken from arbitrary images, not containing objects you want to detect. These negative images, from which the samples are generated, should be listed in a special negative image file containing one image path per line (can be absolute or relative). Note that negative samples and sample images are also called background samples or background images, and are used interchangeably in this document. -An example of description file: +Described images may be of different sizes. However, each image should be equal or larger than the desired training window size (which corresponds to the model dimensions, most of the times being the average size of your object), because these images are used to subsample a given negative image into several image samples having this training window size. + +An example of such a negative description file: Directory structure: @code{.text} @@ -72,100 +36,55 @@ Directory structure: img2.jpg bg.txt @endcode + File bg.txt: @code{.text} img/img1.jpg img/img2.jpg @endcode + +Your set of negative window samples will be used to tell the machine learning step, boosting in this case, what not to look for, when trying to find your objects of interest. + ### Positive Samples -Positive samples are created by opencv_createsamples utility. They may be created from a single -image with object or from a collection of previously marked up images. +Positive samples are created by the opencv_createsamples application. They are used by the boosting process to define what the model should actually look for when trying to find your objects of interest. The application supports two ways of generating a positive sample dataset. -Please note that you need a large dataset of positive samples before you give it to the mentioned -utility, because it only applies perspective transformation. For example you may need only one -positive sample for absolutely rigid object like an OpenCV logo, but you definetely need hundreds -and even thousands of positive samples for faces. In the case of faces you should consider all the -race and age groups, emotions and perhaps beard styles. + 1. You can generate a bunch of positives from a single positive object image. + 2. You can supply all the positives yourself and only use the tool to cut them out, resize them and put them in the opencv needed binary format. -So, a single object image may contain a company logo. Then a large set of positive samples is -created from the given object image by random rotating, changing the logo intensity as well as -placing the logo on arbitrary background. The amount and range of randomness can be controlled by -command line arguments of opencv_createsamples utility. +While the first approach works decently for fixed objects, like very rigid logo's, it tends to fail rather soon for less rigid objects. In that case we do suggest to use the second approach. Many tutorials on the web even state that 100 real object images, can lead to a better model than 1000 artificially generated positives, by using the opencv_createsamples application. If you however do decide to take the first approach, keep some things in mind: + + - Please note that you need more than a single positive samples before you give it to the mentioned application, because it only applies perspective transformation. + - If you want a robust model, take samples that cover the wide range of varieties that can occur within your object class. For example in the case of faces you should consider different races and age groups, emotions and perhaps beard styles. This also applies when using the second approach. + +The first approach takes a single object image with for example a company logo and creates a large set of positive samples from the given object image by randomly rotating the object, changing the image intensity as well as placing the image on arbitrary backgrounds. The amount and range of randomness can be controlled by command line arguments of the opencv_createsamples application. Command line arguments: -- -vec \ + - `-vec ` : Name of the output file containing the positive samples for training. - Name of the output file containing the positive samples for training. + - `-img ` : Source object image (e.g., a company logo). -- -img \ + - `-bg ` : Background description file; contains a list of images which are used as a background for randomly distorted versions of the object. - Source object image (e.g., a company logo). + - `-num ` : Number of positive samples to generate. -- -bg \ + - `-bgcolor ` : Background color (currently grayscale images are assumed); the background color denotes the transparent color. Since there might be compression artifacts, the amount of color tolerance can be specified by -bgthresh. All pixels withing bgcolor-bgthresh and bgcolor+bgthresh range are interpreted as transparent. - Background description file; contains a list of images which are used as a background for - randomly distorted versions of the object. + - `-bgthresh ` + - `-inv` : If specified, colors will be inverted. + - `-randinv` : If specified, colors will be inverted randomly. + - `-maxidev ` : Maximal intensity deviation of pixels in foreground samples. + - `-maxxangle ` : Maximal rotation angle towards x-axis, must be given in radians. + - `-maxyangle ` : Maximal rotation angle towards y-axis, must be given in radians. + - `-maxzangle ` : Maximal rotation angle towards z-axis, must be given in radians. + - `-show` : Useful debugging option. If specified, each sample will be shown. Pressing Esc will continue the samples creation process without showing each sample. + - `-w ` : Width (in pixels) of the output samples. + - `-h ` : Height (in pixels) of the output samples. -- -num \ +When running opencv_createsamples in this way, the following procedure is used to create a sample object instance: The given source image is rotated randomly around all three axes. The chosen angle is limited by `-maxxangle`, `-maxyangle` and `-maxzangle`. Then pixels having the intensity from the [bg_color-bg_color_threshold; bg_color+bg_color_threshold] range are interpreted as transparent. White noise is added to the intensities of the foreground. If the `-inv` key is specified then foreground pixel intensities are inverted. If `-randinv` key is specified then algorithm randomly selects whether inversion should be applied to this sample. Finally, the obtained image is placed onto an arbitrary background from the background description file, resized to the desired size specified by `-w` and `-h` and stored to the vec-file, specified by the `-vec` command line option. - Number of positive samples to generate. - -- -bgcolor \ - - Background color (currently grayscale images are assumed); the background color denotes the - transparent color. Since there might be compression artifacts, the amount of color tolerance - can be specified by -bgthresh. All pixels withing bgcolor-bgthresh and bgcolor+bgthresh range - are interpreted as transparent. - -- -bgthresh \ -- -inv - - If specified, colors will be inverted. - -- -randinv - - If specified, colors will be inverted randomly. - -- -maxidev \ - - Maximal intensity deviation of pixels in foreground samples. - -- -maxxangle \ -- -maxyangle \ -- -maxzangle \ - - Maximum rotation angles must be given in radians. - -- -show - - Useful debugging option. If specified, each sample will be shown. Pressing Esc will continue - the samples creation process without. - -- -w \ - - Width (in pixels) of the output samples. - -- -h \ - - Height (in pixels) of the output samples. - -For following procedure is used to create a sample object instance: The source image is rotated -randomly around all three axes. The chosen angle is limited by -maxxangle, -maxyangle and maxzangle. Then pixels having the -intensity from [bg_color-bg_color_threshold; bg_color+bg_color_threshold] range are -interpreted as transparent. White noise is added to the intensities of the foreground. If the -inv -key is specified then foreground pixel intensities are inverted. If -randinv key is specified then -algorithm randomly selects whether inversion should be applied to this sample. Finally, the obtained -image is placed onto an arbitrary background from the background description file, resized to the -desired size specified by -w and -h and stored to the vec-file, specified by the -vec command line -option. - -Positive samples also may be obtained from a collection of previously marked up images. This -collection is described by a text file similar to background description file. Each line of this -file corresponds to an image. The first element of the line is the filename. It is followed by the -number of object instances. The following numbers are the coordinates of objects bounding rectangles -(x, y, width, height). +Positive samples also may be obtained from a collection of previously marked up images, which is the desired way when building robust object models. This collection is described by a text file similar to the background description file. Each line of this file corresponds to an image. The first element of the line is the filename, followed by the number of object annotations, followed by numbers describing the coordinates of the objects bounding rectangles (x, y, width, height). An example of description file: @@ -184,146 +103,115 @@ img/img2.jpg 2 100 200 50 50 50 30 25 25 Image img1.jpg contains single object instance with the following coordinates of bounding rectangle: (140, 100, 45, 45). Image img2.jpg contains two object instances. -In order to create positive samples from such collection, -info argument should be specified instead -of \`-img\`: +In order to create positive samples from such collection, `-info` argument should be specified instead of `-img`: -- -info \ + - `-info ` : Description file of marked up images collection. - Description file of marked up images collection. +Note that in this case, parameters like `-bg, -bgcolor, -bgthreshold, -inv, -randinv, -maxxangle, -maxyangle, -maxzangle` are simply ignored and not used anymore. The scheme of samples creation in this case is as follows. The object instances are taken from the given images, by cutting out the supplied bounding boxes from the original images. Then they are resized to target samples size (defined by `-w` and `-h`) and stored in output vec-file, defined by the `-vec` parameter. No distortion is applied, so the only affecting arguments are `-w`, `-h`, `-show` and `-num`. -The scheme of samples creation in this case is as follows. The object instances are taken from -images. Then they are resized to target samples size and stored in output vec-file. No distortion is -applied, so the only affecting arguments are -w, -h, -show and -num. +The manual process of creating the `-info` file can also been done by using the opencv_annotation tool. This is an open source tool for visually selecting the regions of interest of your object instances in any given images. The following subsection will discuss in more detail on how to use this application. -opencv_createsamples utility may be used for examining samples stored in positive samples file. In -order to do this only -vec, -w and -h parameters should be specified. +#### Extra remarks -Note that for training, it does not matter how vec-files with positive samples are generated. But -opencv_createsamples utility is the only one way to collect/create a vector file of positive -samples, provided by OpenCV. + - opencv_createsamples utility may be used for examining samples stored in any given positive samples file. In order to do this only `-vec`, `-w` and `-h` parameters should be specified. + - Example of vec-file is available here `opencv/data/vec_files/trainingfaces_24-24.vec`. It can be used to train a face detector with the following window size: `-w 24 -h 24`. -Example of vec-file is available here opencv/data/vec_files/trainingfaces_24-24.vec. It can be -used to train a face detector with the following window size: -w 24 -h 24. +### Using OpenCV's integrated annotation tool + +Since OpenCV 3.x the community has been supplying and maintaining a open source annotation tool, used for generating the `-info` file. The tool can be accessed by the command opencv_annotation if the OpenCV applications where build. + +Using the tool is quite straightforward. The tool accepts several required and some optional parameters: + + - `--annotations` (required) : path to annotations txt file, where you want to store your annotations, which is then passed to the `-info` parameter [example - /data/annotations.txt] + - `--images` (required) : path to folder containing the images with your objects [example - /data/testimages/] + - `--maxWindowHeight` (optional) : if the input image is larger in height then the given resolution here, resize the image for easier annotation, using `--resizeFactor`. + - `--resizeFactor` (optional) : factor used to resize the input image when using the `--maxWindowHeight` parameter. + +Note that the optional parameters can only be used together. An example of a command that could be used can be seen below + +@code{.text} +opencv_annotation --annotations=/path/to/annotations/file.txt --images=/path/to/image/folder/ +@endcode + +This command will fire up a window containing the first image and your mouse cursor which will be used for annotation. A video on how to use the annotation tool can be found [here](https://www.youtube.com/watch?v=EV5gmvoCTSk). Basically there are several keystrokes that trigger an action. The left mouse button is used to select the first corner of your object, then keeps drawing until you are fine, and stops when a second left mouse button click is registered. After each selection you have the following choices: + + - Pressing `c` : confirm the annotation, turning the annotation green and confirming it is stored + - Pressing `d` : delete the last annotation from the list of annotations (easy for removing wrong annotations) + - Pressing `n` : continue to the next image + - Pressing `ESC` : this will exit the annotation software + +Finally you will end up with a usable annotation file that can be passed to the `-info` argument of opencv_createsamples. Cascade Training ---------------- -The next step is the training of classifier. As mentioned above opencv_traincascade or -opencv_haartraining may be used to train a cascade classifier, but only the newer -opencv_traincascade will be described futher. +The next step is the actual training of the boosted cascade of weak classifiers, based on the positive and negative dataset that was prepared beforehand. Command line arguments of opencv_traincascade application grouped by purposes: --# Common arguments: +- Common arguments: + - `-data ` : Where the trained classifier should be stored. This folder should be created manually beforehand. + - `-vec ` : vec-file with positive samples (created by opencv_createsamples utility). + - `-bg ` : Background description file. This is the file containing the negative sample images. + - `-numPos ` : Number of positive samples used in training for every classifier stage. + - `-numNeg ` : Number of negative samples used in training for every classifier stage. + - `-numStages ` : Number of cascade stages to be trained. + - `-precalcValBufSize ` : Size of buffer for precalculated feature values (in Mb). The more memory you assign the faster the training process, however keep in mind that `-precalcValBufSize` and `-precalcIdxBufSize` combined should not exceed you available system memory. + - `-precalcIdxBufSize ` : Size of buffer for precalculated feature indices (in Mb). The more memory you assign the faster the training process, however keep in mind that `-precalcValBufSize` and `-precalcIdxBufSize` combined should not exceed you available system memory. + - `-baseFormatSave` : This argument is actual in case of Haar-like features. If it is specified, the cascade will be saved in the old format. This is only available for backwards compatibility reasons and to allow users stuck to the old deprecated interface, to at least train models using the newer interface. + - `-numThreads ` : Maximum number of threads to use during training. Notice that the actual number of used threads may be lower, depending on your machine and compilation options. By default, the maximum available threads are selected if you built OpenCV with TBB support, which is needed for this optimization. + - `-acceptanceRatioBreakValue ` : This argument is used to determine how precise your model should keep learning and when to stop. A good guideline is to train not further than 10e-5, to ensure the model does not overtrain on your training data. By default this value is set to -1 to disable this feature. - - -data \ +- Cascade parameters: + - `-stageType ` : Type of stages. Only boosted classifiers are supported as a stage type at the moment. + - `-featureType<{HAAR(default), LBP}>` : Type of features: HAAR - Haar-like features, LBP - local binary patterns. + - `-w ` : Width of training samples (in pixels). Must have exactly the same value as used during training samples creation (opencv_createsamples utility). + - `-h ` : Height of training samples (in pixels). Must have exactly the same value as used during training samples creation (opencv_createsamples utility). - Where the trained classifier should be stored. +- Boosted classifer parameters: + - `-bt <{DAB, RAB, LB, GAB(default)}>` : Type of boosted classifiers: DAB - Discrete AdaBoost, RAB - Real AdaBoost, LB - LogitBoost, GAB - Gentle AdaBoost. + - `-minHitRate ` : Minimal desired hit rate for each stage of the classifier. Overall hit rate may be estimated as (min_hit_rate ^ number_of_stages), @cite Viola04 §4.1. + - `-maxFalseAlarmRate ` : Maximal desired false alarm rate for each stage of the classifier. Overall false alarm rate may be estimated as (max_false_alarm_rate ^ number_of_stages), @cite Viola04 §4.1. + - `-weightTrimRate ` : Specifies whether trimming should be used and its weight. A decent choice is 0.95. + - `-maxDepth ` : Maximal depth of a weak tree. A decent choice is 1, that is case of stumps. + - `-maxWeakCount ` : Maximal count of weak trees for every cascade stage. The boosted classifier (stage) will have so many weak trees (<=maxWeakCount), as needed to achieve the given `-maxFalseAlarmRate`. - - -vec \ +- Haar-like feature parameters: + - `-mode ` : Selects the type of Haar features set used in training. BASIC use only upright features, while ALL uses the full set of upright and 45 degree rotated feature set. See @cite Lienhart02 for more details. - vec-file with positive samples (created by opencv_createsamples utility). +- Local Binary Patterns parameters: Local Binary Patterns don't have parameters. - - -bg \ - - Background description file. - - - -numPos \ - - -numNeg \ - - Number of positive/negative samples used in training for every classifier stage. - - - -numStages \ - - Number of cascade stages to be trained. - - - -precalcValBufSize \ - - Size of buffer for precalculated feature values (in Mb). - - - -precalcIdxBufSize \ - - Size of buffer for precalculated feature indices (in Mb). The more memory you have the - faster the training process. - - - -baseFormatSave - - This argument is actual in case of Haar-like features. If it is specified, the cascade will - be saved in the old format. - - - -numThreads \ - - Maximum number of threads to use during training. Notice that the actual number of used - threads may be lower, depending on your machine and compilation options. - - - -acceptanceRatioBreakValue \ - - This argument is used to determine how precise your model should keep learning and when to stop. - A good guideline is to train not further than 10e-5, to ensure the model does not overtrain on your training data. - By default this value is set to -1 to disable this feature. - --# Cascade parameters: - - - -stageType \ - - Type of stages. Only boosted classifier are supported as a stage type at the moment. - - - -featureType\<{HAAR(default), LBP}\> - - Type of features: HAAR - Haar-like features, LBP - local binary patterns. - - - -w \ - - -h \ - - Size of training samples (in pixels). Must have exactly the same values as used during - training samples creation (opencv_createsamples utility). - --# Boosted classifer parameters: - - - -bt \<{DAB, RAB, LB, GAB(default)}\> - - Type of boosted classifiers: DAB - Discrete AdaBoost, RAB - Real AdaBoost, LB - LogitBoost, - GAB - Gentle AdaBoost. - - - -minHitRate \ - - Minimal desired hit rate for each stage of the classifier. Overall hit rate may be estimated - as (min_hit_rate ^ number_of_stages), @cite Viola04 §4.1. - - - -maxFalseAlarmRate \ - - Maximal desired false alarm rate for each stage of the classifier. Overall false alarm rate - may be estimated as (max_false_alarm_rate ^ number_of_stages), @cite Viola04 §4.1. - - - -weightTrimRate \ - - Specifies whether trimming should be used and its weight. A decent choice is 0.95. - - - -maxDepth \ - - Maximal depth of a weak tree. A decent choice is 1, that is case of stumps. - - - -maxWeakCount \ - - Maximal count of weak trees for every cascade stage. The boosted classifier (stage) will - have so many weak trees (\<=maxWeakCount), as needed to achieve the - given -maxFalseAlarmRate. - --# Haar-like feature parameters: - - - -mode \ - - Selects the type of Haar features set used in training. BASIC use only upright features, - while ALL uses the full set of upright and 45 degree rotated feature set. See @cite Lienhart02 - for more details. - --# Local Binary Patterns parameters: - - Local Binary Patterns don't have parameters. - -After the opencv_traincascade application has finished its work, the trained cascade will be saved -in cascade.xml file in the folder, which was passed as -data parameter. Other files in this folder -are created for the case of interrupted training, so you may delete them after completion of -training. +After the opencv_traincascade application has finished its work, the trained cascade will be saved in `cascade.xml` file in the `-data` folder. Other files in this folder are created for the case of interrupted training, so you may delete them after completion of training. Training is finished and you can test your cascade classifier! + +Visualising Cascade Classifiers +------------------------------- + +From time to time it can be usefull to visualise the trained cascade, to see which features it selected and how complex its stages are. For this OpenCV supplies a opencv_visualisation application. This application has the following commands: + + - `--image` (required) : path to a reference image for your object model. This should be an annotation with dimensions [`-w`,`-h`] as passed to both opencv_createsamples and opencv_traincascade application. + - `--model` (required) : path to the trained model, which should be in the folder supplied to the `-data` parameter of the opencv_traincascade application. + - `--data` (optional) : if a data folder is supplied, which has to be manually created beforehand, stage output and a video of the features will be stored. + +An example command can be seen below + +@code{.text} +opencv_visualisation --image=/data/object.png --model=/data/model.xml --data=/data/result/ +@endcode + +Some limitations of the current visualisation tool + - Only handles cascade classifier models, trained with the opencv_traincascade tool, containing __stumps__ as decision trees [default settings]. + - The image provided needs to be a sample window with the original model dimensions, passed to the `--image` parameter. + +Example of the HAAR/LBP face model ran on a given window of Angelina Jolie, which had the same preprocessing as cascade classifier files -->24x24 pixel image, grayscale conversion and histogram equalisation: + +_A video is made with for each stage each feature visualised:_ + +![](images/visualisation_video.png) + +_Each stage is stored as an image for future validation of the features:_ + +![](images/visualisation_single_stage.png) + +_This work was created for [OpenCV 3 Blueprints](https://www.packtpub.com/application-development/opencv-3-blueprints) by StevenPuttemans but Packt Publishing agreed integration into OpenCV._ diff --git a/include/opencv2/opencv.hpp b/include/opencv2/opencv.hpp index ddcadc7210..9037053a02 100644 --- a/include/opencv2/opencv.hpp +++ b/include/opencv2/opencv.hpp @@ -52,46 +52,9 @@ #include "opencv2/core.hpp" // Then the optional modules are checked -// REMARK: keep the includes ordened as the module order on the GitHub repo #ifdef HAVE_OPENCV_CALIB3D #include "opencv2/calib3d.hpp" #endif -#ifdef HAVE_OPENCV_CUDAARITHM -#include "opencv2/cudaarithm.hpp" -#endif -#ifdef HAVE_OPENCV_CUDABGSEGM -#include "opencv2/cudabgsegm.hpp" -#endif -#ifdef HAVE_OPENCV_CUDACODEC -#include "opencv2/cudacodec.hpp" -#endif -#ifdef HAVE_OPENCV_CUDAFEATURES2D -#include "opencv2/cudafeatures2d.hpp" -#endif -#ifdef HAVE_OPENCV_CUDAFILTERS -#include "opencv2/cudafilters.hpp" -#endif -#ifdef HAVE_OPENCV_CUDAIMGPROC -#include "opencv2/cudaimgproc.hpp" -#endif -#ifdef HAVE_OPENCV_CUDALEGACY -#include "opencv2/cudalegacy.hpp" -#endif -#ifdef HAVE_OPENCV_CUDAOBJDETECT -#include "opencv2/cudaobjdetect.hpp" -#endif -#ifdef HAVE_OPENCV_CUDAOPTFLOW -#include "opencv2/cudaoptflow.hpp" -#endif -#ifdef HAVE_OPENCV_CUDASTEREO -#include "opencv2/cudastereo.hpp" -#endif -#ifdef HAVE_OPENCV_CUDAWARPING -#include "opencv2/cudawarping.hpp" -#endif -#ifdef HAVE_OPENCV_CUDEV -#include "opencv2/cudev.hpp" -#endif #ifdef HAVE_OPENCV_FEATURES2D #include "opencv2/features2d.hpp" #endif @@ -138,4 +101,36 @@ #include "opencv2/viz.hpp" #endif +// Finally CUDA specific entries are checked and added +#ifdef HAVE_OPENCV_CUDAARITHM +#include "opencv2/cudaarithm.hpp" +#endif +#ifdef HAVE_OPENCV_CUDABGSEGM +#include "opencv2/cudabgsegm.hpp" +#endif +#ifdef HAVE_OPENCV_CUDACODEC +#include "opencv2/cudacodec.hpp" +#endif +#ifdef HAVE_OPENCV_CUDAFEATURES2D +#include "opencv2/cudafeatures2d.hpp" +#endif +#ifdef HAVE_OPENCV_CUDAFILTERS +#include "opencv2/cudafilters.hpp" +#endif +#ifdef HAVE_OPENCV_CUDAIMGPROC +#include "opencv2/cudaimgproc.hpp" +#endif +#ifdef HAVE_OPENCV_CUDAOBJDETECT +#include "opencv2/cudaobjdetect.hpp" +#endif +#ifdef HAVE_OPENCV_CUDAOPTFLOW +#include "opencv2/cudaoptflow.hpp" +#endif +#ifdef HAVE_OPENCV_CUDASTEREO +#include "opencv2/cudastereo.hpp" +#endif +#ifdef HAVE_OPENCV_CUDAWARPING +#include "opencv2/cudawarping.hpp" +#endif + #endif diff --git a/modules/calib3d/doc/pics/pinhole_camera_model.png b/modules/calib3d/doc/pics/pinhole_camera_model.png index daa7e39d82..3594de9684 100644 Binary files a/modules/calib3d/doc/pics/pinhole_camera_model.png and b/modules/calib3d/doc/pics/pinhole_camera_model.png differ diff --git a/modules/calib3d/include/opencv2/calib3d.hpp b/modules/calib3d/include/opencv2/calib3d.hpp index 3ba7f61ae8..fcca409e55 100644 --- a/modules/calib3d/include/opencv2/calib3d.hpp +++ b/modules/calib3d/include/opencv2/calib3d.hpp @@ -263,6 +263,7 @@ enum { CALIB_USE_INTRINSIC_GUESS = 0x00001, CALIB_FIX_S1_S2_S3_S4 = 0x10000, CALIB_TILTED_MODEL = 0x40000, CALIB_FIX_TAUX_TAUY = 0x80000, + CALIB_USE_QR = 0x100000, //!< use QR instead of SVD decomposition for solving. Faster but potentially less precise // only for stereo CALIB_FIX_INTRINSIC = 0x00100, CALIB_SAME_FOCAL_LENGTH = 0x00200, @@ -320,7 +321,7 @@ mask values are ignored. @param maxIters The maximum number of RANSAC iterations, 2000 is the maximum it can be. @param confidence Confidence level, between 0 and 1. -The functions find and return the perspective transformation \f$H\f$ between the source and the +The function finds and returns the perspective transformation \f$H\f$ between the source and the destination planes: \f[s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}\f] diff --git a/modules/calib3d/src/calibinit.cpp b/modules/calib3d/src/calibinit.cpp index 55fadcb4f0..1bd896463c 100644 --- a/modules/calib3d/src/calibinit.cpp +++ b/modules/calib3d/src/calibinit.cpp @@ -76,6 +76,9 @@ #include #include +using namespace cv; +using namespace std; + //#define ENABLE_TRIM_COL_ROW //#define DEBUG_CHESSBOARD @@ -88,13 +91,9 @@ static int PRINTF( const char* fmt, ... ) return vprintf(fmt, args); } #else -static int PRINTF( const char*, ... ) -{ - return 0; -} +#define PRINTF(...) #endif - //===================================================================================== // Implementation for the enhanced calibration object detection //===================================================================================== @@ -155,10 +154,42 @@ struct CvCBQuad //===================================================================================== -//static CvMat* debug_img = 0; +#ifdef DEBUG_CHESSBOARD +#include "opencv2/highgui.hpp" +#include "opencv2/imgproc.hpp" +static void SHOW(const std::string & name, Mat & img) +{ + imshow(name, img); + while ((uchar)waitKey(0) != 'q') {} +} +static void SHOW_QUADS(const std::string & name, const Mat & img_, CvCBQuad * quads, int quads_count) +{ + Mat img = img_.clone(); + if (img.channels() == 1) + cvtColor(img, img, COLOR_GRAY2BGR); + for (int i = 0; i < quads_count; ++i) + { + CvCBQuad & quad = quads[i]; + for (int j = 0; j < 4; ++j) + { + line(img, quad.corners[j]->pt, quad.corners[(j + 1) % 4]->pt, Scalar(0, 240, 0), 1, LINE_AA); + } + } + imshow(name, img); + while ((uchar)waitKey(0) != 'q') {} +} +#else +#define SHOW(...) +#define SHOW_QUADS(...) +#endif + +//===================================================================================== static int icvGenerateQuads( CvCBQuad **quads, CvCBCorner **corners, - CvMemStorage *storage, CvMat *image, int flags, int *max_quad_buf_size); + CvMemStorage *storage, const Mat &image_, int flags, int *max_quad_buf_size); + +static bool processQuads(CvCBQuad *quads, int quad_count, CvSize pattern_size, int max_quad_buf_size, + CvMemStorage * storage, CvCBCorner *corners, CvPoint2D32f *out_corners, int *out_corner_count, int & prev_sqr_size); /*static int icvGenerateQuadsEx( CvCBQuad **out_quads, CvCBCorner **out_corners, @@ -195,203 +226,198 @@ static void icvRemoveQuadFromGroup(CvCBQuad **quads, int count, CvCBQuad *q0); static int icvCheckBoardMonotony( CvPoint2D32f* corners, CvSize pattern_size ); -int cvCheckChessboardBinary(IplImage* src, CvSize size); - /***************************************************************************************************/ //COMPUTE INTENSITY HISTOGRAM OF INPUT IMAGE -static int icvGetIntensityHistogram( unsigned char* pucImage, int iSizeCols, int iSizeRows, std::vector& piHist ); +static int icvGetIntensityHistogram( const Mat & img, std::vector& piHist ) +{ + // sum up all pixel in row direction and divide by number of columns + for ( int j=0; j& piHist, std::vector& piHistSmooth, int iWidth ); +static int icvSmoothHistogram( const std::vector& piHist, std::vector& piHistSmooth, int iWidth ) +{ + int iIdx; + for ( int i=0; i<256; i++) + { + int iSmooth = 0; + for ( int ii=-iWidth; ii<=iWidth; ii++) + { + iIdx = i+ii; + if (iIdx > 0 && iIdx < 256) + { + iSmooth += piHist[iIdx]; + } + } + piHistSmooth[i] = iSmooth/(2*iWidth+1); + } + return 0; +} +/***************************************************************************************************/ //COMPUTE FAST HISTOGRAM GRADIENT -static int icvGradientOfHistogram( const std::vector& piHist, std::vector& piHistGrad ); +static int icvGradientOfHistogram( const std::vector& piHist, std::vector& piHistGrad ) +{ + piHistGrad[0] = 0; + for ( int i=1; i<255; i++) + { + piHistGrad[i] = piHist[i-1] - piHist[i+1]; + if ( abs(piHistGrad[i]) < 100 ) + { + if ( piHistGrad[i-1] == 0) + piHistGrad[i] = -100; + else + piHistGrad[i] = piHistGrad[i-1]; + } + } + return 0; +} +/***************************************************************************************************/ //PERFORM SMART IMAGE THRESHOLDING BASED ON ANALYSIS OF INTENSTY HISTOGRAM -static bool icvBinarizationHistogramBased( unsigned char* pucImg, int iCols, int iRows ); -/***************************************************************************************************/ -int icvGetIntensityHistogram( unsigned char* pucImage, int iSizeCols, int iSizeRows, std::vector& piHist ) +static bool icvBinarizationHistogramBased( Mat & img ) { - int iVal; + CV_Assert(img.channels() == 1 && img.depth() == CV_8U); + int iCols = img.cols; + int iRows = img.rows; + int iMaxPix = iCols*iRows; + int iMaxPix1 = iMaxPix/100; + const int iNumBins = 256; + std::vector piHistIntensity(iNumBins, 0); + std::vector piHistSmooth(iNumBins, 0); + std::vector piHistGrad(iNumBins, 0); + std::vector piAccumSum(iNumBins, 0); + std::vector piMaxPos(20, 0); + int iThresh = 0; + int iIdx; + int iWidth = 1; - // sum up all pixel in row direction and divide by number of columns - for ( int j=0; j=0; i-- ) { - iVal = (int)pucImage[j*iSizeCols+i]; - piHist[iVal]++; - } - } - return 0; -} -/***************************************************************************************************/ -int icvSmoothHistogram( const std::vector& piHist, std::vector& piHistSmooth, int iWidth ) -{ - int iIdx; - for ( int i=0; i<256; i++) - { - int iSmooth = 0; - for ( int ii=-iWidth; ii<=iWidth; ii++) - { - iIdx = i+ii; - if (iIdx > 0 && iIdx < 256) - { - iSmooth += piHist[iIdx]; - } - } - piHistSmooth[i] = iSmooth/(2*iWidth+1); - } - return 0; -} -/***************************************************************************************************/ -int icvGradientOfHistogram( const std::vector& piHist, std::vector& piHistGrad ) -{ - piHistGrad[0] = 0; - for ( int i=1; i<255; i++) - { - piHistGrad[i] = piHist[i-1] - piHist[i+1]; - if ( abs(piHistGrad[i]) < 100 ) - { - if ( piHistGrad[i-1] == 0) - piHistGrad[i] = -100; - else - piHistGrad[i] = piHistGrad[i-1]; - } - } - return 0; -} -/***************************************************************************************************/ -bool icvBinarizationHistogramBased( unsigned char* pucImg, int iCols, int iRows ) -{ - int iMaxPix = iCols*iRows; - int iMaxPix1 = iMaxPix/100; - const int iNumBins = 256; - std::vector piHistIntensity(iNumBins, 0); - std::vector piHistSmooth(iNumBins, 0); - std::vector piHistGrad(iNumBins, 0); - std::vector piAccumSum(iNumBins, 0); - std::vector piMaxPos(20, 0); - int iThresh = 0; - int iIdx; - int iWidth = 1; - - icvGetIntensityHistogram( pucImg, iCols, iRows, piHistIntensity ); - - // get accumulated sum starting from bright - piAccumSum[iNumBins-1] = piHistIntensity[iNumBins-1]; - for ( int i=iNumBins-2; i>=0; i-- ) - { - piAccumSum[i] = piHistIntensity[i] + piAccumSum[i+1]; - } - - // first smooth the distribution - icvSmoothHistogram( piHistIntensity, piHistSmooth, iWidth ); - - // compute gradient - icvGradientOfHistogram( piHistSmooth, piHistGrad ); - - // check for zeros - int iCntMaxima = 0; - for ( int i=iNumBins-2; (i>2) && (iCntMaxima<20); i--) - { - if ( (piHistGrad[i-1] < 0) && (piHistGrad[i] > 0) ) - { - piMaxPos[iCntMaxima] = i; - iCntMaxima++; - } - } - - iIdx = 0; - int iSumAroundMax = 0; - for ( int i=0; i= 3 - { - // CHECKING THRESHOLD FOR WHITE - int iIdxAccSum = 0, iAccum = 0; - for (int i=iNumBins-1; i>0; i--) - { - iAccum += piHistIntensity[i]; - // iMaxPix/18 is about 5,5%, minimum required number of pixels required for white part of chessboard - if ( iAccum > (iMaxPix/18) ) - { - iIdxAccSum = i; - break; - } + piAccumSum[i] = piHistIntensity[i] + piAccumSum[i+1]; } - int iIdxBGMax = 0; - int iBrightMax = piMaxPos[0]; - // printf("iBrightMax = %d\n", iBrightMax); - for ( int n=0; n2) && (iCntMaxima<20); i--) { - iIdxBGMax = n+1; - if ( piMaxPos[n] < iIdxAccSum ) - { - break; - } - iBrightMax = piMaxPos[n]; + if ( (piHistGrad[i-1] < 0) && (piHistGrad[i] > 0) ) + { + piMaxPos[iCntMaxima] = i; + iCntMaxima++; + } } - // CHECKING THRESHOLD FOR BLACK - int iMaxVal = piHistIntensity[piMaxPos[iIdxBGMax]]; - - //IF TOO CLOSE TO 255, jump to next maximum - if ( piMaxPos[iIdxBGMax] >= 250 && iIdxBGMax < iCntMaxima ) + iIdx = 0; + int iSumAroundMax = 0; + for ( int i=0; i= 3 + { + // CHECKING THRESHOLD FOR WHITE + int iIdxAccSum = 0, iAccum = 0; + for (int i=iNumBins-1; i>0; i--) + { + iAccum += piHistIntensity[i]; + // iMaxPix/18 is about 5,5%, minimum required number of pixels required for white part of chessboard + if ( iAccum > (iMaxPix/18) ) + { + iIdxAccSum = i; + break; + } + } + + int iIdxBGMax = 0; + int iBrightMax = piMaxPos[0]; + // printf("iBrightMax = %d\n", iBrightMax); + for ( int n=0; n= 250 && iIdxBGMax < iCntMaxima ) + { + iIdxBGMax++; + iMaxVal = piHistIntensity[piMaxPos[iIdxBGMax]]; + } + + for ( int n=iIdxBGMax + 1; n= iMaxVal ) + { + iMaxVal = piHistIntensity[piMaxPos[n]]; + iIdxBGMax = n; + } + } + + //SETTING THRESHOLD FOR BINARIZATION + int iDist2 = (iBrightMax - piMaxPos[iIdxBGMax])/2; + iThresh = iBrightMax - iDist2; + PRINTF("THRESHOLD SELECTED = %d, BRIGHTMAX = %d, DARKMAX = %d\n", iThresh, iBrightMax, piMaxPos[iIdxBGMax]); } - for ( int n=iIdxBGMax + 1; n 0 ) { - if ( piHistIntensity[piMaxPos[n]] >= iMaxVal ) - { - iMaxVal = piHistIntensity[piMaxPos[n]]; - iIdxBGMax = n; - } + for ( int jj=0; jj 0 ) - { - for ( int jj=0; jj storage; try { int k = 0; const int min_dilations = 0; const int max_dilations = 7; - cv::Ptr norm_img, thresh_img; - cv::Ptr storage; - - CvMat stub, *img = (CvMat*)arr; - cImgSeg = cvCreateImage(cvGetSize(img), IPL_DEPTH_8U, 1 ); - memcpy( cImgSeg->imageData, cvPtr1D( img, 0), img->rows*img->cols ); - - CvMat stub2, *thresh_img_new; - thresh_img_new = cvGetMat( cImgSeg, &stub2, 0, 0 ); - - int expected_corners_num = (pattern_size.width/2+1)*(pattern_size.height/2+1); - - int prev_sqr_size = 0; if( out_corner_count ) *out_corner_count = 0; - int quad_count = 0, group_idx = 0, dilations = 0; + Mat img = cvarrToMat((CvMat*)arr).clone(); - img = cvGetMat( img, &stub ); - //debug_img = img; - - if( CV_MAT_DEPTH( img->type ) != CV_8U || CV_MAT_CN( img->type ) == 2 ) - CV_Error( CV_StsUnsupportedFormat, "Only 8-bit grayscale or color images are supported" ); + if( img.depth() != CV_8U || (img.channels() != 1 && img.channels() != 3) ) + CV_Error( CV_StsUnsupportedFormat, "Only 8-bit grayscale or color images are supported" ); if( pattern_size.width <= 2 || pattern_size.height <= 2 ) CV_Error( CV_StsOutOfRange, "Both width and height of the pattern should have bigger than 2" ); @@ -440,273 +451,124 @@ int cvFindChessboardCorners( const void* arr, CvSize pattern_size, if( !out_corners ) CV_Error( CV_StsNullPtr, "Null pointer to corners" ); - storage.reset(cvCreateMemStorage(0)); - thresh_img.reset(cvCreateMat( img->rows, img->cols, CV_8UC1 )); - - if( CV_MAT_CN(img->type) != 1 || (flags & CV_CALIB_CB_NORMALIZE_IMAGE) ) + if (img.channels() != 1) { - // equalize the input image histogram - - // that should make the contrast between "black" and "white" areas big enough - norm_img.reset(cvCreateMat( img->rows, img->cols, CV_8UC1 )); - - if( CV_MAT_CN(img->type) != 1 ) - { - cvCvtColor( img, norm_img, CV_BGR2GRAY ); - img = norm_img; - } - - if( flags & CV_CALIB_CB_NORMALIZE_IMAGE ) - { - cvEqualizeHist( img, norm_img ); - img = norm_img; - } + cvtColor(img, img, COLOR_BGR2GRAY); } + + Mat thresh_img_new = img.clone(); + icvBinarizationHistogramBased( thresh_img_new ); // process image in-place + SHOW("New binarization", thresh_img_new); + if( flags & CV_CALIB_CB_FAST_CHECK) { //perform new method for checking chessboard using a binary image. //image is binarised using a threshold dependent on the image histogram - icvBinarizationHistogramBased( (unsigned char*) cImgSeg->imageData, cImgSeg->width, cImgSeg->height ); - int check_chessboard_result = cvCheckChessboardBinary(cImgSeg, pattern_size); - if(check_chessboard_result <= 0) //fall back to the old method + if (checkChessboardBinary(thresh_img_new, pattern_size) <= 0) //fall back to the old method { - IplImage _img; - cvGetImage(img, &_img); - check_chessboard_result = cvCheckChessboard(&_img, pattern_size); - if(check_chessboard_result <= 0) + if (checkChessboard(img, pattern_size) <= 0) { - return 0; + return found; } } } + storage.reset(cvCreateMemStorage(0)); + + int prev_sqr_size = 0; + // Try our standard "1" dilation, but if the pattern is not found, iterate the whole procedure with higher dilations. // This is necessary because some squares simply do not separate properly with a single dilation. However, // we want to use the minimum number of dilations possible since dilations cause the squares to become smaller, // making it difficult to detect smaller squares. - for( dilations = min_dilations; dilations <= max_dilations; dilations++ ) + for( int dilations = min_dilations; dilations <= max_dilations; dilations++ ) { - if (found) - break; // already found it + if (found) + break; // already found it - cvFree(&quads); - cvFree(&corners); + //USE BINARY IMAGE COMPUTED USING icvBinarizationHistogramBased METHOD + dilate( thresh_img_new, thresh_img_new, Mat(), Point(-1, -1), 1 ); - int max_quad_buf_size = 0; - - //USE BINARY IMAGE COMPUTED USING icvBinarizationHistogramBased METHOD - cvDilate( thresh_img_new, thresh_img_new, 0, 1 ); - - // So we can find rectangles that go to the edge, we draw a white line around the image edge. - // Otherwise FindContours will miss those clipped rectangle contours. - // The border color will be the image mean, because otherwise we risk screwing up filters like cvSmooth()... - cvRectangle( thresh_img_new, cvPoint(0,0), cvPoint(thresh_img_new->cols-1, thresh_img_new->rows-1), CV_RGB(255,255,255), 3, 8); - quad_count = icvGenerateQuads( &quads, &corners, storage, thresh_img_new, flags, &max_quad_buf_size ); - PRINTF("Quad count: %d/%d\n", quad_count, expected_corners_num); - - if( quad_count <= 0 ) - { - continue; - } - - // Find quad's neighbors - icvFindQuadNeighbors( quads, quad_count ); - - // allocate extra for adding in icvOrderFoundQuads - cvFree(&quad_group); - cvFree(&corner_group); - quad_group = (CvCBQuad**)cvAlloc( sizeof(quad_group[0]) * max_quad_buf_size); - corner_group = (CvCBCorner**)cvAlloc( sizeof(corner_group[0]) * max_quad_buf_size * 4 ); - - for( group_idx = 0; ; group_idx++ ) - { - int count = 0; - count = icvFindConnectedQuads( quads, quad_count, quad_group, group_idx, storage ); - - int icount = count; - if( count == 0 ) - break; - - // order the quad corners globally - // maybe delete or add some - PRINTF("Starting ordering of inner quads\n"); - count = icvOrderFoundConnectedQuads(count, quad_group, &quad_count, &quads, &corners, pattern_size, max_quad_buf_size, storage ); - PRINTF("Orig count: %d After ordering: %d\n", icount, count); - - if (count == 0) - continue; // haven't found inner quads - - // If count is more than it should be, this will remove those quads - // which cause maximum deviation from a nice square pattern. - count = icvCleanFoundConnectedQuads( count, quad_group, pattern_size ); - PRINTF("Connected group: %d orig count: %d cleaned: %d\n", group_idx, icount, count); - - count = icvCheckQuadGroup( quad_group, count, corner_group, pattern_size ); - PRINTF("Connected group: %d count: %d cleaned: %d\n", group_idx, icount, count); - - int n = count > 0 ? pattern_size.width * pattern_size.height : -count; - n = MIN( n, pattern_size.width * pattern_size.height ); - float sum_dist = 0; - int total = 0; - - for(int i = 0; i < n; i++ ) - { - int ni = 0; - float avgi = corner_group[i]->meanDist(&ni); - sum_dist += avgi*ni; - total += ni; - } - prev_sqr_size = cvRound(sum_dist/MAX(total, 1)); - - if( count > 0 || (out_corner_count && -count > *out_corner_count) ) - { - // copy corners to output array - for(int i = 0; i < n; i++ ) - out_corners[i] = corner_group[i]->pt; - - if( out_corner_count ) - *out_corner_count = n; - - if( count == pattern_size.width*pattern_size.height && - icvCheckBoardMonotony( out_corners, pattern_size )) - { - found = 1; - break; - } - } - } - }//dilations + // So we can find rectangles that go to the edge, we draw a white line around the image edge. + // Otherwise FindContours will miss those clipped rectangle contours. + // The border color will be the image mean, because otherwise we risk screwing up filters like cvSmooth()... + rectangle( thresh_img_new, Point(0,0), Point(thresh_img_new.cols-1, thresh_img_new.rows-1), Scalar(255,255,255), 3, LINE_8); + int max_quad_buf_size = 0; + cvFree(&quads); + cvFree(&corners); + int quad_count = icvGenerateQuads( &quads, &corners, storage, thresh_img_new, flags, &max_quad_buf_size ); + PRINTF("Quad count: %d/%d\n", quad_count, (pattern_size.width/2+1)*(pattern_size.height/2+1)); + SHOW_QUADS("New quads", thresh_img_new, quads, quad_count); + if (processQuads(quads, quad_count, pattern_size, max_quad_buf_size, storage, corners, out_corners, out_corner_count, prev_sqr_size)) + found = 1; + } PRINTF("Chessboard detection result 0: %d\n", found); // revert to old, slower, method if detection failed if (!found) { - PRINTF("Fallback to old algorithm\n"); - // empiric threshold level - // thresholding performed here and not inside the cycle to save processing time - int thresh_level; - if ( !(flags & CV_CALIB_CB_ADAPTIVE_THRESH) ) - { - double mean = cvAvg( img ).val[0]; - thresh_level = cvRound( mean - 10 ); - thresh_level = MAX( thresh_level, 10 ); - cvThreshold( img, thresh_img, thresh_level, 255, CV_THRESH_BINARY ); - } - for( k = 0; k < 6; k++ ) - { - int max_quad_buf_size = 0; - for( dilations = min_dilations; dilations <= max_dilations; dilations++ ) + if( flags & CV_CALIB_CB_NORMALIZE_IMAGE ) { - if (found) - break; // already found it + equalizeHist( img, img ); + } - cvFree(&quads); - cvFree(&corners); + Mat thresh_img; + prev_sqr_size = 0; - // convert the input grayscale image to binary (black-n-white) - if( flags & CV_CALIB_CB_ADAPTIVE_THRESH ) - { - int block_size = cvRound(prev_sqr_size == 0 ? - MIN(img->cols,img->rows)*(k%2 == 0 ? 0.2 : 0.1): prev_sqr_size*2)|1; - - // convert to binary - cvAdaptiveThreshold( img, thresh_img, 255, - CV_ADAPTIVE_THRESH_MEAN_C, CV_THRESH_BINARY, block_size, (k/2)*5 ); - if (dilations > 0) - cvDilate( thresh_img, thresh_img, 0, dilations-1 ); - } - //if flag CV_CALIB_CB_ADAPTIVE_THRESH is not set it doesn't make sense - //to iterate over k - else - { - k = 6; - cvDilate( thresh_img, thresh_img, 0, 1 ); - } - - // So we can find rectangles that go to the edge, we draw a white line around the image edge. - // Otherwise FindContours will miss those clipped rectangle contours. - // The border color will be the image mean, because otherwise we risk screwing up filters like cvSmooth()... - cvRectangle( thresh_img, cvPoint(0,0), cvPoint(thresh_img->cols-1, - thresh_img->rows-1), CV_RGB(255,255,255), 3, 8); - - quad_count = icvGenerateQuads( &quads, &corners, storage, thresh_img, flags, &max_quad_buf_size); - PRINTF("Quad count: %d/%d\n", quad_count, expected_corners_num); - - if( quad_count <= 0 ) - { - continue; - } - - // Find quad's neighbors - icvFindQuadNeighbors( quads, quad_count ); - - // allocate extra for adding in icvOrderFoundQuads - cvFree(&quad_group); - cvFree(&corner_group); - quad_group = (CvCBQuad**)cvAlloc( sizeof(quad_group[0]) * max_quad_buf_size); - corner_group = (CvCBCorner**)cvAlloc( sizeof(corner_group[0]) * max_quad_buf_size * 4 ); - - for( group_idx = 0; ; group_idx++ ) - { - int count = 0; - count = icvFindConnectedQuads( quads, quad_count, quad_group, group_idx, storage ); - - int icount = count; - if( count == 0 ) - break; - - // order the quad corners globally - // maybe delete or add some - PRINTF("Starting ordering of inner quads\n"); - count = icvOrderFoundConnectedQuads(count, quad_group, &quad_count, &quads, &corners, pattern_size, max_quad_buf_size, storage ); - - PRINTF("Orig count: %d After ordering: %d\n", icount, count); - - if (count == 0) - continue; // haven't found inner quads - - - // If count is more than it should be, this will remove those quads - // which cause maximum deviation from a nice square pattern. - count = icvCleanFoundConnectedQuads( count, quad_group, pattern_size ); - PRINTF("Connected group: %d orig count: %d cleaned: %d\n", group_idx, icount, count); - - count = icvCheckQuadGroup( quad_group, count, corner_group, pattern_size ); - PRINTF("Connected group: %d count: %d cleaned: %d\n", group_idx, icount, count); - - int n = count > 0 ? pattern_size.width * pattern_size.height : -count; - n = MIN( n, pattern_size.width * pattern_size.height ); - float sum_dist = 0; - int total = 0; - - for(int i = 0; i < n; i++ ) + PRINTF("Fallback to old algorithm\n"); + const bool useAdaptive = flags & CV_CALIB_CB_ADAPTIVE_THRESH; + if (!useAdaptive) + { + // empiric threshold level + // thresholding performed here and not inside the cycle to save processing time + double mean = cv::mean(img).val[0]; + int thresh_level = MAX(cvRound( mean - 10 ), 10); + threshold( img, thresh_img, thresh_level, 255, THRESH_BINARY ); + } + //if flag CV_CALIB_CB_ADAPTIVE_THRESH is not set it doesn't make sense to iterate over k + int max_k = useAdaptive ? 6 : 1; + for( k = 0; k < max_k; k++ ) + { + for( int dilations = min_dilations; dilations <= max_dilations; dilations++ ) { - int ni = 0; - float avgi = corner_group[i]->meanDist(&ni); - sum_dist += avgi*ni; - total += ni; + if (found) + break; // already found it + + // convert the input grayscale image to binary (black-n-white) + if (useAdaptive) + { + int block_size = cvRound(prev_sqr_size == 0 + ? MIN(img.cols, img.rows) * (k % 2 == 0 ? 0.2 : 0.1) + : prev_sqr_size * 2); + block_size = block_size | 1; + // convert to binary + adaptiveThreshold( img, thresh_img, 255, ADAPTIVE_THRESH_MEAN_C, THRESH_BINARY, block_size, (k/2)*5 ); + if (dilations > 0) + dilate( thresh_img, thresh_img, Mat(), Point(-1, -1), dilations-1 ); + + } + else + { + dilate( thresh_img, thresh_img, Mat(), Point(-1, -1), 1 ); + } + SHOW("Old binarization", thresh_img); + + // So we can find rectangles that go to the edge, we draw a white line around the image edge. + // Otherwise FindContours will miss those clipped rectangle contours. + // The border color will be the image mean, because otherwise we risk screwing up filters like cvSmooth()... + rectangle( thresh_img, Point(0,0), Point(thresh_img.cols-1, thresh_img.rows-1), Scalar(255,255,255), 3, LINE_8); + int max_quad_buf_size = 0; + cvFree(&quads); + cvFree(&corners); + int quad_count = icvGenerateQuads( &quads, &corners, storage, thresh_img, flags, &max_quad_buf_size); + PRINTF("Quad count: %d/%d\n", quad_count, (pattern_size.width/2+1)*(pattern_size.height/2+1)); + SHOW_QUADS("Old quads", thresh_img, quads, quad_count); + if (processQuads(quads, quad_count, pattern_size, max_quad_buf_size, storage, corners, out_corners, out_corner_count, prev_sqr_size)) + found = 1; } - prev_sqr_size = cvRound(sum_dist/MAX(total, 1)); - - if( count > 0 || (out_corner_count && -count > *out_corner_count) ) - { - // copy corners to output array - for(int i = 0; i < n; i++ ) - out_corners[i] = corner_group[i]->pt; - - if( out_corner_count ) - *out_corner_count = n; - - if( count == pattern_size.width*pattern_size.height && icvCheckBoardMonotony( out_corners, pattern_size )) - { - found = 1; - break; - } - } - } - }//dilations - }// for k = 0 -> 6 + } } PRINTF("Chessboard detection result 1: %d\n", found); @@ -722,8 +584,8 @@ int cvFindChessboardCorners( const void* arr, CvSize pattern_size, const int BORDER = 8; for( k = 0; k < pattern_size.width*pattern_size.height; k++ ) { - if( out_corners[k].x <= BORDER || out_corners[k].x > img->cols - BORDER || - out_corners[k].y <= BORDER || out_corners[k].y > img->rows - BORDER ) + if( out_corners[k].x <= BORDER || out_corners[k].x > img.cols - BORDER || + out_corners[k].y <= BORDER || out_corners[k].y > img.rows - BORDER ) break; } @@ -734,51 +596,35 @@ int cvFindChessboardCorners( const void* arr, CvSize pattern_size, if( found ) { - if ( pattern_size.height % 2 == 0 && pattern_size.width % 2 == 0 ) - { - int last_row = (pattern_size.height-1)*pattern_size.width; - double dy0 = out_corners[last_row].y - out_corners[0].y; - if( dy0 < 0 ) + if ( pattern_size.height % 2 == 0 && pattern_size.width % 2 == 0 ) { - int n = pattern_size.width*pattern_size.height; - for(int i = 0; i < n/2; i++ ) - { - CvPoint2D32f temp; - CV_SWAP(out_corners[i], out_corners[n-i-1], temp); - } + int last_row = (pattern_size.height-1)*pattern_size.width; + double dy0 = out_corners[last_row].y - out_corners[0].y; + if( dy0 < 0 ) + { + int n = pattern_size.width*pattern_size.height; + for(int i = 0; i < n/2; i++ ) + { + CvPoint2D32f temp; + CV_SWAP(out_corners[i], out_corners[n-i-1], temp); + } + } } - } - cv::Ptr gray; - if( CV_MAT_CN(img->type) != 1 ) - { - gray.reset(cvCreateMat(img->rows, img->cols, CV_8UC1)); - cvCvtColor(img, gray, CV_BGR2GRAY); - } - else - { - gray.reset(cvCloneMat(img)); - } - int wsize = 2; - cvFindCornerSubPix( gray, out_corners, pattern_size.width*pattern_size.height, - cvSize(wsize, wsize), cvSize(-1,-1), - cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER, 15, 0.1)); + int wsize = 2; + CvMat old_img(img); + cvFindCornerSubPix( &old_img, out_corners, pattern_size.width*pattern_size.height, + cvSize(wsize, wsize), cvSize(-1,-1), + cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER, 15, 0.1)); } } catch(...) { cvFree(&quads); cvFree(&corners); - cvFree(&quad_group); - cvFree(&corner_group); - cvFree(&cImgSeg); throw; } - cvFree(&quads); cvFree(&corners); - cvFree(&quad_group); - cvFree(&corner_group); - cvFree(&cImgSeg); return found; } @@ -1866,8 +1712,9 @@ static void icvFindQuadNeighbors( CvCBQuad *quads, int quad_count ) static int icvGenerateQuads( CvCBQuad **out_quads, CvCBCorner **out_corners, - CvMemStorage *storage, CvMat *image, int flags, int *max_quad_buf_size ) + CvMemStorage *storage, const cv::Mat & image_, int flags, int *max_quad_buf_size ) { + CvMat image_old(image_), *image = &image_old; int quad_count = 0; cv::Ptr temp_storage; @@ -2011,6 +1858,88 @@ icvGenerateQuads( CvCBQuad **out_quads, CvCBCorner **out_corners, return quad_count; } +static bool processQuads(CvCBQuad *quads, int quad_count, CvSize pattern_size, int max_quad_buf_size, + CvMemStorage * storage, CvCBCorner *corners, CvPoint2D32f *out_corners, int *out_corner_count, int & prev_sqr_size) +{ + if( quad_count <= 0 ) + return false; + + bool found = false; + + // Find quad's neighbors + icvFindQuadNeighbors( quads, quad_count ); + + // allocate extra for adding in icvOrderFoundQuads + CvCBQuad **quad_group = 0; + CvCBCorner **corner_group = 0; + + quad_group = (CvCBQuad**)cvAlloc( sizeof(quad_group[0]) * max_quad_buf_size); + corner_group = (CvCBCorner**)cvAlloc( sizeof(corner_group[0]) * max_quad_buf_size * 4 ); + + for( int group_idx = 0; ; group_idx++ ) + { + int count = icvFindConnectedQuads( quads, quad_count, quad_group, group_idx, storage ); + + if( count == 0 ) + break; + + // order the quad corners globally + // maybe delete or add some + PRINTF("Starting ordering of inner quads (%d)\n", count); + count = icvOrderFoundConnectedQuads(count, quad_group, &quad_count, &quads, &corners, + pattern_size, max_quad_buf_size, storage ); + PRINTF("Finished ordering of inner quads (%d)\n", count); + + if (count == 0) + continue; // haven't found inner quads + + // If count is more than it should be, this will remove those quads + // which cause maximum deviation from a nice square pattern. + count = icvCleanFoundConnectedQuads( count, quad_group, pattern_size ); + PRINTF("Connected group: %d, count: %d\n", group_idx, count); + + count = icvCheckQuadGroup( quad_group, count, corner_group, pattern_size ); + PRINTF("Connected group: %d, count: %d\n", group_idx, count); + + int n = count > 0 ? pattern_size.width * pattern_size.height : -count; + n = MIN( n, pattern_size.width * pattern_size.height ); + float sum_dist = 0; + int total = 0; + + for(int i = 0; i < n; i++ ) + { + int ni = 0; + float avgi = corner_group[i]->meanDist(&ni); + sum_dist += avgi*ni; + total += ni; + } + prev_sqr_size = cvRound(sum_dist/MAX(total, 1)); + + if( count > 0 || (out_corner_count && -count > *out_corner_count) ) + { + // copy corners to output array + for(int i = 0; i < n; i++ ) + out_corners[i] = corner_group[i]->pt; + + if( out_corner_count ) + *out_corner_count = n; + + if( count == pattern_size.width*pattern_size.height + && icvCheckBoardMonotony( out_corners, pattern_size )) + { + found = true; + break; + } + } + } + + cvFree(&quad_group); + cvFree(&corner_group); + + return found; +} + +//================================================================================================== CV_IMPL void cvDrawChessboardCorners( CvArr* _image, CvSize pattern_size, @@ -2120,6 +2049,8 @@ cvDrawChessboardCorners( CvArr* _image, CvSize pattern_size, bool cv::findChessboardCorners( InputArray _image, Size patternSize, OutputArray corners, int flags ) { + CV_INSTRUMENT_REGION() + int count = patternSize.area()*2; std::vector tmpcorners(count+1); Mat image = _image.getMat(); CvMat c_image = image; @@ -2149,6 +2080,8 @@ void cv::drawChessboardCorners( InputOutputArray _image, Size patternSize, InputArray _corners, bool patternWasFound ) { + CV_INSTRUMENT_REGION() + Mat corners = _corners.getMat(); if( corners.empty() ) return; @@ -2162,6 +2095,8 @@ void cv::drawChessboardCorners( InputOutputArray _image, Size patternSize, bool cv::findCirclesGrid( InputArray _image, Size patternSize, OutputArray _centers, int flags, const Ptr &blobDetector ) { + CV_INSTRUMENT_REGION() + bool isAsymmetricGrid = (flags & CALIB_CB_ASYMMETRIC_GRID) ? true : false; bool isSymmetricGrid = (flags & CALIB_CB_SYMMETRIC_GRID ) ? true : false; CV_Assert(isAsymmetricGrid ^ isSymmetricGrid); diff --git a/modules/calib3d/src/calibration.cpp b/modules/calib3d/src/calibration.cpp index f2b00551a4..0abbee65e0 100644 --- a/modules/calib3d/src/calibration.cpp +++ b/modules/calib3d/src/calibration.cpp @@ -52,7 +52,6 @@ that is (in a large extent) based on the paper: Z. Zhang. "A flexible new technique for camera calibration". IEEE Transactions on Pattern Analysis and Machine Intelligence, 22(11):1330-1334, 2000. - The 1st initial port was done by Valery Mosyagin. */ @@ -896,9 +895,9 @@ CV_IMPL void cvProjectPoints2( const CvMat* objectPoints, double dicdist2_dt = -icdist2*icdist2*(k[5]*dr2dt + 2*k[6]*r2*dr2dt + 3*k[7]*r4*dr2dt); double da1dt = 2*(x*dydt[j] + y*dxdt[j]); double dmxdt = (dxdt[j]*cdist*icdist2 + x*dcdist_dt*icdist2 + x*cdist*dicdist2_dt + - k[2]*da1dt + k[3]*(dr2dt + 2*x*dxdt[j]) + k[8]*dr2dt + 2*r2*k[9]*dr2dt); + k[2]*da1dt + k[3]*(dr2dt + 4*x*dxdt[j]) + k[8]*dr2dt + 2*r2*k[9]*dr2dt); double dmydt = (dydt[j]*cdist*icdist2 + y*dcdist_dt*icdist2 + y*cdist*dicdist2_dt + - k[2]*(dr2dt + 2*y*dydt[j]) + k[3]*da1dt + k[10]*dr2dt + 2*r2*k[11]*dr2dt); + k[2]*(dr2dt + 4*y*dydt[j]) + k[3]*da1dt + k[10]*dr2dt + 2*r2*k[11]*dr2dt); dXdYd = dMatTilt*Vec2d(dmxdt, dmydt); dpdt_p[j] = fx*dXdYd(0); dpdt_p[dpdt_step+j] = fy*dXdYd(1); @@ -935,9 +934,9 @@ CV_IMPL void cvProjectPoints2( const CvMat* objectPoints, double dicdist2_dr = -icdist2*icdist2*(k[5] + 2*k[6]*r2 + 3*k[7]*r4)*dr2dr; double da1dr = 2*(x*dydr + y*dxdr); double dmxdr = (dxdr*cdist*icdist2 + x*dcdist_dr*icdist2 + x*cdist*dicdist2_dr + - k[2]*da1dr + k[3]*(dr2dr + 2*x*dxdr) + (k[8] + 2*r2*k[9])*dr2dr); + k[2]*da1dr + k[3]*(dr2dr + 4*x*dxdr) + (k[8] + 2*r2*k[9])*dr2dr); double dmydr = (dydr*cdist*icdist2 + y*dcdist_dr*icdist2 + y*cdist*dicdist2_dr + - k[2]*(dr2dr + 2*y*dydr) + k[3]*da1dr + (k[10] + 2*r2*k[11])*dr2dr); + k[2]*(dr2dr + 4*y*dydr) + k[3]*da1dr + (k[10] + 2*r2*k[11])*dr2dr); dXdYd = dMatTilt*Vec2d(dmxdr, dmydr); dpdr_p[j] = fx*dXdYd(0); dpdr_p[dpdr_step+j] = fy*dXdYd(1); @@ -1210,8 +1209,8 @@ CV_IMPL void cvInitIntrinsicParams2D( const CvMat* objectPoints, matA.reset(cvCreateMat( 2*nimages, 2, CV_64F )); _b.reset(cvCreateMat( 2*nimages, 1, CV_64F )); - a[2] = (!imageSize.width) ? 0.5 : (imageSize.width - 1)*0.5; - a[5] = (!imageSize.height) ? 0.5 : (imageSize.height - 1)*0.5; + a[2] = (!imageSize.width) ? 0.5 : (imageSize.width)*0.5; + a[5] = (!imageSize.height) ? 0.5 : (imageSize.height)*0.5; _allH.reset(cvCreateMat( nimages, 9, CV_64F )); // extract vanishing points in order to obtain initial value for the focal length @@ -1486,6 +1485,9 @@ static double cvCalibrateCamera2Internal( const CvMat* objectPoints, if(flags & CALIB_USE_LU) { solver.solveMethod = DECOMP_LU; } + else if(flags & CALIB_USE_QR) { + solver.solveMethod = DECOMP_QR; + } { double* param = solver.param->data.db; @@ -1911,14 +1913,12 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1 /* Compute initial estimate of pose - For each image, compute: R(om) is the rotation matrix of om om(R) is the rotation vector of R R_ref = R(om_right) * R(om_left)' T_ref_list = [T_ref_list; T_right - R_ref * T_left] om_ref_list = {om_ref_list; om(R_ref)] - om = median(om_ref_list) T = median(T_ref_list) */ @@ -2494,8 +2494,8 @@ void cvGetOptimalNewCameraMatrix( const CvMat* cameraMatrix, const CvMat* distCo { double cx0 = M[0][2]; double cy0 = M[1][2]; - double cx = (newImgSize.width-1)*0.5; - double cy = (newImgSize.height-1)*0.5; + double cx = (newImgSize.width)*0.5; + double cy = (newImgSize.height)*0.5; icvGetRectangles( cameraMatrix, distCoeffs, 0, cameraMatrix, imgSize, inner, outer ); double s0 = std::max(std::max(std::max((double)cx/(cx0 - inner.x), (double)cy/(cy0 - inner.y)), @@ -2529,14 +2529,14 @@ void cvGetOptimalNewCameraMatrix( const CvMat* cameraMatrix, const CvMat* distCo icvGetRectangles( cameraMatrix, distCoeffs, 0, 0, imgSize, inner, outer ); // Projection mapping inner rectangle to viewport - double fx0 = (newImgSize.width - 1) / inner.width; - double fy0 = (newImgSize.height - 1) / inner.height; + double fx0 = (newImgSize.width) / inner.width; + double fy0 = (newImgSize.height) / inner.height; double cx0 = -fx0 * inner.x; double cy0 = -fy0 * inner.y; // Projection mapping outer rectangle to viewport - double fx1 = (newImgSize.width - 1) / outer.width; - double fy1 = (newImgSize.height - 1) / outer.height; + double fx1 = (newImgSize.width) / outer.width; + double fy1 = (newImgSize.height) / outer.height; double cx1 = -fx1 * outer.x; double cy1 = -fy1 * outer.y; @@ -2600,8 +2600,8 @@ CV_IMPL int cvStereoRectifyUncalibrated( cvGEMM( &U, &W, 1, 0, 0, &W, CV_GEMM_A_T ); cvMatMul( &W, &V, &F ); - cx = cvRound( (imgSize.width-1)*0.5 ); - cy = cvRound( (imgSize.height-1)*0.5 ); + cx = cvRound( (imgSize.width)*0.5 ); + cy = cvRound( (imgSize.height)*0.5 ); cvZero( _H1 ); cvZero( _H2 ); @@ -2753,6 +2753,8 @@ void cv::reprojectImageTo3D( InputArray _disparity, OutputArray __3dImage, InputArray _Qmat, bool handleMissingValues, int dtype ) { + CV_INSTRUMENT_REGION() + Mat disparity = _disparity.getMat(), Q = _Qmat.getMat(); int stype = disparity.type(); @@ -3181,6 +3183,8 @@ static Mat prepareDistCoeffs(Mat& distCoeffs0, int rtype, int outputSize = 14) void cv::Rodrigues(InputArray _src, OutputArray _dst, OutputArray _jacobian) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); bool v2m = src.cols == 1 || src.rows == 1; _dst.create(3, v2m ? 3 : 1, src.depth()); @@ -3199,6 +3203,8 @@ void cv::Rodrigues(InputArray _src, OutputArray _dst, OutputArray _jacobian) void cv::matMulDeriv( InputArray _Amat, InputArray _Bmat, OutputArray _dABdA, OutputArray _dABdB ) { + CV_INSTRUMENT_REGION() + Mat A = _Amat.getMat(), B = _Bmat.getMat(); _dABdA.create(A.rows*B.cols, A.rows*A.cols, A.type()); _dABdB.create(A.rows*B.cols, B.rows*B.cols, A.type()); @@ -3333,6 +3339,8 @@ cv::Mat cv::initCameraMatrix2D( InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints, Size imageSize, double aspectRatio ) { + CV_INSTRUMENT_REGION() + Mat objPt, imgPt, npoints, cameraMatrix(3, 3, CV_64F); collectCalibrationData( objectPoints, imagePoints, noArray(), objPt, imgPt, 0, npoints ); @@ -3349,6 +3357,8 @@ double cv::calibrateCamera( InputArrayOfArrays _objectPoints, Size imageSize, InputOutputArray _cameraMatrix, InputOutputArray _distCoeffs, OutputArrayOfArrays _rvecs, OutputArrayOfArrays _tvecs, int flags, TermCriteria criteria ) { + CV_INSTRUMENT_REGION() + return calibrateCamera(_objectPoints, _imagePoints, imageSize, _cameraMatrix, _distCoeffs, _rvecs, _tvecs, noArray(), noArray(), noArray(), flags, criteria); } @@ -3361,6 +3371,8 @@ double cv::calibrateCamera(InputArrayOfArrays _objectPoints, OutputArray stdDeviationsExtrinsics, OutputArray _perViewErrors, int flags, TermCriteria criteria ) { + CV_INSTRUMENT_REGION() + int rtype = CV_64F; Mat cameraMatrix = _cameraMatrix.getMat(); cameraMatrix = prepareCameraMatrix(cameraMatrix, rtype); @@ -3473,6 +3485,8 @@ void cv::calibrationMatrixValues( InputArray _cameraMatrix, Size imageSize, double& fovx, double& fovy, double& focalLength, Point2d& principalPoint, double& aspectRatio ) { + CV_INSTRUMENT_REGION() + if(_cameraMatrix.size() != Size(3, 3)) CV_Error(CV_StsUnmatchedSizes, "Size of cameraMatrix must be 3x3!"); @@ -3612,6 +3626,8 @@ bool cv::stereoRectifyUncalibrated( InputArray _points1, InputArray _points2, InputArray _Fmat, Size imgSize, OutputArray _Hmat1, OutputArray _Hmat2, double threshold ) { + CV_INSTRUMENT_REGION() + int rtype = CV_64F; _Hmat1.create(3, 3, rtype); _Hmat2.create(3, 3, rtype); @@ -3629,6 +3645,8 @@ cv::Mat cv::getOptimalNewCameraMatrix( InputArray _cameraMatrix, Size imgSize, double alpha, Size newImgSize, Rect* validPixROI, bool centerPrincipalPoint ) { + CV_INSTRUMENT_REGION() + Mat cameraMatrix = _cameraMatrix.getMat(), distCoeffs = _distCoeffs.getMat(); CvMat c_cameraMatrix = cameraMatrix, c_distCoeffs = distCoeffs; @@ -3649,6 +3667,8 @@ cv::Vec3d cv::RQDecomp3x3( InputArray _Mmat, OutputArray _Qy, OutputArray _Qz ) { + CV_INSTRUMENT_REGION() + Mat M = _Mmat.getMat(); _Rmat.create(3, 3, M.type()); _Qmat.create(3, 3, M.type()); @@ -3680,6 +3700,8 @@ void cv::decomposeProjectionMatrix( InputArray _projMatrix, OutputArray _cameraM OutputArray _rotMatrixX, OutputArray _rotMatrixY, OutputArray _rotMatrixZ, OutputArray _eulerAngles ) { + CV_INSTRUMENT_REGION() + Mat projMatrix = _projMatrix.getMat(); int type = projMatrix.type(); _cameraMatrix.create(3, 3, type); diff --git a/modules/calib3d/src/checkchessboard.cpp b/modules/calib3d/src/checkchessboard.cpp index 88c6baf107..ea3487846b 100644 --- a/modules/calib3d/src/checkchessboard.cpp +++ b/modules/calib3d/src/checkchessboard.cpp @@ -46,28 +46,26 @@ #include #include -//#define DEBUG_WINDOWS +using namespace cv; +using namespace std; -#if defined(DEBUG_WINDOWS) -# include "opencv2/opencv_modules.hpp" -# ifdef HAVE_OPENCV_HIGHGUI -# include "opencv2/highgui.hpp" -# else -# undef DEBUG_WINDOWS -# endif -#endif - -int cvCheckChessboardBinary(IplImage* src, CvSize size); - -static void icvGetQuadrangleHypotheses(CvSeq* contours, std::vector >& quads, int class_id) +static void icvGetQuadrangleHypotheses(const std::vector > & contours, const std::vector< cv::Vec4i > & hierarchy, std::vector >& quads, int class_id) { const float min_aspect_ratio = 0.3f; const float max_aspect_ratio = 3.0f; const float min_box_size = 10.0f; - for(CvSeq* seq = contours; seq != NULL; seq = seq->h_next) + typedef std::vector< std::vector< cv::Point > >::const_iterator iter_t; + iter_t i; + for (i = contours.begin(); i != contours.end(); ++i) { - CvBox2D box = cvMinAreaRect2(seq); + const iter_t::difference_type idx = i - contours.begin(); + if (hierarchy.at(idx)[3] != -1) + continue; // skip holes + + const std::vector< cv::Point > & c = *i; + cv::RotatedRect box = cv::minAreaRect(c); + float box_size = MAX(box.size.width, box.size.height); if(box_size < min_box_size) { @@ -98,6 +96,64 @@ inline bool less_pred(const std::pair& p1, const std::pair > & quads) +{ + Mat thresh; + { + vector< vector > contours; + vector< Vec4i > hierarchy; + threshold(white, thresh, white_thresh, 255, THRESH_BINARY); + findContours(thresh, contours, hierarchy, RETR_CCOMP, CHAIN_APPROX_SIMPLE); + icvGetQuadrangleHypotheses(contours, hierarchy, quads, 1); + } + + { + vector< vector > contours; + vector< Vec4i > hierarchy; + threshold(black, thresh, black_thresh, 255, THRESH_BINARY_INV); + findContours(thresh, contours, hierarchy, RETR_CCOMP, CHAIN_APPROX_SIMPLE); + icvGetQuadrangleHypotheses(contours, hierarchy, quads, 0); + } +} + +static bool checkQuads(vector > & quads, const cv::Size & size) +{ + const size_t min_quads_count = size.width*size.height/2; + std::sort(quads.begin(), quads.end(), less_pred); + + // now check if there are many hypotheses with similar sizes + // do this by floodfill-style algorithm + const float size_rel_dev = 0.4f; + + for(size_t i = 0; i < quads.size(); i++) + { + size_t j = i + 1; + for(; j < quads.size(); j++) + { + if(quads[j].first/quads[i].first > 1.0f + size_rel_dev) + { + break; + } + } + + if(j + 1 > min_quads_count + i) + { + // check the number of black and white squares + std::vector counts; + countClasses(quads, i, j, counts); + const int black_count = cvRound(ceil(size.width/2.0)*ceil(size.height/2.0)); + const int white_count = cvRound(floor(size.width/2.0)*floor(size.height/2.0)); + if(counts[0] < black_count*0.75 || + counts[1] < white_count*0.75) + { + continue; + } + return true; + } + } + return false; +} + // does a fast check if a chessboard is in the input image. This is a workaround to // a problem of cvFindChessboardCorners being slow on images with no chessboard // - src: input image @@ -106,105 +162,32 @@ inline bool less_pred(const std::pair& p1, const std::pairnChannels > 1) - { - cvError(CV_BadNumChannels, "cvCheckChessboard", "supports single-channel images only", - __FILE__, __LINE__); - } + cv::Mat img = cv::cvarrToMat(src); + return checkChessboard(img, size); +} - if(src->depth != 8) - { - cvError(CV_BadDepth, "cvCheckChessboard", "supports depth=8 images only", - __FILE__, __LINE__); - } +int checkChessboard(const cv::Mat & img, const cv::Size & size) +{ + CV_Assert(img.channels() == 1 && img.depth() == CV_8U); const int erosion_count = 1; const float black_level = 20.f; const float white_level = 130.f; const float black_white_gap = 70.f; -#if defined(DEBUG_WINDOWS) - cvNamedWindow("1", 1); - cvShowImage("1", src); - cvWaitKey(0); -#endif //DEBUG_WINDOWS - - CvMemStorage* storage = cvCreateMemStorage(); - - IplImage* white = cvCloneImage(src); - IplImage* black = cvCloneImage(src); - - cvErode(white, white, NULL, erosion_count); - cvDilate(black, black, NULL, erosion_count); - IplImage* thresh = cvCreateImage(cvGetSize(src), IPL_DEPTH_8U, 1); + Mat white; + Mat black; + erode(img, white, Mat(), Point(-1, -1), erosion_count); + dilate(img, black, Mat(), Point(-1, -1), erosion_count); int result = 0; for(float thresh_level = black_level; thresh_level < white_level && !result; thresh_level += 20.0f) { - cvThreshold(white, thresh, thresh_level + black_white_gap, 255, CV_THRESH_BINARY); - -#if defined(DEBUG_WINDOWS) - cvShowImage("1", thresh); - cvWaitKey(0); -#endif //DEBUG_WINDOWS - - CvSeq* first = 0; - std::vector > quads; - cvFindContours(thresh, storage, &first, sizeof(CvContour), CV_RETR_CCOMP); - icvGetQuadrangleHypotheses(first, quads, 1); - - cvThreshold(black, thresh, thresh_level, 255, CV_THRESH_BINARY_INV); - -#if defined(DEBUG_WINDOWS) - cvShowImage("1", thresh); - cvWaitKey(0); -#endif //DEBUG_WINDOWS - - cvFindContours(thresh, storage, &first, sizeof(CvContour), CV_RETR_CCOMP); - icvGetQuadrangleHypotheses(first, quads, 0); - - const size_t min_quads_count = size.width*size.height/2; - std::sort(quads.begin(), quads.end(), less_pred); - - // now check if there are many hypotheses with similar sizes - // do this by floodfill-style algorithm - const float size_rel_dev = 0.4f; - - for(size_t i = 0; i < quads.size(); i++) - { - size_t j = i + 1; - for(; j < quads.size(); j++) - { - if(quads[j].first/quads[i].first > 1.0f + size_rel_dev) - { - break; - } - } - - if(j + 1 > min_quads_count + i) - { - // check the number of black and white squares - std::vector counts; - countClasses(quads, i, j, counts); - const int black_count = cvRound(ceil(size.width/2.0)*ceil(size.height/2.0)); - const int white_count = cvRound(floor(size.width/2.0)*floor(size.height/2.0)); - if(counts[0] < black_count*0.75 || - counts[1] < white_count*0.75) - { - continue; - } - result = 1; - break; - } - } + vector > quads; + fillQuads(white, black, thresh_level + black_white_gap, thresh_level, quads); + if (checkQuads(quads, size)) + result = 1; } - - - cvReleaseImage(&thresh); - cvReleaseImage(&white); - cvReleaseImage(&black); - cvReleaseMemStorage(&storage); - return result; } @@ -214,90 +197,29 @@ int cvCheckChessboard(IplImage* src, CvSize size) // - size: chessboard size // Returns 1 if a chessboard can be in this image and findChessboardCorners should be called, // 0 if there is no chessboard, -1 in case of error -int cvCheckChessboardBinary(IplImage* src, CvSize size) +int checkChessboardBinary(const cv::Mat & img, const cv::Size & size) { - if(src->nChannels > 1) - { - cvError(CV_BadNumChannels, "cvCheckChessboard", "supports single-channel images only", - __FILE__, __LINE__); - } + CV_Assert(img.channels() == 1 && img.depth() == CV_8U); - if(src->depth != 8) - { - cvError(CV_BadDepth, "cvCheckChessboard", "supports depth=8 images only", - __FILE__, __LINE__); - } - - CvMemStorage* storage = cvCreateMemStorage(); - - IplImage* white = cvCloneImage(src); - IplImage* black = cvCloneImage(src); - IplImage* thresh = cvCreateImage(cvGetSize(src), IPL_DEPTH_8U, 1); + Mat white = img.clone(); + Mat black = img.clone(); int result = 0; - for ( int erosion_count = 0; erosion_count <= 3; erosion_count++ ) { - if ( 1 == result ) - break; + if ( 1 == result ) + break; - if ( 0 != erosion_count ) // first iteration keeps original images - { - cvErode(white, white, NULL, 1); - cvDilate(black, black, NULL, 1); - } + if ( 0 != erosion_count ) // first iteration keeps original images + { + erode(white, white, Mat(), Point(-1, -1), 1); + dilate(black, black, Mat(), Point(-1, -1), 1); + } - cvThreshold(white, thresh, 128, 255, CV_THRESH_BINARY); - - CvSeq* first = 0; - std::vector > quads; - cvFindContours(thresh, storage, &first, sizeof(CvContour), CV_RETR_CCOMP); - icvGetQuadrangleHypotheses(first, quads, 1); - - cvThreshold(black, thresh, 128, 255, CV_THRESH_BINARY_INV); - cvFindContours(thresh, storage, &first, sizeof(CvContour), CV_RETR_CCOMP); - icvGetQuadrangleHypotheses(first, quads, 0); - - const size_t min_quads_count = size.width*size.height/2; - std::sort(quads.begin(), quads.end(), less_pred); - - // now check if there are many hypotheses with similar sizes - // do this by floodfill-style algorithm - const float size_rel_dev = 0.4f; - - for(size_t i = 0; i < quads.size(); i++) - { - size_t j = i + 1; - for(; j < quads.size(); j++) - { - if(quads[j].first/quads[i].first > 1.0f + size_rel_dev) - { - break; - } - } - - if(j + 1 > min_quads_count + i) - { - // check the number of black and white squares - std::vector counts; - countClasses(quads, i, j, counts); - const int black_count = cvRound(ceil(size.width/2.0)*ceil(size.height/2.0)); - const int white_count = cvRound(floor(size.width/2.0)*floor(size.height/2.0)); - if(counts[0] < black_count*0.75 || - counts[1] < white_count*0.75) - { - continue; - } - result = 1; - break; - } - } + vector > quads; + fillQuads(white, black, 128, 128, quads); + if (checkQuads(quads, size)) + result = 1; } - - cvReleaseImage(&thresh); - cvReleaseImage(&white); - cvReleaseImage(&black); - cvReleaseMemStorage(&storage); - return result; -} \ No newline at end of file +} diff --git a/modules/calib3d/src/fisheye.cpp b/modules/calib3d/src/fisheye.cpp index 45fe230db9..0a8db58d83 100644 --- a/modules/calib3d/src/fisheye.cpp +++ b/modules/calib3d/src/fisheye.cpp @@ -62,12 +62,16 @@ namespace cv { namespace void cv::fisheye::projectPoints(InputArray objectPoints, OutputArray imagePoints, const Affine3d& affine, InputArray K, InputArray D, double alpha, OutputArray jacobian) { + CV_INSTRUMENT_REGION() + projectPoints(objectPoints, imagePoints, affine.rvec(), affine.translation(), K, D, alpha, jacobian); } void cv::fisheye::projectPoints(InputArray objectPoints, OutputArray imagePoints, InputArray _rvec, InputArray _tvec, InputArray _K, InputArray _D, double alpha, OutputArray jacobian) { + CV_INSTRUMENT_REGION() + // will support only 3-channel data now for points CV_Assert(objectPoints.type() == CV_32FC3 || objectPoints.type() == CV_64FC3); imagePoints.create(objectPoints.size(), CV_MAKETYPE(objectPoints.depth(), 2)); @@ -249,6 +253,8 @@ void cv::fisheye::projectPoints(InputArray objectPoints, OutputArray imagePoints void cv::fisheye::distortPoints(InputArray undistorted, OutputArray distorted, InputArray K, InputArray D, double alpha) { + CV_INSTRUMENT_REGION() + // will support only 2-channel data now for points CV_Assert(undistorted.type() == CV_32FC2 || undistorted.type() == CV_64FC2); distorted.create(undistorted.size(), undistorted.type()); @@ -311,6 +317,8 @@ void cv::fisheye::distortPoints(InputArray undistorted, OutputArray distorted, I void cv::fisheye::undistortPoints( InputArray distorted, OutputArray undistorted, InputArray K, InputArray D, InputArray R, InputArray P) { + CV_INSTRUMENT_REGION() + // will support only 2-channel data now for points CV_Assert(distorted.type() == CV_32FC2 || distorted.type() == CV_64FC2); undistorted.create(distorted.size(), distorted.type()); @@ -401,6 +409,8 @@ void cv::fisheye::undistortPoints( InputArray distorted, OutputArray undistorted void cv::fisheye::initUndistortRectifyMap( InputArray K, InputArray D, InputArray R, InputArray P, const cv::Size& size, int m1type, OutputArray map1, OutputArray map2 ) { + CV_INSTRUMENT_REGION() + CV_Assert( m1type == CV_16SC2 || m1type == CV_32F || m1type <=0 ); map1.create( size, m1type <= 0 ? CV_16SC2 : m1type ); map2.create( size, map1.type() == CV_16SC2 ? CV_16UC1 : CV_32F ); @@ -497,6 +507,8 @@ void cv::fisheye::initUndistortRectifyMap( InputArray K, InputArray D, InputArra void cv::fisheye::undistortImage(InputArray distorted, OutputArray undistorted, InputArray K, InputArray D, InputArray Knew, const Size& new_size) { + CV_INSTRUMENT_REGION() + Size size = new_size.area() != 0 ? new_size : distorted.size(); cv::Mat map1, map2; @@ -511,18 +523,24 @@ void cv::fisheye::undistortImage(InputArray distorted, OutputArray undistorted, void cv::fisheye::estimateNewCameraMatrixForUndistortRectify(InputArray K, InputArray D, const Size &image_size, InputArray R, OutputArray P, double balance, const Size& new_size, double fov_scale) { + CV_INSTRUMENT_REGION() + CV_Assert( K.size() == Size(3, 3) && (K.depth() == CV_32F || K.depth() == CV_64F)); CV_Assert(D.empty() || ((D.total() == 4) && (D.depth() == CV_32F || D.depth() == CV_64F))); int w = image_size.width, h = image_size.height; balance = std::min(std::max(balance, 0.0), 1.0); - cv::Mat points(1, 4, CV_64FC2); + cv::Mat points(1, 8, CV_64FC2); Vec2d* pptr = points.ptr(); - pptr[0] = Vec2d(w/2, 0); - pptr[1] = Vec2d(w, h/2); - pptr[2] = Vec2d(w/2, h); - pptr[3] = Vec2d(0, h/2); + pptr[0] = Vec2d(0, 0); + pptr[1] = Vec2d(w/2, 0); + pptr[2] = Vec2d(w, 0); + pptr[3] = Vec2d(w, h/2); + pptr[4] = Vec2d(w, h); + pptr[5] = Vec2d(w/2, h); + pptr[6] = Vec2d(0, h); + pptr[7] = Vec2d(0, h/2); #if 0 const int N = 10; @@ -532,7 +550,6 @@ void cv::fisheye::estimateNewCameraMatrixForUndistortRectify(InputArray K, Input { pptr[k++] = Vec2d(w/2, 0) - Vec2d(w/8, 0) + Vec2d(w/4/N*i, 0); pptr[k++] = Vec2d(w/2, h-1) - Vec2d(w/8, h-1) + Vec2d(w/4/N*i, h-1); - pptr[k++] = Vec2d(0, h/2) - Vec2d(0, h/8) + Vec2d(0, h/4/N*i); pptr[k++] = Vec2d(w-1, h/2) - Vec2d(w-1, h/8) + Vec2d(w-1, h/4/N*i); } @@ -553,10 +570,14 @@ void cv::fisheye::estimateNewCameraMatrixForUndistortRectify(InputArray K, Input double minx = DBL_MAX, miny = DBL_MAX, maxx = -DBL_MAX, maxy = -DBL_MAX; for(size_t i = 0; i < points.total(); ++i) { - miny = std::min(miny, pptr[i][1]); - maxy = std::max(maxy, pptr[i][1]); - minx = std::min(minx, pptr[i][0]); - maxx = std::max(maxx, pptr[i][0]); + if(i!=1 && i!=5){ + minx = std::min(minx, std::abs(pptr[i][0]-cn[0])); + } + if(i!=3 && i!=7){ + miny = std::min(miny, std::abs(pptr[i][1]-cn[1])); + } + maxy = std::max(maxy, std::abs(pptr[i][1]-cn[1])); + maxx = std::max(maxx, std::abs(pptr[i][0]-cn[0])); } #if 0 @@ -570,13 +591,13 @@ void cv::fisheye::estimateNewCameraMatrixForUndistortRectify(InputArray K, Input } #endif - double f1 = w * 0.5/(cn[0] - minx); - double f2 = w * 0.5/(maxx - cn[0]); - double f3 = h * 0.5 * aspect_ratio/(cn[1] - miny); - double f4 = h * 0.5 * aspect_ratio/(maxy - cn[1]); + double f1 = w * 0.5/(minx); + double f2 = w * 0.5/(maxx); + double f3 = h * 0.5 * aspect_ratio/(miny); + double f4 = h * 0.5 * aspect_ratio/(maxy); - double fmin = std::min(f1, std::min(f2, std::min(f3, f4))); - double fmax = std::max(f1, std::max(f2, std::max(f3, f4))); + double fmax = std::max(f1, f3); + double fmin = std::min(f2, f4); double f = balance * fmin + (1.0 - balance) * fmax; f *= fov_scale > 0 ? 1.0/fov_scale : 1.0; @@ -609,6 +630,8 @@ void cv::fisheye::stereoRectify( InputArray K1, InputArray D1, InputArray K2, In InputArray _R, InputArray _tvec, OutputArray R1, OutputArray R2, OutputArray P1, OutputArray P2, OutputArray Q, int flags, const Size& newImageSize, double balance, double fov_scale) { + CV_INSTRUMENT_REGION() + CV_Assert((_R.size() == Size(3, 3) || _R.total() * _R.channels() == 3) && (_R.depth() == CV_32F || _R.depth() == CV_64F)); CV_Assert(_tvec.total() * _tvec.channels() == 3 && (_tvec.depth() == CV_32F || _tvec.depth() == CV_64F)); @@ -691,6 +714,8 @@ double cv::fisheye::calibrate(InputArrayOfArrays objectPoints, InputArrayOfArray InputOutputArray K, InputOutputArray D, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, int flags , cv::TermCriteria criteria) { + CV_INSTRUMENT_REGION() + CV_Assert(!objectPoints.empty() && !imagePoints.empty() && objectPoints.total() == imagePoints.total()); CV_Assert(objectPoints.type() == CV_32FC3 || objectPoints.type() == CV_64FC3); CV_Assert(imagePoints.type() == CV_32FC2 || imagePoints.type() == CV_64FC2); @@ -828,6 +853,8 @@ double cv::fisheye::stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayO InputOutputArray K1, InputOutputArray D1, InputOutputArray K2, InputOutputArray D2, Size imageSize, OutputArray R, OutputArray T, int flags, TermCriteria criteria) { + CV_INSTRUMENT_REGION() + CV_Assert(!objectPoints.empty() && !imagePoints1.empty() && !imagePoints2.empty()); CV_Assert(objectPoints.total() == imagePoints1.total() || imagePoints1.total() == imagePoints2.total()); CV_Assert(objectPoints.type() == CV_32FC3 || objectPoints.type() == CV_64FC3); @@ -1150,6 +1177,8 @@ void cv::internal::projectPoints(cv::InputArray objectPoints, cv::OutputArray im cv::InputArray _rvec,cv::InputArray _tvec, const IntrinsicParams& param, cv::OutputArray jacobian) { + CV_INSTRUMENT_REGION() + CV_Assert(!objectPoints.empty() && objectPoints.type() == CV_64FC3); Matx33d K(param.f[0], param.f[0] * param.alpha, param.c[0], 0, param.f[1], param.c[1], @@ -1202,6 +1231,8 @@ void cv::internal::ComputeExtrinsicRefine(const Mat& imagePoints, const Mat& obj cv::Mat cv::internal::ComputeHomography(Mat m, Mat M) { + CV_INSTRUMENT_REGION() + int Np = m.cols; if (m.rows < 3) @@ -1301,6 +1332,8 @@ cv::Mat cv::internal::ComputeHomography(Mat m, Mat M) cv::Mat cv::internal::NormalizePixels(const Mat& imagePoints, const IntrinsicParams& param) { + CV_INSTRUMENT_REGION() + CV_Assert(!imagePoints.empty() && imagePoints.type() == CV_64FC2); Mat distorted((int)imagePoints.total(), 1, CV_64FC2), undistorted; diff --git a/modules/calib3d/src/five-point.cpp b/modules/calib3d/src/five-point.cpp index 92e652b0e8..1d39e20f87 100644 --- a/modules/calib3d/src/five-point.cpp +++ b/modules/calib3d/src/five-point.cpp @@ -405,6 +405,8 @@ protected: cv::Mat cv::findEssentialMat( InputArray _points1, InputArray _points2, InputArray _cameraMatrix, int method, double prob, double threshold, OutputArray _mask) { + CV_INSTRUMENT_REGION() + Mat points1, points2, cameraMatrix; _points1.getMat().convertTo(points1, CV_64F); _points2.getMat().convertTo(points2, CV_64F); @@ -450,6 +452,8 @@ cv::Mat cv::findEssentialMat( InputArray _points1, InputArray _points2, InputArr cv::Mat cv::findEssentialMat( InputArray _points1, InputArray _points2, double focal, Point2d pp, int method, double prob, double threshold, OutputArray _mask) { + CV_INSTRUMENT_REGION() + Mat cameraMatrix = (Mat_(3,3) << focal, 0, pp.x, 0, focal, pp.y, 0, 0, 1); return cv::findEssentialMat(_points1, _points2, cameraMatrix, method, prob, threshold, _mask); } @@ -457,6 +461,8 @@ cv::Mat cv::findEssentialMat( InputArray _points1, InputArray _points2, double f int cv::recoverPose( InputArray E, InputArray _points1, InputArray _points2, InputArray _cameraMatrix, OutputArray _R, OutputArray _t, InputOutputArray _mask) { + CV_INSTRUMENT_REGION() + Mat points1, points2, cameraMatrix; _points1.getMat().convertTo(points1, CV_64F); _points2.getMat().convertTo(points2, CV_64F); @@ -616,6 +622,8 @@ int cv::recoverPose( InputArray E, InputArray _points1, InputArray _points2, Out void cv::decomposeEssentialMat( InputArray _E, OutputArray _R1, OutputArray _R2, OutputArray _t ) { + CV_INSTRUMENT_REGION() + Mat E = _E.getMat().reshape(1, 3); CV_Assert(E.cols == 3 && E.rows == 3); diff --git a/modules/calib3d/src/fundam.cpp b/modules/calib3d/src/fundam.cpp index 4a7db9689d..cdcbeadd77 100644 --- a/modules/calib3d/src/fundam.cpp +++ b/modules/calib3d/src/fundam.cpp @@ -343,6 +343,8 @@ cv::Mat cv::findHomography( InputArray _points1, InputArray _points2, int method, double ransacReprojThreshold, OutputArray _mask, const int maxIters, const double confidence) { + CV_INSTRUMENT_REGION() + const double defaultRANSACReprojThreshold = 3; bool result = false; @@ -714,6 +716,8 @@ cv::Mat cv::findFundamentalMat( InputArray _points1, InputArray _points2, int method, double param1, double param2, OutputArray _mask ) { + CV_INSTRUMENT_REGION() + Mat points1 = _points1.getMat(), points2 = _points2.getMat(); Mat m1, m2, F; int npoints = -1; @@ -783,6 +787,8 @@ cv::Mat cv::findFundamentalMat( InputArray _points1, InputArray _points2, void cv::computeCorrespondEpilines( InputArray _points, int whichImage, InputArray _Fmat, OutputArray _lines ) { + CV_INSTRUMENT_REGION() + double f[9]; Mat tempF(3, 3, CV_64F, f); Mat points = _points.getMat(), F = _Fmat.getMat(); @@ -856,6 +862,8 @@ void cv::computeCorrespondEpilines( InputArray _points, int whichImage, void cv::convertPointsFromHomogeneous( InputArray _src, OutputArray _dst ) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); if( !src.isContinuous() ) src = src.clone(); @@ -955,6 +963,8 @@ void cv::convertPointsFromHomogeneous( InputArray _src, OutputArray _dst ) void cv::convertPointsToHomogeneous( InputArray _src, OutputArray _dst ) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); if( !src.isContinuous() ) src = src.clone(); @@ -1036,6 +1046,8 @@ void cv::convertPointsToHomogeneous( InputArray _src, OutputArray _dst ) void cv::convertPointsHomogeneous( InputArray _src, OutputArray _dst ) { + CV_INSTRUMENT_REGION() + int stype = _src.type(), dtype = _dst.type(); CV_Assert( _dst.fixedType() ); @@ -1045,7 +1057,10 @@ void cv::convertPointsHomogeneous( InputArray _src, OutputArray _dst ) convertPointsToHomogeneous(_src, _dst); } -double cv::sampsonDistance(InputArray _pt1, InputArray _pt2, InputArray _F) { +double cv::sampsonDistance(InputArray _pt1, InputArray _pt2, InputArray _F) +{ + CV_INSTRUMENT_REGION() + CV_Assert(_pt1.type() == CV_64F && _pt2.type() == CV_64F && _F.type() == CV_64F); CV_DbgAssert(_pt1.rows() == 3 && _F.size() == Size(3, 3) && _pt1.rows() == _pt2.rows()); diff --git a/modules/calib3d/src/p3p.cpp b/modules/calib3d/src/p3p.cpp index 882868d6b8..f91925b219 100644 --- a/modules/calib3d/src/p3p.cpp +++ b/modules/calib3d/src/p3p.cpp @@ -33,6 +33,8 @@ p3p::p3p(double _fx, double _fy, double _cx, double _cy) bool p3p::solve(cv::Mat& R, cv::Mat& tvec, const cv::Mat& opoints, const cv::Mat& ipoints) { + CV_INSTRUMENT_REGION() + double rotation_matrix[3][3], translation[3]; std::vector points; if (opoints.depth() == ipoints.depth()) diff --git a/modules/calib3d/src/precomp.hpp b/modules/calib3d/src/precomp.hpp index 83a513dcaa..0005f234e2 100644 --- a/modules/calib3d/src/precomp.hpp +++ b/modules/calib3d/src/precomp.hpp @@ -117,4 +117,7 @@ template inline int compressElems( T* ptr, const uchar* mask, int ms } +int checkChessboard(const cv::Mat & img, const cv::Size & size); +int checkChessboardBinary(const cv::Mat & img, const cv::Size & size); + #endif diff --git a/modules/calib3d/src/ptsetreg.cpp b/modules/calib3d/src/ptsetreg.cpp index 463027d510..5e652d4fd5 100644 --- a/modules/calib3d/src/ptsetreg.cpp +++ b/modules/calib3d/src/ptsetreg.cpp @@ -344,10 +344,8 @@ public: else errf = err; CV_Assert( errf.isContinuous() && errf.type() == CV_32F && (int)errf.total() == count ); - std::sort(errf.ptr(), errf.ptr() + count); - - double median = count % 2 != 0 ? - errf.at(count/2) : (errf.at(count/2-1) + errf.at(count/2))*0.5; + std::nth_element(errf.ptr(), errf.ptr() + count/2, errf.ptr() + count); + double median = errf.at(count/2); if( median < minMedian ) { @@ -507,6 +505,8 @@ int cv::estimateAffine3D(InputArray _from, InputArray _to, OutputArray _out, OutputArray _inliers, double param1, double param2) { + CV_INSTRUMENT_REGION() + Mat from = _from.getMat(), to = _to.getMat(); int count = from.checkVector(3); diff --git a/modules/calib3d/src/quadsubpix.cpp b/modules/calib3d/src/quadsubpix.cpp index 2e98a462b5..a640a67e40 100644 --- a/modules/calib3d/src/quadsubpix.cpp +++ b/modules/calib3d/src/quadsubpix.cpp @@ -163,6 +163,8 @@ static int segment_hist_max(const Mat& hist, int& low_thresh, int& high_thresh) bool cv::find4QuadCornerSubpix(InputArray _img, InputOutputArray _corners, Size region_size) { + CV_INSTRUMENT_REGION() + Mat img = _img.getMat(), cornersM = _corners.getMat(); int ncorners = cornersM.checkVector(2, CV_32F); CV_Assert( ncorners >= 0 ); diff --git a/modules/calib3d/src/solvepnp.cpp b/modules/calib3d/src/solvepnp.cpp index 12dcb4a6ca..84a3256739 100644 --- a/modules/calib3d/src/solvepnp.cpp +++ b/modules/calib3d/src/solvepnp.cpp @@ -56,6 +56,8 @@ bool solvePnP( InputArray _opoints, InputArray _ipoints, InputArray _cameraMatrix, InputArray _distCoeffs, OutputArray _rvec, OutputArray _tvec, bool useExtrinsicGuess, int flags ) { + CV_INSTRUMENT_REGION() + Mat opoints = _opoints.getMat(), ipoints = _ipoints.getMat(); int npoints = std::max(opoints.checkVector(3, CV_32F), opoints.checkVector(3, CV_64F)); CV_Assert( npoints >= 0 && npoints == std::max(ipoints.checkVector(2, CV_32F), ipoints.checkVector(2, CV_64F)) ); @@ -214,6 +216,7 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints, int iterationsCount, float reprojectionError, double confidence, OutputArray _inliers, int flags) { + CV_INSTRUMENT_REGION() Mat opoints0 = _opoints.getMat(), ipoints0 = _ipoints.getMat(); Mat opoints, ipoints; diff --git a/modules/calib3d/src/stereobm.cpp b/modules/calib3d/src/stereobm.cpp index c4278b3617..3c868b97a7 100644 --- a/modules/calib3d/src/stereobm.cpp +++ b/modules/calib3d/src/stereobm.cpp @@ -1061,6 +1061,8 @@ public: void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr ) { + CV_INSTRUMENT_REGION() + int dtype = disparr.fixedType() ? disparr.type() : params.dispType; Size leftsize = leftarr.size(); diff --git a/modules/calib3d/src/stereosgbm.cpp b/modules/calib3d/src/stereosgbm.cpp index c7dd8b9fcd..cb14a1c89a 100644 --- a/modules/calib3d/src/stereosgbm.cpp +++ b/modules/calib3d/src/stereosgbm.cpp @@ -1494,6 +1494,8 @@ public: void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr ) { + CV_INSTRUMENT_REGION() + Mat left = leftarr.getMat(), right = rightarr.getMat(); CV_Assert( left.size() == right.size() && left.type() == right.type() && left.depth() == CV_8U ); @@ -1728,6 +1730,8 @@ void filterSpecklesImpl(cv::Mat& img, int newVal, int maxSpeckleSize, int maxDif #ifdef HAVE_IPP static bool ipp_filterSpeckles(Mat &img, int maxSpeckleSize, int newVal, int maxDiff) { + CV_INSTRUMENT_REGION_IPP() + #if IPP_VERSION_X100 >= 810 int type = img.type(); Ipp32s bufsize = 0; @@ -1745,12 +1749,12 @@ static bool ipp_filterSpeckles(Mat &img, int maxSpeckleSize, int newVal, int max if (type == CV_8UC1) { - status = ippiMarkSpeckles_8u_C1IR(img.ptr(), (int)img.step, roisize, + status = CV_INSTRUMENT_FUN_IPP(ippiMarkSpeckles_8u_C1IR, img.ptr(), (int)img.step, roisize, (Ipp8u)newVal, maxSpeckleSize, (Ipp8u)maxDiff, ippiNormL1, pBuffer); } else { - status = ippiMarkSpeckles_16s_C1IR(img.ptr(), (int)img.step, roisize, + status = CV_INSTRUMENT_FUN_IPP(ippiMarkSpeckles_16s_C1IR, img.ptr(), (int)img.step, roisize, (Ipp16s)newVal, maxSpeckleSize, (Ipp16s)maxDiff, ippiNormL1, pBuffer); } if(pBuffer) ippFree(pBuffer); @@ -1769,6 +1773,8 @@ static bool ipp_filterSpeckles(Mat &img, int maxSpeckleSize, int newVal, int max void cv::filterSpeckles( InputOutputArray _img, double _newval, int maxSpeckleSize, double _maxDiff, InputOutputArray __buf ) { + CV_INSTRUMENT_REGION() + Mat img = _img.getMat(); int type = img.type(); Mat temp, &_buf = __buf.needed() ? __buf.getMatRef() : temp; @@ -1787,6 +1793,8 @@ void cv::filterSpeckles( InputOutputArray _img, double _newval, int maxSpeckleSi void cv::validateDisparity( InputOutputArray _disp, InputArray _cost, int minDisparity, int numberOfDisparities, int disp12MaxDiff ) { + CV_INSTRUMENT_REGION() + Mat disp = _disp.getMat(), cost = _cost.getMat(); int cols = disp.cols, rows = disp.rows; int minD = minDisparity, maxD = minDisparity + numberOfDisparities; diff --git a/modules/calib3d/src/triangulate.cpp b/modules/calib3d/src/triangulate.cpp index 0fa5e3d9ef..33c7fd774d 100644 --- a/modules/calib3d/src/triangulate.cpp +++ b/modules/calib3d/src/triangulate.cpp @@ -393,6 +393,8 @@ void cv::triangulatePoints( InputArray _projMatr1, InputArray _projMatr2, InputArray _projPoints1, InputArray _projPoints2, OutputArray _points4D ) { + CV_INSTRUMENT_REGION() + Mat matr1 = _projMatr1.getMat(), matr2 = _projMatr2.getMat(); Mat points1 = _projPoints1.getMat(), points2 = _projPoints2.getMat(); @@ -414,6 +416,8 @@ void cv::triangulatePoints( InputArray _projMatr1, InputArray _projMatr2, void cv::correctMatches( InputArray _F, InputArray _points1, InputArray _points2, OutputArray _newPoints1, OutputArray _newPoints2 ) { + CV_INSTRUMENT_REGION() + Mat F = _F.getMat(); Mat points1 = _points1.getMat(), points2 = _points2.getMat(); diff --git a/modules/calib3d/test/test_cameracalibration.cpp b/modules/calib3d/test/test_cameracalibration.cpp index 2dad0cf222..523594224d 100644 --- a/modules/calib3d/test/test_cameracalibration.cpp +++ b/modules/calib3d/test/test_cameracalibration.cpp @@ -1346,6 +1346,108 @@ void CV_ProjectPointsTest_CPP::project( const Mat& objectPoints, const Mat& rvec ///////////////////////////////// Stereo Calibration ///////////////////////////////////// +class CV_StereoCalibrationCornerTest : public cvtest::BaseTest +{ +public: + CV_StereoCalibrationCornerTest(); + ~CV_StereoCalibrationCornerTest(); + void clear(); +protected: + void run(int); +}; + +CV_StereoCalibrationCornerTest::CV_StereoCalibrationCornerTest() +{ +} + + +CV_StereoCalibrationCornerTest::~CV_StereoCalibrationCornerTest() +{ + clear(); +} + +void CV_StereoCalibrationCornerTest::clear() +{ + cvtest::BaseTest::clear(); +} + +static bool resizeCameraMatrix(const Mat &in_cm, Mat &dst_cm, double scale) +{ + if (in_cm.empty() || in_cm.cols != 3 || in_cm.rows != 3 || in_cm.type() != CV_64FC1) + return false; + dst_cm = in_cm * scale; + dst_cm.at(2, 2) = 1.0; + return true; +} + +// see https://github.com/opencv/opencv/pull/6836 for details +void CV_StereoCalibrationCornerTest::run(int) +{ + const Matx33d M1(906.7857732303256, 0.0, 1026.456125870669, + 0.0, 906.7857732303256, 540.0531577669913, + 0.0, 0.0, 1.0); + const Matx33d M2(906.782205162265, 0.0, 1014.619997352785, + 0.0, 906.782205162265, 561.9990018887295, + 0.0, 0.0, 1.0); + const Matx D1(0.0064836857220181504, 0.033880363848984636, 0.0, 0.0, -0.042996356352306114); + const Matx D2(0.023754068600491646, -0.02364619610835259, 0.0, 0.0, 0.0015014971456262652); + + const Size imageSize(2048, 1088); + const double scale = 0.25; + + const Matx33d Rot(0.999788461750194, -0.015696495349844446, -0.013291041528534329, + 0.015233019205877604, 0.999296086451901, -0.034282455101525826, + 0.01381980018141639, 0.03407274036010432, 0.9993238021218641); + const Matx31d T(-1.552005597952028, 0.0019508251875105093, -0.023335501616116062); + + // generate camera matrices for resized image rectification. + Mat srcM1(M1), srcM2(M2); + Mat rszM1, rszM2; + resizeCameraMatrix(srcM1, rszM1, scale); + resizeCameraMatrix(srcM2, rszM2, scale); + Size rszImageSize(cvRound(scale * imageSize.width), cvRound(scale * imageSize.height)); + Size srcImageSize = imageSize; + // apply stereoRectify + Mat srcR[2], srcP[2], srcQ; + Mat rszR[2], rszP[2], rszQ; + stereoRectify(srcM1, D1, srcM2, D2, srcImageSize, Rot, T, + srcR[0], srcR[1], srcP[0], srcP[1], srcQ, + CALIB_ZERO_DISPARITY, 0); + stereoRectify(rszM1, D1, rszM2, D2, rszImageSize, Rot, T, + rszR[0], rszR[1], rszP[0], rszP[1], rszQ, + CALIB_ZERO_DISPARITY, 0); + // generate remap maps + Mat srcRmap[2], rszRmap[2]; + initUndistortRectifyMap(srcM1, D1, srcR[0], srcP[0], srcImageSize, CV_32FC2, srcRmap[0], srcRmap[1]); + initUndistortRectifyMap(rszM1, D1, rszR[0], rszP[0], rszImageSize, CV_32FC2, rszRmap[0], rszRmap[1]); + + // generate source image + // it's an artificial pattern with white rect in the center + Mat image(imageSize, CV_8UC3); + image.setTo(0); + image(cv::Rect(imageSize.width / 3, imageSize.height / 3, imageSize.width / 3, imageSize.height / 3)).setTo(255); + + // perform remap-resize + Mat src_result; + remap(image, src_result, srcRmap[0], srcRmap[1], INTER_LINEAR); + resize(src_result, src_result, Size(), scale, scale, INTER_LINEAR); + // perform resize-remap + Mat rsz_result; + resize(image, rsz_result, Size(), scale, scale, INTER_LINEAR); + remap(rsz_result, rsz_result, rszRmap[0], rszRmap[1], INTER_LINEAR); + + // modifying the camera matrix with resizeCameraMatrix must yield the same + // result as calibrating the downscaled images + int cnz = countNonZero((cv::Mat(src_result - rsz_result) != 0)( + cv::Rect(src_result.cols / 3, src_result.rows / 3, + (int)(src_result.cols / 3.1), int(src_result.rows / 3.1)))); + if (cnz) + { + ts->printf( cvtest::TS::LOG, "The camera matrix is wrong for downscaled image\n"); + ts->set_failed_test_info( cvtest::TS::FAIL_BAD_ACCURACY ); + } +} + class CV_StereoCalibrationTest : public cvtest::BaseTest { public: @@ -1949,7 +2051,7 @@ TEST(Calib3d_ProjectPoints_C, accuracy) { CV_ProjectPointsTest_C test; test.saf TEST(Calib3d_ProjectPoints_CPP, regression) { CV_ProjectPointsTest_CPP test; test.safe_run(); } TEST(Calib3d_StereoCalibrate_C, regression) { CV_StereoCalibrationTest_C test; test.safe_run(); } TEST(Calib3d_StereoCalibrate_CPP, regression) { CV_StereoCalibrationTest_CPP test; test.safe_run(); } - +TEST(Calib3d_StereoCalibrateCorner, regression) { CV_StereoCalibrationCornerTest test; test.safe_run(); } TEST(Calib3d_Triangulate, accuracy) { diff --git a/modules/calib3d/test/test_chesscorners.cpp b/modules/calib3d/test/test_chesscorners.cpp index fd3da2e440..f4208a574c 100644 --- a/modules/calib3d/test/test_chesscorners.cpp +++ b/modules/calib3d/test/test_chesscorners.cpp @@ -51,29 +51,31 @@ using namespace cv; #define _L2_ERR -void show_points( const Mat& gray, const Mat& u, const vector& v, Size pattern_size, bool was_found ) +//#define DEBUG_CHESSBOARD + +#ifdef DEBUG_CHESSBOARD +#include "opencv2/highgui.hpp" +void show_points( const Mat& gray, const Mat& expected, const vector& actual, bool was_found ) { Mat rgb( gray.size(), CV_8U); merge(vector(3, gray), rgb); - for(size_t i = 0; i < v.size(); i++ ) - circle( rgb, v[i], 3, Scalar(255, 0, 0), FILLED); + for(size_t i = 0; i < actual.size(); i++ ) + circle( rgb, actual[i], 5, Scalar(0, 0, 200), 1, LINE_AA); - if( !u.empty() ) + if( !expected.empty() ) { - const Point2f* u_data = u.ptr(); - size_t count = u.cols * u.rows; + const Point2f* u_data = expected.ptr(); + size_t count = expected.cols * expected.rows; for(size_t i = 0; i < count; i++ ) - circle( rgb, u_data[i], 3, Scalar(0, 255, 0), FILLED); + circle(rgb, u_data[i], 4, Scalar(0, 240, 0), 1, LINE_AA); } - if (!v.empty()) - { - Mat corners((int)v.size(), 1, CV_32FC2, (void*)&v[0]); - drawChessboardCorners( rgb, pattern_size, corners, was_found ); - } - //namedWindow( "test", 0 ); imshow( "test", rgb ); waitKey(0); + putText(rgb, was_found ? "FOUND !!!" : "NOT FOUND", Point(5, 20), FONT_HERSHEY_PLAIN, 1, Scalar(0, 240, 0)); + imshow( "test", rgb ); while ((uchar)waitKey(0) != 'q') {}; } - +#else +#define show_points(...) +#endif enum Pattern { CHESSBOARD, CIRCLES_GRID, ASYMMETRIC_CIRCLES_GRID }; @@ -253,7 +255,6 @@ void CV_ChessboardDetectorTest::run_batch( const string& filename ) result = findCirclesGrid(gray, pattern_size, v, CALIB_CB_ASYMMETRIC_GRID | algorithmFlags); break; } - show_points( gray, Mat(), v, pattern_size, result ); if( result ^ doesContatinChessboard || v.size() != count_exp ) { @@ -280,7 +281,7 @@ void CV_ChessboardDetectorTest::run_batch( const string& filename ) if( pattern == CHESSBOARD ) cornerSubPix( gray, v, Size(5, 5), Size(-1,-1), TermCriteria(TermCriteria::EPS|TermCriteria::MAX_ITER, 30, 0.1)); //find4QuadCornerSubpix(gray, v, Size(5, 5)); - show_points( gray, expected, v, pattern_size, result ); + show_points( gray, expected, v, result ); #ifndef WRITE_POINTS // printf("called find4QuadCornerSubpix\n"); err = calcError(v, expected); @@ -298,6 +299,10 @@ void CV_ChessboardDetectorTest::run_batch( const string& filename ) max_precise_error = MAX( max_precise_error, err ); #endif } + else + { + show_points( gray, Mat(), v, result ); + } #ifdef WRITE_POINTS Mat mat_v(pattern_size, CV_32FC2, (void*)&v[0]); diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index 36c4eea5d4..0485a08ad3 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -22,8 +22,10 @@ endif() file(GLOB lib_cuda_hdrs "include/opencv2/${name}/cuda/*.hpp" "include/opencv2/${name}/cuda/*.h") file(GLOB lib_cuda_hdrs_detail "include/opencv2/${name}/cuda/detail/*.hpp" "include/opencv2/${name}/cuda/detail/*.h") -source_group("Cuda Headers" FILES ${lib_cuda_hdrs}) -source_group("Cuda Headers\\Detail" FILES ${lib_cuda_hdrs_detail}) +source_group("Include\\Cuda Headers" FILES ${lib_cuda_hdrs}) +source_group("Include\\Cuda Headers\\Detail" FILES ${lib_cuda_hdrs_detail}) + +source_group("Src" FILES "${OPENCV_MODULE_opencv_core_BINARY_DIR}/version_string.inc") ocv_glob_module_sources(SOURCES "${OPENCV_MODULE_opencv_core_BINARY_DIR}/version_string.inc" HEADERS ${lib_cuda_hdrs} ${lib_cuda_hdrs_detail}) diff --git a/modules/core/doc/intro.markdown b/modules/core/doc/intro.markdown index 964fb06331..41d80781b6 100644 --- a/modules/core/doc/intro.markdown +++ b/modules/core/doc/intro.markdown @@ -22,7 +22,7 @@ libraries. The following modules are available: - **objdetect** - detection of objects and instances of the predefined classes (for example, faces, eyes, mugs, people, cars, and so on). - **highgui** - an easy-to-use interface to simple UI capabilities. -- **videoio** - an easy-to-use interface to video capturing and video codecs. +- @ref videoio - an easy-to-use interface to video capturing and video codecs. - **gpu** - GPU-accelerated algorithms from different OpenCV modules. - ... some other helper modules, such as FLANN and Google test wrappers, Python bindings, and others. diff --git a/modules/core/include/opencv2/core.hpp b/modules/core/include/opencv2/core.hpp index 88b06f3911..48e05ff696 100644 --- a/modules/core/include/opencv2/core.hpp +++ b/modules/core/include/opencv2/core.hpp @@ -426,7 +426,7 @@ CV_EXPORTS_W void multiply(InputArray src1, InputArray src2, /** @brief Performs per-element division of two arrays or a scalar by an array. -The functions divide divide one array by another: +The function cv::divide divides one array by another: \f[\texttt{dst(I) = saturate(src1(I)*scale/src2(I))}\f] or a scalar by an array when there is no src1 : \f[\texttt{dst(I) = saturate(scale/src2(I))}\f] @@ -553,7 +553,7 @@ CV_EXPORTS_W void LUT(InputArray src, InputArray lut, OutputArray dst); /** @brief Calculates the sum of array elements. -The functions sum calculate and return the sum of array elements, +The function cv::sum calculates and returns the sum of array elements, independently for each channel. @param src input array that must have from 1 to 4 channels. @sa countNonZero, mean, meanStdDev, norm, minMaxLoc, reduce @@ -599,10 +599,10 @@ CV_EXPORTS_W void findNonZero( InputArray src, OutputArray idx ); /** @brief Calculates an average (mean) of array elements. -The function mean calculates the mean value M of array elements, +The function cv::mean calculates the mean value M of array elements, independently for each channel, and return it: \f[\begin{array}{l} N = \sum _{I: \; \texttt{mask} (I) \ne 0} 1 \\ M_c = \left ( \sum _{I: \; \texttt{mask} (I) \ne 0}{ \texttt{mtx} (I)_c} \right )/N \end{array}\f] -When all the mask elements are 0's, the functions return Scalar::all(0) +When all the mask elements are 0's, the function returns Scalar::all(0) @param src input array that should have from 1 to 4 channels so that the result can be stored in Scalar_ . @param mask optional operation mask. @@ -612,11 +612,11 @@ CV_EXPORTS_W Scalar mean(InputArray src, InputArray mask = noArray()); /** Calculates a mean and standard deviation of array elements. -The function meanStdDev calculates the mean and the standard deviation M +The function cv::meanStdDev calculates the mean and the standard deviation M of array elements independently for each channel and returns it via the output parameters: \f[\begin{array}{l} N = \sum _{I, \texttt{mask} (I) \ne 0} 1 \\ \texttt{mean} _c = \frac{\sum_{ I: \; \texttt{mask}(I) \ne 0} \texttt{src} (I)_c}{N} \\ \texttt{stddev} _c = \sqrt{\frac{\sum_{ I: \; \texttt{mask}(I) \ne 0} \left ( \texttt{src} (I)_c - \texttt{mean} _c \right )^2}{N}} \end{array}\f] -When all the mask elements are 0's, the functions return +When all the mask elements are 0's, the function returns mean=stddev=Scalar::all(0). @note The calculated standard deviation is only the diagonal of the complete normalized covariance matrix. If the full matrix is needed, you @@ -636,7 +636,7 @@ CV_EXPORTS_W void meanStdDev(InputArray src, OutputArray mean, OutputArray stdde /** @brief Calculates an absolute array norm, an absolute difference norm, or a relative difference norm. -The functions norm calculate an absolute norm of src1 (when there is no +The function cv::norm calculates an absolute norm of src1 (when there is no src2 ): \f[norm = \forkthree{\|\texttt{src1}\|_{L_{\infty}} = \max _I | \texttt{src1} (I)|}{if \(\texttt{normType} = \texttt{NORM_INF}\) } @@ -655,7 +655,7 @@ or { \frac{\|\texttt{src1}-\texttt{src2}\|_{L_1} }{\|\texttt{src2}\|_{L_1}} }{if \(\texttt{normType} = \texttt{NORM_RELATIVE_L1}\) } { \frac{\|\texttt{src1}-\texttt{src2}\|_{L_2} }{\|\texttt{src2}\|_{L_2}} }{if \(\texttt{normType} = \texttt{NORM_RELATIVE_L2}\) }\f] -The functions norm return the calculated norm. +The function cv::norm returns the calculated norm. When the mask parameter is specified and it is not empty, the norm is calculated only over the region specified by the mask. @@ -703,7 +703,7 @@ CV_EXPORTS_W void batchDistance(InputArray src1, InputArray src2, /** @brief Normalizes the norm or value range of an array. -The functions normalize scale and shift the input array elements so that +The function cv::normalize normalizes scale and shift the input array elements so that \f[\| \texttt{dst} \| _{L_p}= \texttt{alpha}\f] (where p=Inf, 1 or 2) when normType=NORM_INF, NORM_L1, or NORM_L2, respectively; or so that \f[\min _I \texttt{dst} (I)= \texttt{alpha} , \, \, \max _I \texttt{dst} (I)= \texttt{beta}\f] @@ -773,11 +773,11 @@ CV_EXPORTS void normalize( const SparseMat& src, SparseMat& dst, double alpha, i /** @brief Finds the global minimum and maximum in an array. -The functions minMaxLoc find the minimum and maximum element values and their positions. The +The function cv::minMaxLoc finds the minimum and maximum element values and their positions. The extremums are searched across the whole array or, if mask is not an empty array, in the specified array region. -The functions do not work with multi-channel arrays. If you need to find minimum or maximum +The function do not work with multi-channel arrays. If you need to find minimum or maximum elements across all the channels, use Mat::reshape first to reinterpret the array as single-channel. Or you may extract the particular channel using either extractImageCOI , or mixChannels , or split . @@ -796,7 +796,7 @@ CV_EXPORTS_W void minMaxLoc(InputArray src, CV_OUT double* minVal, /** @brief Finds the global minimum and maximum in an array -The function minMaxIdx finds the minimum and maximum element values and their positions. The +The function cv::minMaxIdx finds the minimum and maximum element values and their positions. The extremums are searched across the whole array or, if mask is not an empty array, in the specified array region. The function does not work with multi-channel arrays. If you need to find minimum or maximum elements across all the channels, use Mat::reshape first to reinterpret the array as @@ -834,7 +834,7 @@ CV_EXPORTS void minMaxLoc(const SparseMat& a, double* minVal, /** @brief Reduces a matrix to a vector. -The function reduce reduces the matrix to a vector by treating the matrix rows/columns as a set of +The function cv::reduce reduces the matrix to a vector by treating the matrix rows/columns as a set of 1D vectors and performing the specified operation on the vectors until a single row/column is obtained. For example, the function can be used to compute horizontal and vertical projections of a raster image. In case of REDUCE_MAX and REDUCE_MIN , the output image should have the same type as the source one. @@ -853,7 +853,7 @@ CV_EXPORTS_W void reduce(InputArray src, OutputArray dst, int dim, int rtype, in /** @brief Creates one multi-channel array out of several single-channel ones. -The function merge merges several arrays to make a single multi-channel array. That is, each +The function cv::merge merges several arrays to make a single multi-channel array. That is, each element of the output array will be a concatenation of the elements of the input arrays, where elements of i-th input array are treated as mv[i].channels()-element vectors. @@ -878,7 +878,7 @@ CV_EXPORTS_W void merge(InputArrayOfArrays mv, OutputArray dst); /** @brief Divides a multi-channel array into several single-channel arrays. -The functions split split a multi-channel array into separate single-channel arrays: +The function cv::split splits a multi-channel array into separate single-channel arrays: \f[\texttt{mv} [c](I) = \texttt{src} (I)_c\f] If you need to extract a single channel or do some other sophisticated channel permutation, use mixChannels . @@ -990,7 +990,7 @@ CV_EXPORTS_W void insertChannel(InputArray src, InputOutputArray dst, int coi); /** @brief Flips a 2D array around vertical, horizontal, or both axes. -The function flip flips the array in one of three different ways (row +The function cv::flip flips the array in one of three different ways (row and column indices are 0-based): \f[\texttt{dst} _{ij} = \left\{ @@ -1177,7 +1177,7 @@ CV_EXPORTS_W void vconcat(InputArrayOfArrays src, OutputArray dst); Calculates the per-element bit-wise conjunction of two arrays or an array and a scalar. -The function calculates the per-element bit-wise logical conjunction for: +The function cv::bitwise_and calculates the per-element bit-wise logical conjunction for: * Two arrays when src1 and src2 have the same size: \f[\texttt{dst} (I) = \texttt{src1} (I) \wedge \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0\f] * An array and a scalar when src2 is constructed from Scalar or has @@ -1204,7 +1204,7 @@ CV_EXPORTS_W void bitwise_and(InputArray src1, InputArray src2, /** @brief Calculates the per-element bit-wise disjunction of two arrays or an array and a scalar. -The function calculates the per-element bit-wise logical disjunction for: +The function cv::bitwise_or calculates the per-element bit-wise logical disjunction for: * Two arrays when src1 and src2 have the same size: \f[\texttt{dst} (I) = \texttt{src1} (I) \vee \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0\f] * An array and a scalar when src2 is constructed from Scalar or has @@ -1231,7 +1231,7 @@ CV_EXPORTS_W void bitwise_or(InputArray src1, InputArray src2, /** @brief Calculates the per-element bit-wise "exclusive or" operation on two arrays or an array and a scalar. -The function calculates the per-element bit-wise logical "exclusive-or" +The function cv::bitwise_xor calculates the per-element bit-wise logical "exclusive-or" operation for: * Two arrays when src1 and src2 have the same size: \f[\texttt{dst} (I) = \texttt{src1} (I) \oplus \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0\f] @@ -1258,7 +1258,7 @@ CV_EXPORTS_W void bitwise_xor(InputArray src1, InputArray src2, /** @brief Inverts every bit of an array. -The function calculates per-element bit-wise inversion of the input +The function cv::bitwise_not calculates per-element bit-wise inversion of the input array: \f[\texttt{dst} (I) = \neg \texttt{src} (I)\f] In case of a floating-point input array, its machine-specific bit @@ -1275,7 +1275,7 @@ CV_EXPORTS_W void bitwise_not(InputArray src, OutputArray dst, /** @brief Calculates the per-element absolute difference between two arrays or between an array and a scalar. -The function absdiff calculates: +The function cv::absdiff calculates: * Absolute difference between two arrays when they have the same size and type: \f[\texttt{dst}(I) = \texttt{saturate} (| \texttt{src1}(I) - \texttt{src2}(I)|)\f] @@ -1350,7 +1350,7 @@ CV_EXPORTS_W void compare(InputArray src1, InputArray src2, OutputArray dst, int /** @brief Calculates per-element minimum of two arrays or an array and a scalar. -The functions min calculate the per-element minimum of two arrays: +The function cv::min calculates the per-element minimum of two arrays: \f[\texttt{dst} (I)= \min ( \texttt{src1} (I), \texttt{src2} (I))\f] or array and a scalar: \f[\texttt{dst} (I)= \min ( \texttt{src1} (I), \texttt{value} )\f] @@ -1371,7 +1371,7 @@ CV_EXPORTS void min(const UMat& src1, const UMat& src2, UMat& dst); /** @brief Calculates per-element maximum of two arrays or an array and a scalar. -The functions max calculate the per-element maximum of two arrays: +The function cv::max calculates the per-element maximum of two arrays: \f[\texttt{dst} (I)= \max ( \texttt{src1} (I), \texttt{src2} (I))\f] or array and a scalar: \f[\texttt{dst} (I)= \max ( \texttt{src1} (I), \texttt{value} )\f] @@ -1392,7 +1392,7 @@ CV_EXPORTS void max(const UMat& src1, const UMat& src2, UMat& dst); /** @brief Calculates a square root of array elements. -The functions sqrt calculate a square root of each input array element. +The function cv::sqrt calculates a square root of each input array element. In case of multi-channel arrays, each channel is processed independently. The accuracy is approximately the same as of the built-in std::sqrt . @@ -1403,7 +1403,7 @@ CV_EXPORTS_W void sqrt(InputArray src, OutputArray dst); /** @brief Raises every array element to a power. -The function pow raises every element of the input array to power : +The function cv::pow raises every element of the input array to power : \f[\texttt{dst} (I) = \fork{\texttt{src}(I)^{power}}{if \(\texttt{power}\) is integer}{|\texttt{src}(I)|^{power}}{otherwise}\f] So, for a non-integer power exponent, the absolute values of input array @@ -1428,7 +1428,7 @@ CV_EXPORTS_W void pow(InputArray src, double power, OutputArray dst); /** @brief Calculates the exponent of every array element. -The function exp calculates the exponent of every element of the input +The function cv::exp calculates the exponent of every element of the input array: \f[\texttt{dst} [I] = e^{ src(I) }\f] @@ -1444,7 +1444,7 @@ CV_EXPORTS_W void exp(InputArray src, OutputArray dst); /** @brief Calculates the natural logarithm of every array element. -The function log calculates the natural logarithm of every element of the input array: +The function cv::log calculates the natural logarithm of every element of the input array: \f[\texttt{dst} (I) = \log (\texttt{src}(I)) \f] Output on zero, negative and special (NaN, Inf) values is undefined. @@ -1457,7 +1457,7 @@ CV_EXPORTS_W void log(InputArray src, OutputArray dst); /** @brief Calculates x and y coordinates of 2D vectors from their magnitude and angle. -The function polarToCart calculates the Cartesian coordinates of each 2D +The function cv::polarToCart calculates the Cartesian coordinates of each 2D vector represented by the corresponding elements of magnitude and angle: \f[\begin{array}{l} \texttt{x} (I) = \texttt{magnitude} (I) \cos ( \texttt{angle} (I)) \\ \texttt{y} (I) = \texttt{magnitude} (I) \sin ( \texttt{angle} (I)) \\ \end{array}\f] @@ -1480,7 +1480,7 @@ CV_EXPORTS_W void polarToCart(InputArray magnitude, InputArray angle, /** @brief Calculates the magnitude and angle of 2D vectors. -The function cartToPolar calculates either the magnitude, angle, or both +The function cv::cartToPolar calculates either the magnitude, angle, or both for every 2D vector (x(I),y(I)): \f[\begin{array}{l} \texttt{magnitude} (I)= \sqrt{\texttt{x}(I)^2+\texttt{y}(I)^2} , \\ \texttt{angle} (I)= \texttt{atan2} ( \texttt{y} (I), \texttt{x} (I))[ \cdot180 / \pi ] \end{array}\f] @@ -1502,7 +1502,7 @@ CV_EXPORTS_W void cartToPolar(InputArray x, InputArray y, /** @brief Calculates the rotation angle of 2D vectors. -The function phase calculates the rotation angle of each 2D vector that +The function cv::phase calculates the rotation angle of each 2D vector that is formed from the corresponding elements of x and y : \f[\texttt{angle} (I) = \texttt{atan2} ( \texttt{y} (I), \texttt{x} (I))\f] @@ -1521,7 +1521,7 @@ CV_EXPORTS_W void phase(InputArray x, InputArray y, OutputArray angle, /** @brief Calculates the magnitude of 2D vectors. -The function magnitude calculates the magnitude of 2D vectors formed +The function cv::magnitude calculates the magnitude of 2D vectors formed from the corresponding elements of x and y arrays: \f[\texttt{dst} (I) = \sqrt{\texttt{x}(I)^2 + \texttt{y}(I)^2}\f] @param x floating-point array of x-coordinates of the vectors. @@ -1534,11 +1534,11 @@ CV_EXPORTS_W void magnitude(InputArray x, InputArray y, OutputArray magnitude); /** @brief Checks every element of an input array for invalid values. -The functions checkRange check that every array element is neither NaN nor infinite. When minVal \> --DBL_MAX and maxVal \< DBL_MAX, the functions also check that each value is between minVal and +The function cv::checkRange checks that every array element is neither NaN nor infinite. When minVal \> +-DBL_MAX and maxVal \< DBL_MAX, the function also checks that each value is between minVal and maxVal. In case of multi-channel arrays, each channel is processed independently. If some values are out of range, position of the first outlier is stored in pos (when pos != NULL). Then, the -functions either return false (when quiet=true) or throw an exception. +function either returns false (when quiet=true) or throws an exception. @param a input array. @param quiet a flag, indicating whether the functions quietly return false when the array elements are out of range or they throw an exception. @@ -1556,7 +1556,7 @@ CV_EXPORTS_W void patchNaNs(InputOutputArray a, double val = 0); /** @brief Performs generalized matrix multiplication. -The function performs generalized matrix multiplication similar to the +The function cv::gemm performs generalized matrix multiplication similar to the gemm functions in BLAS level 3. For example, `gemm(src1, src2, alpha, src3, beta, dst, GEMM_1_T + GEMM_3_T)` corresponds to @@ -1587,7 +1587,7 @@ CV_EXPORTS_W void gemm(InputArray src1, InputArray src2, double alpha, /** @brief Calculates the product of a matrix and its transposition. -The function mulTransposed calculates the product of src and its +The function cv::mulTransposed calculates the product of src and its transposition: \f[\texttt{dst} = \texttt{scale} ( \texttt{src} - \texttt{delta} )^T ( \texttt{src} - \texttt{delta} )\f] if aTa=true , and @@ -1619,7 +1619,7 @@ CV_EXPORTS_W void mulTransposed( InputArray src, OutputArray dst, bool aTa, /** @brief Transposes a matrix. -The function transpose transposes the matrix src : +The function cv::transpose transposes the matrix src : \f[\texttt{dst} (i,j) = \texttt{src} (j,i)\f] @note No complex conjugation is done in case of a complex matrix. It it should be done separately if needed. @@ -1630,7 +1630,7 @@ CV_EXPORTS_W void transpose(InputArray src, OutputArray dst); /** @brief Performs the matrix transformation of every array element. -The function transform performs the matrix transformation of every +The function cv::transform performs the matrix transformation of every element of the array src and stores the results in dst : \f[\texttt{dst} (I) = \texttt{m} \cdot \texttt{src} (I)\f] (when m.cols=src.channels() ), or @@ -1656,7 +1656,7 @@ CV_EXPORTS_W void transform(InputArray src, OutputArray dst, InputArray m ); /** @brief Performs the perspective matrix transformation of vectors. -The function perspectiveTransform transforms every element of src by +The function cv::perspectiveTransform transforms every element of src by treating it as a 2D or 3D vector, in the following way: \f[(x, y, z) \rightarrow (x'/w, y'/w, z'/w)\f] where @@ -1683,7 +1683,7 @@ CV_EXPORTS_W void perspectiveTransform(InputArray src, OutputArray dst, InputArr /** @brief Copies the lower or the upper half of a square matrix to another half. -The function completeSymm copies the lower half of a square matrix to +The function cv::completeSymm copies the lower half of a square matrix to its another half. The matrix diagonal remains unchanged: * \f$\texttt{mtx}_{ij}=\texttt{mtx}_{ji}\f$ for \f$i > j\f$ if lowerToUpper=false @@ -1698,7 +1698,7 @@ CV_EXPORTS_W void completeSymm(InputOutputArray mtx, bool lowerToUpper = false); /** @brief Initializes a scaled identity matrix. -The function setIdentity initializes a scaled identity matrix: +The function cv::setIdentity initializes a scaled identity matrix: \f[\texttt{mtx} (i,j)= \fork{\texttt{value}}{ if \(i=j\)}{0}{otherwise}\f] The function can also be emulated using the matrix initializers and the @@ -1715,7 +1715,7 @@ CV_EXPORTS_W void setIdentity(InputOutputArray mtx, const Scalar& s = Scalar(1)) /** @brief Returns the determinant of a square floating-point matrix. -The function determinant calculates and returns the determinant of the +The function cv::determinant calculates and returns the determinant of the specified matrix. For small matrices ( mtx.cols=mtx.rows\<=3 ), the direct method is used. For larger matrices, the function uses LU factorization with partial pivoting. @@ -1730,7 +1730,7 @@ CV_EXPORTS_W double determinant(InputArray mtx); /** @brief Returns the trace of a matrix. -The function trace returns the sum of the diagonal elements of the +The function cv::trace returns the sum of the diagonal elements of the matrix mtx . \f[\mathrm{tr} ( \texttt{mtx} ) = \sum _i \texttt{mtx} (i,i)\f] @param mtx input matrix. @@ -1739,7 +1739,7 @@ CV_EXPORTS_W Scalar trace(InputArray mtx); /** @brief Finds the inverse or pseudo-inverse of a matrix. -The function invert inverts the matrix src and stores the result in dst +The function cv::invert inverts the matrix src and stores the result in dst . When the matrix src is singular or non-square, the function calculates the pseudo-inverse matrix (the dst matrix) so that norm(src\*dst - I) is minimal, where I is an identity matrix. @@ -1766,7 +1766,7 @@ CV_EXPORTS_W double invert(InputArray src, OutputArray dst, int flags = DECOMP_L /** @brief Solves one or more linear systems or least-squares problems. -The function solve solves a linear system or least-squares problem (the +The function cv::solve solves a linear system or least-squares problem (the latter is possible with SVD or QR methods, or by specifying the flag DECOMP_NORMAL ): \f[\texttt{dst} = \arg \min _X \| \texttt{src1} \cdot \texttt{X} - \texttt{src2} \|\f] @@ -1791,7 +1791,7 @@ CV_EXPORTS_W bool solve(InputArray src1, InputArray src2, /** @brief Sorts each row or each column of a matrix. -The function sort sorts each matrix row or each matrix column in +The function cv::sort sorts each matrix row or each matrix column in ascending or descending order. So you should pass two operation flags to get desired behaviour. If you want to sort matrix rows or columns lexicographically, you can use STL std::sort generic function with the @@ -1806,7 +1806,7 @@ CV_EXPORTS_W void sort(InputArray src, OutputArray dst, int flags); /** @brief Sorts each row or each column of a matrix. -The function sortIdx sorts each matrix row or each matrix column in the +The function cv::sortIdx sorts each matrix row or each matrix column in the ascending or descending order. So you should pass two operation flags to get desired behaviour. Instead of reordering the elements themselves, it stores the indices of sorted elements in the output array. For example: @@ -1840,7 +1840,7 @@ CV_EXPORTS_W int solveCubic(InputArray coeffs, OutputArray roots); /** @brief Finds the real or complex roots of a polynomial equation. -The function solvePoly finds real and complex roots of a polynomial equation: +The function cv::solvePoly finds real and complex roots of a polynomial equation: \f[\texttt{coeffs} [n] x^{n} + \texttt{coeffs} [n-1] x^{n-1} + ... + \texttt{coeffs} [1] x + \texttt{coeffs} [0] = 0\f] @param coeffs array of polynomial coefficients. @param roots output (complex) array of roots. @@ -1850,7 +1850,7 @@ CV_EXPORTS_W double solvePoly(InputArray coeffs, OutputArray roots, int maxIters /** @brief Calculates eigenvalues and eigenvectors of a symmetric matrix. -The functions eigen calculate just eigenvalues, or eigenvalues and eigenvectors of the symmetric +The function cv::eigen calculates just eigenvalues, or eigenvalues and eigenvectors of the symmetric matrix src: @code src*eigenvectors.row(i).t() = eigenvalues.at(i)*eigenvectors.row(i).t() @@ -1871,7 +1871,7 @@ CV_EXPORTS_W bool eigen(InputArray src, OutputArray eigenvalues, /** @brief Calculates the covariance matrix of a set of vectors. -The functions calcCovarMatrix calculate the covariance matrix and, optionally, the mean vector of +The function cv::calcCovarMatrix calculates the covariance matrix and, optionally, the mean vector of the set of input vectors. @param samples samples stored as separate matrices @param nsamples number of samples @@ -1921,7 +1921,7 @@ CV_EXPORTS_W void SVBackSubst( InputArray w, InputArray u, InputArray vt, /** @brief Calculates the Mahalanobis distance between two vectors. -The function Mahalanobis calculates and returns the weighted distance between two vectors: +The function cv::Mahalanobis calculates and returns the weighted distance between two vectors: \f[d( \texttt{vec1} , \texttt{vec2} )= \sqrt{\sum_{i,j}{\texttt{icovar(i,j)}\cdot(\texttt{vec1}(I)-\texttt{vec2}(I))\cdot(\texttt{vec1(j)}-\texttt{vec2(j)})} }\f] The covariance matrix may be calculated using the cv::calcCovarMatrix function and then inverted using the invert function (preferably using the cv::DECOMP_SVD method, as the most accurate). @@ -1933,7 +1933,7 @@ CV_EXPORTS_W double Mahalanobis(InputArray v1, InputArray v2, InputArray icovar) /** @brief Performs a forward or inverse Discrete Fourier transform of a 1D or 2D floating-point array. -The function performs one of the following: +The function cv::dft performs one of the following: - Forward the Fourier transform of a 1D vector of N elements: \f[Y = F^{(N)} \cdot X,\f] where \f$F^{(N)}_{jk}=\exp(-2\pi i j k/N)\f$ and \f$i=\sqrt{-1}\f$ @@ -2081,7 +2081,7 @@ CV_EXPORTS_W void idft(InputArray src, OutputArray dst, int flags = 0, int nonze /** @brief Performs a forward or inverse discrete Cosine transform of 1D or 2D array. -The function dct performs a forward or inverse discrete Cosine transform (DCT) of a 1D or 2D +The function cv::dct performs a forward or inverse discrete Cosine transform (DCT) of a 1D or 2D floating-point array: - Forward Cosine transform of a 1D vector of N elements: \f[Y = C^{(N)} \cdot X\f] @@ -2132,7 +2132,7 @@ CV_EXPORTS_W void idct(InputArray src, OutputArray dst, int flags = 0); /** @brief Performs the per-element multiplication of two Fourier spectrums. -The function mulSpectrums performs the per-element multiplication of the two CCS-packed or complex +The function cv::mulSpectrums performs the per-element multiplication of the two CCS-packed or complex matrices that are results of a real or complex Fourier transform. The function, together with dft and idft , may be used to calculate convolution (pass conjB=false ) @@ -2159,7 +2159,7 @@ original one. Arrays whose size is a power-of-two (2, 4, 8, 16, 32, ...) are the Though, the arrays whose size is a product of 2's, 3's, and 5's (for example, 300 = 5\*5\*3\*2\*2) are also processed quite efficiently. -The function getOptimalDFTSize returns the minimum number N that is greater than or equal to vecsize +The function cv::getOptimalDFTSize returns the minimum number N that is greater than or equal to vecsize so that the DFT of a vector of size N can be processed efficiently. In the current implementation N = 2 ^p^ \* 3 ^q^ \* 5 ^r^ for some integer p, q, r. @@ -2175,7 +2175,7 @@ CV_EXPORTS_W int getOptimalDFTSize(int vecsize); /** @brief Returns the default random number generator. -The function theRNG returns the default random number generator. For each thread, there is a +The function cv::theRNG returns the default random number generator. For each thread, there is a separate random number generator, so you can use the function safely in multi-thread environments. If you just need to get a single random number using this generator or initialize an array, you can use randu or randn instead. But if you are going to generate many random numbers inside a loop, it @@ -2186,7 +2186,7 @@ CV_EXPORTS RNG& theRNG(); /** @brief Sets state of default random number generator. -The function sets state of default random number generator to custom value. +The function cv::setRNGSeed sets state of default random number generator to custom value. @param seed new state for default random number generator @sa RNG, randu, randn */ @@ -2206,7 +2206,7 @@ CV_EXPORTS_W void randu(InputOutputArray dst, InputArray low, InputArray high); /** @brief Fills the array with normally distributed random numbers. -The function randn fills the matrix dst with normally distributed random numbers with the specified +The function cv::randn fills the matrix dst with normally distributed random numbers with the specified mean vector and the standard deviation matrix. The generated random numbers are clipped to fit the value range of the output array data type. @param dst output array of random numbers; the array must be pre-allocated and have 1 to 4 channels. @@ -2219,7 +2219,7 @@ CV_EXPORTS_W void randn(InputOutputArray dst, InputArray mean, InputArray stddev /** @brief Shuffles the array elements randomly. -The function randShuffle shuffles the specified 1D array by randomly choosing pairs of elements and +The function cv::randShuffle shuffles the specified 1D array by randomly choosing pairs of elements and swapping them. The number of such swap operations will be dst.rows\*dst.cols\*iterFactor . @param dst input/output numerical 1D array. @param iterFactor scale factor that determines the number of random swap operations (see the details diff --git a/modules/core/include/opencv2/core/base.hpp b/modules/core/include/opencv2/core/base.hpp index ed633f5dcc..0432ccb842 100644 --- a/modules/core/include/opencv2/core/base.hpp +++ b/modules/core/include/opencv2/core/base.hpp @@ -49,6 +49,8 @@ # error base.hpp header must be compiled as C++ #endif +#include "opencv2/opencv_modules.hpp" + #include #include diff --git a/modules/core/include/opencv2/core/core_c.h b/modules/core/include/opencv2/core/core_c.h index a0ed632642..f7e0bbb750 100644 --- a/modules/core/include/opencv2/core/core_c.h +++ b/modules/core/include/opencv2/core/core_c.h @@ -1976,8 +1976,16 @@ CVAPI(void) cvSetIPLAllocators( Cv_iplCreateImageHeader create_header, The function opens file storage for reading or writing data. In the latter case, a new file is created or an existing file is rewritten. The type of the read or written file is determined by the -filename extension: .xml for XML and .yml or .yaml for YAML. The function returns a pointer to the -CvFileStorage structure. If the file cannot be opened then the function returns NULL. +filename extension: .xml for XML, .yml or .yaml for YAML and .json for JSON. + +At the same time, it also supports adding parameters like "example.xml?base64". The three ways +are the same: +@snippet samples/cpp/filestorage_base64.cpp suffix_in_file_name +@snippet samples/cpp/filestorage_base64.cpp flag_write_base64 +@snippet samples/cpp/filestorage_base64.cpp flag_write_and_flag_base64 + +The function returns a pointer to the CvFileStorage structure. +If the file cannot be opened then the function returns NULL. @param filename Name of the file associated with the storage @param memstorage Memory storage used for temporary data and for : storing dynamic structures, such as CvSeq or CvGraph . If it is NULL, a temporary memory @@ -1985,6 +1993,7 @@ CvFileStorage structure. If the file cannot be opened then the function returns @param flags Can be one of the following: > - **CV_STORAGE_READ** the storage is open for reading > - **CV_STORAGE_WRITE** the storage is open for writing + (use **CV_STORAGE_WRITE | CV_STORAGE_WRITE_BASE64** to write rawdata in Base64) @param encoding */ CVAPI(CvFileStorage*) cvOpenFileStorage( const char* filename, CvMemStorage* memstorage, @@ -2022,7 +2031,8 @@ One and only one of the two above flags must be specified @param type_name Optional parameter - the object type name. In case of XML it is written as a type_id attribute of the structure opening tag. In the case of YAML it is written after a colon following the structure name (see the example in - CvFileStorage description). Mainly it is used with user objects. When the storage is read, the + CvFileStorage description). In case of JSON it is written as a name/value pair. + Mainly it is used with user objects. When the storage is read, the encoded type name is used to determine the object type (see CvTypeInfo and cvFindType ). @param attributes This parameter is not used in the current implementation */ @@ -2162,7 +2172,7 @@ the file with multiple streams looks like this: @endcode The YAML file will look like this: @code{.yaml} - %YAML:1.0 + %YAML 1.0 # stream #1 data ... --- @@ -2187,6 +2197,28 @@ to a sequence rather than a map. CVAPI(void) cvWriteRawData( CvFileStorage* fs, const void* src, int len, const char* dt ); +/** @brief Writes multiple numbers in Base64. + +If either CV_STORAGE_WRITE_BASE64 or cv::FileStorage::WRITE_BASE64 is used, +this function will be the same as cvWriteRawData. If neither, the main +difference is that it outputs a sequence in Base64 encoding rather than +in plain text. + +This function can only be used to write a sequence with a type "binary". + +Consider the following two examples where their output is the same: +@snippet samples/cpp/filestorage_base64.cpp without_base64_flag +and +@snippet samples/cpp/filestorage_base64.cpp with_write_base64_flag + +@param fs File storage +@param src Pointer to the written array +@param len Number of the array elements to write +@param dt Specification of each array element, see @ref format_spec "format specification" +*/ +CVAPI(void) cvWriteRawDataBase64( CvFileStorage* fs, const void* src, + int len, const char* dt ); + /** @brief Returns a unique pointer for a given name. The function returns a unique pointer for each particular file node name. This pointer can be then @@ -2468,7 +2500,7 @@ CVAPI(void) cvReadRawData( const CvFileStorage* fs, const CvFileNode* src, /** @brief Writes a file node to another file storage. The function writes a copy of a file node to file storage. Possible applications of the function are -merging several file storages into one and conversion between XML and YAML formats. +merging several file storages into one and conversion between XML, YAML and JSON formats. @param fs Destination file storage @param new_node_name New name of the file node in the destination file storage. To keep the existing name, use cvcvGetFileNodeName diff --git a/modules/core/include/opencv2/core/cuda.hpp b/modules/core/include/opencv2/core/cuda.hpp index 0f7bf01c73..295f3de85e 100644 --- a/modules/core/include/opencv2/core/cuda.hpp +++ b/modules/core/include/opencv2/core/cuda.hpp @@ -855,7 +855,14 @@ private: CV_EXPORTS void printCudaDeviceInfo(int device); CV_EXPORTS void printShortCudaDeviceInfo(int device); -CV_EXPORTS void convertFp16Cuda(InputArray _src, OutputArray _dst, Stream& stream = Stream::Null()); +/** @brief Converts an array to half precision floating number. + +@param _src input array. +@param _dst output array. +@param stream Stream for the asynchronous version. +@sa convertFp16 +*/ +CV_EXPORTS void convertFp16(InputArray _src, OutputArray _dst, Stream& stream = Stream::Null()); //! @} cudacore_init diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h index e3ad5cf902..87fe88594e 100644 --- a/modules/core/include/opencv2/core/cvdef.h +++ b/modules/core/include/opencv2/core/cvdef.h @@ -307,11 +307,32 @@ enum CpuFeatures { #define CV_2PI 6.283185307179586476925286766559 #define CV_LOG2 0.69314718055994530941723212145818 +typedef union Cv16suf +{ + short i; +#if ( defined (__arm__) || defined (__aarch64__) ) && !defined (__CUDACC__) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC_MINOR__ ) ) || ( 5 <= __GNUC__ ) ) ) + __fp16 h; +#endif + struct _fp16Format + { + unsigned int significand : 10; + unsigned int exponent : 5; + unsigned int sign : 1; + } fmt; +} +Cv16suf; + typedef union Cv32suf { int i; unsigned u; float f; + struct _fp32Format + { + unsigned int significand : 23; + unsigned int exponent : 8; + unsigned int sign : 1; + } fmt; } Cv32suf; diff --git a/modules/core/include/opencv2/core/fast_math.hpp b/modules/core/include/opencv2/core/fast_math.hpp index b8b241b026..0a0e02831e 100644 --- a/modules/core/include/opencv2/core/fast_math.hpp +++ b/modules/core/include/opencv2/core/fast_math.hpp @@ -71,6 +71,7 @@ #define ARM_ROUND(_value, _asm_string) \ int res; \ float temp; \ + (void)temp; \ asm(_asm_string : [res] "=r" (res), [temp] "=w" (temp) : [value] "w" (_value)); \ return res // 2. version for double diff --git a/modules/core/include/opencv2/core/hal/hal.hpp b/modules/core/include/opencv2/core/hal/hal.hpp index f254b58582..63d766585b 100644 --- a/modules/core/include/opencv2/core/hal/hal.hpp +++ b/modules/core/include/opencv2/core/hal/hal.hpp @@ -66,6 +66,8 @@ CV_EXPORTS bool Cholesky32f(float* A, size_t astep, int m, float* b, size_t bste CV_EXPORTS bool Cholesky64f(double* A, size_t astep, int m, double* b, size_t bstep, int n); CV_EXPORTS void SVD32f(float* At, size_t astep, float* W, float* U, size_t ustep, float* Vt, size_t vstep, int m, int n, int flags); CV_EXPORTS void SVD64f(double* At, size_t astep, double* W, double* U, size_t ustep, double* Vt, size_t vstep, int m, int n, int flags); +CV_EXPORTS int QR32f(float* A, size_t astep, int m, int n, int k, float* b, size_t bstep, float* hFactors); +CV_EXPORTS int QR64f(double* A, size_t astep, int m, int n, int k, double* b, size_t bstep, double* hFactors); CV_EXPORTS void gemm32f(const float* src1, size_t src1_step, const float* src2, size_t src2_step, float alpha, const float* src3, size_t src3_step, float beta, float* dst, size_t dst_step, diff --git a/modules/core/include/opencv2/core/hal/intrin_cpp.hpp b/modules/core/include/opencv2/core/hal/intrin_cpp.hpp index 04b1d928b2..97ea5ea0b6 100644 --- a/modules/core/include/opencv2/core/hal/intrin_cpp.hpp +++ b/modules/core/include/opencv2/core/hal/intrin_cpp.hpp @@ -103,7 +103,7 @@ block and to save contents of the register to memory block. These operations allow to reorder or recombine elements in one or multiple vectors. -- Interleave, deinterleave (3 and 4 channels): @ref v_load_deinterleave, @ref v_store_interleave +- Interleave, deinterleave (2, 3 and 4 channels): @ref v_load_deinterleave, @ref v_store_interleave - Expand: @ref v_load_expand, @ref v_load_expand_q, @ref v_expand - Pack: @ref v_pack, @ref v_pack_u, @ref v_rshr_pack, @ref v_rshr_pack_u, @ref v_pack_store, @ref v_pack_u_store, @ref v_rshr_pack_store, @ref v_rshr_pack_u_store @@ -1075,12 +1075,31 @@ v_load_expand_q(const _Tp* ptr) return c; } -/** @brief Load and deinterleave (4 channels) +/** @brief Load and deinterleave (2 channels) -Load data from memory deinterleave and store to 4 registers. +Load data from memory deinterleave and store to 2 registers. Scheme: @code -{A1 B1 C1 D1 A2 B2 C2 D2 ...} ==> {A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...}, {D1 D2 ...} +{A1 B1 A2 B2 ...} ==> {A1 A2 ...}, {B1 B2 ...} +@endcode +For all types except 64-bit. */ +template inline void v_load_deinterleave(const _Tp* ptr, v_reg<_Tp, n>& a, + v_reg<_Tp, n>& b) +{ + int i, i2; + for( i = i2 = 0; i < n; i++, i2 += 2 ) + { + a.s[i] = ptr[i2]; + b.s[i] = ptr[i2+1]; + } +} + +/** @brief Load and deinterleave (3 channels) + +Load data from memory deinterleave and store to 3 registers. +Scheme: +@code +{A1 B1 C1 A2 B2 C2 ...} ==> {A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...} @endcode For all types except 64-bit. */ template inline void v_load_deinterleave(const _Tp* ptr, v_reg<_Tp, n>& a, @@ -1095,12 +1114,12 @@ template inline void v_load_deinterleave(const _Tp* ptr, v_ } } -/** @brief Load and deinterleave (3 channels) +/** @brief Load and deinterleave (4 channels) -Load data from memory deinterleave and store to 3 registers. +Load data from memory deinterleave and store to 4 registers. Scheme: @code -{A1 B1 C1 A2 B2 C2 ...} ==> {A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...} +{A1 B1 C1 D1 A2 B2 C2 D2 ...} ==> {A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...}, {D1 D2 ...} @endcode For all types except 64-bit. */ template @@ -1118,12 +1137,32 @@ inline void v_load_deinterleave(const _Tp* ptr, v_reg<_Tp, n>& a, } } +/** @brief Interleave and store (2 channels) + +Interleave and store data from 2 registers to memory. +Scheme: +@code +{A1 A2 ...}, {B1 B2 ...} ==> {A1 B1 A2 B2 ...} +@endcode +For all types except 64-bit. */ +template +inline void v_store_interleave( _Tp* ptr, const v_reg<_Tp, n>& a, + const v_reg<_Tp, n>& b) +{ + int i, i2; + for( i = i2 = 0; i < n; i++, i2 += 2 ) + { + ptr[i2] = a.s[i]; + ptr[i2+1] = b.s[i]; + } +} + /** @brief Interleave and store (3 channels) Interleave and store data from 3 registers to memory. Scheme: @code -{A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...}, {D1 D2 ...} ==> {A1 B1 C1 D1 A2 B2 C2 D2 ...} +{A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...} ==> {A1 B1 C1 A2 B2 C2 ...} @endcode For all types except 64-bit. */ template diff --git a/modules/core/include/opencv2/core/hal/intrin_neon.hpp b/modules/core/include/opencv2/core/hal/intrin_neon.hpp index f3e47ca8ba..dd5e2e91db 100644 --- a/modules/core/include/opencv2/core/hal/intrin_neon.hpp +++ b/modules/core/include/opencv2/core/hal/intrin_neon.hpp @@ -53,6 +53,28 @@ namespace cv //! @cond IGNORED #define CV_SIMD128 1 +#if defined(__aarch64__) +#define CV_SIMD128_64F 1 +#else +#define CV_SIMD128_64F 0 +#endif + +#if CV_SIMD128_64F +#define OPENCV_HAL_IMPL_NEON_REINTERPRET(_Tpv, suffix) \ +template static inline \ +_Tpv vreinterpretq_##suffix##_f64(T a) { return (_Tpv) a; } \ +template static inline \ +float64x2_t vreinterpretq_f64_##suffix(T a) { return (float64x2_t) a; } +OPENCV_HAL_IMPL_NEON_REINTERPRET(uint8x16_t, u8) +OPENCV_HAL_IMPL_NEON_REINTERPRET(int8x16_t, s8) +OPENCV_HAL_IMPL_NEON_REINTERPRET(uint16x8_t, u16) +OPENCV_HAL_IMPL_NEON_REINTERPRET(int16x8_t, s16) +OPENCV_HAL_IMPL_NEON_REINTERPRET(uint32x4_t, u32) +OPENCV_HAL_IMPL_NEON_REINTERPRET(int32x4_t, s32) +OPENCV_HAL_IMPL_NEON_REINTERPRET(uint64x2_t, u64) +OPENCV_HAL_IMPL_NEON_REINTERPRET(int64x2_t, s64) +OPENCV_HAL_IMPL_NEON_REINTERPRET(float32x4_t, f32) +#endif struct v_uint8x16 { @@ -232,6 +254,60 @@ struct v_int64x2 int64x2_t val; }; +#if CV_SIMD128_64F +struct v_float64x2 +{ + typedef double lane_type; + enum { nlanes = 2 }; + + v_float64x2() {} + explicit v_float64x2(float64x2_t v) : val(v) {} + v_float64x2(double v0, double v1) + { + double v[] = {v0, v1}; + val = vld1q_f64(v); + } + double get0() const + { + return vgetq_lane_f64(val, 0); + } + float64x2_t val; +}; +#endif + +#if defined (HAVE_FP16) +// Workaround for old comiplers +template static inline int16x4_t vreinterpret_s16_f16(T a) +{ return (int16x4_t)a; } +template static inline float16x4_t vreinterpret_f16_s16(T a) +{ return (float16x4_t)a; } +template static inline float16x4_t vld1_f16(const T* ptr) +{ return vreinterpret_f16_s16(vld1_s16((const short*)ptr)); } +template static inline void vst1_f16(T* ptr, float16x4_t a) +{ vst1_s16((short*)ptr, vreinterpret_s16_f16(a)); } +static inline short vget_lane_f16(float16x4_t a, int b) +{ return vget_lane_s16(vreinterpret_s16_f16(a), b); } + +struct v_float16x4 +{ + typedef short lane_type; + enum { nlanes = 4 }; + + v_float16x4() {} + explicit v_float16x4(float16x4_t v) : val(v) {} + v_float16x4(short v0, short v1, short v2, short v3) + { + short v[] = {v0, v1, v2, v3}; + val = vld1_f16(v); + } + short get0() const + { + return vget_lane_f16(val, 0); + } + float16x4_t val; +}; +#endif + #define OPENCV_HAL_IMPL_NEON_INIT(_Tpv, _Tp, suffix) \ inline v_##_Tpv v_setzero_##suffix() { return v_##_Tpv(vdupq_n_##suffix((_Tp)0)); } \ inline v_##_Tpv v_setall_##suffix(_Tp v) { return v_##_Tpv(vdupq_n_##suffix(v)); } \ @@ -255,6 +331,21 @@ OPENCV_HAL_IMPL_NEON_INIT(int32x4, int, s32) OPENCV_HAL_IMPL_NEON_INIT(uint64x2, uint64, u64) OPENCV_HAL_IMPL_NEON_INIT(int64x2, int64, s64) OPENCV_HAL_IMPL_NEON_INIT(float32x4, float, f32) +#if CV_SIMD128_64F +#define OPENCV_HAL_IMPL_NEON_INIT_64(_Tpv, suffix) \ +inline v_float64x2 v_reinterpret_as_f64(const v_##_Tpv& v) { return v_float64x2(vreinterpretq_f64_##suffix(v.val)); } +OPENCV_HAL_IMPL_NEON_INIT(float64x2, double, f64) +OPENCV_HAL_IMPL_NEON_INIT_64(uint8x16, u8) +OPENCV_HAL_IMPL_NEON_INIT_64(int8x16, s8) +OPENCV_HAL_IMPL_NEON_INIT_64(uint16x8, u16) +OPENCV_HAL_IMPL_NEON_INIT_64(int16x8, s16) +OPENCV_HAL_IMPL_NEON_INIT_64(uint32x4, u32) +OPENCV_HAL_IMPL_NEON_INIT_64(int32x4, s32) +OPENCV_HAL_IMPL_NEON_INIT_64(uint64x2, u64) +OPENCV_HAL_IMPL_NEON_INIT_64(int64x2, s64) +OPENCV_HAL_IMPL_NEON_INIT_64(float32x4, f32) +OPENCV_HAL_IMPL_NEON_INIT_64(float64x2, f64) +#endif #define OPENCV_HAL_IMPL_NEON_PACK(_Tpvec, _Tp, hreg, suffix, _Tpwvec, wsuffix, pack, op) \ inline _Tpvec v_##pack(const _Tpwvec& a, const _Tpwvec& b) \ @@ -337,7 +428,13 @@ OPENCV_HAL_IMPL_NEON_BIN_OP(+, v_int64x2, vaddq_s64) OPENCV_HAL_IMPL_NEON_BIN_OP(-, v_int64x2, vsubq_s64) OPENCV_HAL_IMPL_NEON_BIN_OP(+, v_uint64x2, vaddq_u64) OPENCV_HAL_IMPL_NEON_BIN_OP(-, v_uint64x2, vsubq_u64) - +#if CV_SIMD128_64F +OPENCV_HAL_IMPL_NEON_BIN_OP(/, v_float32x4, vdivq_f32) +OPENCV_HAL_IMPL_NEON_BIN_OP(+, v_float64x2, vaddq_f64) +OPENCV_HAL_IMPL_NEON_BIN_OP(-, v_float64x2, vsubq_f64) +OPENCV_HAL_IMPL_NEON_BIN_OP(*, v_float64x2, vmulq_f64) +OPENCV_HAL_IMPL_NEON_BIN_OP(/, v_float64x2, vdivq_f64) +#else inline v_float32x4 operator / (const v_float32x4& a, const v_float32x4& b) { float32x4_t reciprocal = vrecpeq_f32(b.val); @@ -353,6 +450,7 @@ inline v_float32x4& operator /= (v_float32x4& a, const v_float32x4& b) a.val = vmulq_f32(a.val, reciprocal); return a; } +#endif inline void v_mul_expand(const v_int16x8& a, const v_int16x8& b, v_int32x4& c, v_int32x4& d) @@ -421,6 +519,18 @@ inline v_float32x4 operator ~ (const v_float32x4& a) return v_float32x4(vreinterpretq_f32_s32(vmvnq_s32(vreinterpretq_s32_f32(a.val)))); } +#if CV_SIMD128_64F +inline v_float32x4 v_sqrt(const v_float32x4& x) +{ + return v_float32x4(vsqrtq_f32(x.val)); +} + +inline v_float32x4 v_invsqrt(const v_float32x4& x) +{ + v_float32x4 one = v_setall_f32(1.0f); + return one / v_sqrt(x); +} +#else inline v_float32x4 v_sqrt(const v_float32x4& x) { float32x4_t x1 = vmaxq_f32(x.val, vdupq_n_f32(FLT_MIN)); @@ -437,10 +547,47 @@ inline v_float32x4 v_invsqrt(const v_float32x4& x) e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(x.val, e), e), e); return v_float32x4(e); } +#endif inline v_float32x4 v_abs(v_float32x4 x) { return v_float32x4(vabsq_f32(x.val)); } +#if CV_SIMD128_64F +#define OPENCV_HAL_IMPL_NEON_DBL_BIT_OP(bin_op, intrin) \ +inline v_float64x2 operator bin_op (const v_float64x2& a, const v_float64x2& b) \ +{ \ + return v_float64x2(vreinterpretq_f64_s64(intrin(vreinterpretq_s64_f64(a.val), vreinterpretq_s64_f64(b.val)))); \ +} \ +inline v_float64x2& operator bin_op##= (v_float64x2& a, const v_float64x2& b) \ +{ \ + a.val = vreinterpretq_f64_s64(intrin(vreinterpretq_s64_f64(a.val), vreinterpretq_s64_f64(b.val))); \ + return a; \ +} + +OPENCV_HAL_IMPL_NEON_DBL_BIT_OP(&, vandq_s64) +OPENCV_HAL_IMPL_NEON_DBL_BIT_OP(|, vorrq_s64) +OPENCV_HAL_IMPL_NEON_DBL_BIT_OP(^, veorq_s64) + +inline v_float64x2 operator ~ (const v_float64x2& a) +{ + return v_float64x2(vreinterpretq_f64_s32(vmvnq_s32(vreinterpretq_s32_f64(a.val)))); +} + +inline v_float64x2 v_sqrt(const v_float64x2& x) +{ + return v_float64x2(vsqrtq_f64(x.val)); +} + +inline v_float64x2 v_invsqrt(const v_float64x2& x) +{ + v_float64x2 one = v_setall_f64(1.0f); + return one / v_sqrt(x); +} + +inline v_float64x2 v_abs(v_float64x2 x) +{ return v_float64x2(vabsq_f64(x.val)); } +#endif + // TODO: exp, log, sin, cos #define OPENCV_HAL_IMPL_NEON_BIN_FUNC(_Tpvec, func, intrin) \ @@ -463,8 +610,23 @@ OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int32x4, v_min, vminq_s32) OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int32x4, v_max, vmaxq_s32) OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_float32x4, v_min, vminq_f32) OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_float32x4, v_max, vmaxq_f32) +#if CV_SIMD128_64F +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_float64x2, v_min, vminq_f64) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_float64x2, v_max, vmaxq_f64) +#endif - +#if CV_SIMD128_64F +inline int64x2_t vmvnq_s64(int64x2_t a) +{ + int64x2_t vx = vreinterpretq_s64_u32(vdupq_n_u32(0xFFFFFFFF)); + return veorq_s64(a, vx); +} +inline uint64x2_t vmvnq_u64(uint64x2_t a) +{ + uint64x2_t vx = vreinterpretq_u64_u32(vdupq_n_u32(0xFFFFFFFF)); + return veorq_u64(a, vx); +} +#endif #define OPENCV_HAL_IMPL_NEON_INT_CMP_OP(_Tpvec, cast, suffix, not_suffix) \ inline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \ { return _Tpvec(cast(vceqq_##suffix(a.val, b.val))); } \ @@ -486,6 +648,11 @@ OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_int16x8, vreinterpretq_s16_u16, s16, u16) OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_uint32x4, OPENCV_HAL_NOP, u32, u32) OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_int32x4, vreinterpretq_s32_u32, s32, u32) OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_float32x4, vreinterpretq_f32_u32, f32, u32) +#if CV_SIMD128_64F +OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_uint64x2, OPENCV_HAL_NOP, u64, u64) +OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_int64x2, vreinterpretq_s64_u64, s64, u64) +OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_float64x2, vreinterpretq_f64_u64, f64, u64) +#endif OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint8x16, v_add_wrap, vaddq_u8) OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int8x16, v_add_wrap, vaddq_s8) @@ -501,6 +668,9 @@ OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint8x16, v_absdiff, vabdq_u8) OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint16x8, v_absdiff, vabdq_u16) OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint32x4, v_absdiff, vabdq_u32) OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_float32x4, v_absdiff, vabdq_f32) +#if CV_SIMD128_64F +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_float64x2, v_absdiff, vabdq_f64) +#endif #define OPENCV_HAL_IMPL_NEON_BIN_FUNC2(_Tpvec, _Tpvec2, cast, func, intrin) \ inline _Tpvec2 func(const _Tpvec& a, const _Tpvec& b) \ @@ -528,6 +698,24 @@ inline v_float32x4 v_muladd(const v_float32x4& a, const v_float32x4& b, const v_ return v_float32x4(vmlaq_f32(c.val, a.val, b.val)); } +#if CV_SIMD128_64F +inline v_float64x2 v_magnitude(const v_float64x2& a, const v_float64x2& b) +{ + v_float64x2 x(vaddq_f64(vmulq_f64(a.val, a.val), vmulq_f64(b.val, b.val))); + return v_sqrt(x); +} + +inline v_float64x2 v_sqr_magnitude(const v_float64x2& a, const v_float64x2& b) +{ + return v_float64x2(vaddq_f64(vmulq_f64(a.val, a.val), vmulq_f64(b.val, b.val))); +} + +inline v_float64x2 v_muladd(const v_float64x2& a, const v_float64x2& b, const v_float64x2& c) +{ + return v_float64x2(vaddq_f64(c.val, vmulq_f64(a.val, b.val))); +} +#endif + // trade efficiency for convenience #define OPENCV_HAL_IMPL_NEON_SHIFT_OP(_Tpvec, suffix, _Tps, ssuffix) \ inline _Tpvec operator << (const _Tpvec& a, int n) \ @@ -575,6 +763,17 @@ OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_int32x4, int, s32) OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_uint64x2, uint64, u64) OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_int64x2, int64, s64) OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_float32x4, float, f32) +#if CV_SIMD128_64F +OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_float64x2, double, f64) +#endif + +#if defined (HAVE_FP16) +// Workaround for old comiplers +inline v_float16x4 v_load_f16(const short* ptr) +{ return v_float16x4(vld1_f16(ptr)); } +inline void v_store_f16(short* ptr, v_float16x4& a) +{ vst1_f16(ptr, a.val); } +#endif #define OPENCV_HAL_IMPL_NEON_REDUCE_OP_4(_Tpvec, scalartype, func, scalar_func) \ inline scalartype v_reduce_##func(const _Tpvec& a) \ @@ -627,6 +826,16 @@ inline int v_signmask(const v_int32x4& a) { return v_signmask(v_reinterpret_as_u32(a)); } inline int v_signmask(const v_float32x4& a) { return v_signmask(v_reinterpret_as_u32(a)); } +#if CV_SIMD128_64F +inline int v_signmask(const v_uint64x2& a) +{ + int64x1_t m0 = vdup_n_s64(0); + uint64x2_t v0 = vshlq_u64(vshrq_n_u64(a.val, 63), vcombine_s64(m0, m0)); + return (int)vgetq_lane_u64(v0, 0) + ((int)vgetq_lane_u64(v0, 1) << 1); +} +inline int v_signmask(const v_float64x2& a) +{ return v_signmask(v_reinterpret_as_u64(a)); } +#endif #define OPENCV_HAL_IMPL_NEON_CHECK_ALLANY(_Tpvec, suffix, shift) \ inline bool v_check_all(const v_##_Tpvec& a) \ @@ -645,6 +854,9 @@ inline bool v_check_any(const v_##_Tpvec& a) \ OPENCV_HAL_IMPL_NEON_CHECK_ALLANY(uint8x16, u8, 7) OPENCV_HAL_IMPL_NEON_CHECK_ALLANY(uint16x8, u16, 15) OPENCV_HAL_IMPL_NEON_CHECK_ALLANY(uint32x4, u32, 31) +#if CV_SIMD128_64F +OPENCV_HAL_IMPL_NEON_CHECK_ALLANY(uint64x2, u64, 63) +#endif inline bool v_check_all(const v_int8x16& a) { return v_check_all(v_reinterpret_as_u8(a)); } @@ -664,6 +876,17 @@ inline bool v_check_any(const v_int32x4& a) inline bool v_check_any(const v_float32x4& a) { return v_check_any(v_reinterpret_as_u32(a)); } +#if CV_SIMD128_64F +inline bool v_check_all(const v_int64x2& a) +{ return v_check_all(v_reinterpret_as_u64(a)); } +inline bool v_check_all(const v_float64x2& a) +{ return v_check_all(v_reinterpret_as_u64(a)); } +inline bool v_check_any(const v_int64x2& a) +{ return v_check_any(v_reinterpret_as_u64(a)); } +inline bool v_check_any(const v_float64x2& a) +{ return v_check_any(v_reinterpret_as_u64(a)); } +#endif + #define OPENCV_HAL_IMPL_NEON_SELECT(_Tpvec, suffix, usuffix) \ inline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \ { \ @@ -677,6 +900,9 @@ OPENCV_HAL_IMPL_NEON_SELECT(v_int16x8, s16, u16) OPENCV_HAL_IMPL_NEON_SELECT(v_uint32x4, u32, u32) OPENCV_HAL_IMPL_NEON_SELECT(v_int32x4, s32, u32) OPENCV_HAL_IMPL_NEON_SELECT(v_float32x4, f32, u32) +#if CV_SIMD128_64F +OPENCV_HAL_IMPL_NEON_SELECT(v_float64x2, f64, u64) +#endif #define OPENCV_HAL_IMPL_NEON_EXPAND(_Tpvec, _Tpwvec, _Tp, suffix) \ inline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1) \ @@ -710,6 +936,27 @@ inline v_int32x4 v_load_expand_q(const schar* ptr) return v_int32x4(vmovl_s16(v1)); } +#if defined(__aarch64__) +#define OPENCV_HAL_IMPL_NEON_UNPACKS(_Tpvec, suffix) \ +inline void v_zip(const v_##_Tpvec& a0, const v_##_Tpvec& a1, v_##_Tpvec& b0, v_##_Tpvec& b1) \ +{ \ + b0.val = vzip1q_##suffix(a0.val, a1.val); \ + b1.val = vzip2q_##suffix(a0.val, a1.val); \ +} \ +inline v_##_Tpvec v_combine_low(const v_##_Tpvec& a, const v_##_Tpvec& b) \ +{ \ + return v_##_Tpvec(vcombine_##suffix(vget_low_##suffix(a.val), vget_low_##suffix(b.val))); \ +} \ +inline v_##_Tpvec v_combine_high(const v_##_Tpvec& a, const v_##_Tpvec& b) \ +{ \ + return v_##_Tpvec(vcombine_##suffix(vget_high_##suffix(a.val), vget_high_##suffix(b.val))); \ +} \ +inline void v_recombine(const v_##_Tpvec& a, const v_##_Tpvec& b, v_##_Tpvec& c, v_##_Tpvec& d) \ +{ \ + c.val = vcombine_##suffix(vget_low_##suffix(a.val), vget_low_##suffix(b.val)); \ + d.val = vcombine_##suffix(vget_high_##suffix(a.val), vget_high_##suffix(b.val)); \ +} +#else #define OPENCV_HAL_IMPL_NEON_UNPACKS(_Tpvec, suffix) \ inline void v_zip(const v_##_Tpvec& a0, const v_##_Tpvec& a1, v_##_Tpvec& b0, v_##_Tpvec& b1) \ { \ @@ -730,6 +977,7 @@ inline void v_recombine(const v_##_Tpvec& a, const v_##_Tpvec& b, v_##_Tpvec& c, c.val = vcombine_##suffix(vget_low_##suffix(a.val), vget_low_##suffix(b.val)); \ d.val = vcombine_##suffix(vget_high_##suffix(a.val), vget_high_##suffix(b.val)); \ } +#endif OPENCV_HAL_IMPL_NEON_UNPACKS(uint8x16, u8) OPENCV_HAL_IMPL_NEON_UNPACKS(int8x16, s8) @@ -738,6 +986,9 @@ OPENCV_HAL_IMPL_NEON_UNPACKS(int16x8, s16) OPENCV_HAL_IMPL_NEON_UNPACKS(uint32x4, u32) OPENCV_HAL_IMPL_NEON_UNPACKS(int32x4, s32) OPENCV_HAL_IMPL_NEON_UNPACKS(float32x4, f32) +#if CV_SIMD128_64F +OPENCV_HAL_IMPL_NEON_UNPACKS(float64x2, f64) +#endif #define OPENCV_HAL_IMPL_NEON_EXTRACT(_Tpvec, suffix) \ template \ @@ -755,6 +1006,9 @@ OPENCV_HAL_IMPL_NEON_EXTRACT(int32x4, s32) OPENCV_HAL_IMPL_NEON_EXTRACT(uint64x2, u64) OPENCV_HAL_IMPL_NEON_EXTRACT(int64x2, s64) OPENCV_HAL_IMPL_NEON_EXTRACT(float32x4, f32) +#if CV_SIMD128_64F +OPENCV_HAL_IMPL_NEON_EXTRACT(float64x2, f64) +#endif inline v_int32x4 v_round(const v_float32x4& a) { @@ -782,6 +1036,38 @@ inline v_int32x4 v_ceil(const v_float32x4& a) inline v_int32x4 v_trunc(const v_float32x4& a) { return v_int32x4(vcvtq_s32_f32(a.val)); } +#if CV_SIMD128_64F +inline v_int32x4 v_round(const v_float64x2& a) +{ + static const int32x2_t zero = vdup_n_s32(0); + return v_int32x4(vcombine_s32(vmovn_s64(vcvtaq_s64_f64(a.val)), zero)); +} + +inline v_int32x4 v_floor(const v_float64x2& a) +{ + static const int32x2_t zero = vdup_n_s32(0); + int64x2_t a1 = vcvtq_s64_f64(a.val); + uint64x2_t mask = vcgtq_f64(vcvtq_f64_s64(a1), a.val); + a1 = vaddq_s64(a1, vreinterpretq_s64_u64(mask)); + return v_int32x4(vcombine_s32(vmovn_s64(a1), zero)); +} + +inline v_int32x4 v_ceil(const v_float64x2& a) +{ + static const int32x2_t zero = vdup_n_s32(0); + int64x2_t a1 = vcvtq_s64_f64(a.val); + uint64x2_t mask = vcgtq_f64(a.val, vcvtq_f64_s64(a1)); + a1 = vsubq_s64(a1, vreinterpretq_s64_u64(mask)); + return v_int32x4(vcombine_s32(vmovn_s64(a1), zero)); +} + +inline v_int32x4 v_trunc(const v_float64x2& a) +{ + static const int32x2_t zero = vdup_n_s32(0); + return v_int32x4(vcombine_s32(vmovn_s64(vcvtaq_s64_f64(a.val)), zero)); +} +#endif + #define OPENCV_HAL_IMPL_NEON_TRANSPOSE4x4(_Tpvec, suffix) \ inline void v_transpose4x4(const v_##_Tpvec& a0, const v_##_Tpvec& a1, \ const v_##_Tpvec& a2, const v_##_Tpvec& a3, \ @@ -809,6 +1095,12 @@ OPENCV_HAL_IMPL_NEON_TRANSPOSE4x4(int32x4, s32) OPENCV_HAL_IMPL_NEON_TRANSPOSE4x4(float32x4, f32) #define OPENCV_HAL_IMPL_NEON_INTERLEAVED(_Tpvec, _Tp, suffix) \ +inline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b) \ +{ \ + _Tpvec##x2_t v = vld2q_##suffix(ptr); \ + a.val = v.val[0]; \ + b.val = v.val[1]; \ +} \ inline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b, v_##_Tpvec& c) \ { \ _Tpvec##x3_t v = vld3q_##suffix(ptr); \ @@ -825,6 +1117,13 @@ inline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b, \ c.val = v.val[2]; \ d.val = v.val[3]; \ } \ +inline void v_store_interleave( _Tp* ptr, const v_##_Tpvec& a, const v_##_Tpvec& b) \ +{ \ + _Tpvec##x2_t v; \ + v.val[0] = a.val; \ + v.val[1] = b.val; \ + vst2q_##suffix(ptr, v); \ +} \ inline void v_store_interleave( _Tp* ptr, const v_##_Tpvec& a, const v_##_Tpvec& b, const v_##_Tpvec& c) \ { \ _Tpvec##x3_t v; \ @@ -851,12 +1150,55 @@ OPENCV_HAL_IMPL_NEON_INTERLEAVED(int16x8, short, s16) OPENCV_HAL_IMPL_NEON_INTERLEAVED(uint32x4, unsigned, u32) OPENCV_HAL_IMPL_NEON_INTERLEAVED(int32x4, int, s32) OPENCV_HAL_IMPL_NEON_INTERLEAVED(float32x4, float, f32) +#if CV_SIMD128_64F +OPENCV_HAL_IMPL_NEON_INTERLEAVED(float64x2, double, f64) +#endif inline v_float32x4 v_cvt_f32(const v_int32x4& a) { return v_float32x4(vcvtq_f32_s32(a.val)); } +#if CV_SIMD128_64F +inline v_float32x4 v_cvt_f32(const v_float64x2& a) +{ + float32x2_t zero = vdup_n_f32(0.0f); + return v_float32x4(vcombine_f32(vcvt_f32_f64(a.val), zero)); +} + +inline v_float64x2 v_cvt_f64(const v_int32x4& a) +{ + return v_float64x2(vcvt_f64_f32(vcvt_f32_s32(vget_low_s32(a.val)))); +} + +inline v_float64x2 v_cvt_f64_high(const v_int32x4& a) +{ + return v_float64x2(vcvt_f64_f32(vcvt_f32_s32(vget_high_s32(a.val)))); +} + +inline v_float64x2 v_cvt_f64(const v_float32x4& a) +{ + return v_float64x2(vcvt_f64_f32(vget_low_f32(a.val))); +} + +inline v_float64x2 v_cvt_f64_high(const v_float32x4& a) +{ + return v_float64x2(vcvt_f64_f32(vget_high_f32(a.val))); +} +#endif + +#if defined (HAVE_FP16) +inline v_float32x4 v_cvt_f32(const v_float16x4& a) +{ + return v_float32x4(vcvt_f32_f16(a.val)); +} + +inline v_float16x4 v_cvt_f16(const v_float32x4& a) +{ + return v_float16x4(vcvt_f16_f32(a.val)); +} +#endif + //! @endcond } diff --git a/modules/core/include/opencv2/core/hal/intrin_sse.hpp b/modules/core/include/opencv2/core/hal/intrin_sse.hpp index 1840e0305d..3e2ebae68c 100644 --- a/modules/core/include/opencv2/core/hal/intrin_sse.hpp +++ b/modules/core/include/opencv2/core/hal/intrin_sse.hpp @@ -252,6 +252,26 @@ struct v_float64x2 __m128d val; }; +#if defined(HAVE_FP16) +struct v_float16x4 +{ + typedef short lane_type; + enum { nlanes = 4 }; + + v_float16x4() {} + explicit v_float16x4(__m128i v) : val(v) {} + v_float16x4(short v0, short v1, short v2, short v3) + { + val = _mm_setr_epi16(v0, v1, v2, v3, 0, 0, 0, 0); + } + short get0() const + { + return (short)_mm_cvtsi128_si32(val); + } + __m128i val; +}; +#endif + #define OPENCV_HAL_IMPL_SSE_INITVEC(_Tpvec, _Tp, suffix, zsuffix, ssuffix, _Tps, cast) \ inline _Tpvec v_setzero_##suffix() { return _Tpvec(_mm_setzero_##zsuffix()); } \ inline _Tpvec v_setall_##suffix(_Tp v) { return _Tpvec(_mm_set1_##ssuffix((_Tps)v)); } \ @@ -1021,6 +1041,13 @@ inline void v_store_high(_Tp* ptr, const _Tpvec& a) \ OPENCV_HAL_IMPL_SSE_LOADSTORE_FLT_OP(v_float32x4, float, ps) OPENCV_HAL_IMPL_SSE_LOADSTORE_FLT_OP(v_float64x2, double, pd) +#if defined(HAVE_FP16) +inline v_float16x4 v_load_f16(const short* ptr) +{ return v_float16x4(_mm_loadl_epi64((const __m128i*)ptr)); } +inline void v_store_f16(short* ptr, v_float16x4& a) +{ _mm_storel_epi64((__m128i*)ptr, a.val); } +#endif + #define OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(_Tpvec, scalartype, func, scalar_func) \ inline scalartype v_reduce_##func(const _Tpvec& a) \ { \ @@ -1374,6 +1401,18 @@ inline void v_load_deinterleave(const unsigned* ptr, v_uint32x4& a, v_uint32x4& v_transpose4x4(u0, u1, u2, u3, a, b, c, d); } +// 2-channel, float only +inline void v_load_deinterleave(const float* ptr, v_float32x4& a, v_float32x4& b) +{ + const int mask_lo = _MM_SHUFFLE(2, 0, 2, 0), mask_hi = _MM_SHUFFLE(3, 1, 3, 1); + + __m128 u0 = _mm_loadu_ps(ptr); // a0 b0 a1 b1 + __m128 u1 = _mm_loadu_ps((ptr + 4)); // a2 b2 a3 b3 + + a.val = _mm_shuffle_ps(u0, u1, mask_lo); // a0 a1 a2 a3 + b.val = _mm_shuffle_ps(u0, u1, mask_hi); // b0 b1 ab b3 +} + inline void v_store_interleave( uchar* ptr, const v_uint8x16& a, const v_uint8x16& b, const v_uint8x16& c ) { @@ -1529,6 +1568,18 @@ inline void v_store_interleave(unsigned* ptr, const v_uint32x4& a, const v_uint3 v_store(ptr + 12, t3); } +// 2-channel, float only +inline void v_store_interleave(float* ptr, const v_float32x4& a, const v_float32x4& b) +{ + // a0 a1 a2 a3 ... + // b0 b1 b2 b3 ... + __m128 u0 = _mm_unpacklo_ps(a.val, b.val); // a0 b0 a1 b1 + __m128 u1 = _mm_unpackhi_ps(a.val, b.val); // a2 b2 a3 b3 + + _mm_storeu_ps(ptr, u0); + _mm_storeu_ps((ptr + 4), u1); +} + #define OPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(_Tpvec, _Tp, suffix, _Tpuvec, _Tpu, usuffix) \ inline void v_load_deinterleave( const _Tp* ptr, _Tpvec& a0, \ _Tpvec& b0, _Tpvec& c0 ) \ @@ -1587,11 +1638,33 @@ inline v_float64x2 v_cvt_f64(const v_int32x4& a) return v_float64x2(_mm_cvtepi32_pd(a.val)); } +inline v_float64x2 v_cvt_f64_high(const v_int32x4& a) +{ + return v_float64x2(_mm_cvtepi32_pd(_mm_srli_si128(a.val,8))); +} + inline v_float64x2 v_cvt_f64(const v_float32x4& a) { return v_float64x2(_mm_cvtps_pd(a.val)); } +inline v_float64x2 v_cvt_f64_high(const v_float32x4& a) +{ + return v_float64x2(_mm_cvtps_pd(_mm_castsi128_ps(_mm_srli_si128(_mm_castps_si128(a.val),8)))); +} + +#if defined(HAVE_FP16) +inline v_float32x4 v_cvt_f32(const v_float16x4& a) +{ + return v_float32x4(_mm_cvtph_ps(a.val)); +} + +inline v_float16x4 v_cvt_f16(const v_float32x4& a) +{ + return v_float16x4(_mm_cvtps_ph(a.val, 0)); +} +#endif + //! @endcond } diff --git a/modules/core/include/opencv2/core/mat.hpp b/modules/core/include/opencv2/core/mat.hpp index ab2ba79734..b8b15d2db3 100644 --- a/modules/core/include/opencv2/core/mat.hpp +++ b/modules/core/include/opencv2/core/mat.hpp @@ -1645,10 +1645,16 @@ public: /** @overload */ const uchar* ptr(int i0=0) const; - /** @overload */ - uchar* ptr(int i0, int i1); - /** @overload */ - const uchar* ptr(int i0, int i1) const; + /** @overload + @param row Index along the dimension 0 + @param col Index along the dimension 1 + */ + uchar* ptr(int row, int col); + /** @overload + @param row Index along the dimension 0 + @param col Index along the dimension 1 + */ + const uchar* ptr(int row, int col) const; /** @overload */ uchar* ptr(int i0, int i1, int i2); @@ -1668,10 +1674,16 @@ public: template _Tp* ptr(int i0=0); /** @overload */ template const _Tp* ptr(int i0=0) const; - /** @overload */ - template _Tp* ptr(int i0, int i1); - /** @overload */ - template const _Tp* ptr(int i0, int i1) const; + /** @overload + @param row Index along the dimension 0 + @param col Index along the dimension 1 + */ + template _Tp* ptr(int row, int col); + /** @overload + @param row Index along the dimension 0 + @param col Index along the dimension 1 + */ + template const _Tp* ptr(int row, int col) const; /** @overload */ template _Tp* ptr(int i0, int i1, int i2); /** @overload */ @@ -1721,15 +1733,15 @@ public: */ template const _Tp& at(int i0=0) const; /** @overload - @param i0 Index along the dimension 0 - @param i1 Index along the dimension 1 + @param row Index along the dimension 0 + @param col Index along the dimension 1 */ - template _Tp& at(int i0, int i1); + template _Tp& at(int row, int col); /** @overload - @param i0 Index along the dimension 0 - @param i1 Index along the dimension 1 + @param row Index along the dimension 0 + @param col Index along the dimension 1 */ - template const _Tp& at(int i0, int i1) const; + template const _Tp& at(int row, int col) const; /** @overload @param i0 Index along the dimension 0 @@ -2094,9 +2106,9 @@ public: //! returns read-only reference to the specified element (1D case) const _Tp& operator ()(int idx0) const; //! returns reference to the specified element (2D case) - _Tp& operator ()(int idx0, int idx1); + _Tp& operator ()(int row, int col); //! returns read-only reference to the specified element (2D case) - const _Tp& operator ()(int idx0, int idx1) const; + const _Tp& operator ()(int row, int col) const; //! returns reference to the specified element (3D case) _Tp& operator ()(int idx0, int idx1, int idx2); //! returns read-only reference to the specified element (3D case) diff --git a/modules/core/include/opencv2/core/mat.inl.hpp b/modules/core/include/opencv2/core/mat.inl.hpp index 2ba152f375..49ea17f485 100644 --- a/modules/core/include/opencv2/core/mat.inl.hpp +++ b/modules/core/include/opencv2/core/mat.inl.hpp @@ -680,7 +680,8 @@ void Mat::addref() CV_XADD(&u->refcount, 1); } -inline void Mat::release() +inline +void Mat::release() { if( u && CV_XADD(&u->refcount, -1) == 1 ) deallocate(); diff --git a/modules/core/include/opencv2/core/persistence.hpp b/modules/core/include/opencv2/core/persistence.hpp index 65a1ff4c4c..01f28d57a3 100644 --- a/modules/core/include/opencv2/core/persistence.hpp +++ b/modules/core/include/opencv2/core/persistence.hpp @@ -57,8 +57,9 @@ Several functions that are described below take CvFileStorage\* as inputs and al save or to load hierarchical collections that consist of scalar values, standard CXCore objects (such as matrices, sequences, graphs), and user-defined objects. -OpenCV can read and write data in XML () or YAML () -formats. Below is an example of 3x3 floating-point identity matrix A, stored in XML and YAML files +OpenCV can read and write data in XML (), YAML () or +JSON () formats. Below is an example of 3x3 floating-point identity matrix A, +stored in XML and YAML files using CXCore functions: XML: @code{.xml} @@ -85,7 +86,8 @@ As it can be seen from the examples, XML uses nested tags to represent hierarchy indentation for that purpose (similar to the Python programming language). The same functions can read and write data in both formats; the particular format is determined by -the extension of the opened file, ".xml" for XML files and ".yml" or ".yaml" for YAML. +the extension of the opened file, ".xml" for XML files, ".yml" or ".yaml" for YAML and ".json" for +JSON. */ typedef struct CvFileStorage CvFileStorage; typedef struct CvFileNode CvFileNode; @@ -101,20 +103,20 @@ namespace cv { /** @addtogroup core_xml -XML/YAML file storages. {#xml_storage} +XML/YAML/JSON file storages. {#xml_storage} ======================= Writing to a file storage. -------------------------- -You can store and then restore various OpenCV data structures to/from XML () -or YAML () formats. Also, it is possible store and load arbitrarily complex -data structures, which include OpenCV data structures, as well as primitive data types (integer and -floating-point numbers and text strings) as their elements. +You can store and then restore various OpenCV data structures to/from XML (), +YAML () or JSON () formats. Also, it is possible store +and load arbitrarily complex data structures, which include OpenCV data structures, as well as +primitive data types (integer and floating-point numbers and text strings) as their elements. -Use the following procedure to write something to XML or YAML: +Use the following procedure to write something to XML, YAML or JSON: -# Create new FileStorage and open it for writing. It can be done with a single call to FileStorage::FileStorage constructor that takes a filename, or you can use the default constructor -and then call FileStorage::open. Format of the file (XML or YAML) is determined from the filename -extension (".xml" and ".yml"/".yaml", respectively) +and then call FileStorage::open. Format of the file (XML, YAML or JSON) is determined from the filename +extension (".xml", ".yml"/".yaml" and ".json", respectively) -# Write all the data you want using the streaming operator `<<`, just like in the case of STL streams. -# Close the file using FileStorage::release. FileStorage destructor also closes the file. @@ -177,19 +179,19 @@ features: - { x:344, y:158, lbp:[ 1, 1, 0, 0, 0, 0, 1, 0 ] } @endcode -As an exercise, you can replace ".yml" with ".xml" in the sample above and see, how the +As an exercise, you can replace ".yml" with ".xml" or ".json" in the sample above and see, how the corresponding XML file will look like. Several things can be noted by looking at the sample code and the output: -- The produced YAML (and XML) consists of heterogeneous collections that can be nested. There are 2 - types of collections: named collections (mappings) and unnamed collections (sequences). In mappings +- The produced YAML (and XML/JSON) consists of heterogeneous collections that can be nested. There are + 2 types of collections: named collections (mappings) and unnamed collections (sequences). In mappings each element has a name and is accessed by name. This is similar to structures and std::map in C/C++ and dictionaries in Python. In sequences elements do not have names, they are accessed by indices. This is similar to arrays and std::vector in C/C++ and lists, tuples in Python. "Heterogeneous" means that elements of each single collection can have different types. - Top-level collection in YAML/XML is a mapping. Each matrix is stored as a mapping, and the matrix + Top-level collection in YAML/XML/JSON is a mapping. Each matrix is stored as a mapping, and the matrix elements are stored as a sequence. Then, there is a sequence of features, where each feature is represented a mapping, and lbp value in a nested sequence. @@ -205,7 +207,7 @@ Several things can be noted by looking at the sample code and the output: - To write a sequence, you first write the special string `[`, then write the elements, then write the closing `]`. -- In YAML (but not XML), mappings and sequences can be written in a compact Python-like inline +- In YAML/JSON (but not XML), mappings and sequences can be written in a compact Python-like inline form. In the sample above matrix elements, as well as each feature, including its lbp value, is stored in such inline form. To store a mapping/sequence in a compact form, put `:` after the opening character, e.g. use `{:` instead of `{` and `[:` instead of `[`. When the @@ -213,7 +215,7 @@ Several things can be noted by looking at the sample code and the output: Reading data from a file storage. --------------------------------- -To read the previously written XML or YAML file, do the following: +To read the previously written XML, YAML or JSON file, do the following: -# Open the file storage using FileStorage::FileStorage constructor or FileStorage::open method. In the current implementation the whole file is parsed and the whole representation of file storage is built in memory as a hierarchy of file nodes (see FileNode) @@ -294,8 +296,8 @@ A complete example using the FileStorage interface class CV_EXPORTS FileNode; class CV_EXPORTS FileNodeIterator; -/** @brief XML/YAML file storage class that encapsulates all the information necessary for writing or reading -data to/from a file. +/** @brief XML/YAML/JSON file storage class that encapsulates all the information necessary for writing or +reading data to/from a file. */ class CV_EXPORTS_W FileStorage { @@ -311,7 +313,11 @@ public: FORMAT_MASK = (7<<3), //!< mask for format flags FORMAT_AUTO = 0, //!< flag, auto format FORMAT_XML = (1<<3), //!< flag, XML format - FORMAT_YAML = (2<<3) //!< flag, YAML format + FORMAT_YAML = (2<<3), //!< flag, YAML format + FORMAT_JSON = (3<<3), //!< flag, JSON format + + BASE64 = 64, //!< flag, write rawdata in Base64 by default. (consider using WRITE_BASE64) + WRITE_BASE64 = BASE64 | WRITE, //!< flag, enable both WRITE and BASE64 }; enum { @@ -330,9 +336,9 @@ public: /** @overload @param source Name of the file to open or the text string to read the data from. Extension of the - file (.xml or .yml/.yaml) determines its format (XML or YAML respectively). Also you can append .gz - to work with compressed files, for example myHugeMatrix.xml.gz. If both FileStorage::WRITE and - FileStorage::MEMORY flags are specified, source is used just to specify the output file format (e.g. + file (.xml, .yml/.yaml, or .json) determines its format (XML, YAML or JSON respectively). Also you can + append .gz to work with compressed files, for example myHugeMatrix.xml.gz. If both FileStorage::WRITE + and FileStorage::MEMORY flags are specified, source is used just to specify the output file format (e.g. mydata.xml, .yml etc.). @param flags Mode of operation. See FileStorage::Mode @param encoding Encoding of the file. Note that UTF-16 XML encoding is not supported currently and @@ -351,10 +357,12 @@ public: See description of parameters in FileStorage::FileStorage. The method calls FileStorage::release before opening the file. @param filename Name of the file to open or the text string to read the data from. - Extension of the file (.xml or .yml/.yaml) determines its format (XML or YAML respectively). - Also you can append .gz to work with compressed files, for example myHugeMatrix.xml.gz. If both + Extension of the file (.xml, .yml/.yaml or .json) determines its format (XML, YAML or JSON + respectively). Also you can append .gz to work with compressed files, for example myHugeMatrix.xml.gz. If both FileStorage::WRITE and FileStorage::MEMORY flags are specified, source is used just to specify - the output file format (e.g. mydata.xml, .yml etc.). + the output file format (e.g. mydata.xml, .yml etc.). A file name can also contain parameters. + You can use this format, "*?base64" (e.g. "file.json?base64" (case sensitive)), as an alternative to + FileStorage::BASE64 flag. @param flags Mode of operation. One of FileStorage::Mode @param encoding Encoding of the file. Note that UTF-16 XML encoding is not supported currently and you should use 8-bit encoding instead of it. diff --git a/modules/core/include/opencv2/core/private.hpp b/modules/core/include/opencv2/core/private.hpp index 656394bd38..1a876b03f2 100644 --- a/modules/core/include/opencv2/core/private.hpp +++ b/modules/core/include/opencv2/core/private.hpp @@ -288,17 +288,6 @@ private: #define IPP_VERSION_X100 0 #endif -// There shoud be no API difference in OpenCV between ICV and IPP since 9.0 -#if (defined HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 900 -#undef HAVE_IPP_ICV_ONLY -#endif - -#ifdef HAVE_IPP_ICV_ONLY -#define HAVE_ICV 1 -#else -#define HAVE_ICV 0 -#endif - #if defined HAVE_IPP #if IPP_VERSION_X100 >= 900 #define IPP_INITIALIZER(FEAT) \ @@ -344,7 +333,7 @@ static struct __IppInitializer__ __ipp_initializer__; #ifdef CV_IPP_RUN_VERBOSE #define CV_IPP_RUN_(condition, func, ...) \ { \ - if (cv::ipp::useIPP() && (condition) && func) \ + if (cv::ipp::useIPP() && (condition) && (func)) \ { \ printf("%s: IPP implementation is running\n", CV_Func); \ fflush(stdout); \ @@ -376,18 +365,24 @@ static struct __IppInitializer__ __ipp_initializer__; } #else #define CV_IPP_RUN_(condition, func, ...) \ - if (cv::ipp::useIPP() && (condition) && func) \ + if (cv::ipp::useIPP() && (condition) && (func)) \ { \ CV_IMPL_ADD(CV_IMPL_IPP); \ return __VA_ARGS__; \ } #endif - +#define CV_IPP_RUN_FAST(func, ...) \ + if (cv::ipp::useIPP() && (func)) \ + { \ + CV_IMPL_ADD(CV_IMPL_IPP); \ + return __VA_ARGS__; \ + } #else #define CV_IPP_RUN_(condition, func, ...) +#define CV_IPP_RUN_FAST(func, ...) #endif -#define CV_IPP_RUN(condition, func, ...) CV_IPP_RUN_(condition, func, __VA_ARGS__) +#define CV_IPP_RUN(condition, func, ...) CV_IPP_RUN_((condition), (func), __VA_ARGS__) #ifndef IPPI_CALL @@ -443,6 +438,139 @@ CV_EXPORTS void setUseTegra(bool flag); } #endif +#ifdef ENABLE_INSTRUMENTATION +namespace cv +{ +namespace instr +{ +struct InstrTLSStruct +{ + InstrTLSStruct() + { + pCurrentNode = NULL; + } + InstrNode* pCurrentNode; +}; + +class InstrStruct +{ +public: + InstrStruct() + { + useInstr = false; + enableMapping = true; + + rootNode.m_payload = NodeData("ROOT", NULL, 0, TYPE_GENERAL, IMPL_PLAIN); + tlsStruct.get()->pCurrentNode = &rootNode; + } + + Mutex mutexCreate; + Mutex mutexCount; + + bool useInstr; + bool enableMapping; + InstrNode rootNode; + TLSData tlsStruct; +}; + +class CV_EXPORTS IntrumentationRegion +{ +public: + IntrumentationRegion(const char* funName, const char* fileName, int lineNum, TYPE instrType = TYPE_GENERAL, IMPL implType = IMPL_PLAIN); + ~IntrumentationRegion(); + +private: + bool m_disabled; // region status + uint64 m_regionTicks; +}; + +InstrStruct& getInstrumentStruct(); +InstrTLSStruct& getInstrumentTLSStruct(); +CV_EXPORTS InstrNode* getCurrentNode(); +} +} + +///// General instrumentation +// Instrument region +#define CV_INSTRUMENT_REGION_META(NAME, TYPE, IMPL) ::cv::instr::IntrumentationRegion __instr_region__(NAME, __FILE__, __LINE__, TYPE, IMPL); +// Instrument functions with non-void return type +#define CV_INSTRUMENT_FUN_RT_META(TYPE, IMPL, ERROR_COND, FUN, ...) ([&]()\ +{\ + if(::cv::instr::useInstrumentation()){\ + ::cv::instr::IntrumentationRegion __instr__(#FUN, __FILE__, __LINE__, TYPE, IMPL);\ + try{\ + auto status = ((FUN)(__VA_ARGS__));\ + if(ERROR_COND){\ + ::cv::instr::getCurrentNode()->m_payload.m_funError = true;\ + CV_INSTRUMENT_MARK_META(IMPL, #FUN " - BadExit");\ + }\ + return status;\ + }catch(...){\ + ::cv::instr::getCurrentNode()->m_payload.m_funError = true;\ + CV_INSTRUMENT_MARK_META(IMPL, #FUN " - BadExit");\ + throw;\ + }\ + }else{\ + return ((FUN)(__VA_ARGS__));\ + }\ +}()) +// Instrument functions with void return type +#define CV_INSTRUMENT_FUN_RV_META(TYPE, IMPL, FUN, ...) ([&]()\ +{\ + if(::cv::instr::useInstrumentation()){\ + ::cv::instr::IntrumentationRegion __instr__(#FUN, __FILE__, __LINE__, TYPE, IMPL);\ + try{\ + (FUN)(__VA_ARGS__);\ + }catch(...){\ + ::cv::instr::getCurrentNode()->m_payload.m_funError = true;\ + CV_INSTRUMENT_MARK_META(IMPL, #FUN "- BadExit");\ + throw;\ + }\ + }else{\ + (FUN)(__VA_ARGS__);\ + }\ +}()) +// Instrumentation information marker +#define CV_INSTRUMENT_MARK_META(IMPL, NAME, ...) {::cv::instr::IntrumentationRegion __instr_mark__(NAME, __FILE__, __LINE__, ::cv::instr::TYPE_MARKER, IMPL);} + +///// General instrumentation +// General OpenCV region instrumentation macro +#define CV_INSTRUMENT_REGION() CV_INSTRUMENT_REGION_META(__FUNCTION__, cv::instr::TYPE_GENERAL, cv::instr::IMPL_PLAIN) +// Parallel OpenCV region instrumentation macro +#define CV_INSTRUMENT_REGION_MT() CV_INSTRUMENT_REGION_MT_META(cv::instr::TYPE_GENERAL, cv::instr::IMPL_PLAIN) + +///// IPP instrumentation +// Wrapper region instrumentation macro +#define CV_INSTRUMENT_REGION_IPP() CV_INSTRUMENT_REGION_META(__FUNCTION__, ::cv::instr::TYPE_WRAPPER, ::cv::instr::IMPL_IPP) +// Function instrumentation macro +#define CV_INSTRUMENT_FUN_IPP(FUN, ...) CV_INSTRUMENT_FUN_RT_META(::cv::instr::TYPE_FUN, ::cv::instr::IMPL_IPP, status < 0, FUN, __VA_ARGS__) +// Diagnostic markers +#define CV_INSTRUMENT_MARK_IPP(NAME) CV_INSTRUMENT_MARK_META(::cv::instr::IMPL_IPP, NAME) + +///// OpenCL instrumentation +// Wrapper region instrumentation macro +#define CV_INSTRUMENT_REGION_OPENCL() CV_INSTRUMENT_REGION_META(__FUNCTION__, ::cv::instr::TYPE_WRAPPER, ::cv::instr::IMPL_OPENCL) +#define CV_INSTRUMENT_REGION_OPENCL_(NAME) CV_INSTRUMENT_REGION_META(NAME, ::cv::instr::TYPE_WRAPPER, ::cv::instr::IMPL_OPENCL) +// Function instrumentation macro +#define CV_INSTRUMENT_FUN_OPENCL_KERNEL(FUN, ...) CV_INSTRUMENT_FUN_RT_META(::cv::instr::TYPE_FUN, ::cv::instr::IMPL_OPENCL, status == 0, FUN, __VA_ARGS__) +// Diagnostic markers +#define CV_INSTRUMENT_MARK_OPENCL(NAME) CV_INSTRUMENT_MARK_META(::cv::instr::IMPL_OPENCL, NAME) +#else +#define CV_INSTRUMENT_REGION_META(...) + +#define CV_INSTRUMENT_REGION() +#define CV_INSTRUMENT_REGION_MT() + +#define CV_INSTRUMENT_REGION_IPP() +#define CV_INSTRUMENT_FUN_IPP(FUN, ...) ((FUN)(__VA_ARGS__)) +#define CV_INSTRUMENT_MARK_IPP(NAME) + +#define CV_INSTRUMENT_REGION_OPENCL() +#define CV_INSTRUMENT_REGION_OPENCL_(...) +#define CV_INSTRUMENT_FUN_OPENCL_KERNEL(FUN, ...) ((FUN)(__VA_ARGS__)) +#define CV_INSTRUMENT_MARK_OPENCL(NAME) +#endif + //! @endcond #endif // __OPENCV_CORE_PRIVATE_HPP__ diff --git a/modules/core/include/opencv2/core/types_c.h b/modules/core/include/opencv2/core/types_c.h index cb39587a9a..a25a565df6 100644 --- a/modules/core/include/opencv2/core/types_c.h +++ b/modules/core/include/opencv2/core/types_c.h @@ -1669,6 +1669,9 @@ typedef struct CvFileStorage CvFileStorage; #define CV_STORAGE_FORMAT_AUTO 0 #define CV_STORAGE_FORMAT_XML 8 #define CV_STORAGE_FORMAT_YAML 16 +#define CV_STORAGE_FORMAT_JSON 24 +#define CV_STORAGE_BASE64 64 +#define CV_STORAGE_WRITE_BASE64 (CV_STORAGE_BASE64 | CV_STORAGE_WRITE) /** @brief List of attributes. : diff --git a/modules/core/include/opencv2/core/utility.hpp b/modules/core/include/opencv2/core/utility.hpp index 768c4d5223..01f5c7664a 100644 --- a/modules/core/include/opencv2/core/utility.hpp +++ b/modules/core/include/opencv2/core/utility.hpp @@ -495,8 +495,8 @@ void Mat::forEach_impl(const Functor& operation) { { public: PixelOperationWrapper(Mat_<_Tp>* const frame, const Functor& _operation) - : mat(frame), op(_operation) {}; - virtual ~PixelOperationWrapper(){}; + : mat(frame), op(_operation) {} + virtual ~PixelOperationWrapper(){} // ! Overloaded virtual operator // convert range call to row call. virtual void operator()(const Range &range) const { @@ -525,7 +525,7 @@ void Mat::forEach_impl(const Functor& operation) { this->rowCall(&idx[0], COLS, DIMS); } } - }; + } private: Mat_<_Tp>* const mat; const Functor op; @@ -562,12 +562,12 @@ void Mat::forEach_impl(const Functor& operation) { op(*pixel++, static_cast(idx)); idx[1]++; } - }; + } PixelOperationWrapper& operator=(const PixelOperationWrapper &) { CV_Assert(false); // We can not remove this implementation because Visual Studio warning C4822. return *this; - }; + } }; parallel_for_(cv::Range(0, LINES), PixelOperationWrapper(reinterpret_cast*>(this), operation)); @@ -650,8 +650,8 @@ private: virtual void deleteDataInstance(void* pData) const {delete (T*)pData;} // Wrapper to release data by template // Disable TLS copy operations - TLSData(TLSData &) {}; - TLSData& operator =(const TLSData &) {return *this;}; + TLSData(TLSData &) {} + TLSData& operator =(const TLSData &) {return *this;} }; /** @brief Designed for command line parsing @@ -1002,6 +1002,147 @@ template<> inline std::string CommandLineParser::get(const String& //! @endcond + +// Basic Node class for tree building +template +class CV_EXPORTS Node +{ +public: + Node() + { + m_pParent = 0; + } + Node(OBJECT& payload) : m_payload(payload) + { + m_pParent = 0; + } + ~Node() + { + removeChilds(); + if (m_pParent) + { + int idx = m_pParent->findChild(this); + if (idx >= 0) + m_pParent->m_childs.erase(m_pParent->m_childs.begin() + idx); + } + } + + Node* findChild(OBJECT& payload) const + { + for(int i = 0; i < this->m_childs.size(); i++) + { + if(this->m_childs[i]->m_payload == payload) + return this->m_childs[i]; + } + return NULL; + } + + int findChild(Node *pNode) const + { + for (int i = 0; i < this->m_childs.size(); i++) + { + if(this->m_childs[i] == pNode) + return i; + } + return -1; + } + + void addChild(Node *pNode) + { + if(!pNode) + return; + + CV_Assert(pNode->m_pParent == 0); + pNode->m_pParent = this; + this->m_childs.push_back(pNode); + } + + void removeChilds() + { + for(int i = 0; i < m_childs.size(); i++) + { + m_childs[i]->m_pParent = 0; // avoid excessive parent vector trimming + delete m_childs[i]; + } + m_childs.clear(); + } + +public: + OBJECT m_payload; + Node* m_pParent; + std::vector*> m_childs; +}; + +// Instrumentation external interface +namespace instr +{ + +#if !defined OPENCV_ABI_CHECK + +enum TYPE +{ + TYPE_GENERAL = 0, // OpenCV API function, e.g. exported function + TYPE_MARKER, // Information marker + TYPE_WRAPPER, // Wrapper function for implementation + TYPE_FUN, // Simple function call +}; + +enum IMPL +{ + IMPL_PLAIN = 0, + IMPL_IPP, + IMPL_OPENCL, +}; + +class CV_EXPORTS NodeData +{ +public: + NodeData(const char* funName = 0, const char* fileName = NULL, int lineNum = 0, cv::instr::TYPE instrType = TYPE_GENERAL, cv::instr::IMPL implType = IMPL_PLAIN); + NodeData(NodeData &ref); + ~NodeData(); + NodeData& operator=(const NodeData&); + + cv::String m_funName; + cv::instr::TYPE m_instrType; + cv::instr::IMPL m_implType; + const char* m_fileName; + int m_lineNum; + + volatile int m_counter; + volatile uint64 m_ticksTotal; + + // No synchronization + double getTotalMs() const { return (double)m_ticksTotal * 1000. / cv::getTickFrequency(); } + // No synchronization + double getMeanMs() const { return (double)m_ticksTotal * 1000. / (m_counter * cv::getTickFrequency()); } + + bool m_funError; + bool m_stopPoint; +}; +bool operator==(const NodeData& lhs, const NodeData& rhs); + +typedef Node InstrNode; + +CV_EXPORTS InstrNode* getTrace(); + +#endif // !defined OPENCV_ABI_CHECK + + +CV_EXPORTS bool useInstrumentation(); +CV_EXPORTS void setUseInstrumentation(bool flag); +CV_EXPORTS void resetTrace(); + +enum FLAGS +{ + FLAGS_NONE = 0, + FLAGS_MAPPING = 1 << 0, +}; + +CV_EXPORTS void setFlags(FLAGS modeFlags); +static inline void setFlags(int modeFlags) { setFlags((FLAGS)modeFlags); } +CV_EXPORTS FLAGS getFlags(); +} + } //namespace cv #ifndef DISABLE_OPENCV_24_COMPATIBILITY diff --git a/modules/core/perf/perf_io_base64.cpp b/modules/core/perf/perf_io_base64.cpp new file mode 100644 index 0000000000..799c52c394 --- /dev/null +++ b/modules/core/perf/perf_io_base64.cpp @@ -0,0 +1,86 @@ +#include "perf_precomp.hpp" + +using namespace std; +using namespace cv; +using namespace perf; +using std::tr1::make_tuple; +using std::tr1::get; + +typedef std::tr1::tuple Size_MatType_Str_t; +typedef TestBaseWithParam Size_Mat_StrType; + +#define MAT_SIZES ::perf::sz1080p/*, ::perf::sz4320p*/ +#define MAT_TYPES CV_8UC1, CV_32FC1 +#define FILE_EXTENSION String(".xml"), String(".yml"), String(".json") + + +PERF_TEST_P(Size_Mat_StrType, fs_text, + testing::Combine(testing::Values(MAT_SIZES), + testing::Values(MAT_TYPES), + testing::Values(FILE_EXTENSION)) + ) +{ + Size size = get<0>(GetParam()); + int type = get<1>(GetParam()); + String ext = get<2>(GetParam()); + + Mat src(size.height, size.width, type); + Mat dst = src.clone(); + + declare.in(src, WARMUP_RNG).out(dst); + + cv::String file_name = cv::tempfile(ext.c_str()); + cv::String key = "test_mat"; + + TEST_CYCLE_MULTIRUN(2) + { + { + FileStorage fs(file_name, cv::FileStorage::WRITE); + fs << key << src; + fs.release(); + } + { + FileStorage fs(file_name, cv::FileStorage::READ); + fs[key] >> dst; + fs.release(); + } + } + + remove(file_name.c_str()); + SANITY_CHECK_NOTHING(); +} + +PERF_TEST_P(Size_Mat_StrType, fs_base64, + testing::Combine(testing::Values(MAT_SIZES), + testing::Values(MAT_TYPES), + testing::Values(FILE_EXTENSION)) + ) +{ + Size size = get<0>(GetParam()); + int type = get<1>(GetParam()); + String ext = get<2>(GetParam()); + + Mat src(size.height, size.width, type); + Mat dst = src.clone(); + + cv::String file_name = cv::tempfile(ext.c_str()); + cv::String key = "test_mat"; + + declare.in(src, WARMUP_RNG).out(dst); + TEST_CYCLE_MULTIRUN(2) + { + { + FileStorage fs(file_name, cv::FileStorage::WRITE_BASE64); + fs << key << src; + fs.release(); + } + { + FileStorage fs(file_name, cv::FileStorage::READ); + fs[key] >> dst; + fs.release(); + } + } + + remove(file_name.c_str()); + SANITY_CHECK_NOTHING(); +} diff --git a/modules/core/perf/perf_umat.cpp b/modules/core/perf/perf_umat.cpp index ddeaa7abc7..2f45b792cb 100644 --- a/modules/core/perf/perf_umat.cpp +++ b/modules/core/perf/perf_umat.cpp @@ -13,7 +13,6 @@ using namespace ::testing; using std::tr1::tuple; using std::tr1::get; -namespace { struct OpenCLState { @@ -64,5 +63,3 @@ OCL_PERF_TEST_P(UMatTest, CustomPtr, Combine(Values(sz1080p, sz2160p), Bool(), : SANITY_CHECK_NOTHING(); } - -} // namespace cvtest diff --git a/modules/core/src/arithm.cpp b/modules/core/src/arithm.cpp index fc20a18311..4b1c67339b 100644 --- a/modules/core/src/arithm.cpp +++ b/modules/core/src/arithm.cpp @@ -369,58 +369,78 @@ static BinaryFuncC* getMinTab() void cv::bitwise_and(InputArray a, InputArray b, OutputArray c, InputArray mask) { + CV_INSTRUMENT_REGION() + BinaryFuncC f = (BinaryFuncC)GET_OPTIMIZED(cv::hal::and8u); binary_op(a, b, c, mask, &f, true, OCL_OP_AND); } void cv::bitwise_or(InputArray a, InputArray b, OutputArray c, InputArray mask) { + CV_INSTRUMENT_REGION() + BinaryFuncC f = (BinaryFuncC)GET_OPTIMIZED(cv::hal::or8u); binary_op(a, b, c, mask, &f, true, OCL_OP_OR); } void cv::bitwise_xor(InputArray a, InputArray b, OutputArray c, InputArray mask) { + CV_INSTRUMENT_REGION() + BinaryFuncC f = (BinaryFuncC)GET_OPTIMIZED(cv::hal::xor8u); binary_op(a, b, c, mask, &f, true, OCL_OP_XOR); } void cv::bitwise_not(InputArray a, OutputArray c, InputArray mask) { + CV_INSTRUMENT_REGION() + BinaryFuncC f = (BinaryFuncC)GET_OPTIMIZED(cv::hal::not8u); binary_op(a, a, c, mask, &f, true, OCL_OP_NOT); } void cv::max( InputArray src1, InputArray src2, OutputArray dst ) { + CV_INSTRUMENT_REGION() + binary_op(src1, src2, dst, noArray(), getMaxTab(), false, OCL_OP_MAX ); } void cv::min( InputArray src1, InputArray src2, OutputArray dst ) { + CV_INSTRUMENT_REGION() + binary_op(src1, src2, dst, noArray(), getMinTab(), false, OCL_OP_MIN ); } void cv::max(const Mat& src1, const Mat& src2, Mat& dst) { + CV_INSTRUMENT_REGION() + OutputArray _dst(dst); binary_op(src1, src2, _dst, noArray(), getMaxTab(), false, OCL_OP_MAX ); } void cv::min(const Mat& src1, const Mat& src2, Mat& dst) { + CV_INSTRUMENT_REGION() + OutputArray _dst(dst); binary_op(src1, src2, _dst, noArray(), getMinTab(), false, OCL_OP_MIN ); } void cv::max(const UMat& src1, const UMat& src2, UMat& dst) { + CV_INSTRUMENT_REGION() + OutputArray _dst(dst); binary_op(src1, src2, _dst, noArray(), getMaxTab(), false, OCL_OP_MAX ); } void cv::min(const UMat& src1, const UMat& src2, UMat& dst) { + CV_INSTRUMENT_REGION() + OutputArray _dst(dst); binary_op(src1, src2, _dst, noArray(), getMinTab(), false, OCL_OP_MIN ); } @@ -901,12 +921,16 @@ static BinaryFuncC* getAbsDiffTab() void cv::add( InputArray src1, InputArray src2, OutputArray dst, InputArray mask, int dtype ) { + CV_INSTRUMENT_REGION() + arithm_op(src1, src2, dst, mask, dtype, getAddTab(), false, 0, OCL_OP_ADD ); } void cv::subtract( InputArray _src1, InputArray _src2, OutputArray _dst, InputArray mask, int dtype ) { + CV_INSTRUMENT_REGION() + #ifdef HAVE_TEGRA_OPTIMIZATION if (tegra::useTegra()) { @@ -965,6 +989,8 @@ void cv::subtract( InputArray _src1, InputArray _src2, OutputArray _dst, void cv::absdiff( InputArray src1, InputArray src2, OutputArray dst ) { + CV_INSTRUMENT_REGION() + arithm_op(src1, src2, dst, noArray(), -1, getAbsDiffTab(), false, 0, OCL_OP_ABSDIFF); } @@ -1016,6 +1042,8 @@ static BinaryFuncC* getRecipTab() void cv::multiply(InputArray src1, InputArray src2, OutputArray dst, double scale, int dtype) { + CV_INSTRUMENT_REGION() + arithm_op(src1, src2, dst, noArray(), dtype, getMulTab(), true, &scale, std::abs(scale - 1.0) < DBL_EPSILON ? OCL_OP_MUL : OCL_OP_MUL_SCALE); } @@ -1023,12 +1051,16 @@ void cv::multiply(InputArray src1, InputArray src2, void cv::divide(InputArray src1, InputArray src2, OutputArray dst, double scale, int dtype) { + CV_INSTRUMENT_REGION() + arithm_op(src1, src2, dst, noArray(), dtype, getDivTab(), true, &scale, OCL_OP_DIV_SCALE); } void cv::divide(double scale, InputArray src2, OutputArray dst, int dtype) { + CV_INSTRUMENT_REGION() + arithm_op(src2, src2, dst, noArray(), dtype, getRecipTab(), true, &scale, OCL_OP_RECIP_SCALE); } @@ -1056,6 +1088,8 @@ static BinaryFuncC* getAddWeightedTab() void cv::addWeighted( InputArray src1, double alpha, InputArray src2, double beta, double gamma, OutputArray dst, int dtype ) { + CV_INSTRUMENT_REGION() + double scalars[] = {alpha, beta, gamma}; arithm_op(src1, src2, dst, noArray(), dtype, getAddWeightedTab(), true, scalars, OCL_OP_ADDW); } @@ -1194,6 +1228,8 @@ static bool ocl_compare(InputArray _src1, InputArray _src2, OutputArray _dst, in void cv::compare(InputArray _src1, InputArray _src2, OutputArray _dst, int op) { + CV_INSTRUMENT_REGION() + CV_Assert( op == CMP_LT || op == CMP_LE || op == CMP_EQ || op == CMP_NE || op == CMP_GE || op == CMP_GT ); @@ -1889,6 +1925,8 @@ static bool ocl_inRange( InputArray _src, InputArray _lowerb, void cv::inRange(InputArray _src, InputArray _lowerb, InputArray _upperb, OutputArray _dst) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(_src.dims() <= 2 && _lowerb.dims() <= 2 && _upperb.dims() <= 2 && OCL_PERFORMANCE_CHECK(_dst.isUMat()), ocl_inRange(_src, _lowerb, _upperb, _dst)) @@ -2274,7 +2312,7 @@ static inline void fixSteps(int width, int height, size_t elemSize, size_t& step CV_IPP_CHECK() \ { \ fixSteps(width, height, sizeof(dst[0]), step1, step2, step); \ - if (0 <= fun(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(width, height), 0)) \ + if (0 <= CV_INSTRUMENT_FUN_IPP(fun, src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(width, height), 0)) \ { \ CV_IMPL_ADD(CV_IMPL_IPP); \ return; \ @@ -2286,7 +2324,7 @@ static inline void fixSteps(int width, int height, size_t elemSize, size_t& step CV_IPP_CHECK() \ { \ fixSteps(width, height, sizeof(dst[0]), step1, step2, step); \ - if (0 <= fun(src2, (int)step2, src1, (int)step1, dst, (int)step, ippiSize(width, height), 0)) \ + if (0 <= CV_INSTRUMENT_FUN_IPP(fun, src2, (int)step2, src1, (int)step1, dst, (int)step, ippiSize(width, height), 0)) \ { \ CV_IMPL_ADD(CV_IMPL_IPP); \ return; \ @@ -2298,7 +2336,7 @@ static inline void fixSteps(int width, int height, size_t elemSize, size_t& step CV_IPP_CHECK() \ { \ fixSteps(width, height, sizeof(dst[0]), step1, step2, step); \ - if (0 <= fun(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(width, height))) \ + if (0 <= CV_INSTRUMENT_FUN_IPP(fun, src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(width, height))) \ { \ CV_IMPL_ADD(CV_IMPL_IPP); \ return; \ @@ -2310,7 +2348,7 @@ static inline void fixSteps(int width, int height, size_t elemSize, size_t& step CV_IPP_CHECK() \ { \ fixSteps(width, height, sizeof(dst[0]), step1, step2, step); \ - if (0 <= fun(src2, (int)step2, src1, (int)step1, dst, (int)step, ippiSize(width, height))) \ + if (0 <= CV_INSTRUMENT_FUN_IPP(fun, src2, (int)step2, src1, (int)step1, dst, (int)step, ippiSize(width, height))) \ { \ CV_IMPL_ADD(CV_IMPL_IPP); \ return; \ @@ -2467,7 +2505,7 @@ void sub64f( const double* src1, size_t step1, int i = 0; \ for(; i < height; i++) \ { \ - if (0 > fun(s1, s2, d, width)) \ + if (0 > CV_INSTRUMENT_FUN_IPP(fun, s1, s2, d, width)) \ break; \ s1 = (type*)((uchar*)s1 + step1); \ s2 = (type*)((uchar*)s2 + step2); \ @@ -2684,7 +2722,7 @@ void absdiff64f( const double* src1, size_t step1, CV_IPP_CHECK() \ { \ fixSteps(width, height, sizeof(dst[0]), step1, step2, step); (void)src2; \ - if (0 <= fun(src1, (int)step1, dst, (int)step, ippiSize(width, height))) \ + if (0 <= CV_INSTRUMENT_FUN_IPP(fun, src1, (int)step1, dst, (int)step, ippiSize(width, height))) \ { \ CV_IMPL_ADD(CV_IMPL_IPP); \ return; \ @@ -2750,7 +2788,7 @@ inline static IppCmpOp convert_cmp(int _cmpop) if( op >= 0 ) \ { \ fixSteps(width, height, sizeof(dst[0]), step1, step2, step); \ - if (0 <= fun(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(width, height), op)) \ + if (0 <= CV_INSTRUMENT_FUN_IPP(fun, src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(width, height), op)) \ { \ CV_IMPL_ADD(CV_IMPL_IPP); \ return; \ @@ -3023,7 +3061,7 @@ void cmp64f(const double* src1, size_t step1, const double* src2, size_t step2, { \ if (std::fabs(fscale - 1) <= FLT_EPSILON) \ { \ - if (fun(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(width, height), 0) >= 0) \ + if (CV_INSTRUMENT_FUN_IPP(fun, src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(width, height), 0) >= 0) \ { \ CV_IMPL_ADD(CV_IMPL_IPP); \ return; \ @@ -3037,7 +3075,7 @@ void cmp64f(const double* src1, size_t step1, const double* src2, size_t step2, { \ if (std::fabs(fscale - 1) <= FLT_EPSILON) \ { \ - if (fun(src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(width, height)) >= 0) \ + if (CV_INSTRUMENT_FUN_IPP(fun, src1, (int)step1, src2, (int)step2, dst, (int)step, ippiSize(width, height)) >= 0) \ { \ CV_IMPL_ADD(CV_IMPL_IPP); \ return; \ diff --git a/modules/core/src/convert.cpp b/modules/core/src/convert.cpp index dc974505e5..dc2da5e611 100644 --- a/modules/core/src/convert.cpp +++ b/modules/core/src/convert.cpp @@ -44,6 +44,7 @@ #include "precomp.hpp" #include "opencl_kernels_core.hpp" +#include "opencv2/core/hal/intrin.hpp" #ifdef __APPLE__ #undef CV_NEON @@ -84,6 +85,8 @@ static MergeFunc getMergeFunc(int depth) void cv::split(const Mat& src, Mat* mv) { + CV_INSTRUMENT_REGION() + int k, depth = src.depth(), cn = src.channels(); if( cn == 1 ) { @@ -176,6 +179,8 @@ static bool ocl_split( InputArray _m, OutputArrayOfArrays _mv ) void cv::split(InputArray _m, OutputArrayOfArrays _mv) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(_m.dims() <= 2 && _mv.isUMatVector(), ocl_split(_m, _mv)) @@ -201,6 +206,8 @@ void cv::split(InputArray _m, OutputArrayOfArrays _mv) void cv::merge(const Mat* mv, size_t n, OutputArray _dst) { + CV_INSTRUMENT_REGION() + CV_Assert( mv && n > 0 ); int depth = mv[0].depth(); @@ -345,6 +352,8 @@ static bool ocl_merge( InputArrayOfArrays _mv, OutputArray _dst ) void cv::merge(InputArrayOfArrays _mv, OutputArray _dst) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(_mv.isUMatVector() && _dst.isUMat(), ocl_merge(_mv, _dst)) @@ -439,6 +448,8 @@ static MixChannelsFunc getMixchFunc(int depth) void cv::mixChannels( const Mat* src, size_t nsrcs, Mat* dst, size_t ndsts, const int* fromTo, size_t npairs ) { + CV_INSTRUMENT_REGION() + if( npairs == 0 ) return; CV_Assert( src && nsrcs > 0 && dst && ndsts > 0 && fromTo && npairs > 0 ); @@ -615,6 +626,8 @@ static bool ocl_mixChannels(InputArrayOfArrays _src, InputOutputArrayOfArrays _d void cv::mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst, const int* fromTo, size_t npairs) { + CV_INSTRUMENT_REGION() + if (npairs == 0 || fromTo == NULL) return; @@ -644,6 +657,8 @@ void cv::mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst, void cv::mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst, const std::vector& fromTo) { + CV_INSTRUMENT_REGION() + if (fromTo.empty()) return; @@ -672,6 +687,8 @@ void cv::mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst, void cv::extractChannel(InputArray _src, OutputArray _dst, int coi) { + CV_INSTRUMENT_REGION() + int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type); CV_Assert( 0 <= coi && coi < cn ); int ch[] = { coi, 0 }; @@ -693,6 +710,8 @@ void cv::extractChannel(InputArray _src, OutputArray _dst, int coi) void cv::insertChannel(InputArray _src, InputOutputArray _dst, int coi) { + CV_INSTRUMENT_REGION() + int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype); int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype), dcn = CV_MAT_CN(dtype); CV_Assert( _src.sameSize(_dst) && sdepth == ddepth ); @@ -4361,45 +4380,19 @@ struct Cvt_SIMD #endif -#if !( ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC__ ) ) || ( 5 <= __GNUC__ ) ) ) ) +#if !( ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC_MINOR__ ) ) || ( 5 <= __GNUC__ ) ) ) ) // const numbers for floating points format const unsigned int kShiftSignificand = 13; const unsigned int kMaskFp16Significand = 0x3ff; const unsigned int kBiasFp16Exponent = 15; const unsigned int kBiasFp32Exponent = 127; - -union fp32Int32 -{ - int i; - float f; - struct _fp32Format - { - unsigned int significand : 23; - unsigned int exponent : 8; - unsigned int sign : 1; - } fmt; -}; #endif -union fp16Int16 -{ - short i; -#if ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC__ ) ) || ( 5 <= __GNUC__ ) ) ) - __fp16 h; -#endif - struct _fp16Format - { - unsigned int significand : 10; - unsigned int exponent : 5; - unsigned int sign : 1; - } fmt; -}; - -#if ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC__ ) ) || ( 5 <= __GNUC__ ) ) ) +#if ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC_MINOR__ ) ) || ( 5 <= __GNUC__ ) ) ) static float convertFp16SW(short fp16) { // Fp16 -> Fp32 - fp16Int16 a; + Cv16suf a; a.i = fp16; return (float)a.h; } @@ -4407,12 +4400,12 @@ static float convertFp16SW(short fp16) static float convertFp16SW(short fp16) { // Fp16 -> Fp32 - fp16Int16 b; + Cv16suf b; b.i = fp16; int exponent = b.fmt.exponent - kBiasFp16Exponent; int significand = b.fmt.significand; - fp32Int32 a; + Cv32suf a; a.i = 0; a.fmt.sign = b.fmt.sign; // sign bit if( exponent == 16 ) @@ -4457,11 +4450,11 @@ static float convertFp16SW(short fp16) } #endif -#if ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC__ ) ) || ( 5 <= __GNUC__ ) ) ) +#if ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC_MINOR__ ) ) || ( 5 <= __GNUC__ ) ) ) static short convertFp16SW(float fp32) { // Fp32 -> Fp16 - fp16Int16 a; + Cv16suf a; a.h = (__fp16)fp32; return a.i; } @@ -4469,12 +4462,12 @@ static short convertFp16SW(float fp32) static short convertFp16SW(float fp32) { // Fp32 -> Fp16 - fp32Int32 a; + Cv32suf a; a.f = fp32; int exponent = a.fmt.exponent - kBiasFp32Exponent; int significand = a.fmt.significand; - fp16Int16 result; + Cv16suf result; result.i = 0; unsigned int absolute = a.i & 0x7fffffff; if( 0x477ff000 <= absolute ) @@ -4565,24 +4558,14 @@ cvtScaleHalf_( const float* src, size_t sstep, short* dst, size_t if ( ( (intptr_t)dst & 0xf ) == 0 ) #endif { -#if CV_FP16 +#if CV_FP16 && CV_SIMD128 for ( ; x <= size.width - 4; x += 4) { -#if defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86) || defined(i386) - __m128 v_src = _mm_loadu_ps(src + x); + v_float32x4 v_src = v_load(src + x); - __m128i v_dst = _mm_cvtps_ph(v_src, 0); + v_float16x4 v_dst = v_cvt_f16(v_src); - _mm_storel_epi64((__m128i *)(dst + x), v_dst); -#elif defined __GNUC__ && (defined __arm__ || defined __aarch64__) - float32x4_t v_src = vld1q_f32(src + x); - - float16x4_t v_dst = vcvt_f16_f32(v_src); - - vst1_f16((float16_t*)(dst + x), v_dst); -#else -#error "Configuration error" -#endif + v_store_f16(dst + x, v_dst); } #endif } @@ -4621,24 +4604,14 @@ cvtScaleHalf_( const short* src, size_t sstep, float* dst, size_t if ( ( (intptr_t)src & 0xf ) == 0 ) #endif { -#if CV_FP16 +#if CV_FP16 && CV_SIMD128 for ( ; x <= size.width - 4; x += 4) { -#if defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86) || defined(i386) - __m128i v_src = _mm_loadl_epi64((__m128i*)(src+x)); + v_float16x4 v_src = v_load_f16(src + x); - __m128 v_dst = _mm_cvtph_ps(v_src); + v_float32x4 v_dst = v_cvt_f32(v_src); - _mm_storeu_ps(dst + x, v_dst); -#elif defined __GNUC__ && (defined __arm__ || defined __aarch64__) - float16x4_t v_src = vld1_f16((float16_t*)(src + x)); - - float32x4_t v_dst = vcvt_f32_f16(v_src); - - vst1q_f32(dst + x, v_dst); -#else -#error "Configuration error" -#endif + v_store(dst + x, v_dst); } #endif } @@ -4767,7 +4740,7 @@ dtype* dst, size_t dstep, Size size, double* scale) \ static void cvt##suffix( const stype* src, size_t sstep, const uchar*, size_t, \ dtype* dst, size_t dstep, Size size, double*) \ { \ - CV_IPP_RUN(src && dst, ippiConvert_##ippFavor(src, (int)sstep, dst, (int)dstep, ippiSize(size.width, size.height)) >= 0)\ + CV_IPP_RUN(src && dst, CV_INSTRUMENT_FUN_IPP(ippiConvert_##ippFavor, src, (int)sstep, dst, (int)dstep, ippiSize(size.width, size.height)) >= 0) \ cvt_(src, sstep, dst, dstep, size); \ } @@ -4775,7 +4748,7 @@ static void cvt##suffix( const stype* src, size_t sstep, const uchar*, size_t, \ static void cvt##suffix( const stype* src, size_t sstep, const uchar*, size_t, \ dtype* dst, size_t dstep, Size size, double*) \ { \ - CV_IPP_RUN(src && dst, ippiConvert_##ippFavor(src, (int)sstep, dst, (int)dstep, ippiSize(size.width, size.height), ippRndFinancial, 0) >= 0)\ + CV_IPP_RUN(src && dst, CV_INSTRUMENT_FUN_IPP(ippiConvert_##ippFavor, src, (int)sstep, dst, (int)dstep, ippiSize(size.width, size.height), ippRndFinancial, 0) >= 0) \ cvt_(src, sstep, dst, dstep, size); \ } #else @@ -5102,6 +5075,8 @@ static bool ocl_convertScaleAbs( InputArray _src, OutputArray _dst, double alpha void cv::convertScaleAbs( InputArray _src, OutputArray _dst, double alpha, double beta ) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(), ocl_convertScaleAbs(_src, _dst, alpha, beta)) @@ -5132,6 +5107,8 @@ void cv::convertScaleAbs( InputArray _src, OutputArray _dst, double alpha, doubl void cv::convertFp16( InputArray _src, OutputArray _dst) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); int ddepth = 0; @@ -5174,6 +5151,8 @@ void cv::convertFp16( InputArray _src, OutputArray _dst) void cv::Mat::convertTo(OutputArray _dst, int _type, double alpha, double beta) const { + CV_INSTRUMENT_REGION() + bool noScale = fabs(alpha-1) < DBL_EPSILON && fabs(beta) < DBL_EPSILON; if( _type < 0 ) @@ -5398,7 +5377,7 @@ public: CV_DbgAssert(lutcn == 3 || lutcn == 4); if (lutcn == 3) { - IppStatus status = ippiCopy_8u_C3P3R(lut.ptr(), (int)lut.step[0], lutTable, (int)lut.step[0], sz256); + IppStatus status = CV_INSTRUMENT_FUN_IPP(ippiCopy_8u_C3P3R, lut.ptr(), (int)lut.step[0], lutTable, (int)lut.step[0], sz256); if (status < 0) { setIppErrorStatus(); @@ -5408,7 +5387,7 @@ public: } else if (lutcn == 4) { - IppStatus status = ippiCopy_8u_C4P4R(lut.ptr(), (int)lut.step[0], lutTable, (int)lut.step[0], sz256); + IppStatus status = CV_INSTRUMENT_FUN_IPP(ippiCopy_8u_C4P4R, lut.ptr(), (int)lut.step[0], lutTable, (int)lut.step[0], sz256); if (status < 0) { setIppErrorStatus(); @@ -5441,7 +5420,7 @@ public: if (lutcn == 3) { - if (ippiLUTPalette_8u_C3R( + if (CV_INSTRUMENT_FUN_IPP(ippiLUTPalette_8u_C3R, src.ptr(), (int)src.step[0], dst.ptr(), (int)dst.step[0], ippiSize(dst.size()), lutTable, 8) >= 0) { @@ -5451,7 +5430,7 @@ public: } else if (lutcn == 4) { - if (ippiLUTPalette_8u_C4R( + if (CV_INSTRUMENT_FUN_IPP(ippiLUTPalette_8u_C4R, src.ptr(), (int)src.step[0], dst.ptr(), (int)dst.step[0], ippiSize(dst.size()), lutTable, 8) >= 0) { @@ -5470,6 +5449,8 @@ private: static bool ipp_lut(Mat &src, Mat &lut, Mat &dst) { + CV_INSTRUMENT_REGION_IPP() + int lutcn = lut.channels(); if(src.dims > 2) @@ -5555,6 +5536,8 @@ private: void cv::LUT( InputArray _src, InputArray _lut, OutputArray _dst ) { + CV_INSTRUMENT_REGION() + int cn = _src.channels(), depth = _src.depth(); int lutcn = _lut.channels(); @@ -5702,6 +5685,8 @@ static bool ocl_normalize( InputArray _src, InputOutputArray _dst, InputArray _m void cv::normalize( InputArray _src, InputOutputArray _dst, double a, double b, int norm_type, int rtype, InputArray _mask ) { + CV_INSTRUMENT_REGION() + double scale = 1, shift = 0; if( norm_type == CV_MINMAX ) { diff --git a/modules/core/src/copy.cpp b/modules/core/src/copy.cpp index f2201e66fe..7149b8f37f 100644 --- a/modules/core/src/copy.cpp +++ b/modules/core/src/copy.cpp @@ -82,7 +82,7 @@ copyMask_(const uchar* _src, size_t sstep, const uchar* mask, size_t mstep, ucha template<> void copyMask_(const uchar* _src, size_t sstep, const uchar* mask, size_t mstep, uchar* _dst, size_t dstep, Size size) { - CV_IPP_RUN(true, ippiCopy_8u_C1MR(_src, (int)sstep, _dst, (int)dstep, ippiSize(size), mask, (int)mstep) >= 0) + CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippiCopy_8u_C1MR, _src, (int)sstep, _dst, (int)dstep, ippiSize(size), mask, (int)mstep) >= 0) for( ; size.height--; mask += mstep, _src += sstep, _dst += dstep ) { @@ -122,7 +122,7 @@ copyMask_(const uchar* _src, size_t sstep, const uchar* mask, size_t mste template<> void copyMask_(const uchar* _src, size_t sstep, const uchar* mask, size_t mstep, uchar* _dst, size_t dstep, Size size) { - CV_IPP_RUN(true, ippiCopy_16u_C1MR((const Ipp16u *)_src, (int)sstep, (Ipp16u *)_dst, (int)dstep, ippiSize(size), mask, (int)mstep) >= 0) + CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippiCopy_16u_C1MR, (const Ipp16u *)_src, (int)sstep, (Ipp16u *)_dst, (int)dstep, ippiSize(size), mask, (int)mstep) >= 0) for( ; size.height--; mask += mstep, _src += sstep, _dst += dstep ) { @@ -194,7 +194,7 @@ static void copyMask##suffix(const uchar* src, size_t sstep, const uchar* mask, static void copyMask##suffix(const uchar* src, size_t sstep, const uchar* mask, size_t mstep, \ uchar* dst, size_t dstep, Size size, void*) \ { \ - CV_IPP_RUN(true, ippiCopy_##ippfavor((const ipptype *)src, (int)sstep, (ipptype *)dst, (int)dstep, ippiSize(size), (const Ipp8u *)mask, (int)mstep) >= 0)\ + CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippiCopy_##ippfavor, (const ipptype *)src, (int)sstep, (ipptype *)dst, (int)dstep, ippiSize(size), (const Ipp8u *)mask, (int)mstep) >= 0)\ copyMask_(src, sstep, mask, mstep, dst, dstep, size); \ } #else @@ -251,6 +251,8 @@ BinaryFunc getCopyMaskFunc(size_t esz) /* dst = src */ void Mat::copyTo( OutputArray _dst ) const { + CV_INSTRUMENT_REGION() + int dtype = _dst.type(); if( _dst.fixedType() && dtype != type() ) { @@ -296,7 +298,7 @@ void Mat::copyTo( OutputArray _dst ) const (size_t)step <= (size_t)INT_MAX && (size_t)dst.step <= (size_t)INT_MAX , - ippiCopy_8u_C1R(sptr, (int)step, dptr, (int)dst.step, ippiSize((int)(cols*elemSize()), rows)) >= 0 + CV_INSTRUMENT_FUN_IPP(ippiCopy_8u_C1R, sptr, (int)step, dptr, (int)dst.step, ippiSize((int)(cols*elemSize()), rows)) >= 0 ) Size sz = getContinuousSize(*this, dst); @@ -327,6 +329,8 @@ void Mat::copyTo( OutputArray _dst ) const void Mat::copyTo( OutputArray _dst, InputArray _mask ) const { + CV_INSTRUMENT_REGION() + Mat mask = _mask.getMat(); if( !mask.data ) { @@ -367,6 +371,8 @@ void Mat::copyTo( OutputArray _dst, InputArray _mask ) const Mat& Mat::operator = (const Scalar& s) { + CV_INSTRUMENT_REGION() + const Mat* arrays[] = { this }; uchar* dptr; NAryMatIterator it(arrays, &dptr, 1); @@ -375,7 +381,7 @@ Mat& Mat::operator = (const Scalar& s) if( is[0] == 0 && is[1] == 0 && is[2] == 0 && is[3] == 0 ) { -#if defined HAVE_IPP && !defined HAVE_IPP_ICV_ONLY && IPP_DISABLE_BLOCK +#if defined HAVE_IPP && IPP_DISABLE_BLOCK CV_IPP_CHECK() { if (dims <= 2 || isContinuous()) @@ -435,6 +441,8 @@ Mat& Mat::operator = (const Scalar& s) #if defined HAVE_IPP static bool ipp_Mat_setTo(Mat *src, Mat &value, Mat &mask) { + CV_INSTRUMENT_REGION_IPP() + int cn = src->channels(), depth0 = src->depth(); if (!mask.empty() && (src->dims <= 2 || (src->isContinuous() && mask.isContinuous())) && @@ -460,13 +468,13 @@ static bool ipp_Mat_setTo(Mat *src, Mat &value, Mat &mask) /*if (depth0 == CV_8U) status = ippiSet_8u_C1MR(*(Ipp8u *)buf, (Ipp8u *)data, dstep, roisize, mask.data, mstep); else*/ if (depth0 == CV_16U) - status = ippiSet_16u_C1MR(*(Ipp16u *)buf, (Ipp16u *)src->data, dstep, roisize, mask.data, mstep); + status = CV_INSTRUMENT_FUN_IPP(ippiSet_16u_C1MR, *(Ipp16u *)buf, (Ipp16u *)src->data, dstep, roisize, mask.data, mstep); else if (depth0 == CV_16S) - status = ippiSet_16s_C1MR(*(Ipp16s *)buf, (Ipp16s *)src->data, dstep, roisize, mask.data, mstep); + status = CV_INSTRUMENT_FUN_IPP(ippiSet_16s_C1MR, *(Ipp16s *)buf, (Ipp16s *)src->data, dstep, roisize, mask.data, mstep); else if (depth0 == CV_32S) - status = ippiSet_32s_C1MR(*(Ipp32s *)buf, (Ipp32s *)src->data, dstep, roisize, mask.data, mstep); + status = CV_INSTRUMENT_FUN_IPP(ippiSet_32s_C1MR, *(Ipp32s *)buf, (Ipp32s *)src->data, dstep, roisize, mask.data, mstep); else if (depth0 == CV_32F) - status = ippiSet_32f_C1MR(*(Ipp32f *)buf, (Ipp32f *)src->data, dstep, roisize, mask.data, mstep); + status = CV_INSTRUMENT_FUN_IPP(ippiSet_32f_C1MR, *(Ipp32f *)buf, (Ipp32f *)src->data, dstep, roisize, mask.data, mstep); } else if (cn == 3 || cn == 4) { @@ -476,7 +484,7 @@ static bool ipp_Mat_setTo(Mat *src, Mat &value, Mat &mask) { \ typedef Ipp##ippfavor ipptype; \ ipptype ippvalue[4] = { ((ipptype *)buf)[0], ((ipptype *)buf)[1], ((ipptype *)buf)[2], ((ipptype *)buf)[3] }; \ - status = ippiSet_##ippfavor##_C##ippcn##MR(ippvalue, (ipptype *)src->data, dstep, roisize, mask.data, mstep); \ + status = CV_INSTRUMENT_FUN_IPP(ippiSet_##ippfavor##_C##ippcn##MR, ippvalue, (ipptype *)src->data, dstep, roisize, mask.data, mstep); \ } while ((void)0, 0) #define IPP_SET_CN(ippcn) \ @@ -515,6 +523,8 @@ static bool ipp_Mat_setTo(Mat *src, Mat &value, Mat &mask) Mat& Mat::setTo(InputArray _value, InputArray _mask) { + CV_INSTRUMENT_REGION() + if( empty() ) return *this; @@ -523,7 +533,7 @@ Mat& Mat::setTo(InputArray _value, InputArray _mask) CV_Assert( checkScalar(value, type(), _value.kind(), _InputArray::MAT )); CV_Assert( mask.empty() || (mask.type() == CV_8U && size == mask.size) ); - CV_IPP_RUN(true, ipp_Mat_setTo((cv::Mat*)this, value, mask), *this) + CV_IPP_RUN_FAST(ipp_Mat_setTo((cv::Mat*)this, value, mask), *this) size_t esz = elemSize(); BinaryFunc copymask = getCopyMaskFunc(esz); @@ -700,65 +710,67 @@ static bool ocl_flip(InputArray _src, OutputArray _dst, int flipCode ) #if defined HAVE_IPP static bool ipp_flip( Mat &src, Mat &dst, int flip_mode ) { + CV_INSTRUMENT_REGION_IPP() + int type = src.type(); - typedef IppStatus (CV_STDCALL * ippiMirror)(const void * pSrc, int srcStep, void * pDst, int dstStep, IppiSize roiSize, IppiAxis flip); - typedef IppStatus (CV_STDCALL * ippiMirrorI)(const void * pSrcDst, int srcDstStep, IppiSize roiSize, IppiAxis flip); - ippiMirror ippFunc = 0; - ippiMirrorI ippFuncI = 0; + typedef IppStatus (CV_STDCALL * IppiMirror)(const void * pSrc, int srcStep, void * pDst, int dstStep, IppiSize roiSize, IppiAxis flip); + typedef IppStatus (CV_STDCALL * IppiMirrorI)(const void * pSrcDst, int srcDstStep, IppiSize roiSize, IppiAxis flip); + IppiMirror ippiMirror = 0; + IppiMirrorI ippiMirror_I = 0; if (src.data == dst.data) { CV_SUPPRESS_DEPRECATED_START - ippFuncI = - type == CV_8UC1 ? (ippiMirrorI)ippiMirror_8u_C1IR : - type == CV_8UC3 ? (ippiMirrorI)ippiMirror_8u_C3IR : - type == CV_8UC4 ? (ippiMirrorI)ippiMirror_8u_C4IR : - type == CV_16UC1 ? (ippiMirrorI)ippiMirror_16u_C1IR : - type == CV_16UC3 ? (ippiMirrorI)ippiMirror_16u_C3IR : - type == CV_16UC4 ? (ippiMirrorI)ippiMirror_16u_C4IR : - type == CV_16SC1 ? (ippiMirrorI)ippiMirror_16s_C1IR : - type == CV_16SC3 ? (ippiMirrorI)ippiMirror_16s_C3IR : - type == CV_16SC4 ? (ippiMirrorI)ippiMirror_16s_C4IR : - type == CV_32SC1 ? (ippiMirrorI)ippiMirror_32s_C1IR : - type == CV_32SC3 ? (ippiMirrorI)ippiMirror_32s_C3IR : - type == CV_32SC4 ? (ippiMirrorI)ippiMirror_32s_C4IR : - type == CV_32FC1 ? (ippiMirrorI)ippiMirror_32f_C1IR : - type == CV_32FC3 ? (ippiMirrorI)ippiMirror_32f_C3IR : - type == CV_32FC4 ? (ippiMirrorI)ippiMirror_32f_C4IR : 0; + ippiMirror_I = + type == CV_8UC1 ? (IppiMirrorI)ippiMirror_8u_C1IR : + type == CV_8UC3 ? (IppiMirrorI)ippiMirror_8u_C3IR : + type == CV_8UC4 ? (IppiMirrorI)ippiMirror_8u_C4IR : + type == CV_16UC1 ? (IppiMirrorI)ippiMirror_16u_C1IR : + type == CV_16UC3 ? (IppiMirrorI)ippiMirror_16u_C3IR : + type == CV_16UC4 ? (IppiMirrorI)ippiMirror_16u_C4IR : + type == CV_16SC1 ? (IppiMirrorI)ippiMirror_16s_C1IR : + type == CV_16SC3 ? (IppiMirrorI)ippiMirror_16s_C3IR : + type == CV_16SC4 ? (IppiMirrorI)ippiMirror_16s_C4IR : + type == CV_32SC1 ? (IppiMirrorI)ippiMirror_32s_C1IR : + type == CV_32SC3 ? (IppiMirrorI)ippiMirror_32s_C3IR : + type == CV_32SC4 ? (IppiMirrorI)ippiMirror_32s_C4IR : + type == CV_32FC1 ? (IppiMirrorI)ippiMirror_32f_C1IR : + type == CV_32FC3 ? (IppiMirrorI)ippiMirror_32f_C3IR : + type == CV_32FC4 ? (IppiMirrorI)ippiMirror_32f_C4IR : 0; CV_SUPPRESS_DEPRECATED_END } else { - ippFunc = - type == CV_8UC1 ? (ippiMirror)ippiMirror_8u_C1R : - type == CV_8UC3 ? (ippiMirror)ippiMirror_8u_C3R : - type == CV_8UC4 ? (ippiMirror)ippiMirror_8u_C4R : - type == CV_16UC1 ? (ippiMirror)ippiMirror_16u_C1R : - type == CV_16UC3 ? (ippiMirror)ippiMirror_16u_C3R : - type == CV_16UC4 ? (ippiMirror)ippiMirror_16u_C4R : - type == CV_16SC1 ? (ippiMirror)ippiMirror_16s_C1R : - type == CV_16SC3 ? (ippiMirror)ippiMirror_16s_C3R : - type == CV_16SC4 ? (ippiMirror)ippiMirror_16s_C4R : - type == CV_32SC1 ? (ippiMirror)ippiMirror_32s_C1R : - type == CV_32SC3 ? (ippiMirror)ippiMirror_32s_C3R : - type == CV_32SC4 ? (ippiMirror)ippiMirror_32s_C4R : - type == CV_32FC1 ? (ippiMirror)ippiMirror_32f_C1R : - type == CV_32FC3 ? (ippiMirror)ippiMirror_32f_C3R : - type == CV_32FC4 ? (ippiMirror)ippiMirror_32f_C4R : 0; + ippiMirror = + type == CV_8UC1 ? (IppiMirror)ippiMirror_8u_C1R : + type == CV_8UC3 ? (IppiMirror)ippiMirror_8u_C3R : + type == CV_8UC4 ? (IppiMirror)ippiMirror_8u_C4R : + type == CV_16UC1 ? (IppiMirror)ippiMirror_16u_C1R : + type == CV_16UC3 ? (IppiMirror)ippiMirror_16u_C3R : + type == CV_16UC4 ? (IppiMirror)ippiMirror_16u_C4R : + type == CV_16SC1 ? (IppiMirror)ippiMirror_16s_C1R : + type == CV_16SC3 ? (IppiMirror)ippiMirror_16s_C3R : + type == CV_16SC4 ? (IppiMirror)ippiMirror_16s_C4R : + type == CV_32SC1 ? (IppiMirror)ippiMirror_32s_C1R : + type == CV_32SC3 ? (IppiMirror)ippiMirror_32s_C3R : + type == CV_32SC4 ? (IppiMirror)ippiMirror_32s_C4R : + type == CV_32FC1 ? (IppiMirror)ippiMirror_32f_C1R : + type == CV_32FC3 ? (IppiMirror)ippiMirror_32f_C3R : + type == CV_32FC4 ? (IppiMirror)ippiMirror_32f_C4R : 0; } IppiAxis axis = flip_mode == 0 ? ippAxsHorizontal : flip_mode > 0 ? ippAxsVertical : ippAxsBoth; IppiSize roisize = { dst.cols, dst.rows }; - if (ippFunc != 0) + if (ippiMirror != 0) { - if (ippFunc(src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, ippiSize(src.cols, src.rows), axis) >= 0) + if (CV_INSTRUMENT_FUN_IPP(ippiMirror, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, ippiSize(src.cols, src.rows), axis) >= 0) return true; } - else if (ippFuncI != 0) + else if (ippiMirror_I != 0) { - if (ippFuncI(dst.ptr(), (int)dst.step, roisize, axis) >= 0) + if (CV_INSTRUMENT_FUN_IPP(ippiMirror_I, dst.ptr(), (int)dst.step, roisize, axis) >= 0) return true; } @@ -769,6 +781,8 @@ static bool ipp_flip( Mat &src, Mat &dst, int flip_mode ) void flip( InputArray _src, OutputArray _dst, int flip_mode ) { + CV_INSTRUMENT_REGION() + CV_Assert( _src.dims() <= 2 ); Size size = _src.size(); @@ -794,7 +808,7 @@ void flip( InputArray _src, OutputArray _dst, int flip_mode ) _dst.create( size, type ); Mat dst = _dst.getMat(); - CV_IPP_RUN(true, ipp_flip(src, dst, flip_mode)); + CV_IPP_RUN_FAST(ipp_flip(src, dst, flip_mode)); size_t esz = CV_ELEM_SIZE(type); @@ -839,6 +853,8 @@ static bool ocl_repeat(InputArray _src, int ny, int nx, OutputArray _dst) void repeat(InputArray _src, int ny, int nx, OutputArray _dst) { + CV_INSTRUMENT_REGION() + CV_Assert( _src.dims() <= 2 ); CV_Assert( ny > 0 && nx > 0 ); @@ -890,6 +906,8 @@ Mat repeat(const Mat& src, int ny, int nx) */ int cv::borderInterpolate( int p, int len, int borderType ) { + CV_INSTRUMENT_REGION() + if( (unsigned)p < (unsigned)len ) ; else if( borderType == BORDER_REPLICATE ) @@ -1119,6 +1137,8 @@ static bool ocl_copyMakeBorder( InputArray _src, OutputArray _dst, int top, int void cv::copyMakeBorder( InputArray _src, OutputArray _dst, int top, int bottom, int left, int right, int borderType, const Scalar& value ) { + CV_INSTRUMENT_REGION() + CV_Assert( top >= 0 && bottom >= 0 && left >= 0 && right >= 0 ); CV_OCL_RUN(_dst.isUMat() && _src.dims() <= 2, diff --git a/modules/core/src/cuda/gpu_mat.cu b/modules/core/src/cuda/gpu_mat.cu index a772e43abc..987de9e7c5 100644 --- a/modules/core/src/cuda/gpu_mat.cu +++ b/modules/core/src/cuda/gpu_mat.cu @@ -594,7 +594,7 @@ void cv::cuda::GpuMat::convertTo(OutputArray _dst, int rtype, double alpha, doub funcs[sdepth][ddepth](reshape(1), dst.reshape(1), alpha, beta, stream); } -void cv::cuda::convertFp16Cuda(InputArray _src, OutputArray _dst, Stream& stream) +void cv::cuda::convertFp16(InputArray _src, OutputArray _dst, Stream& stream) { GpuMat src = _src.getGpuMat(); int ddepth = 0; diff --git a/modules/core/src/dxt.cpp b/modules/core/src/dxt.cpp index 162052667b..b52ba93032 100644 --- a/modules/core/src/dxt.cpp +++ b/modules/core/src/dxt.cpp @@ -469,53 +469,53 @@ template<> struct DFT_VecR4 static IppStatus ippsDFTFwd_CToC( const Complex* src, Complex* dst, const void* spec, uchar* buf) { - return ippsDFTFwd_CToC_32fc( (const Ipp32fc*)src, (Ipp32fc*)dst, + return CV_INSTRUMENT_FUN_IPP(ippsDFTFwd_CToC_32fc, (const Ipp32fc*)src, (Ipp32fc*)dst, (const IppsDFTSpec_C_32fc*)spec, buf); } static IppStatus ippsDFTFwd_CToC( const Complex* src, Complex* dst, const void* spec, uchar* buf) { - return ippsDFTFwd_CToC_64fc( (const Ipp64fc*)src, (Ipp64fc*)dst, + return CV_INSTRUMENT_FUN_IPP(ippsDFTFwd_CToC_64fc, (const Ipp64fc*)src, (Ipp64fc*)dst, (const IppsDFTSpec_C_64fc*)spec, buf); } static IppStatus ippsDFTInv_CToC( const Complex* src, Complex* dst, const void* spec, uchar* buf) { - return ippsDFTInv_CToC_32fc( (const Ipp32fc*)src, (Ipp32fc*)dst, + return CV_INSTRUMENT_FUN_IPP(ippsDFTInv_CToC_32fc, (const Ipp32fc*)src, (Ipp32fc*)dst, (const IppsDFTSpec_C_32fc*)spec, buf); } static IppStatus ippsDFTInv_CToC( const Complex* src, Complex* dst, const void* spec, uchar* buf) { - return ippsDFTInv_CToC_64fc( (const Ipp64fc*)src, (Ipp64fc*)dst, + return CV_INSTRUMENT_FUN_IPP(ippsDFTInv_CToC_64fc, (const Ipp64fc*)src, (Ipp64fc*)dst, (const IppsDFTSpec_C_64fc*)spec, buf); } static IppStatus ippsDFTFwd_RToPack( const float* src, float* dst, const void* spec, uchar* buf) { - return ippsDFTFwd_RToPack_32f( src, dst, (const IppsDFTSpec_R_32f*)spec, buf); + return CV_INSTRUMENT_FUN_IPP(ippsDFTFwd_RToPack_32f, src, dst, (const IppsDFTSpec_R_32f*)spec, buf); } static IppStatus ippsDFTFwd_RToPack( const double* src, double* dst, const void* spec, uchar* buf) { - return ippsDFTFwd_RToPack_64f( src, dst, (const IppsDFTSpec_R_64f*)spec, buf); + return CV_INSTRUMENT_FUN_IPP(ippsDFTFwd_RToPack_64f, src, dst, (const IppsDFTSpec_R_64f*)spec, buf); } static IppStatus ippsDFTInv_PackToR( const float* src, float* dst, const void* spec, uchar* buf) { - return ippsDFTInv_PackToR_32f( src, dst, (const IppsDFTSpec_R_32f*)spec, buf); + return CV_INSTRUMENT_FUN_IPP(ippsDFTInv_PackToR_32f, src, dst, (const IppsDFTSpec_R_32f*)spec, buf); } static IppStatus ippsDFTInv_PackToR( const double* src, double* dst, const void* spec, uchar* buf) { - return ippsDFTInv_PackToR_64f( src, dst, (const IppsDFTSpec_R_64f*)spec, buf); + return CV_INSTRUMENT_FUN_IPP(ippsDFTInv_PackToR_64f, src, dst, (const IppsDFTSpec_R_64f*)spec, buf); } #endif @@ -1564,6 +1564,8 @@ public: virtual void operator()(const Range& range) const { + CV_INSTRUMENT_REGION_IPP(); + IppStatus status; Ipp8u* pBuffer = 0; Ipp8u* pMemInit= 0; @@ -1645,6 +1647,8 @@ public: virtual void operator()(const Range& range) const { + CV_INSTRUMENT_REGION_IPP(); + IppStatus status; Ipp8u* pBuffer = 0; Ipp8u* pMemInit= 0; @@ -1728,30 +1732,32 @@ bool Dft_R_IPPLoop(const uchar * src, size_t src_step, uchar * dst, size_t dst_s struct IPPDFT_C_Functor { - IPPDFT_C_Functor(ippiDFT_C_Func _func) : func(_func){} + IPPDFT_C_Functor(ippiDFT_C_Func _func) : ippiDFT_CToC_32fc_C1R(_func){} bool operator()(const Ipp32fc* src, size_t srcStep, Ipp32fc* dst, size_t dstStep, const IppiDFTSpec_C_32fc* pDFTSpec, Ipp8u* pBuffer) const { - return func ? func(src, static_cast(srcStep), dst, static_cast(dstStep), pDFTSpec, pBuffer) >= 0 : false; + return ippiDFT_CToC_32fc_C1R ? CV_INSTRUMENT_FUN_IPP(ippiDFT_CToC_32fc_C1R, src, static_cast(srcStep), dst, static_cast(dstStep), pDFTSpec, pBuffer) >= 0 : false; } private: - ippiDFT_C_Func func; + ippiDFT_C_Func ippiDFT_CToC_32fc_C1R; }; struct IPPDFT_R_Functor { - IPPDFT_R_Functor(ippiDFT_R_Func _func) : func(_func){} + IPPDFT_R_Functor(ippiDFT_R_Func _func) : ippiDFT_PackToR_32f_C1R(_func){} bool operator()(const Ipp32f* src, size_t srcStep, Ipp32f* dst, size_t dstStep, const IppiDFTSpec_R_32f* pDFTSpec, Ipp8u* pBuffer) const { - return func ? func(src, static_cast(srcStep), dst, static_cast(dstStep), pDFTSpec, pBuffer) >= 0 : false; + return ippiDFT_PackToR_32f_C1R ? CV_INSTRUMENT_FUN_IPP(ippiDFT_PackToR_32f_C1R, src, static_cast(srcStep), dst, static_cast(dstStep), pDFTSpec, pBuffer) >= 0 : false; } private: - ippiDFT_R_Func func; + ippiDFT_R_Func ippiDFT_PackToR_32f_C1R; }; static bool ippi_DFT_C_32F(const uchar * src, size_t src_step, uchar * dst, size_t dst_step, int width, int height, bool inv, int norm_flag) { + CV_INSTRUMENT_REGION_IPP() + IppStatus status; Ipp8u* pBuffer = 0; Ipp8u* pMemInit= 0; @@ -1787,9 +1793,9 @@ static bool ippi_DFT_C_32F(const uchar * src, size_t src_step, uchar * dst, size } if (!inv) - status = ippiDFTFwd_CToC_32fc_C1R( (Ipp32fc*)src, static_cast(src_step), (Ipp32fc*)dst, static_cast(dst_step), pDFTSpec, pBuffer ); + status = CV_INSTRUMENT_FUN_IPP(ippiDFTFwd_CToC_32fc_C1R, (Ipp32fc*)src, static_cast(src_step), (Ipp32fc*)dst, static_cast(dst_step), pDFTSpec, pBuffer); else - status = ippiDFTInv_CToC_32fc_C1R( (Ipp32fc*)src, static_cast(src_step), (Ipp32fc*)dst, static_cast(dst_step), pDFTSpec, pBuffer ); + status = CV_INSTRUMENT_FUN_IPP(ippiDFTInv_CToC_32fc_C1R, (Ipp32fc*)src, static_cast(src_step), (Ipp32fc*)dst, static_cast(dst_step), pDFTSpec, pBuffer); if ( sizeBuffer > 0 ) ippFree( pBuffer ); @@ -1806,6 +1812,8 @@ static bool ippi_DFT_C_32F(const uchar * src, size_t src_step, uchar * dst, size static bool ippi_DFT_R_32F(const uchar * src, size_t src_step, uchar * dst, size_t dst_step, int width, int height, bool inv, int norm_flag) { + CV_INSTRUMENT_REGION_IPP() + IppStatus status; Ipp8u* pBuffer = 0; Ipp8u* pMemInit= 0; @@ -1841,9 +1849,9 @@ static bool ippi_DFT_R_32F(const uchar * src, size_t src_step, uchar * dst, size } if (!inv) - status = ippiDFTFwd_RToPack_32f_C1R( (float*)src, static_cast(src_step), (float*)dst, static_cast(dst_step), pDFTSpec, pBuffer ); + status = CV_INSTRUMENT_FUN_IPP(ippiDFTFwd_RToPack_32f_C1R, (float*)src, static_cast(src_step), (float*)dst, static_cast(dst_step), pDFTSpec, pBuffer); else - status = ippiDFTInv_PackToR_32f_C1R( (float*)src, static_cast(src_step), (float*)dst, static_cast(dst_step), pDFTSpec, pBuffer ); + status = CV_INSTRUMENT_FUN_IPP(ippiDFTInv_PackToR_32f_C1R, (float*)src, static_cast(src_step), (float*)dst, static_cast(dst_step), pDFTSpec, pBuffer); if ( sizeBuffer > 0 ) ippFree( pBuffer ); @@ -3318,6 +3326,8 @@ Ptr DFT2D::create(int width, int height, int depth, void cv::dft( InputArray _src0, OutputArray _dst, int flags, int nonzero_rows ) { + CV_INSTRUMENT_REGION() + #ifdef HAVE_CLAMDFFT CV_OCL_RUN(ocl::haveAmdFft() && ocl::Device::getDefault().type() != ocl::Device::TYPE_CPU && _dst.isUMat() && _src0.dims() <= 2 && nonzero_rows == 0, @@ -3363,6 +3373,8 @@ void cv::dft( InputArray _src0, OutputArray _dst, int flags, int nonzero_rows ) void cv::idft( InputArray src, OutputArray dst, int flags, int nonzero_rows ) { + CV_INSTRUMENT_REGION() + dft( src, dst, flags | DFT_INVERSE, nonzero_rows ); } @@ -3407,6 +3419,8 @@ static bool ocl_mulSpectrums( InputArray _srcA, InputArray _srcB, void cv::mulSpectrums( InputArray _srcA, InputArray _srcB, OutputArray _dst, int flags, bool conjB ) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(_dst.isUMat() && _srcA.dims() <= 2 && _srcB.dims() <= 2, ocl_mulSpectrums(_srcA, _srcB, _dst, flags, conjB)) @@ -3795,6 +3809,8 @@ public: virtual void operator()(const Range& range) const { + CV_INSTRUMENT_REGION_IPP() + if(*ok == false) return; @@ -3818,7 +3834,7 @@ public: ippFree(pInitBuf); \ return; - ippiDCTFunc ippDctFun = inv ? (ippiDCTFunc)ippiDCTInv_32f_C1R : (ippiDCTFunc)ippiDCTFwd_32f_C1R; + ippiDCTFunc ippiDCT_32f_C1R = inv ? (ippiDCTFunc)ippiDCTInv_32f_C1R : (ippiDCTFunc)ippiDCTFwd_32f_C1R; ippiDCTInit ippDctInit = inv ? (ippiDCTInit)ippiDCTInvInit_32f : (ippiDCTInit)ippiDCTFwdInit_32f; ippiDCTGetSize ippDctGetSize = inv ? (ippiDCTGetSize)ippiDCTInvGetSize_32f : (ippiDCTGetSize)ippiDCTFwdGetSize_32f; @@ -3856,7 +3872,7 @@ public: for(int i = range.start; i < range.end; ++i) { - if(ippDctFun((float*)(src + src_step * i), static_cast(src_step), (float*)(dst + dst_step * i), static_cast(dst_step), pDCTSpec, pBuffer) < 0) + if(CV_INSTRUMENT_FUN_IPP(ippiDCT_32f_C1R, (float*)(src + src_step * i), static_cast(src_step), (float*)(dst + dst_step * i), static_cast(dst_step), pDCTSpec, pBuffer) < 0) { *ok = false; IPP_RETURN @@ -3925,6 +3941,8 @@ static bool DctIPPLoop(const uchar * src, size_t src_step, uchar * dst, size_t d static bool ippi_DCT_32f(const uchar * src, size_t src_step, uchar * dst, size_t dst_step, int width, int height, bool inv, bool row) { + CV_INSTRUMENT_REGION_IPP() + if(row) return DctIPPLoop(src, src_step, dst, dst_step, width, height, inv); else @@ -3948,7 +3966,7 @@ static bool ippi_DCT_32f(const uchar * src, size_t src_step, uchar * dst, size_t if(pInitBuf) \ ippFree(pInitBuf); \ - ippiDCTFunc ippDctFun = inv ? (ippiDCTFunc)ippiDCTInv_32f_C1R : (ippiDCTFunc)ippiDCTFwd_32f_C1R; + ippiDCTFunc ippiDCT_32f_C1R = inv ? (ippiDCTFunc)ippiDCTInv_32f_C1R : (ippiDCTFunc)ippiDCTFwd_32f_C1R; ippiDCTInit ippDctInit = inv ? (ippiDCTInit)ippiDCTInvInit_32f : (ippiDCTInit)ippiDCTFwdInit_32f; ippiDCTGetSize ippDctGetSize = inv ? (ippiDCTGetSize)ippiDCTInvGetSize_32f : (ippiDCTGetSize)ippiDCTFwdGetSize_32f; @@ -3978,7 +3996,7 @@ static bool ippi_DCT_32f(const uchar * src, size_t src_step, uchar * dst, size_t return false; } - if(ippDctFun((float*)src, static_cast(src_step), (float*)dst, static_cast(dst_step), pDCTSpec, pBuffer) < 0) + if(CV_INSTRUMENT_FUN_IPP(ippiDCT_32f_C1R, (float*)src, static_cast(src_step), (float*)dst, static_cast(dst_step), pDCTSpec, pBuffer) < 0) { IPP_RELEASE return false; @@ -4218,6 +4236,8 @@ Ptr DCT2D::create(int width, int height, int depth, int flags) void cv::dct( InputArray _src0, OutputArray _dst, int flags ) { + CV_INSTRUMENT_REGION() + Mat src0 = _src0.getMat(), src = src0; int type = src.type(), depth = src.depth(); @@ -4240,6 +4260,8 @@ void cv::dct( InputArray _src0, OutputArray _dst, int flags ) void cv::idct( InputArray src, OutputArray dst, int flags ) { + CV_INSTRUMENT_REGION() + dct( src, dst, flags | DCT_INVERSE ); } diff --git a/modules/core/src/glob.cpp b/modules/core/src/glob.cpp index e0c7f66a3a..9bd3bdbfca 100644 --- a/modules/core/src/glob.cpp +++ b/modules/core/src/glob.cpp @@ -259,6 +259,8 @@ static void glob_rec(const cv::String& directory, const cv::String& wildchart, s void cv::glob(String pattern, std::vector& result, bool recursive) { + CV_INSTRUMENT_REGION() + result.clear(); String path, wildchart; diff --git a/modules/core/src/hal_internal.cpp b/modules/core/src/hal_internal.cpp index 07054f1d6c..0c6b7c01f8 100644 --- a/modules/core/src/hal_internal.cpp +++ b/modules/core/src/hal_internal.cpp @@ -46,17 +46,27 @@ #ifdef HAVE_LAPACK +#ifdef HAVE_LAPACK_MKL + #include + #include +#endif + +#ifdef HAVE_LAPACK_GENERIC + #include + #include +#endif + #include -#include -#include #include #include #include #include +#include #define HAL_GEMM_SMALL_COMPLEX_MATRIX_THRESH 100 #define HAL_GEMM_SMALL_MATRIX_THRESH 100 #define HAL_SVD_SMALL_MATRIX_THRESH 25 +#define HAL_QR_SMALL_MATRIX_THRESH 30 #define HAL_LU_SMALL_MATRIX_THRESH 100 #define HAL_CHOLESKY_SMALL_MATRIX_THRESH 100 @@ -150,7 +160,7 @@ lapack_LU(fptype* a, size_t a_step, int m, fptype* b, size_t b_step, int n, int* template static inline int lapack_Cholesky(fptype* a, size_t a_step, int m, fptype* b, size_t b_step, int n, bool* info) { - int lapackStatus; + int lapackStatus = 0; int lda = a_step / sizeof(fptype); char L[] = {'L', '\0'}; @@ -227,7 +237,7 @@ lapack_SVD(fptype* a, size_t a_step, fptype *w, fptype* u, size_t u_step, fptype else if(typeid(fptype) == typeid(double)) dgesdd_(mode, &m, &n, (double*)a, &lda, (double*)w, (double*)u, &ldu, (double*)vt, &ldv, (double*)&work1, &lwork, iworkBuf, info); - lwork = round(work1); //optimal buffer size + lwork = (int)round(work1); //optimal buffer size fptype* buffer = new fptype[lwork + 1]; if(typeid(fptype) == typeid(float)) @@ -251,6 +261,106 @@ lapack_SVD(fptype* a, size_t a_step, fptype *w, fptype* u, size_t u_step, fptype return CV_HAL_ERROR_OK; } +template static inline int +lapack_QR(fptype* a, size_t a_step, int m, int n, int k, fptype* b, size_t b_step, fptype* dst, int* info) +{ + int lda = a_step / sizeof(fptype); + char mode[] = { 'N', '\0' }; + if(m < n) + return CV_HAL_ERROR_NOT_IMPLEMENTED; + + std::vector tmpAMemHolder; + fptype* tmpA; + int ldtmpA; + if (m == n) + { + transpose_square_inplace(a, lda, m); + tmpA = a; + ldtmpA = lda; + } + else + { + tmpAMemHolder.resize(m*n); + tmpA = &tmpAMemHolder.front(); + ldtmpA = m; + transpose(a, lda, tmpA, m, m, n); + } + + int lwork = -1; + fptype work1 = 0.; + + if (b) + { + if (k == 1 && b_step == sizeof(fptype)) + { + if (typeid(fptype) == typeid(float)) + sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)b, &m, (float*)&work1, &lwork, info); + else if (typeid(fptype) == typeid(double)) + dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)&work1, &lwork, info); + + lwork = (int)round(work1); //optimal buffer size + std::vector workBufMemHolder(lwork + 1); + fptype* buffer = &workBufMemHolder.front(); + + if (typeid(fptype) == typeid(float)) + sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)b, &m, (float*)buffer, &lwork, info); + else if (typeid(fptype) == typeid(double)) + dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)buffer, &lwork, info); + } + else + { + std::vector tmpBMemHolder(m*k); + fptype* tmpB = &tmpBMemHolder.front(); + int ldb = b_step / sizeof(fptype); + transpose(b, ldb, tmpB, m, m, k); + + if (typeid(fptype) == typeid(float)) + sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)tmpB, &m, (float*)&work1, &lwork, info); + else if (typeid(fptype) == typeid(double)) + dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)&work1, &lwork, info); + + lwork = (int)round(work1); //optimal buffer size + std::vector workBufMemHolder(lwork + 1); + fptype* buffer = &workBufMemHolder.front(); + + if (typeid(fptype) == typeid(float)) + sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)tmpB, &m, (float*)buffer, &lwork, info); + else if (typeid(fptype) == typeid(double)) + dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)buffer, &lwork, info); + + transpose(tmpB, m, b, ldb, k, m); + } + } + else + { + if (typeid(fptype) == typeid(float)) + sgeqrf_(&m, &n, (float*)tmpA, &ldtmpA, (float*)dst, (float*)&work1, &lwork, info); + else if (typeid(fptype) == typeid(double)) + dgeqrf_(&m, &n, (double*)tmpA, &ldtmpA, (double*)dst, (double*)&work1, &lwork, info); + + lwork = (int)round(work1); //optimal buffer size + std::vector workBufMemHolder(lwork + 1); + fptype* buffer = &workBufMemHolder.front(); + + if (typeid(fptype) == typeid(float)) + sgeqrf_(&m, &n, (float*)tmpA, &ldtmpA, (float*)dst, (float*)buffer, &lwork, info); + else if (typeid(fptype) == typeid(double)) + dgeqrf_(&m, &n, (double*)tmpA, &ldtmpA, (double*)dst, (double*)buffer, &lwork, info); + } + + if (m == n) + transpose_square_inplace(a, lda, m); + else + transpose(tmpA, m, a, lda, n, m); + + if (*info != 0) + *info = 0; + else + *info = 1; + + return CV_HAL_ERROR_OK; +} + template static inline int lapack_gemm(const fptype *src1, size_t src1_step, const fptype *src2, size_t src2_step, fptype alpha, const fptype *src3, size_t src3_step, fptype beta, fptype *dst, size_t dst_step, int a_m, int a_n, int d_n, int flags) @@ -451,6 +561,20 @@ int lapack_SVD64f(double* a, size_t a_step, double *w, double* u, size_t u_step, return lapack_SVD(a, a_step, w, u, u_step, vt, v_step, m, n, flags, &info); } +int lapack_QR32f(float* src1, size_t src1_step, int m, int n, int k, float* src2, size_t src2_step, float* dst, int* info) +{ + if (m < HAL_QR_SMALL_MATRIX_THRESH) + return CV_HAL_ERROR_NOT_IMPLEMENTED; + return lapack_QR(src1, src1_step, m, n, k, src2, src2_step, dst, info); +} + +int lapack_QR64f(double* src1, size_t src1_step, int m, int n, int k, double* src2, size_t src2_step, double* dst, int* info) +{ + if (m < HAL_QR_SMALL_MATRIX_THRESH) + return CV_HAL_ERROR_NOT_IMPLEMENTED; + return lapack_QR(src1, src1_step, m, n, k, src2, src2_step, dst, info); +} + int lapack_gemm32f(const float *src1, size_t src1_step, const float *src2, size_t src2_step, float alpha, const float *src3, size_t src3_step, float beta, float *dst, size_t dst_step, int m, int n, int k, int flags) { diff --git a/modules/core/src/hal_internal.hpp b/modules/core/src/hal_internal.hpp index 26bc142e04..129a710145 100644 --- a/modules/core/src/hal_internal.hpp +++ b/modules/core/src/hal_internal.hpp @@ -55,6 +55,8 @@ int lapack_Cholesky32f(float* a, size_t a_step, int m, float* b, size_t b_step, int lapack_Cholesky64f(double* a, size_t a_step, int m, double* b, size_t b_step, int n, bool* info); int lapack_SVD32f(float* a, size_t a_step, float* w, float* u, size_t u_step, float* vt, size_t v_step, int m, int n, int flags); int lapack_SVD64f(double* a, size_t a_step, double* w, double* u, size_t u_step, double* vt, size_t v_step, int m, int n, int flags); +int lapack_QR32f(float* src1, size_t src1_step, int m, int n, int k, float* src2, size_t src2_step, float* dst, int* info); +int lapack_QR64f(double* src1, size_t src1_step, int m, int n, int k, double* src2, size_t src2_step, double* dst, int* info); int lapack_gemm32f(const float* src1, size_t src1_step, const float* src2, size_t src2_step, float alpha, const float* src3, size_t src3_step, float beta, float* dst, size_t dst_step, int m, int n, int k, int flags); @@ -83,6 +85,11 @@ int lapack_gemm64fc(const double* src1, size_t src1_step, const double* src2, si #undef cv_hal_SVD64f #define cv_hal_SVD64f lapack_SVD64f +#undef cv_hal_QR32f +#define cv_hal_QR32f lapack_QR32f +#undef cv_hal_QR64f +#define cv_hal_QR64f lapack_QR64f + #undef cv_hal_gemm32f #define cv_hal_gemm32f lapack_gemm32f #undef cv_hal_gemm64f diff --git a/modules/core/src/hal_replacement.hpp b/modules/core/src/hal_replacement.hpp index 7f826b4096..9a1177e9c2 100644 --- a/modules/core/src/hal_replacement.hpp +++ b/modules/core/src/hal_replacement.hpp @@ -582,11 +582,11 @@ Performs \f$LU\f$ decomposition of square matrix \f$A=P*L*U\f$ (where \f$P\f$ is Function returns the \f$sign\f$ of permutation \f$P\f$ via parameter info. @param src1 pointer to input matrix \f$A\f$ stored in row major order. After finish of work src1 contains at least \f$U\f$ part of \f$LU\f$ decomposition which is appropriate for determainant calculation: \f$det(A)=sign*\prod_{j=1}^{M}a_{jj}\f$. -@param src1_step number of bytes each matrix \f$A\f$ row occupies. +@param src1_step number of bytes between two consequent rows of matrix \f$A\f$. @param m size of square matrix \f$A\f$. @param src2 pointer to \f$M\times N\f$ matrix \f$B\f$ which is the right-hand side of system \f$A*X=B\f$. \f$B\f$ stored in row major order. If src2 is null pointer only \f$LU\f$ decomposition will be performed. After finish of work src2 contains solution \f$X\f$ of system \f$A*X=B\f$. -@param src2_step number of bytes each matrix \f$B\f$ row occupies. +@param src2_step number of bytes between two consequent rows of matrix \f$B\f$. @param n number of right-hand vectors in \f$M\times N\f$ matrix \f$B\f$. @param info indicates success of decomposition. If *info is equals to zero decomposition failed, othervise *info is equals to \f$sign\f$. */ @@ -599,11 +599,11 @@ inline int hal_ni_LU64f(double* src1, size_t src1_step, int m, double* src2, siz /** Performs Cholesky decomposition of matrix \f$A = L*L^T\f$ and solves matrix equation \f$A*X=B\f$. @param src1 pointer to input matrix \f$A\f$ stored in row major order. After finish of work src1 contains lower triangular matrix \f$L\f$. -@param src1_step number of bytes each matrix \f$A\f$ row occupies. +@param src1_step number of bytes between two consequent rows of matrix \f$A\f$. @param m size of square matrix \f$A\f$. @param src2 pointer to \f$M\times N\f$ matrix \f$B\f$ which is the right-hand side of system \f$A*X=B\f$. B stored in row major order. If src2 is null pointer only Cholesky decomposition will be performed. After finish of work src2 contains solution \f$X\f$ of system \f$A*X=B\f$. -@param src2_step number of bytes each matrix \f$B\f$ row occupies. +@param src2_step number of bytes between two consequent rows of matrix \f$B\f$. @param n number of right-hand vectors in \f$M\times N\f$ matrix \f$B\f$. @param info indicates success of decomposition. If *info is false decomposition failed. */ @@ -618,12 +618,12 @@ inline int hal_ni_Cholesky64f(double* src1, size_t src1_step, int m, double* src Performs singular value decomposition of \f$M\times N\f$(\f$M>N\f$) matrix \f$A = U*\Sigma*V^T\f$. @param src pointer to input \f$M\times N\f$ matrix \f$A\f$ stored in column major order. After finish of work src will be filled with rows of \f$U\f$ or not modified (depends of flag CV_HAL_SVD_MODIFY_A). -@param src_step number of bytes each matrix \f$A\f$ column occupies. +@param src_step number of bytes between two consequent columns of matrix \f$A\f$. @param w pointer to array for singular values of matrix \f$A\f$ (i. e. first \f$N\f$ diagonal elements of matrix \f$\Sigma\f$). @param u pointer to output \f$M\times N\f$ or \f$M\times M\f$ matrix \f$U\f$ (size depends of flags). Pointer must be valid if flag CV_HAL_SVD_MODIFY_A not used. -@param u_step number of bytes each matrix \f$U\f$ row occupies. +@param u_step number of bytes between two consequent rows of matrix \f$U\f$. @param vt pointer to array for \f$N\times N\f$ matrix \f$V^T\f$. -@param vt_step number of bytes each matrix \f$V^T\f$ row occupies. +@param vt_step number of bytes between two consequent rows of matrix \f$V^T\f$. @param m number fo rows in matrix \f$A\f$. @param n number of columns in matrix \f$A\f$. @param flags algorithm options (combination of CV_HAL_SVD_FULL_UV, ...). @@ -634,6 +634,27 @@ inline int hal_ni_SVD32f(float* src, size_t src_step, float* w, float* u, size_t inline int hal_ni_SVD64f(double* src, size_t src_step, double* w, double* u, size_t u_step, double* vt, size_t vt_step, int m, int n, int flags) { return CV_HAL_ERROR_NOT_IMPLEMENTED; } //! @} +/** +Performs QR decomposition of \f$M\times N\f$(\f$M>N\f$) matrix \f$A = Q*R\f$ and solves matrix equation \f$A*X=B\f$. +@param src1 pointer to input matrix \f$A\f$ stored in row major order. After finish of work src1 contains upper triangular \f$N\times N\f$ matrix \f$R\f$. +Lower triangle of src1 will be filled with vectors of elementary reflectors. See @cite VandLec and Lapack's DGEQRF documentation for details. +@param src1_step number of bytes between two consequent rows of matrix \f$A\f$. +@param m number fo rows in matrix \f$A\f$. +@param n number of columns in matrix \f$A\f$. +@param k number of right-hand vectors in \f$M\times K\f$ matrix \f$B\f$. +@param src2 pointer to \f$M\times K\f$ matrix \f$B\f$ which is the right-hand side of system \f$A*X=B\f$. \f$B\f$ stored in row major order. +If src2 is null pointer only QR decomposition will be performed. Otherwise system will be solved and src1 will be used as temporary buffer, so +after finish of work src2 contains solution \f$X\f$ of system \f$A*X=B\f$. +@param src2_step number of bytes between two consequent rows of matrix \f$B\f$. +@param dst pointer to continiuos \f$N\times 1\f$ array for scalar factors of elementary reflectors. See @cite VandLec for details. +@param info indicates success of decomposition. If *info is zero decomposition failed. +*/ +//! @addtogroup core_hal_interface_decomp_qr QR matrix decomposition +//! @{ +inline int hal_ni_QR32f(float* src1, size_t src1_step, int m, int n, int k, float* src2, size_t src2_step, float* dst, int* info) { return CV_HAL_ERROR_NOT_IMPLEMENTED; } +inline int hal_ni_QR64f(double* src1, size_t src1_step, int m, int n, int k, double* src2, size_t src2_step, double* dst, int* info) { return CV_HAL_ERROR_NOT_IMPLEMENTED; } +//! @} + //! @cond IGNORED @@ -643,6 +664,8 @@ inline int hal_ni_SVD64f(double* src, size_t src_step, double* w, double* u, siz #define cv_hal_Cholesky64f hal_ni_Cholesky64f #define cv_hal_SVD32f hal_ni_SVD32f #define cv_hal_SVD64f hal_ni_SVD64f +#define cv_hal_QR32f hal_ni_QR32f +#define cv_hal_QR64f hal_ni_QR64f //! @endcond @@ -651,15 +674,15 @@ The function performs generalized matrix multiplication similar to the gemm func \f$D = \alpha*AB+\beta*C\f$ @param src1 pointer to input \f$M\times N\f$ matrix \f$A\f$ or \f$A^T\f$ stored in row major order. -@param src1_step number of bytes each matrix \f$A\f$ or \f$A^T\f$ row occupies. +@param src1_step number of bytes between two consequent rows of matrix \f$A\f$ or \f$A^T\f$. @param src2 pointer to input \f$N\times K\f$ matrix \f$B\f$ or \f$B^T\f$ stored in row major order. -@param src2_step number of bytes each matrix \f$B\f$ or \f$B^T\f$ row occupies. +@param src2_step number of bytes between two consequent rows of matrix \f$B\f$ or \f$B^T\f$. @param alpha \f$\alpha\f$ multiplier before \f$AB\f$ @param src3 pointer to input \f$M\times K\f$ matrix \f$C\f$ or \f$C^T\f$ stored in row major order. -@param src3_step number of bytes each matrix \f$C\f$ or \f$C^T\f$ row occupies. +@param src3_step number of bytes between two consequent rows of matrix \f$C\f$ or \f$C^T\f$. @param beta \f$\beta\f$ multiplier before \f$C\f$ @param dst pointer to input \f$M\times K\f$ matrix \f$D\f$ stored in row major order. -@param dst_step number of bytes each matrix \f$D\f$ row occupies. +@param dst_step number of bytes between two consequent rows of matrix \f$D\f$. @param m number of rows in matrix \f$A\f$ or \f$A^T\f$, equals to number of rows in matrix \f$D\f$ @param n number of columns in matrix \f$A\f$ or \f$A^T\f$ @param k number of columns in matrix \f$B\f$ or \f$B^T\f$, equals to number of columns in matrix \f$D\f$ diff --git a/modules/core/src/kmeans.cpp b/modules/core/src/kmeans.cpp index a81334aa8f..df017adca3 100644 --- a/modules/core/src/kmeans.cpp +++ b/modules/core/src/kmeans.cpp @@ -219,6 +219,8 @@ double cv::kmeans( InputArray _data, int K, TermCriteria criteria, int attempts, int flags, OutputArray _centers ) { + CV_INSTRUMENT_REGION() + const int SPP_TRIALS = 3; Mat data0 = _data.getMat(); bool isrow = data0.rows == 1; diff --git a/modules/core/src/lapack.cpp b/modules/core/src/lapack.cpp index 3711ca9e17..a602eecd80 100644 --- a/modules/core/src/lapack.cpp +++ b/modules/core/src/lapack.cpp @@ -52,21 +52,29 @@ namespace cv int LU(float* A, size_t astep, int m, float* b, size_t bstep, int n) { + CV_INSTRUMENT_REGION() + return hal::LU32f(A, astep, m, b, bstep, n); } int LU(double* A, size_t astep, int m, double* b, size_t bstep, int n) { + CV_INSTRUMENT_REGION() + return hal::LU64f(A, astep, m, b, bstep, n); } bool Cholesky(float* A, size_t astep, int m, float* b, size_t bstep, int n) { + CV_INSTRUMENT_REGION() + return hal::Cholesky32f(A, astep, m, b, bstep, n); } bool Cholesky(double* A, size_t astep, int m, double* b, size_t bstep, int n) { + CV_INSTRUMENT_REGION() + return hal::Cholesky64f(A, astep, m, b, bstep, n); } @@ -746,6 +754,8 @@ SVBkSb( int m, int n, const double* w, size_t wstep, double cv::determinant( InputArray _mat ) { + CV_INSTRUMENT_REGION() + Mat mat = _mat.getMat(); double result = 0; int type = mat.type(), rows = mat.rows; @@ -822,6 +832,8 @@ double cv::determinant( InputArray _mat ) double cv::invert( InputArray _src, OutputArray _dst, int method ) { + CV_INSTRUMENT_REGION() + bool result = false; Mat src = _src.getMat(); int type = src.type(); @@ -1080,6 +1092,8 @@ double cv::invert( InputArray _src, OutputArray _dst, int method ) bool cv::solve( InputArray _src, InputArray _src2arg, OutputArray _dst, int method ) { + CV_INSTRUMENT_REGION() + bool result = true; Mat src = _src.getMat(), _src2 = _src2arg.getMat(); int type = src.type(); @@ -1224,9 +1238,6 @@ bool cv::solve( InputArray _src, InputArray _src2arg, OutputArray _dst, int meth return result; } - if( method == DECOMP_QR ) - method = DECOMP_SVD; - int m = src.rows, m_ = m, n = src.cols, nb = _src2.cols; size_t esz = CV_ELEM_SIZE(type), bufsize = 0; size_t vstep = alignSize(n*esz, 16); @@ -1254,7 +1265,6 @@ bool cv::solve( InputArray _src, InputArray _src2arg, OutputArray _dst, int meth if( is_normal ) bufsize += n*nb*esz; - if( method == DECOMP_SVD || method == DECOMP_EIG ) bufsize += n*5*esz + n*vstep + nb*sizeof(double) + 32; @@ -1307,6 +1317,28 @@ bool cv::solve( InputArray _src, InputArray _src2arg, OutputArray _dst, int meth else result = hal::Cholesky64f(a.ptr(), a.step, n, dst.ptr(), dst.step, nb); } + else if( method == DECOMP_QR ) + { + Mat rhsMat; + if( is_normal || m == n ) + { + src2.copyTo(dst); + rhsMat = dst; + } + else + { + rhsMat = Mat(m, nb, type); + src2.copyTo(rhsMat); + } + + if( type == CV_32F ) + result = hal::QR32f(a.ptr(), a.step, a.rows, a.cols, rhsMat.cols, rhsMat.ptr(), rhsMat.step, NULL) != 0; + else + result = hal::QR64f(a.ptr(), a.step, a.rows, a.cols, rhsMat.cols, rhsMat.ptr(), rhsMat.step, NULL) != 0; + + if (rhsMat.rows != dst.rows) + rhsMat.rowRange(0, dst.rows).copyTo(dst); + } else { ptr = alignPtr(ptr, 16); @@ -1356,6 +1388,8 @@ bool cv::solve( InputArray _src, InputArray _src2arg, OutputArray _dst, int meth bool cv::eigen( InputArray _src, OutputArray _evals, OutputArray _evects ) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); int type = src.type(); int n = src.rows; @@ -1464,11 +1498,15 @@ static void _SVDcompute( InputArray _aarr, OutputArray _w, void SVD::compute( InputArray a, OutputArray w, OutputArray u, OutputArray vt, int flags ) { + CV_INSTRUMENT_REGION() + _SVDcompute(a, w, u, vt, flags); } void SVD::compute( InputArray a, OutputArray w, int flags ) { + CV_INSTRUMENT_REGION() + _SVDcompute(a, w, noArray(), noArray(), flags); } @@ -1517,11 +1555,15 @@ void SVD::backSubst( InputArray rhs, OutputArray dst ) const void cv::SVDecomp(InputArray src, OutputArray w, OutputArray u, OutputArray vt, int flags) { + CV_INSTRUMENT_REGION() + SVD::compute(src, w, u, vt, flags); } void cv::SVBackSubst(InputArray w, InputArray u, InputArray vt, InputArray rhs, OutputArray dst) { + CV_INSTRUMENT_REGION() + SVD::backSubst(w, u, vt, rhs, dst); } diff --git a/modules/core/src/lda.cpp b/modules/core/src/lda.cpp index c52833b41c..4ccbf8a834 100644 --- a/modules/core/src/lda.cpp +++ b/modules/core/src/lda.cpp @@ -898,6 +898,8 @@ public: // National Institute of Standards and Technology (NIST). void compute(InputArray src) { + CV_INSTRUMENT_REGION() + if(isSymmetric(src)) { // Fall back to OpenCV for a symmetric matrix! cv::eigen(src, _eigenvalues, _eigenvectors); diff --git a/modules/core/src/mathfuncs.cpp b/modules/core/src/mathfuncs.cpp index e974776c85..b9bdf49eb3 100644 --- a/modules/core/src/mathfuncs.cpp +++ b/modules/core/src/mathfuncs.cpp @@ -101,6 +101,8 @@ static bool ocl_math_op(InputArray _src1, InputArray _src2, OutputArray _dst, in \* ************************************************************************** */ float cubeRoot( float value ) { + CV_INSTRUMENT_REGION() + float fr; Cv32suf v, m; int ix, s; @@ -142,6 +144,8 @@ float cubeRoot( float value ) void magnitude( InputArray src1, InputArray src2, OutputArray dst ) { + CV_INSTRUMENT_REGION() + int type = src1.type(), depth = src1.depth(), cn = src1.channels(); CV_Assert( src1.size() == src2.size() && type == src2.type() && (depth == CV_32F || depth == CV_64F)); @@ -176,6 +180,8 @@ void magnitude( InputArray src1, InputArray src2, OutputArray dst ) void phase( InputArray src1, InputArray src2, OutputArray dst, bool angleInDegrees ) { + CV_INSTRUMENT_REGION() + int type = src1.type(), depth = src1.depth(), cn = src1.channels(); CV_Assert( src1.size() == src2.size() && type == src2.type() && (depth == CV_32F || depth == CV_64F)); @@ -260,6 +266,8 @@ static bool ocl_cartToPolar( InputArray _src1, InputArray _src2, void cartToPolar( InputArray src1, InputArray src2, OutputArray dst1, OutputArray dst2, bool angleInDegrees ) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(dst1.isUMat() && dst2.isUMat(), ocl_cartToPolar(src1, src2, dst1, dst2, angleInDegrees)) @@ -492,6 +500,8 @@ static bool ocl_polarToCart( InputArray _mag, InputArray _angle, void polarToCart( InputArray src1, InputArray src2, OutputArray dst1, OutputArray dst2, bool angleInDegrees ) { + CV_INSTRUMENT_REGION() + int type = src2.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type); CV_Assert((depth == CV_32F || depth == CV_64F) && (src1.empty() || src1.type() == type)); @@ -509,14 +519,14 @@ void polarToCart( InputArray src1, InputArray src2, { if (Mag.isContinuous() && Angle.isContinuous() && X.isContinuous() && Y.isContinuous() && !angleInDegrees) { - typedef IppStatus (CV_STDCALL * ippsPolarToCart)(const void * pSrcMagn, const void * pSrcPhase, + typedef IppStatus (CV_STDCALL * IppsPolarToCart)(const void * pSrcMagn, const void * pSrcPhase, void * pDstRe, void * pDstIm, int len); - ippsPolarToCart ippFunc = - depth == CV_32F ? (ippsPolarToCart)ippsPolarToCart_32f : - depth == CV_64F ? (ippsPolarToCart)ippsPolarToCart_64f : 0; - CV_Assert(ippFunc != 0); + IppsPolarToCart ippsPolarToCart = + depth == CV_32F ? (IppsPolarToCart)ippsPolarToCart_32f : + depth == CV_64F ? (IppsPolarToCart)ippsPolarToCart_64f : 0; + CV_Assert(ippsPolarToCart != 0); - IppStatus status = ippFunc(Mag.ptr(), Angle.ptr(), X.ptr(), Y.ptr(), static_cast(cn * X.total())); + IppStatus status = CV_INSTRUMENT_FUN_IPP(ippsPolarToCart, Mag.ptr(), Angle.ptr(), X.ptr(), Y.ptr(), static_cast(cn * X.total())); if (status >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); @@ -618,45 +628,10 @@ void polarToCart( InputArray src1, InputArray src2, * E X P * \****************************************************************************************/ -#ifdef HAVE_IPP -static void Exp_32f_ipp(const float *x, float *y, int n) -{ - CV_IPP_CHECK() - { - if (0 <= ippsExp_32f_A21(x, y, n)) - { - CV_IMPL_ADD(CV_IMPL_IPP); - return; - } - setIppErrorStatus(); - } - hal::exp32f(x, y, n); -} - -static void Exp_64f_ipp(const double *x, double *y, int n) -{ - CV_IPP_CHECK() - { - if (0 <= ippsExp_64f_A50(x, y, n)) - { - CV_IMPL_ADD(CV_IMPL_IPP); - return; - } - setIppErrorStatus(); - } - hal::exp64f(x, y, n); -} - -#define Exp_32f Exp_32f_ipp -#define Exp_64f Exp_64f_ipp -#else -#define Exp_32f hal::exp32f -#define Exp_64f hal::exp64f -#endif - - void exp( InputArray _src, OutputArray _dst ) { + CV_INSTRUMENT_REGION() + int type = _src.type(), depth = _src.depth(), cn = _src.channels(); CV_Assert( depth == CV_32F || depth == CV_64F ); @@ -675,9 +650,9 @@ void exp( InputArray _src, OutputArray _dst ) for( size_t i = 0; i < it.nplanes; i++, ++it ) { if( depth == CV_32F ) - Exp_32f((const float*)ptrs[0], (float*)ptrs[1], len); + hal::exp32f((const float*)ptrs[0], (float*)ptrs[1], len); else - Exp_64f((const double*)ptrs[0], (double*)ptrs[1], len); + hal::exp64f((const double*)ptrs[0], (double*)ptrs[1], len); } } @@ -686,44 +661,10 @@ void exp( InputArray _src, OutputArray _dst ) * L O G * \****************************************************************************************/ -#ifdef HAVE_IPP -static void Log_32f_ipp(const float *x, float *y, int n) -{ - CV_IPP_CHECK() - { - if (0 <= ippsLn_32f_A21(x, y, n)) - { - CV_IMPL_ADD(CV_IMPL_IPP); - return; - } - setIppErrorStatus(); - } - hal::log32f(x, y, n); -} - -static void Log_64f_ipp(const double *x, double *y, int n) -{ - CV_IPP_CHECK() - { - if (0 <= ippsLn_64f_A50(x, y, n)) - { - CV_IMPL_ADD(CV_IMPL_IPP); - return; - } - setIppErrorStatus(); - } - hal::log64f(x, y, n); -} - -#define Log_32f Log_32f_ipp -#define Log_64f Log_64f_ipp -#else -#define Log_32f hal::log32f -#define Log_64f hal::log64f -#endif - void log( InputArray _src, OutputArray _dst ) { + CV_INSTRUMENT_REGION() + int type = _src.type(), depth = _src.depth(), cn = _src.channels(); CV_Assert( depth == CV_32F || depth == CV_64F ); @@ -742,9 +683,9 @@ void log( InputArray _src, OutputArray _dst ) for( size_t i = 0; i < it.nplanes; i++, ++it ) { if( depth == CV_32F ) - Log_32f( (const float*)ptrs[0], (float*)ptrs[1], len ); + hal::log32f( (const float*)ptrs[0], (float*)ptrs[1], len ); else - Log_64f( (const double*)ptrs[0], (double*)ptrs[1], len ); + hal::log64f( (const double*)ptrs[0], (double*)ptrs[1], len ); } } @@ -1233,6 +1174,8 @@ static void Sqrt_64f(const double* src, double* dst, int n) { hal::sqrt64f(src, void pow( InputArray _src, double power, OutputArray _dst ) { + CV_INSTRUMENT_REGION() + int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type), ipower = cvRound(power); bool is_ipower = fabs(ipower - power) < DBL_EPSILON; @@ -1318,12 +1261,12 @@ void pow( InputArray _src, double power, OutputArray _dst ) { int bsz = std::min(len - j, blockSize); - #if defined(HAVE_IPP) +#if defined(HAVE_IPP) CV_IPP_CHECK() { IppStatus status = depth == CV_32F ? - ippsPowx_32f_A21((const float*)ptrs[0], (float)power, (float*)ptrs[1], bsz) : - ippsPowx_64f_A50((const double*)ptrs[0], (double)power, (double*)ptrs[1], bsz); + CV_INSTRUMENT_FUN_IPP(ippsPowx_32f_A21, (const float*)ptrs[0], (float)power, (float*)ptrs[1], bsz) : + CV_INSTRUMENT_FUN_IPP(ippsPowx_64f_A50, (const double*)ptrs[0], (double)power, (double*)ptrs[1], bsz); if (status >= 0) { @@ -1334,7 +1277,7 @@ void pow( InputArray _src, double power, OutputArray _dst ) } setIppErrorStatus(); } - #endif +#endif if( depth == CV_32F ) { @@ -1345,10 +1288,10 @@ void pow( InputArray _src, double power, OutputArray _dst ) if( x != x0 ) memcpy(x, x0, bsz*esz1); - Log_32f(x, y, bsz); + hal::log32f(x, y, bsz); for( k = 0; k < bsz; k++ ) y[k] = (float)(y[k]*power); - Exp_32f(y, y, bsz); + hal::exp32f(y, y, bsz); for( k = 0; k < bsz; k++ ) { if( x0[k] <= 0 ) @@ -1372,10 +1315,10 @@ void pow( InputArray _src, double power, OutputArray _dst ) if( x != x0 ) memcpy(x, x0, bsz*esz1); - Log_64f(x, y, bsz); + hal::log64f(x, y, bsz); for( k = 0; k < bsz; k++ ) y[k] *= power; - Exp_64f(y, y, bsz); + hal::exp64f(y, y, bsz); for( k = 0; k < bsz; k++ ) { @@ -1400,6 +1343,8 @@ void pow( InputArray _src, double power, OutputArray _dst ) void sqrt(InputArray a, OutputArray b) { + CV_INSTRUMENT_REGION() + cv::pow(a, 0.5, b); } @@ -1485,6 +1430,8 @@ check_range_function check_range_functions[] = bool checkRange(InputArray _src, bool quiet, Point* pt, double minVal, double maxVal) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); if ( src.dims > 2 ) @@ -1622,6 +1569,8 @@ static bool ocl_patchNaNs( InputOutputArray _a, float value ) void patchNaNs( InputOutputArray _a, double _val ) { + CV_INSTRUMENT_REGION() + CV_Assert( _a.depth() == CV_32F ); CV_OCL_RUN(_a.isUMat() && _a.dims() <= 2, @@ -1787,6 +1736,8 @@ CV_IMPL int cvCheckArr( const CvArr* arr, int flags, int cv::solveCubic( InputArray _coeffs, OutputArray _roots ) { + CV_INSTRUMENT_REGION() + const int n0 = 3; Mat coeffs = _coeffs.getMat(); int ctype = coeffs.type(); @@ -1932,6 +1883,8 @@ int cv::solveCubic( InputArray _coeffs, OutputArray _roots ) http://en.wikipedia.org/wiki/Durand%E2%80%93Kerner_method */ double cv::solvePoly( InputArray _coeffs0, OutputArray _roots0, int maxIters ) { + CV_INSTRUMENT_REGION() + typedef Complex C; double maxDiff = 0; diff --git a/modules/core/src/mathfuncs_core.cpp b/modules/core/src/mathfuncs_core.cpp index de292fae94..c021812247 100644 --- a/modules/core/src/mathfuncs_core.cpp +++ b/modules/core/src/mathfuncs_core.cpp @@ -44,8 +44,6 @@ using namespace std; -#undef HAVE_IPP - namespace { static const float atan2_p1 = 0.9997878412794807f*(float)(180/CV_PI); @@ -205,12 +203,16 @@ namespace cv { namespace hal { void fastAtan32f(const float *Y, const float *X, float *angle, int len, bool angleInDegrees ) { + CV_INSTRUMENT_REGION() + CALL_HAL(fastAtan32f, cv_hal_fastAtan32f, Y, X, angle, len, angleInDegrees); atanImpl(Y, X, angle, len, angleInDegrees); } void fastAtan64f(const double *Y, const double *X, double *angle, int len, bool angleInDegrees) { + CV_INSTRUMENT_REGION() + CALL_HAL(fastAtan64f, cv_hal_fastAtan64f, Y, X, angle, len, angleInDegrees); atanImpl(Y, X, angle, len, angleInDegrees); } @@ -218,24 +220,17 @@ void fastAtan64f(const double *Y, const double *X, double *angle, int len, bool // deprecated void fastAtan2(const float *Y, const float *X, float *angle, int len, bool angleInDegrees ) { + CV_INSTRUMENT_REGION() + fastAtan32f(Y, X, angle, len, angleInDegrees); } void magnitude32f(const float* x, const float* y, float* mag, int len) { + CV_INSTRUMENT_REGION() + CALL_HAL(magnitude32f, cv_hal_magnitude32f, x, y, mag, len); -#if defined HAVE_IPP - CV_IPP_CHECK() - { - IppStatus status = ippsMagnitude_32f(x, y, mag, len); - if (status >= 0) - { - CV_IMPL_ADD(CV_IMPL_IPP); - return; - } - setIppErrorStatus(); - } -#endif + CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippsMagnitude_32f, x, y, mag, len) >= 0); int i = 0; @@ -260,19 +255,10 @@ void magnitude32f(const float* x, const float* y, float* mag, int len) void magnitude64f(const double* x, const double* y, double* mag, int len) { + CV_INSTRUMENT_REGION() + CALL_HAL(magnitude64f, cv_hal_magnitude64f, x, y, mag, len); -#if defined(HAVE_IPP) - CV_IPP_CHECK() - { - IppStatus status = ippsMagnitude_64f(x, y, mag, len); - if (status >= 0) - { - CV_IMPL_ADD(CV_IMPL_IPP); - return; - } - setIppErrorStatus(); - } -#endif + CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippsMagnitude_64f, x, y, mag, len) >= 0); int i = 0; @@ -298,18 +284,10 @@ void magnitude64f(const double* x, const double* y, double* mag, int len) void invSqrt32f(const float* src, float* dst, int len) { + CV_INSTRUMENT_REGION() + CALL_HAL(invSqrt32f, cv_hal_invSqrt32f, src, dst, len); -#if defined(HAVE_IPP) - CV_IPP_CHECK() - { - if (ippsInvSqrt_32f_A21(src, dst, len) >= 0) - { - CV_IMPL_ADD(CV_IMPL_IPP); - return; - } - setIppErrorStatus(); - } -#endif + CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippsInvSqrt_32f_A21, src, dst, len) >= 0); int i = 0; @@ -330,7 +308,11 @@ void invSqrt32f(const float* src, float* dst, int len) void invSqrt64f(const double* src, double* dst, int len) { + CV_INSTRUMENT_REGION() + CALL_HAL(invSqrt64f, cv_hal_invSqrt64f, src, dst, len); + CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippsInvSqrt_64f_A50, src, dst, len) >= 0); + int i = 0; #if CV_SSE2 @@ -346,18 +328,10 @@ void invSqrt64f(const double* src, double* dst, int len) void sqrt32f(const float* src, float* dst, int len) { + CV_INSTRUMENT_REGION() + CALL_HAL(sqrt32f, cv_hal_sqrt32f, src, dst, len); -#if defined(HAVE_IPP) - CV_IPP_CHECK() - { - if (ippsSqrt_32f_A21(src, dst, len) >= 0) - { - CV_IMPL_ADD(CV_IMPL_IPP); - return; - } - setIppErrorStatus(); - } -#endif + CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippsSqrt_32f_A21, src, dst, len) >= 0); int i = 0; @@ -378,18 +352,10 @@ void sqrt32f(const float* src, float* dst, int len) void sqrt64f(const double* src, double* dst, int len) { + CV_INSTRUMENT_REGION() + CALL_HAL(sqrt64f, cv_hal_sqrt64f, src, dst, len); -#if defined(HAVE_IPP) - CV_IPP_CHECK() - { - if (ippsSqrt_64f_A50(src, dst, len) >= 0) - { - CV_IMPL_ADD(CV_IMPL_IPP); - return; - } - setIppErrorStatus(); - } -#endif + CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippsSqrt_64f_A50, src, dst, len) >= 0); int i = 0; @@ -510,7 +476,11 @@ static const double exp_max_val = 3000.*(1 << EXPTAB_SCALE); // log10(DBL_MAX) < void exp32f( const float *_x, float *y, int n ) { + CV_INSTRUMENT_REGION() + CALL_HAL(exp32f, cv_hal_exp32f, _x, y, n); + CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippsExp_32f_A21, _x, y, n) >= 0); + static const float A4 = (float)(1.000000000000002438532970795181890933776 / EXPPOLY_32F_A0), A3 = (float)(.6931471805521448196800669615864773144641 / EXPPOLY_32F_A0), @@ -710,7 +680,11 @@ void exp32f( const float *_x, float *y, int n ) void exp64f( const double *_x, double *y, int n ) { + CV_INSTRUMENT_REGION() + CALL_HAL(exp64f, cv_hal_exp64f, _x, y, n); + CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippsExp_64f_A50, _x, y, n) >= 0); + static const double A5 = .99999999999999999998285227504999 / EXPPOLY_32F_A0, A4 = .69314718055994546743029643825322 / EXPPOLY_32F_A0, @@ -1155,7 +1129,11 @@ static const double ln_2 = 0.69314718055994530941723212145818; void log32f( const float *_x, float *y, int n ) { + CV_INSTRUMENT_REGION() + CALL_HAL(log32f, cv_hal_log32f, _x, y, n); + CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippsLn_32f_A21, _x, y, n) >= 0); + static const float shift[] = { 0, -1.f/512 }; static const float A0 = 0.3333333333333333333333333f, @@ -1300,7 +1278,11 @@ void log32f( const float *_x, float *y, int n ) void log64f( const double *x, double *y, int n ) { + CV_INSTRUMENT_REGION() + CALL_HAL(log64f, cv_hal_log64f, x, y, n); + CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippsLn_64f_A50, x, y, n) >= 0); + static const double shift[] = { 0, -1./512 }; static const double A7 = 1.0, diff --git a/modules/core/src/matmul.cpp b/modules/core/src/matmul.cpp index 88097ca00b..477d4ab9e6 100644 --- a/modules/core/src/matmul.cpp +++ b/modules/core/src/matmul.cpp @@ -868,6 +868,8 @@ static bool ocl_gemm( InputArray matA, InputArray matB, double alpha, static void gemmImpl( Mat A, Mat B, double alpha, Mat C, double beta, Mat D, int flags ) { + CV_INSTRUMENT_REGION() + const int block_lin_size = 128; const int block_size = block_lin_size * block_lin_size; @@ -2082,6 +2084,8 @@ static TransformFunc getDiagTransformFunc(int depth) void cv::transform( InputArray _src, OutputArray _dst, InputArray _mtx ) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(), m = _mtx.getMat(); int depth = src.depth(), scn = src.channels(), dcn = m.rows; CV_Assert( scn == m.cols || scn + 1 == m.cols ); @@ -2260,6 +2264,8 @@ perspectiveTransform_64f(const double* src, double* dst, const double* m, int le void cv::perspectiveTransform( InputArray _src, OutputArray _dst, InputArray _mtx ) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(), m = _mtx.getMat(); int depth = src.depth(), scn = src.channels(), dcn = m.rows-1; CV_Assert( scn + 1 == m.cols ); @@ -2454,6 +2460,8 @@ static bool ocl_scaleAdd( InputArray _src1, double alpha, InputArray _src2, Outp void cv::scaleAdd( InputArray _src1, double alpha, InputArray _src2, OutputArray _dst ) { + CV_INSTRUMENT_REGION() + int type = _src1.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type); CV_Assert( type == _src2.type() ); @@ -2499,6 +2507,8 @@ void cv::scaleAdd( InputArray _src1, double alpha, InputArray _src2, OutputArray void cv::calcCovarMatrix( const Mat* data, int nsamples, Mat& covar, Mat& _mean, int flags, int ctype ) { + CV_INSTRUMENT_REGION() + CV_Assert( data && nsamples > 0 ); Size size = data[0].size(); int sz = size.width * size.height, esz = (int)data[0].elemSize(); @@ -2539,6 +2549,8 @@ void cv::calcCovarMatrix( const Mat* data, int nsamples, Mat& covar, Mat& _mean, void cv::calcCovarMatrix( InputArray _src, OutputArray _covar, InputOutputArray _mean, int flags, int ctype ) { + CV_INSTRUMENT_REGION() + if(_src.kind() == _InputArray::STD_VECTOR_MAT) { std::vector src; @@ -2626,6 +2638,8 @@ void cv::calcCovarMatrix( InputArray _src, OutputArray _covar, InputOutputArray double cv::Mahalanobis( InputArray _v1, InputArray _v2, InputArray _icovar ) { + CV_INSTRUMENT_REGION() + Mat v1 = _v1.getMat(), v2 = _v2.getMat(), icovar = _icovar.getMat(); int type = v1.type(), depth = v1.depth(); Size sz = v1.size(); @@ -2916,6 +2930,8 @@ typedef void (*MulTransposedFunc)(const Mat& src, Mat& dst, const Mat& delta, do void cv::mulTransposed( InputArray _src, OutputArray _dst, bool ata, InputArray _delta, double scale, int dtype ) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(), delta = _delta.getMat(); const int gemm_level = 100; // boundary above which GEMM is faster. int stype = src.type(); @@ -3059,9 +3075,9 @@ static double dotProd_8u(const uchar* src1, const uchar* src2, int len) #if ARITHM_USE_IPP && IPP_DISABLE_BLOCK CV_IPP_CHECK() { - if (0 <= ippiDotProd_8u64f_C1R(src1, (int)(len*sizeof(src1[0])), + if (0 <= CV_INSTRUMENT_FUN_IPP(ippiDotProd_8u64f_C1R, (src1, (int)(len*sizeof(src1[0])), src2, (int)(len*sizeof(src2[0])), - ippiSize(len, 1), &r)) + ippiSize(len, 1), &r))) { CV_IMPL_ADD(CV_IMPL_IPP); return r; @@ -3258,7 +3274,7 @@ static double dotProd_16u(const ushort* src1, const ushort* src2, int len) CV_IPP_CHECK() { double r = 0; - if (0 <= ippiDotProd_16u64f_C1R(src1, (int)(len*sizeof(src1[0])), src2, (int)(len*sizeof(src2[0])), ippiSize(len, 1), &r)) + if (0 <= CV_INSTRUMENT_FUN_IPP(ippiDotProd_16u64f_C1R, src1, (int)(len*sizeof(src1[0])), src2, (int)(len*sizeof(src2[0])), ippiSize(len, 1), &r)) { CV_IMPL_ADD(CV_IMPL_IPP); return r; @@ -3275,7 +3291,7 @@ static double dotProd_16s(const short* src1, const short* src2, int len) CV_IPP_CHECK() { double r = 0; - if (0 <= ippiDotProd_16s64f_C1R(src1, (int)(len*sizeof(src1[0])), src2, (int)(len*sizeof(src2[0])), ippiSize(len, 1), &r)) + if (0 <= CV_INSTRUMENT_FUN_IPP(ippiDotProd_16s64f_C1R, src1, (int)(len*sizeof(src1[0])), src2, (int)(len*sizeof(src2[0])), ippiSize(len, 1), &r)) { CV_IMPL_ADD(CV_IMPL_IPP); return r; @@ -3292,7 +3308,7 @@ static double dotProd_32s(const int* src1, const int* src2, int len) CV_IPP_CHECK() { double r = 0; - if (0 <= ippiDotProd_32s64f_C1R(src1, (int)(len*sizeof(src1[0])), src2, (int)(len*sizeof(src2[0])), ippiSize(len, 1), &r)) + if (0 <= CV_INSTRUMENT_FUN_IPP(ippiDotProd_32s64f_C1R, src1, (int)(len*sizeof(src1[0])), src2, (int)(len*sizeof(src2[0])), ippiSize(len, 1), &r)) { CV_IMPL_ADD(CV_IMPL_IPP); return r; @@ -3311,7 +3327,7 @@ static double dotProd_32f(const float* src1, const float* src2, int len) #if (ARITHM_USE_IPP == 1) CV_IPP_CHECK() { - if (0 <= ippsDotProd_32f64f(src1, src2, len, &r)) + if (0 <= CV_INSTRUMENT_FUN_IPP(ippsDotProd_32f64f, src1, src2, len, &r)) { CV_IMPL_ADD(CV_IMPL_IPP); return r; @@ -3349,7 +3365,7 @@ static double dotProd_64f(const double* src1, const double* src2, int len) CV_IPP_CHECK() { double r = 0; - if (0 <= ippsDotProd_64f(src1, src2, len, &r)) + if (0 <= CV_INSTRUMENT_FUN_IPP(ippsDotProd_64f, src1, src2, len, &r)) { CV_IMPL_ADD(CV_IMPL_IPP); return r; @@ -3378,6 +3394,8 @@ static DotProdFunc getDotProdFunc(int depth) double Mat::dot(InputArray _mat) const { + CV_INSTRUMENT_REGION() + Mat mat = _mat.getMat(); int cn = channels(); DotProdFunc func = getDotProdFunc(depth()); diff --git a/modules/core/src/matop.cpp b/modules/core/src/matop.cpp index 2a6ec2635c..e7cfa01730 100644 --- a/modules/core/src/matop.cpp +++ b/modules/core/src/matop.cpp @@ -333,6 +333,8 @@ void MatOp::augAssignXor(const MatExpr& expr, Mat& m) const void MatOp::add(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const { + CV_INSTRUMENT_REGION() + if( this == e2.op ) { double alpha = 1, beta = 1; @@ -364,6 +366,8 @@ void MatOp::add(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const void MatOp::add(const MatExpr& expr1, const Scalar& s, MatExpr& res) const { + CV_INSTRUMENT_REGION() + Mat m1; expr1.op->assign(expr1, m1); MatOp_AddEx::makeExpr(res, m1, Mat(), 1, 0, s); @@ -372,6 +376,8 @@ void MatOp::add(const MatExpr& expr1, const Scalar& s, MatExpr& res) const void MatOp::subtract(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const { + CV_INSTRUMENT_REGION() + if( this == e2.op ) { double alpha = 1, beta = -1; @@ -403,6 +409,8 @@ void MatOp::subtract(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const void MatOp::subtract(const Scalar& s, const MatExpr& expr, MatExpr& res) const { + CV_INSTRUMENT_REGION() + Mat m; expr.op->assign(expr, m); MatOp_AddEx::makeExpr(res, m, Mat(), -1, 0, s); @@ -411,6 +419,8 @@ void MatOp::subtract(const Scalar& s, const MatExpr& expr, MatExpr& res) const void MatOp::multiply(const MatExpr& e1, const MatExpr& e2, MatExpr& res, double scale) const { + CV_INSTRUMENT_REGION() + if( this == e2.op ) { Mat m1, m2; @@ -462,6 +472,8 @@ void MatOp::multiply(const MatExpr& e1, const MatExpr& e2, MatExpr& res, double void MatOp::multiply(const MatExpr& expr, double s, MatExpr& res) const { + CV_INSTRUMENT_REGION() + Mat m; expr.op->assign(expr, m); MatOp_AddEx::makeExpr(res, m, Mat(), s, 0); @@ -470,6 +482,8 @@ void MatOp::multiply(const MatExpr& expr, double s, MatExpr& res) const void MatOp::divide(const MatExpr& e1, const MatExpr& e2, MatExpr& res, double scale) const { + CV_INSTRUMENT_REGION() + if( this == e2.op ) { if( isReciprocal(e1) && isReciprocal(e2) ) @@ -510,6 +524,8 @@ void MatOp::divide(const MatExpr& e1, const MatExpr& e2, MatExpr& res, double sc void MatOp::divide(double s, const MatExpr& expr, MatExpr& res) const { + CV_INSTRUMENT_REGION() + Mat m; expr.op->assign(expr, m); MatOp_Bin::makeExpr(res, '/', m, Mat(), s); @@ -518,6 +534,8 @@ void MatOp::divide(double s, const MatExpr& expr, MatExpr& res) const void MatOp::abs(const MatExpr& expr, MatExpr& res) const { + CV_INSTRUMENT_REGION() + Mat m; expr.op->assign(expr, m); MatOp_Bin::makeExpr(res, 'a', m, Mat()); @@ -526,6 +544,8 @@ void MatOp::abs(const MatExpr& expr, MatExpr& res) const void MatOp::transpose(const MatExpr& expr, MatExpr& res) const { + CV_INSTRUMENT_REGION() + Mat m; expr.op->assign(expr, m); MatOp_T::makeExpr(res, m, 1); @@ -590,6 +610,8 @@ Size MatOp::size(const MatExpr& expr) const int MatOp::type(const MatExpr& expr) const { + CV_INSTRUMENT_REGION() + return !expr.a.empty() ? expr.a.type() : expr.b.empty() ? expr.b.type() : expr.c.type(); } @@ -1038,6 +1060,8 @@ MatExpr operator > (double s, const Mat& a) MatExpr min(const Mat& a, const Mat& b) { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_Bin::makeExpr(e, 'm', a, b); return e; @@ -1045,6 +1069,8 @@ MatExpr min(const Mat& a, const Mat& b) MatExpr min(const Mat& a, double s) { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_Bin::makeExpr(e, 'n', a, s); return e; @@ -1052,6 +1078,8 @@ MatExpr min(const Mat& a, double s) MatExpr min(double s, const Mat& a) { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_Bin::makeExpr(e, 'n', a, s); return e; @@ -1059,6 +1087,8 @@ MatExpr min(double s, const Mat& a) MatExpr max(const Mat& a, const Mat& b) { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_Bin::makeExpr(e, 'M', a, b); return e; @@ -1066,6 +1096,8 @@ MatExpr max(const Mat& a, const Mat& b) MatExpr max(const Mat& a, double s) { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_Bin::makeExpr(e, 'N', a, s); return e; @@ -1073,6 +1105,8 @@ MatExpr max(const Mat& a, double s) MatExpr max(double s, const Mat& a) { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_Bin::makeExpr(e, 'N', a, s); return e; @@ -1150,6 +1184,8 @@ MatExpr operator ~(const Mat& a) MatExpr abs(const Mat& a) { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_Bin::makeExpr(e, 'a', a, Scalar()); return e; @@ -1157,6 +1193,8 @@ MatExpr abs(const Mat& a) MatExpr abs(const MatExpr& e) { + CV_INSTRUMENT_REGION() + MatExpr en; e.op->abs(e, en); return en; @@ -1179,6 +1217,8 @@ Size MatExpr::size() const int MatExpr::type() const { + CV_INSTRUMENT_REGION() + if( isInitializer(*this) ) return a.type(); if( isCmp(*this) ) @@ -1261,6 +1301,8 @@ void MatOp_AddEx::assign(const MatExpr& e, Mat& m, int _type) const void MatOp_AddEx::add(const MatExpr& e, const Scalar& s, MatExpr& res) const { + CV_INSTRUMENT_REGION() + res = e; res.s += s; } @@ -1268,6 +1310,8 @@ void MatOp_AddEx::add(const MatExpr& e, const Scalar& s, MatExpr& res) const void MatOp_AddEx::subtract(const Scalar& s, const MatExpr& e, MatExpr& res) const { + CV_INSTRUMENT_REGION() + res = e; res.alpha = -res.alpha; res.beta = -res.beta; @@ -1276,6 +1320,8 @@ void MatOp_AddEx::subtract(const Scalar& s, const MatExpr& e, MatExpr& res) cons void MatOp_AddEx::multiply(const MatExpr& e, double s, MatExpr& res) const { + CV_INSTRUMENT_REGION() + res = e; res.alpha *= s; res.beta *= s; @@ -1284,6 +1330,8 @@ void MatOp_AddEx::multiply(const MatExpr& e, double s, MatExpr& res) const void MatOp_AddEx::divide(double s, const MatExpr& e, MatExpr& res) const { + CV_INSTRUMENT_REGION() + if( isScaled(e) ) MatOp_Bin::makeExpr(res, '/', e.a, Mat(), s/e.alpha); else @@ -1293,6 +1341,8 @@ void MatOp_AddEx::divide(double s, const MatExpr& e, MatExpr& res) const void MatOp_AddEx::transpose(const MatExpr& e, MatExpr& res) const { + CV_INSTRUMENT_REGION() + if( isScaled(e) ) MatOp_T::makeExpr(res, e.a, e.alpha); else @@ -1301,6 +1351,8 @@ void MatOp_AddEx::transpose(const MatExpr& e, MatExpr& res) const void MatOp_AddEx::abs(const MatExpr& e, MatExpr& res) const { + CV_INSTRUMENT_REGION() + if( (!e.b.data || e.beta == 0) && fabs(e.alpha) == 1 ) MatOp_Bin::makeExpr(res, 'a', e.a, -e.s*e.alpha); else if( e.b.data && e.alpha + e.beta == 0 && e.alpha*e.beta == -1 ) @@ -1361,6 +1413,8 @@ void MatOp_Bin::assign(const MatExpr& e, Mat& m, int _type) const void MatOp_Bin::multiply(const MatExpr& e, double s, MatExpr& res) const { + CV_INSTRUMENT_REGION() + if( e.flags == '*' || e.flags == '/' ) { res = e; @@ -1372,6 +1426,8 @@ void MatOp_Bin::multiply(const MatExpr& e, double s, MatExpr& res) const void MatOp_Bin::divide(double s, const MatExpr& e, MatExpr& res) const { + CV_INSTRUMENT_REGION() + if( e.flags == '/' && (!e.b.data || e.beta == 0) ) MatOp_AddEx::makeExpr(res, e.a, Mat(), s/e.alpha, 0); else @@ -1427,12 +1483,16 @@ void MatOp_T::assign(const MatExpr& e, Mat& m, int _type) const void MatOp_T::multiply(const MatExpr& e, double s, MatExpr& res) const { + CV_INSTRUMENT_REGION() + res = e; res.alpha *= s; } void MatOp_T::transpose(const MatExpr& e, MatExpr& res) const { + CV_INSTRUMENT_REGION() + if( e.alpha == 1 ) MatOp_Identity::makeExpr(res, e.a); else @@ -1457,6 +1517,8 @@ void MatOp_GEMM::assign(const MatExpr& e, Mat& m, int _type) const void MatOp_GEMM::add(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const { + CV_INSTRUMENT_REGION() + bool i1 = isIdentity(e1), i2 = isIdentity(e2); double alpha1 = i1 ? 1 : e1.alpha, alpha2 = i2 ? 1 : e2.alpha; @@ -1474,6 +1536,8 @@ void MatOp_GEMM::add(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const void MatOp_GEMM::subtract(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const { + CV_INSTRUMENT_REGION() + bool i1 = isIdentity(e1), i2 = isIdentity(e2); double alpha1 = i1 ? 1 : e1.alpha, alpha2 = i2 ? 1 : e2.alpha; @@ -1491,6 +1555,8 @@ void MatOp_GEMM::subtract(const MatExpr& e1, const MatExpr& e2, MatExpr& res) co void MatOp_GEMM::multiply(const MatExpr& e, double s, MatExpr& res) const { + CV_INSTRUMENT_REGION() + res = e; res.alpha *= s; res.beta *= s; @@ -1498,6 +1564,8 @@ void MatOp_GEMM::multiply(const MatExpr& e, double s, MatExpr& res) const void MatOp_GEMM::transpose(const MatExpr& e, MatExpr& res) const { + CV_INSTRUMENT_REGION() + res = e; res.flags = (!(e.flags & CV_GEMM_A_T) ? CV_GEMM_B_T : 0) | (!(e.flags & CV_GEMM_B_T) ? CV_GEMM_A_T : 0) | @@ -1577,6 +1645,8 @@ void MatOp_Initializer::assign(const MatExpr& e, Mat& m, int _type) const void MatOp_Initializer::multiply(const MatExpr& e, double s, MatExpr& res) const { + CV_INSTRUMENT_REGION() + res = e; res.alpha *= s; } @@ -1595,6 +1665,8 @@ inline void MatOp_Initializer::makeExpr(MatExpr& res, int method, int ndims, con MatExpr Mat::t() const { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_T::makeExpr(e, *this); return e; @@ -1602,6 +1674,8 @@ MatExpr Mat::t() const MatExpr Mat::inv(int method) const { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_Invert::makeExpr(e, method, *this); return e; @@ -1610,6 +1684,8 @@ MatExpr Mat::inv(int method) const MatExpr Mat::mul(InputArray m, double scale) const { + CV_INSTRUMENT_REGION() + MatExpr e; if(m.kind() == _InputArray::EXPR) { @@ -1623,6 +1699,8 @@ MatExpr Mat::mul(InputArray m, double scale) const MatExpr Mat::zeros(int rows, int cols, int type) { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_Initializer::makeExpr(e, '0', Size(cols, rows), type); return e; @@ -1630,6 +1708,8 @@ MatExpr Mat::zeros(int rows, int cols, int type) MatExpr Mat::zeros(Size size, int type) { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_Initializer::makeExpr(e, '0', size, type); return e; @@ -1637,6 +1717,8 @@ MatExpr Mat::zeros(Size size, int type) MatExpr Mat::zeros(int ndims, const int* sizes, int type) { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_Initializer::makeExpr(e, '0', ndims, sizes, type); return e; @@ -1644,6 +1726,8 @@ MatExpr Mat::zeros(int ndims, const int* sizes, int type) MatExpr Mat::ones(int rows, int cols, int type) { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_Initializer::makeExpr(e, '1', Size(cols, rows), type); return e; @@ -1651,6 +1735,8 @@ MatExpr Mat::ones(int rows, int cols, int type) MatExpr Mat::ones(Size size, int type) { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_Initializer::makeExpr(e, '1', size, type); return e; @@ -1658,6 +1744,8 @@ MatExpr Mat::ones(Size size, int type) MatExpr Mat::ones(int ndims, const int* sizes, int type) { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_Initializer::makeExpr(e, '1', ndims, sizes, type); return e; @@ -1665,6 +1753,8 @@ MatExpr Mat::ones(int ndims, const int* sizes, int type) MatExpr Mat::eye(int rows, int cols, int type) { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_Initializer::makeExpr(e, 'I', Size(cols, rows), type); return e; @@ -1672,6 +1762,8 @@ MatExpr Mat::eye(int rows, int cols, int type) MatExpr Mat::eye(Size size, int type) { + CV_INSTRUMENT_REGION() + MatExpr e; MatOp_Initializer::makeExpr(e, 'I', size, type); return e; diff --git a/modules/core/src/matrix.cpp b/modules/core/src/matrix.cpp index 02160ecd61..46137ddda3 100644 --- a/modules/core/src/matrix.cpp +++ b/modules/core/src/matrix.cpp @@ -77,9 +77,9 @@ void MatAllocator::download(UMatData* u, void* dstptr, { CV_Assert( sz[i] <= (size_t)INT_MAX ); if( sz[i] == 0 ) - return; + return; if( srcofs ) - srcptr += srcofs[i]*(i <= dims-2 ? srcstep[i] : 1); + srcptr += srcofs[i]*(i <= dims-2 ? srcstep[i] : 1); isz[i] = (int)sz[i]; } @@ -89,9 +89,9 @@ void MatAllocator::download(UMatData* u, void* dstptr, const Mat* arrays[] = { &src, &dst }; uchar* ptrs[2]; NAryMatIterator it(arrays, ptrs, 2); - size_t j, planesz = it.size; + size_t planesz = it.size; - for( j = 0; j < it.nplanes; j++, ++it ) + for( size_t j = 0; j < it.nplanes; j++, ++it ) memcpy(ptrs[1], ptrs[0], planesz); } @@ -108,9 +108,9 @@ void MatAllocator::upload(UMatData* u, const void* srcptr, int dims, const size_ { CV_Assert( sz[i] <= (size_t)INT_MAX ); if( sz[i] == 0 ) - return; + return; if( dstofs ) - dstptr += dstofs[i]*(i <= dims-2 ? dststep[i] : 1); + dstptr += dstofs[i]*(i <= dims-2 ? dststep[i] : 1); isz[i] = (int)sz[i]; } @@ -120,9 +120,9 @@ void MatAllocator::upload(UMatData* u, const void* srcptr, int dims, const size_ const Mat* arrays[] = { &src, &dst }; uchar* ptrs[2]; NAryMatIterator it(arrays, ptrs, 2); - size_t j, planesz = it.size; + size_t planesz = it.size; - for( j = 0; j < it.nplanes; j++, ++it ) + for( size_t j = 0; j < it.nplanes; j++, ++it ) memcpy(ptrs[1], ptrs[0], planesz); } @@ -130,6 +130,8 @@ void MatAllocator::copy(UMatData* usrc, UMatData* udst, int dims, const size_t s const size_t srcofs[], const size_t srcstep[], const size_t dstofs[], const size_t dststep[], bool /*sync*/) const { + CV_INSTRUMENT_REGION() + if(!usrc || !udst) return; int isz[CV_MAX_DIM]; @@ -153,9 +155,9 @@ void MatAllocator::copy(UMatData* usrc, UMatData* udst, int dims, const size_t s const Mat* arrays[] = { &src, &dst }; uchar* ptrs[2]; NAryMatIterator it(arrays, ptrs, 2); - size_t j, planesz = it.size; + size_t planesz = it.size; - for( j = 0; j < it.nplanes; j++, ++it ) + for( size_t j = 0; j < it.nplanes; j++, ++it ) memcpy(ptrs[1], ptrs[0], planesz); } @@ -299,8 +301,7 @@ static inline void setSize( Mat& m, int _dims, const int* _sz, return; size_t esz = CV_ELEM_SIZE(m.flags), esz1 = CV_ELEM_SIZE1(m.flags), total = esz; - int i; - for( i = _dims-1; i >= 0; i-- ) + for( int i = _dims-1; i >= 0; i-- ) { int s = _sz[i]; CV_Assert( s >= 0 ); @@ -544,16 +545,16 @@ Mat::Mat(const Mat& m, const Range* ranges) : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows) { - int i, d = m.dims; + int d = m.dims; CV_Assert(ranges); - for( i = 0; i < d; i++ ) + for( int i = 0; i < d; i++ ) { Range r = ranges[i]; CV_Assert( r == Range::all() || (0 <= r.start && r.start < r.end && r.end <= m.size[i]) ); } *this = m; - for( i = 0; i < d; i++ ) + for( int i = 0; i < d; i++ ) { Range r = ranges[i]; if( r != Range::all() && r != Range(0, size.p[i])) @@ -578,8 +579,8 @@ static Mat cvMatNDToMat(const CvMatND* m, bool copyData) int _sizes[CV_MAX_DIM]; size_t _steps[CV_MAX_DIM]; - int i, d = m->dims; - for( i = 0; i < d; i++ ) + int d = m->dims; + for( int i = 0; i < d; i++ ) { _sizes[i] = m->dim[i].size; _steps[i] = m->dim[i].step; @@ -1056,6 +1057,8 @@ int Mat::checkVector(int _elemChannels, int _depth, bool _requireContinuous) con void scalarToRawData(const Scalar& s, void* _buf, int type, int unroll_to) { + CV_INSTRUMENT_REGION() + int i, depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type); CV_Assert(cn <= 4); switch(depth) @@ -1286,10 +1289,10 @@ void _InputArray::getMatVector(std::vector& mv) const if( k == MAT ) { const Mat& m = *(const Mat*)obj; - int i, n = (int)m.size[0]; + int n = (int)m.size[0]; mv.resize(n); - for( i = 0; i < n; i++ ) + for( int i = 0; i < n; i++ ) mv[i] = m.dims == 2 ? Mat(1, m.cols, m.type(), (void*)m.ptr(i)) : Mat(m.dims-1, &m.size[1], m.type(), (void*)m.ptr(i), &m.step[1]); return; @@ -1298,20 +1301,20 @@ void _InputArray::getMatVector(std::vector& mv) const if( k == EXPR ) { Mat m = *(const MatExpr*)obj; - int i, n = m.size[0]; + int n = m.size[0]; mv.resize(n); - for( i = 0; i < n; i++ ) + for( int i = 0; i < n; i++ ) mv[i] = m.row(i); return; } if( k == MATX ) { - size_t i, n = sz.height, esz = CV_ELEM_SIZE(flags); + size_t n = sz.height, esz = CV_ELEM_SIZE(flags); mv.resize(n); - for( i = 0; i < n; i++ ) + for( size_t i = 0; i < n; i++ ) mv[i] = Mat(1, sz.width, CV_MAT_TYPE(flags), (uchar*)obj + esz*sz.width*i); return; } @@ -1320,11 +1323,11 @@ void _InputArray::getMatVector(std::vector& mv) const { const std::vector& v = *(const std::vector*)obj; - size_t i, n = v.size(), esz = CV_ELEM_SIZE(flags); + size_t n = v.size(), esz = CV_ELEM_SIZE(flags); int t = CV_MAT_DEPTH(flags), cn = CV_MAT_CN(flags); mv.resize(n); - for( i = 0; i < n; i++ ) + for( size_t i = 0; i < n; i++ ) mv[i] = Mat(1, cn, t, (void*)(&v[0] + esz*i)); return; } @@ -1338,11 +1341,11 @@ void _InputArray::getMatVector(std::vector& mv) const if( k == STD_VECTOR_VECTOR ) { const std::vector >& vv = *(const std::vector >*)obj; - int i, n = (int)vv.size(); + int n = (int)vv.size(); int t = CV_MAT_TYPE(flags); mv.resize(n); - for( i = 0; i < n; i++ ) + for( int i = 0; i < n; i++ ) { const std::vector& v = vv[i]; mv[i] = Mat(size(i), t, (void*)&v[0]); @@ -1353,10 +1356,10 @@ void _InputArray::getMatVector(std::vector& mv) const if( k == STD_VECTOR_MAT ) { const std::vector& v = *(const std::vector*)obj; - size_t i, n = v.size(); + size_t n = v.size(); mv.resize(n); - for( i = 0; i < n; i++ ) + for( size_t i = 0; i < n; i++ ) mv[i] = v[i]; return; } @@ -1364,10 +1367,10 @@ void _InputArray::getMatVector(std::vector& mv) const if( k == STD_VECTOR_UMAT ) { const std::vector& v = *(const std::vector*)obj; - size_t i, n = v.size(); + size_t n = v.size(); mv.resize(n); - for( i = 0; i < n; i++ ) + for( size_t i = 0; i < n; i++ ) mv[i] = v[i].getMat(accessFlags); return; } @@ -1389,10 +1392,10 @@ void _InputArray::getUMatVector(std::vector& umv) const if( k == STD_VECTOR_MAT ) { const std::vector& v = *(const std::vector*)obj; - size_t i, n = v.size(); + size_t n = v.size(); umv.resize(n); - for( i = 0; i < n; i++ ) + for( size_t i = 0; i < n; i++ ) umv[i] = v[i].getUMat(accessFlags); return; } @@ -1400,10 +1403,10 @@ void _InputArray::getUMatVector(std::vector& umv) const if( k == STD_VECTOR_UMAT ) { const std::vector& v = *(const std::vector*)obj; - size_t i, n = v.size(); + size_t n = v.size(); umv.resize(n); - for( i = 0; i < n; i++ ) + for( size_t i = 0; i < n; i++ ) umv[i] = v[i]; return; } @@ -1994,6 +1997,9 @@ bool _InputArray::isContinuous(int i) const return vv[i].isContinuous(); } + if( k == CUDA_GPU_MAT ) + return i < 0 ? ((const cuda::GpuMat*)obj)->isContinuous() : true; + CV_Error(CV_StsNotImplemented, "Unknown/unsupported array type"); return false; } @@ -2802,6 +2808,8 @@ InputOutputArray noArray() { return _none; } void cv::hconcat(const Mat* src, size_t nsrc, OutputArray _dst) { + CV_INSTRUMENT_REGION() + if( nsrc == 0 || !src ) { _dst.release(); @@ -2809,8 +2817,7 @@ void cv::hconcat(const Mat* src, size_t nsrc, OutputArray _dst) } int totalCols = 0, cols = 0; - size_t i; - for( i = 0; i < nsrc; i++ ) + for( size_t i = 0; i < nsrc; i++ ) { CV_Assert( src[i].dims <= 2 && src[i].rows == src[0].rows && @@ -2819,7 +2826,7 @@ void cv::hconcat(const Mat* src, size_t nsrc, OutputArray _dst) } _dst.create( src[0].rows, totalCols, src[0].type()); Mat dst = _dst.getMat(); - for( i = 0; i < nsrc; i++ ) + for( size_t i = 0; i < nsrc; i++ ) { Mat dpart = dst(Rect(cols, 0, src[i].cols, src[i].rows)); src[i].copyTo(dpart); @@ -2829,12 +2836,16 @@ void cv::hconcat(const Mat* src, size_t nsrc, OutputArray _dst) void cv::hconcat(InputArray src1, InputArray src2, OutputArray dst) { + CV_INSTRUMENT_REGION() + Mat src[] = {src1.getMat(), src2.getMat()}; hconcat(src, 2, dst); } void cv::hconcat(InputArray _src, OutputArray dst) { + CV_INSTRUMENT_REGION() + std::vector src; _src.getMatVector(src); hconcat(!src.empty() ? &src[0] : 0, src.size(), dst); @@ -2842,6 +2853,8 @@ void cv::hconcat(InputArray _src, OutputArray dst) void cv::vconcat(const Mat* src, size_t nsrc, OutputArray _dst) { + CV_INSTRUMENT_REGION() + if( nsrc == 0 || !src ) { _dst.release(); @@ -2849,8 +2862,7 @@ void cv::vconcat(const Mat* src, size_t nsrc, OutputArray _dst) } int totalRows = 0, rows = 0; - size_t i; - for( i = 0; i < nsrc; i++ ) + for( size_t i = 0; i < nsrc; i++ ) { CV_Assert(src[i].dims <= 2 && src[i].cols == src[0].cols && @@ -2859,7 +2871,7 @@ void cv::vconcat(const Mat* src, size_t nsrc, OutputArray _dst) } _dst.create( totalRows, src[0].cols, src[0].type()); Mat dst = _dst.getMat(); - for( i = 0; i < nsrc; i++ ) + for( size_t i = 0; i < nsrc; i++ ) { Mat dpart(dst, Rect(0, rows, src[i].cols, src[i].rows)); src[i].copyTo(dpart); @@ -2869,12 +2881,16 @@ void cv::vconcat(const Mat* src, size_t nsrc, OutputArray _dst) void cv::vconcat(InputArray src1, InputArray src2, OutputArray dst) { + CV_INSTRUMENT_REGION() + Mat src[] = {src1.getMat(), src2.getMat()}; vconcat(src, 2, dst); } void cv::vconcat(InputArray _src, OutputArray dst) { + CV_INSTRUMENT_REGION() + std::vector src; _src.getMatVector(src); vconcat(!src.empty() ? &src[0] : 0, src.size(), dst); @@ -2924,13 +2940,15 @@ static bool ocl_setIdentity( InputOutputArray _m, const Scalar& s ) void cv::setIdentity( InputOutputArray _m, const Scalar& s ) { + CV_INSTRUMENT_REGION() + CV_Assert( _m.dims() <= 2 ); CV_OCL_RUN(_m.isUMat(), ocl_setIdentity(_m, s)) Mat m = _m.getMat(); - int i, j, rows = m.rows, cols = m.cols, type = m.type(); + int rows = m.rows, cols = m.cols, type = m.type(); if( type == CV_32FC1 ) { @@ -2938,9 +2956,9 @@ void cv::setIdentity( InputOutputArray _m, const Scalar& s ) float val = (float)s[0]; size_t step = m.step/sizeof(data[0]); - for( i = 0; i < rows; i++, data += step ) + for( int i = 0; i < rows; i++, data += step ) { - for( j = 0; j < cols; j++ ) + for( int j = 0; j < cols; j++ ) data[j] = 0; if( i < cols ) data[i] = val; @@ -2952,9 +2970,9 @@ void cv::setIdentity( InputOutputArray _m, const Scalar& s ) double val = s[0]; size_t step = m.step/sizeof(data[0]); - for( i = 0; i < rows; i++, data += step ) + for( int i = 0; i < rows; i++, data += step ) { - for( j = 0; j < cols; j++ ) + for( int j = 0; j < cols; j++ ) data[j] = j == i ? val : 0; } } @@ -2969,9 +2987,11 @@ void cv::setIdentity( InputOutputArray _m, const Scalar& s ) cv::Scalar cv::trace( InputArray _m ) { + CV_INSTRUMENT_REGION() + Mat m = _m.getMat(); CV_Assert( m.dims <= 2 ); - int i, type = m.type(); + int type = m.type(); int nm = std::min(m.rows, m.cols); if( type == CV_32FC1 ) @@ -2979,7 +2999,7 @@ cv::Scalar cv::trace( InputArray _m ) const float* ptr = m.ptr(); size_t step = m.step/sizeof(ptr[0]) + 1; double _s = 0; - for( i = 0; i < nm; i++ ) + for( int i = 0; i < nm; i++ ) _s += ptr[i*step]; return _s; } @@ -2989,7 +3009,7 @@ cv::Scalar cv::trace( InputArray _m ) const double* ptr = m.ptr(); size_t step = m.step/sizeof(ptr[0]) + 1; double _s = 0; - for( i = 0; i < nm; i++ ) + for( int i = 0; i < nm; i++ ) _s += ptr[i*step]; return _s; } @@ -3061,12 +3081,11 @@ transpose_( const uchar* src, size_t sstep, uchar* dst, size_t dstep, Size sz ) template static void transposeI_( uchar* data, size_t step, int n ) { - int i, j; - for( i = 0; i < n; i++ ) + for( int i = 0; i < n; i++ ) { T* row = (T*)(data + step*i); uchar* data1 = data + i*sizeof(T); - for( j = i+1; j < n; j++ ) + for( int j = i+1; j < n; j++ ) std::swap( row[j], *(T*)(data1 + step*j) ); } } @@ -3170,62 +3189,64 @@ static bool ocl_transpose( InputArray _src, OutputArray _dst ) #ifdef HAVE_IPP static bool ipp_transpose( Mat &src, Mat &dst ) { + CV_INSTRUMENT_REGION_IPP() + int type = src.type(); - typedef IppStatus (CV_STDCALL * ippiTranspose)(const void * pSrc, int srcStep, void * pDst, int dstStep, IppiSize roiSize); - typedef IppStatus (CV_STDCALL * ippiTransposeI)(const void * pSrcDst, int srcDstStep, IppiSize roiSize); - ippiTranspose ippFunc = 0; - ippiTransposeI ippFuncI = 0; + typedef IppStatus (CV_STDCALL * IppiTranspose)(const void * pSrc, int srcStep, void * pDst, int dstStep, IppiSize roiSize); + typedef IppStatus (CV_STDCALL * IppiTransposeI)(const void * pSrcDst, int srcDstStep, IppiSize roiSize); + IppiTranspose ippiTranspose = 0; + IppiTransposeI ippiTranspose_I = 0; if (dst.data == src.data && dst.cols == dst.rows) { CV_SUPPRESS_DEPRECATED_START - ippFuncI = - type == CV_8UC1 ? (ippiTransposeI)ippiTranspose_8u_C1IR : - type == CV_8UC3 ? (ippiTransposeI)ippiTranspose_8u_C3IR : - type == CV_8UC4 ? (ippiTransposeI)ippiTranspose_8u_C4IR : - type == CV_16UC1 ? (ippiTransposeI)ippiTranspose_16u_C1IR : - type == CV_16UC3 ? (ippiTransposeI)ippiTranspose_16u_C3IR : - type == CV_16UC4 ? (ippiTransposeI)ippiTranspose_16u_C4IR : - type == CV_16SC1 ? (ippiTransposeI)ippiTranspose_16s_C1IR : - type == CV_16SC3 ? (ippiTransposeI)ippiTranspose_16s_C3IR : - type == CV_16SC4 ? (ippiTransposeI)ippiTranspose_16s_C4IR : - type == CV_32SC1 ? (ippiTransposeI)ippiTranspose_32s_C1IR : - type == CV_32SC3 ? (ippiTransposeI)ippiTranspose_32s_C3IR : - type == CV_32SC4 ? (ippiTransposeI)ippiTranspose_32s_C4IR : - type == CV_32FC1 ? (ippiTransposeI)ippiTranspose_32f_C1IR : - type == CV_32FC3 ? (ippiTransposeI)ippiTranspose_32f_C3IR : - type == CV_32FC4 ? (ippiTransposeI)ippiTranspose_32f_C4IR : 0; + ippiTranspose_I = + type == CV_8UC1 ? (IppiTransposeI)ippiTranspose_8u_C1IR : + type == CV_8UC3 ? (IppiTransposeI)ippiTranspose_8u_C3IR : + type == CV_8UC4 ? (IppiTransposeI)ippiTranspose_8u_C4IR : + type == CV_16UC1 ? (IppiTransposeI)ippiTranspose_16u_C1IR : + type == CV_16UC3 ? (IppiTransposeI)ippiTranspose_16u_C3IR : + type == CV_16UC4 ? (IppiTransposeI)ippiTranspose_16u_C4IR : + type == CV_16SC1 ? (IppiTransposeI)ippiTranspose_16s_C1IR : + type == CV_16SC3 ? (IppiTransposeI)ippiTranspose_16s_C3IR : + type == CV_16SC4 ? (IppiTransposeI)ippiTranspose_16s_C4IR : + type == CV_32SC1 ? (IppiTransposeI)ippiTranspose_32s_C1IR : + type == CV_32SC3 ? (IppiTransposeI)ippiTranspose_32s_C3IR : + type == CV_32SC4 ? (IppiTransposeI)ippiTranspose_32s_C4IR : + type == CV_32FC1 ? (IppiTransposeI)ippiTranspose_32f_C1IR : + type == CV_32FC3 ? (IppiTransposeI)ippiTranspose_32f_C3IR : + type == CV_32FC4 ? (IppiTransposeI)ippiTranspose_32f_C4IR : 0; CV_SUPPRESS_DEPRECATED_END } else { - ippFunc = - type == CV_8UC1 ? (ippiTranspose)ippiTranspose_8u_C1R : - type == CV_8UC3 ? (ippiTranspose)ippiTranspose_8u_C3R : - type == CV_8UC4 ? (ippiTranspose)ippiTranspose_8u_C4R : - type == CV_16UC1 ? (ippiTranspose)ippiTranspose_16u_C1R : - type == CV_16UC3 ? (ippiTranspose)ippiTranspose_16u_C3R : - type == CV_16UC4 ? (ippiTranspose)ippiTranspose_16u_C4R : - type == CV_16SC1 ? (ippiTranspose)ippiTranspose_16s_C1R : - type == CV_16SC3 ? (ippiTranspose)ippiTranspose_16s_C3R : - type == CV_16SC4 ? (ippiTranspose)ippiTranspose_16s_C4R : - type == CV_32SC1 ? (ippiTranspose)ippiTranspose_32s_C1R : - type == CV_32SC3 ? (ippiTranspose)ippiTranspose_32s_C3R : - type == CV_32SC4 ? (ippiTranspose)ippiTranspose_32s_C4R : - type == CV_32FC1 ? (ippiTranspose)ippiTranspose_32f_C1R : - type == CV_32FC3 ? (ippiTranspose)ippiTranspose_32f_C3R : - type == CV_32FC4 ? (ippiTranspose)ippiTranspose_32f_C4R : 0; + ippiTranspose = + type == CV_8UC1 ? (IppiTranspose)ippiTranspose_8u_C1R : + type == CV_8UC3 ? (IppiTranspose)ippiTranspose_8u_C3R : + type == CV_8UC4 ? (IppiTranspose)ippiTranspose_8u_C4R : + type == CV_16UC1 ? (IppiTranspose)ippiTranspose_16u_C1R : + type == CV_16UC3 ? (IppiTranspose)ippiTranspose_16u_C3R : + type == CV_16UC4 ? (IppiTranspose)ippiTranspose_16u_C4R : + type == CV_16SC1 ? (IppiTranspose)ippiTranspose_16s_C1R : + type == CV_16SC3 ? (IppiTranspose)ippiTranspose_16s_C3R : + type == CV_16SC4 ? (IppiTranspose)ippiTranspose_16s_C4R : + type == CV_32SC1 ? (IppiTranspose)ippiTranspose_32s_C1R : + type == CV_32SC3 ? (IppiTranspose)ippiTranspose_32s_C3R : + type == CV_32SC4 ? (IppiTranspose)ippiTranspose_32s_C4R : + type == CV_32FC1 ? (IppiTranspose)ippiTranspose_32f_C1R : + type == CV_32FC3 ? (IppiTranspose)ippiTranspose_32f_C3R : + type == CV_32FC4 ? (IppiTranspose)ippiTranspose_32f_C4R : 0; } IppiSize roiSize = { src.cols, src.rows }; - if (ippFunc != 0) + if (ippiTranspose != 0) { - if (ippFunc(src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roiSize) >= 0) + if (CV_INSTRUMENT_FUN_IPP(ippiTranspose, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roiSize) >= 0) return true; } - else if (ippFuncI != 0) + else if (ippiTranspose_I != 0) { - if (ippFuncI(dst.ptr(), (int)dst.step, roiSize) >= 0) + if (CV_INSTRUMENT_FUN_IPP(ippiTranspose_I, dst.ptr(), (int)dst.step, roiSize) >= 0) return true; } return false; @@ -3237,6 +3258,8 @@ static bool ipp_transpose( Mat &src, Mat &dst ) void cv::transpose( InputArray _src, OutputArray _dst ) { + CV_INSTRUMENT_REGION() + int type = _src.type(), esz = CV_ELEM_SIZE(type); CV_Assert( _src.dims() <= 2 && esz <= 32 ); @@ -3261,7 +3284,7 @@ void cv::transpose( InputArray _src, OutputArray _dst ) return; } - CV_IPP_RUN(true, ipp_transpose(src, dst)) + CV_IPP_RUN_FAST(ipp_transpose(src, dst)) if( dst.data == src.data ) { @@ -3283,6 +3306,8 @@ void cv::transpose( InputArray _src, OutputArray _dst ) void cv::completeSymm( InputOutputArray _m, bool LtoR ) { + CV_INSTRUMENT_REGION() + Mat m = _m.getMat(); size_t step = m.step, esz = m.elemSize(); CV_Assert( m.dims <= 2 && m.rows == m.cols ); @@ -3388,7 +3413,7 @@ reduceC_( const Mat& srcmat, Mat& dstmat ) { typedef typename Op::rtype WT; Size size = srcmat.size(); - int i, k, cn = srcmat.channels(); + int cn = srcmat.channels(); size.width *= cn; Op op; @@ -3397,13 +3422,14 @@ reduceC_( const Mat& srcmat, Mat& dstmat ) const T* src = srcmat.ptr(y); ST* dst = dstmat.ptr(y); if( size.width == cn ) - for( k = 0; k < cn; k++ ) + for( int k = 0; k < cn; k++ ) dst[k] = src[k]; else { - for( k = 0; k < cn; k++ ) + for( int k = 0; k < cn; k++ ) { WT a0 = src[k], a1 = src[k+cn]; + int i; for( i = 2*cn; i <= size.width - 4*cn; i += 4*cn ) { a0 = op(a0, (WT)src[i+k]); @@ -3417,7 +3443,7 @@ reduceC_( const Mat& srcmat, Mat& dstmat ) a0 = op(a0, (WT)src[i+k]); } a0 = op(a0, a1); - dst[k] = (ST)a0; + dst[k] = (ST)a0; } } } @@ -3458,43 +3484,43 @@ static inline bool ipp_reduceSumC_8u16u16s32f_64f(const cv::Mat& srcmat, cv::Mat IppiSize roisize = { srcmat.size().width, 1 }; - typedef IppStatus (CV_STDCALL * ippiSum)(const void * pSrc, int srcStep, IppiSize roiSize, Ipp64f* pSum); - typedef IppStatus (CV_STDCALL * ippiSumHint)(const void * pSrc, int srcStep, IppiSize roiSize, Ipp64f* pSum, IppHintAlgorithm hint); - ippiSum ippFunc = 0; - ippiSumHint ippFuncHint = 0; + typedef IppStatus (CV_STDCALL * IppiSum)(const void * pSrc, int srcStep, IppiSize roiSize, Ipp64f* pSum); + typedef IppStatus (CV_STDCALL * IppiSumHint)(const void * pSrc, int srcStep, IppiSize roiSize, Ipp64f* pSum, IppHintAlgorithm hint); + IppiSum ippiSum = 0; + IppiSumHint ippiSumHint = 0; if(ddepth == CV_64F) { - ippFunc = - stype == CV_8UC1 ? (ippiSum)ippiSum_8u_C1R : - stype == CV_8UC3 ? (ippiSum)ippiSum_8u_C3R : - stype == CV_8UC4 ? (ippiSum)ippiSum_8u_C4R : - stype == CV_16UC1 ? (ippiSum)ippiSum_16u_C1R : - stype == CV_16UC3 ? (ippiSum)ippiSum_16u_C3R : - stype == CV_16UC4 ? (ippiSum)ippiSum_16u_C4R : - stype == CV_16SC1 ? (ippiSum)ippiSum_16s_C1R : - stype == CV_16SC3 ? (ippiSum)ippiSum_16s_C3R : - stype == CV_16SC4 ? (ippiSum)ippiSum_16s_C4R : 0; - ippFuncHint = - stype == CV_32FC1 ? (ippiSumHint)ippiSum_32f_C1R : - stype == CV_32FC3 ? (ippiSumHint)ippiSum_32f_C3R : - stype == CV_32FC4 ? (ippiSumHint)ippiSum_32f_C4R : 0; + ippiSum = + stype == CV_8UC1 ? (IppiSum)ippiSum_8u_C1R : + stype == CV_8UC3 ? (IppiSum)ippiSum_8u_C3R : + stype == CV_8UC4 ? (IppiSum)ippiSum_8u_C4R : + stype == CV_16UC1 ? (IppiSum)ippiSum_16u_C1R : + stype == CV_16UC3 ? (IppiSum)ippiSum_16u_C3R : + stype == CV_16UC4 ? (IppiSum)ippiSum_16u_C4R : + stype == CV_16SC1 ? (IppiSum)ippiSum_16s_C1R : + stype == CV_16SC3 ? (IppiSum)ippiSum_16s_C3R : + stype == CV_16SC4 ? (IppiSum)ippiSum_16s_C4R : 0; + ippiSumHint = + stype == CV_32FC1 ? (IppiSumHint)ippiSum_32f_C1R : + stype == CV_32FC3 ? (IppiSumHint)ippiSum_32f_C3R : + stype == CV_32FC4 ? (IppiSumHint)ippiSum_32f_C4R : 0; } - if(ippFunc) + if(ippiSum) { for(int y = 0; y < srcmat.size().height; y++) { - if(ippFunc(srcmat.ptr(y), sstep, roisize, dstmat.ptr(y)) < 0) + if(CV_INSTRUMENT_FUN_IPP(ippiSum, srcmat.ptr(y), sstep, roisize, dstmat.ptr(y)) < 0) return false; } return true; } - else if(ippFuncHint) + else if(ippiSumHint) { for(int y = 0; y < srcmat.size().height; y++) { - if(ippFuncHint(srcmat.ptr(y), sstep, roisize, dstmat.ptr(y), ippAlgHintAccurate) < 0) + if(CV_INSTRUMENT_FUN_IPP(ippiSumHint, srcmat.ptr(y), sstep, roisize, dstmat.ptr(y), ippAlgHintAccurate) < 0) return false; } return true; @@ -3505,7 +3531,7 @@ static inline bool ipp_reduceSumC_8u16u16s32f_64f(const cv::Mat& srcmat, cv::Mat static inline void reduceSumC_8u16u16s32f_64f(const cv::Mat& srcmat, cv::Mat& dstmat) { - CV_IPP_RUN(true, ipp_reduceSumC_8u16u16s32f_64f(srcmat, dstmat)); + CV_IPP_RUN_FAST(ipp_reduceSumC_8u16u16s32f_64f(srcmat, dstmat)); cv::ReduceFunc func = 0; @@ -3555,7 +3581,7 @@ static inline bool ipp_reduce##optype##C##favor(const cv::Mat& srcmat, cv::Mat& IppiSize roisize = ippiSize(srcmat.size().width, 1);\ for(int y = 0; y < srcmat.size().height; y++)\ {\ - if(ippi##optype##_##favor##_C1R(srcmat.ptr(y), sstep, roisize, dstmat.ptr(y)) < 0)\ + if(CV_INSTRUMENT_FUN_IPP(ippi##optype##_##favor##_C1R, srcmat.ptr(y), sstep, roisize, dstmat.ptr(y)) < 0)\ return false;\ }\ return true;\ @@ -3564,7 +3590,7 @@ static inline bool ipp_reduce##optype##C##favor(const cv::Mat& srcmat, cv::Mat& } \ static inline void reduce##optype##C##favor(const cv::Mat& srcmat, cv::Mat& dstmat) \ { \ - CV_IPP_RUN(true, ipp_reduce##optype##C##favor(srcmat, dstmat)); \ + CV_IPP_RUN_FAST(ipp_reduce##optype##C##favor(srcmat, dstmat)); \ cv::reduceC_ < type1, type2, cv::Op##optype < type2 > >(srcmat, dstmat); \ } #endif @@ -3704,6 +3730,8 @@ static bool ocl_reduce(InputArray _src, OutputArray _dst, void cv::reduce(InputArray _src, OutputArray _dst, int dim, int op, int dtype) { + CV_INSTRUMENT_REGION() + CV_Assert( _src.dims() <= 2 ); int op0 = op; int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), cn = CV_MAT_CN(stype); @@ -3903,7 +3931,7 @@ template static void sort_( const Mat& src, Mat& dst, int flags ) { AutoBuffer buf; T* bptr; - int i, j, n, len; + int n, len; bool sortRows = (flags & 1) == CV_SORT_EVERY_ROW; bool inplace = src.data == dst.data; bool sortDescending = (flags & CV_SORT_DESCENDING) != 0; @@ -3928,7 +3956,7 @@ template static void sort_( const Mat& src, Mat& dst, int flags ) } #endif - for( i = 0; i < n; i++ ) + for( int i = 0; i < n; i++ ) { T* ptr = bptr; if( sortRows ) @@ -3943,12 +3971,12 @@ template static void sort_( const Mat& src, Mat& dst, int flags ) } else { - for( j = 0; j < len; j++ ) + for( int j = 0; j < len; j++ ) ptr[j] = src.ptr(j)[i]; } #ifdef USE_IPP_SORT - if (!ippSortFunc || ippSortFunc(ptr, len) < 0) + if (!ippSortFunc || CV_INSTRUMENT_FUN_IPP(ippSortFunc, ptr, len) < 0) #endif { #ifdef USE_IPP_SORT @@ -3959,13 +3987,13 @@ template static void sort_( const Mat& src, Mat& dst, int flags ) if( sortDescending ) { #ifdef USE_IPP_SORT - if (!ippFlipFunc || ippFlipFunc(ptr, len) < 0) + if (!ippFlipFunc || CV_INSTRUMENT_FUN_IPP(ippFlipFunc, ptr, len) < 0) #endif { #ifdef USE_IPP_SORT setIppErrorStatus(); #endif - for( j = 0; j < len/2; j++ ) + for( int j = 0; j < len/2; j++ ) std::swap(ptr[j], ptr[len-1-j]); } #ifdef USE_IPP_SORT @@ -3984,7 +4012,7 @@ template static void sort_( const Mat& src, Mat& dst, int flags ) #endif if( !sortRows ) - for( j = 0; j < len; j++ ) + for( int j = 0; j < len; j++ ) dst.ptr(j)[i] = ptr[j]; } } @@ -4025,14 +4053,12 @@ template static void sortIdx_( const Mat& src, Mat& dst, int flags ) { AutoBuffer buf; AutoBuffer ibuf; - T* bptr; - int* _iptr; - int i, j, n, len; bool sortRows = (flags & 1) == CV_SORT_EVERY_ROW; bool sortDescending = (flags & CV_SORT_DESCENDING) != 0; CV_Assert( src.data != dst.data ); + int n, len; if( sortRows ) n = src.rows, len = src.cols; else @@ -4041,8 +4067,8 @@ template static void sortIdx_( const Mat& src, Mat& dst, int flags ) buf.allocate(len); ibuf.allocate(len); } - bptr = (T*)buf; - _iptr = (int*)ibuf; + T* bptr = (T*)buf; + int* _iptr = (int*)ibuf; #if defined USE_IPP_SORT && IPP_DISABLE_BLOCK int depth = src.depth(); @@ -4055,7 +4081,7 @@ template static void sortIdx_( const Mat& src, Mat& dst, int flags ) } #endif - for( i = 0; i < n; i++ ) + for( int i = 0; i < n; i++ ) { T* ptr = bptr; int* iptr = _iptr; @@ -4067,10 +4093,10 @@ template static void sortIdx_( const Mat& src, Mat& dst, int flags ) } else { - for( j = 0; j < len; j++ ) + for( int j = 0; j < len; j++ ) ptr[j] = src.ptr(j)[i]; } - for( j = 0; j < len; j++ ) + for( int j = 0; j < len; j++ ) iptr[j] = j; #if defined USE_IPP_SORT && IPP_DISABLE_BLOCK @@ -4090,7 +4116,7 @@ template static void sortIdx_( const Mat& src, Mat& dst, int flags ) #if defined USE_IPP_SORT && IPP_DISABLE_BLOCK setIppErrorStatus(); #endif - for( j = 0; j < len/2; j++ ) + for( int j = 0; j < len/2; j++ ) std::swap(iptr[j], iptr[len-1-j]); } #if defined USE_IPP_SORT && IPP_DISABLE_BLOCK @@ -4109,7 +4135,7 @@ template static void sortIdx_( const Mat& src, Mat& dst, int flags ) #endif if( !sortRows ) - for( j = 0; j < len; j++ ) + for( int j = 0; j < len; j++ ) dst.ptr(j)[i] = iptr[j]; } } @@ -4120,6 +4146,8 @@ typedef void (*SortFunc)(const Mat& src, Mat& dst, int flags); void cv::sort( InputArray _src, OutputArray _dst, int flags ) { + CV_INSTRUMENT_REGION() + static SortFunc tab[] = { sort_, sort_, sort_, sort_, @@ -4135,6 +4163,8 @@ void cv::sort( InputArray _src, OutputArray _dst, int flags ) void cv::sortIdx( InputArray _src, OutputArray _dst, int flags ) { + CV_INSTRUMENT_REGION() + static SortFunc tab[] = { sortIdx_, sortIdx_, sortIdx_, sortIdx_, @@ -4216,22 +4246,17 @@ cvReduce( const CvArr* srcarr, CvArr* dstarr, int dim, int op ) CV_IMPL CvArr* cvRange( CvArr* arr, double start, double end ) { - int ok = 0; - CvMat stub, *mat = (CvMat*)arr; - double delta; - int type, step; + int step; double val = start; - int i, j; - int rows, cols; if( !CV_IS_MAT(mat) ) mat = cvGetMat( mat, &stub); - rows = mat->rows; - cols = mat->cols; - type = CV_MAT_TYPE(mat->type); - delta = (end-start)/(rows*cols); + int rows = mat->rows; + int cols = mat->cols; + int type = CV_MAT_TYPE(mat->type); + double delta = (end-start)/(rows*cols); if( CV_IS_MAT_CONT(mat->type) ) { @@ -4250,29 +4275,28 @@ cvRange( CvArr* arr, double start, double end ) if( fabs(val - ival) < DBL_EPSILON && fabs(delta - idelta) < DBL_EPSILON ) { - for( i = 0; i < rows; i++, idata += step ) - for( j = 0; j < cols; j++, ival += idelta ) + for( int i = 0; i < rows; i++, idata += step ) + for( int j = 0; j < cols; j++, ival += idelta ) idata[j] = ival; } else { - for( i = 0; i < rows; i++, idata += step ) - for( j = 0; j < cols; j++, val += delta ) + for( int i = 0; i < rows; i++, idata += step ) + for( int j = 0; j < cols; j++, val += delta ) idata[j] = cvRound(val); } } else if( type == CV_32FC1 ) { float* fdata = mat->data.fl; - for( i = 0; i < rows; i++, fdata += step ) - for( j = 0; j < cols; j++, val += delta ) + for( int i = 0; i < rows; i++, fdata += step ) + for( int j = 0; j < cols; j++, val += delta ) fdata[j] = (float)val; } else CV_Error( CV_StsUnsupportedFormat, "The function only supports 32sC1 and 32fC1 datatypes" ); - ok = 1; - return ok ? arr : 0; + return arr; } @@ -4673,7 +4697,7 @@ void MatConstIterator::seek(ptrdiff_t ofs, bool relative) void MatConstIterator::seek(const int* _idx, bool relative) { - int i, d = m->dims; + int d = m->dims; ptrdiff_t ofs = 0; if( !_idx ) ; @@ -4681,7 +4705,7 @@ void MatConstIterator::seek(const int* _idx, bool relative) ofs = _idx[0]*m->size[1] + _idx[1]; else { - for( i = 0; i < d; i++ ) + for( int i = 0; i < d; i++ ) ofs = ofs*m->size[i] + _idx[i]; } seek(ofs, relative); @@ -4891,13 +4915,13 @@ SparseMat::SparseMat(const Mat& m) void SparseMat::create(int d, const int* _sizes, int _type) { - int i; CV_Assert( _sizes && 0 < d && d <= CV_MAX_DIM ); - for( i = 0; i < d; i++ ) + for( int i = 0; i < d; i++ ) CV_Assert( _sizes[i] > 0 ); _type = CV_MAT_TYPE(_type); if( hdr && _type == type() && hdr->dims == d && hdr->refcount == 1 ) { + int i; for( i = 0; i < d; i++ ) if( _sizes[i] != hdr->size[i] ) break; @@ -4910,7 +4934,7 @@ void SparseMat::create(int d, const int* _sizes, int _type) int _sizes_backup[CV_MAX_DIM]; // #5991 if (_sizes == hdr->size) { - for(i = 0; i < d; i++ ) + for(int i = 0; i < d; i++ ) _sizes_backup[i] = _sizes[i]; _sizes = _sizes_backup; } @@ -4930,9 +4954,9 @@ void SparseMat::copyTo( SparseMat& m ) const } m.create( hdr->dims, hdr->size, type() ); SparseMatConstIterator from = begin(); - size_t i, N = nzcount(), esz = elemSize(); + size_t N = nzcount(), esz = elemSize(); - for( i = 0; i < N; i++, ++from ) + for( size_t i = 0; i < N; i++, ++from ) { const Node* n = from.node(); uchar* to = m.newNode(n->idx, n->hashval); @@ -4948,9 +4972,9 @@ void SparseMat::copyTo( Mat& m ) const m = Scalar(0); SparseMatConstIterator from = begin(); - size_t i, N = nzcount(), esz = elemSize(); + size_t N = nzcount(), esz = elemSize(); - for( i = 0; i < N; i++, ++from ) + for( size_t i = 0; i < N; i++, ++from ) { const Node* n = from.node(); copyElem( from.ptr, (ndims > 1 ? m.ptr(n->idx) : m.ptr(n->idx[0])), esz); @@ -4977,12 +5001,12 @@ void SparseMat::convertTo( SparseMat& m, int rtype, double alpha ) const m.create( hdr->dims, hdr->size, rtype ); SparseMatConstIterator from = begin(); - size_t i, N = nzcount(); + size_t N = nzcount(); if( alpha == 1 ) { ConvertData cvtfunc = getConvertElem(type(), rtype); - for( i = 0; i < N; i++, ++from ) + for( size_t i = 0; i < N; i++, ++from ) { const Node* n = from.node(); uchar* to = hdr == m.hdr ? from.ptr : m.newNode(n->idx, n->hashval); @@ -4992,7 +5016,7 @@ void SparseMat::convertTo( SparseMat& m, int rtype, double alpha ) const else { ConvertScaleData cvtfunc = getConvertScaleElem(type(), rtype); - for( i = 0; i < N; i++, ++from ) + for( size_t i = 0; i < N; i++, ++from ) { const Node* n = from.node(); uchar* to = hdr == m.hdr ? from.ptr : m.newNode(n->idx, n->hashval); @@ -5014,12 +5038,12 @@ void SparseMat::convertTo( Mat& m, int rtype, double alpha, double beta ) const m = Scalar(beta); SparseMatConstIterator from = begin(); - size_t i, N = nzcount(); + size_t N = nzcount(); if( alpha == 1 && beta == 0 ) { ConvertData cvtfunc = getConvertElem(type(), rtype); - for( i = 0; i < N; i++, ++from ) + for( size_t i = 0; i < N; i++, ++from ) { const Node* n = from.node(); uchar* to = m.ptr(n->idx); @@ -5029,7 +5053,7 @@ void SparseMat::convertTo( Mat& m, int rtype, double alpha, double beta ) const else { ConvertScaleData cvtfunc = getConvertScaleElem(type(), rtype); - for( i = 0; i < N; i++, ++from ) + for( size_t i = 0; i < N; i++, ++from ) { const Node* n = from.node(); uchar* to = m.ptr(n->idx); @@ -5063,7 +5087,7 @@ uchar* SparseMat::ptr(int i0, bool createMissing, size_t* hashval) int idx[] = { i0 }; return newNode( idx, h ); } - return 0; + return NULL; } uchar* SparseMat::ptr(int i0, int i1, bool createMissing, size_t* hashval) @@ -5085,7 +5109,7 @@ uchar* SparseMat::ptr(int i0, int i1, bool createMissing, size_t* hashval) int idx[] = { i0, i1 }; return newNode( idx, h ); } - return 0; + return NULL; } uchar* SparseMat::ptr(int i0, int i1, int i2, bool createMissing, size_t* hashval) @@ -5108,7 +5132,7 @@ uchar* SparseMat::ptr(int i0, int i1, int i2, bool createMissing, size_t* hashva int idx[] = { i0, i1, i2 }; return newNode( idx, h ); } - return 0; + return NULL; } uchar* SparseMat::ptr(const int* idx, bool createMissing, size_t* hashval) @@ -5132,7 +5156,7 @@ uchar* SparseMat::ptr(const int* idx, bool createMissing, size_t* hashval) nidx = elem->next; } - return createMissing ? newNode(idx, h) : 0; + return createMissing ? newNode(idx, h) : NULL; } void SparseMat::erase(int i0, int i1, size_t* hashval) @@ -5206,13 +5230,13 @@ void SparseMat::resizeHashTab(size_t newsize) if((newsize & (newsize-1)) != 0) newsize = (size_t)1 << cvCeil(std::log((double)newsize)/CV_LOG2); - size_t i, hsize = hdr->hashtab.size(); + size_t hsize = hdr->hashtab.size(); std::vector _newh(newsize); size_t* newh = &_newh[0]; - for( i = 0; i < newsize; i++ ) + for( size_t i = 0; i < newsize; i++ ) newh[i] = 0; uchar* pool = &hdr->pool[0]; - for( i = 0; i < hsize; i++ ) + for( size_t i = 0; i < hsize; i++ ) { size_t nidx = hdr->hashtab[i]; while( nidx ) @@ -5341,6 +5365,8 @@ SparseMatConstIterator& SparseMatConstIterator::operator ++() double norm( const SparseMat& src, int normType ) { + CV_INSTRUMENT_REGION() + SparseMatConstIterator it = src.begin(); size_t i, N = src.nzcount(); @@ -5390,6 +5416,8 @@ double norm( const SparseMat& src, int normType ) void minMaxLoc( const SparseMat& src, double* _minval, double* _maxval, int* _minidx, int* _maxidx ) { + CV_INSTRUMENT_REGION() + SparseMatConstIterator it = src.begin(); size_t i, N = src.nzcount(), d = src.hdr ? src.hdr->dims : 0; int type = src.type(); @@ -5453,6 +5481,8 @@ void minMaxLoc( const SparseMat& src, double* _minval, double* _maxval, int* _mi void normalize( const SparseMat& src, SparseMat& dst, double a, int norm_type ) { + CV_INSTRUMENT_REGION() + double scale = 1; if( norm_type == CV_L2 || norm_type == CV_L1 || norm_type == CV_C ) { diff --git a/modules/core/src/matrix_decomp.cpp b/modules/core/src/matrix_decomp.cpp index dc9c014930..66c584a103 100644 --- a/modules/core/src/matrix_decomp.cpp +++ b/modules/core/src/matrix_decomp.cpp @@ -109,6 +109,8 @@ LUImpl(_Tp* A, size_t astep, int m, _Tp* b, size_t bstep, int n, _Tp eps) int LU32f(float* A, size_t astep, int m, float* b, size_t bstep, int n) { + CV_INSTRUMENT_REGION() + int output; CALL_HAL_RET(LU32f, cv_hal_LU32f, output, A, astep, m, b, bstep, n) output = LUImpl(A, astep, m, b, bstep, n, FLT_EPSILON*10); @@ -118,6 +120,8 @@ int LU32f(float* A, size_t astep, int m, float* b, size_t bstep, int n) int LU64f(double* A, size_t astep, int m, double* b, size_t bstep, int n) { + CV_INSTRUMENT_REGION() + int output; CALL_HAL_RET(LU64f, cv_hal_LU64f, output, A, astep, m, b, bstep, n) output = LUImpl(A, astep, m, b, bstep, n, DBL_EPSILON*100); @@ -153,8 +157,12 @@ CholImpl(_Tp* A, size_t astep, int m, _Tp* b, size_t bstep, int n) L[i*astep + i] = (_Tp)(1./std::sqrt(s)); } - if( !b ) + if (!b) + { + for( i = 0; i < m; i++ ) + L[i*astep + i]=1/L[i*astep + i]; return true; + } // LLt x = b // 1: L y = b @@ -193,12 +201,16 @@ CholImpl(_Tp* A, size_t astep, int m, _Tp* b, size_t bstep, int n) b[i*bstep + j] = (_Tp)(s*L[i*astep + i]); } } + for( i = 0; i < m; i++ ) + L[i*astep + i]=1/L[i*astep + i]; return true; } bool Cholesky32f(float* A, size_t astep, int m, float* b, size_t bstep, int n) { + CV_INSTRUMENT_REGION() + bool output; CALL_HAL_RET(Cholesky32f, cv_hal_Cholesky32f, output, A, astep, m, b, bstep, n) return CholImpl(A, astep, m, b, bstep, n); @@ -206,11 +218,136 @@ bool Cholesky32f(float* A, size_t astep, int m, float* b, size_t bstep, int n) bool Cholesky64f(double* A, size_t astep, int m, double* b, size_t bstep, int n) { + CV_INSTRUMENT_REGION() + bool output; CALL_HAL_RET(Cholesky64f, cv_hal_Cholesky64f, output, A, astep, m, b, bstep, n) return CholImpl(A, astep, m, b, bstep, n); } +template inline static int +sign(_Tp x) +{ + if (x >= (_Tp)0) + return 1; + else + return -1; +} + +template static inline int +QRImpl(_Tp* A, size_t astep, int m, int n, int k, _Tp* b, size_t bstep, _Tp* hFactors, _Tp eps) +{ + astep /= sizeof(_Tp); + bstep /= sizeof(_Tp); + + cv::AutoBuffer<_Tp> buffer; + size_t buf_size = m ? m + n : hFactors != NULL; + buffer.allocate(buf_size); + _Tp* vl = buffer; + if (hFactors == NULL) + hFactors = vl + m; + + for (int l = 0; l < n; l++) + { + //generate vl + int vlSize = m - l; + _Tp vlNorm = (_Tp)0; + for (int i = 0; i < vlSize; i++) + { + vl[i] = A[(l + i)*astep + l]; + vlNorm += vl[i] * vl[i]; + } + _Tp tmpV = vl[0]; + vl[0] = vl[0] + sign(vl[0])*std::sqrt(vlNorm); + vlNorm = std::sqrt(vlNorm + vl[0] * vl[0] - tmpV*tmpV); + for (int i = 0; i < vlSize; i++) + { + vl[i] /= vlNorm; + } + //multiply A_l*vl + for (int j = l; j < n; j++) + { + _Tp v_lA = (_Tp)0; + for (int i = l; i < m; i++) + { + v_lA += vl[i - l] * A[i*astep + j]; + } + + for (int i = l; i < m; i++) + { + A[i*astep + j] -= 2 * vl[i - l] * v_lA; + } + } + + //save vl and factors + hFactors[l] = vl[0] * vl[0]; + for (int i = 1; i < vlSize; i++) + { + A[(l + i)*astep + l] = vl[i] / vl[0]; + } + } + + if (b) + { + //generate new rhs + for (int l = 0; l < n; l++) + { + //unpack vl + vl[0] = (_Tp)1; + for (int j = 1; j < m - l; j++) + { + vl[j] = A[(j + l)*astep + l]; + } + + //h_l*x + for (int j = 0; j < k; j++) + { + _Tp v_lB = (_Tp)0; + for (int i = l; i < m; i++) + v_lB += vl[i - l] * b[i*bstep + j]; + + for (int i = l; i < m; i++) + b[i*bstep + j] -= 2 * vl[i - l] * v_lB * hFactors[l]; + } + } + //do back substitution + for (int i = n - 1; i >= 0; i--) + { + for (int j = n - 1; j > i; j--) + { + for (int p = 0; p < k; p++) + b[i*bstep + p] -= b[j*bstep + p] * A[i*astep + j]; + } + if (std::abs(A[i*astep + i]) < eps) + return 0; + for (int p = 0; p < k; p++) + b[i*bstep + p] /= A[i*astep + i]; + } + } + + return 1; +} + +int QR32f(float* A, size_t astep, int m, int n, int k, float* b, size_t bstep, float* hFactors) +{ + CV_INSTRUMENT_REGION() + + int output; + CALL_HAL_RET(QR32f, cv_hal_QR32f, output, A, astep, m, n, k, b, bstep, hFactors); + output = QRImpl(A, astep, m, n, k, b, bstep, hFactors, FLT_EPSILON * 10); + return output; +} + +int QR64f(double* A, size_t astep, int m, int n, int k, double* b, size_t bstep, double* hFactors) +{ + CV_INSTRUMENT_REGION() + + int output; + CALL_HAL_RET(QR64f, cv_hal_QR64f, output, A, astep, m, n, k, b, bstep, hFactors) + output = QRImpl(A, astep, m, n, k, b, bstep, hFactors, DBL_EPSILON * 100); + return output; +} + //============================================================================= // for compatibility with 3.0 diff --git a/modules/core/src/ocl.cpp b/modules/core/src/ocl.cpp index 6780d85e57..8212030c8e 100644 --- a/modules/core/src/ocl.cpp +++ b/modules/core/src/ocl.cpp @@ -45,6 +45,9 @@ #include #include #include // std::cerr +#if !(defined _MSC_VER) || (defined _MSC_VER && _MSC_VER > 1700) +#include +#endif #define CV_OPENCL_ALWAYS_SHOW_BUILD_LOG 0 #define CV_OPENCL_SHOW_RUN_ERRORS 0 @@ -3169,6 +3172,9 @@ struct Kernel::Impl { cl_program ph = (cl_program)prog.ptr(); cl_int retval = 0; +#ifdef ENABLE_INSTRUMENTATION + name = kname; +#endif handle = ph != 0 ? clCreateKernel(ph, kname, &retval) : 0; CV_OclDbgAssert(retval == CL_SUCCESS); @@ -3221,6 +3227,9 @@ struct Kernel::Impl IMPLEMENT_REFCOUNTABLE(); +#ifdef ENABLE_INSTRUMENTATION + cv::String name; +#endif cl_kernel handle; cl_event e; enum { MAX_ARRS = 16 }; @@ -3441,6 +3450,8 @@ int Kernel::set(int i, const KernelArg& arg) bool Kernel::run(int dims, size_t _globalsize[], size_t _localsize[], bool sync, const Queue& q) { + CV_INSTRUMENT_REGION_META(p->name.c_str(), instr::TYPE_FUN, instr::IMPL_OPENCL); + if(!p || !p->handle || p->e != 0) return false; @@ -3552,6 +3563,7 @@ struct Program::Impl Impl(const ProgramSource& _src, const String& _buildflags, String& errmsg) { + CV_INSTRUMENT_REGION_OPENCL_(cv::format("Compile: %" PRIx64 " options: %s", _src.hash(), _buildflags.c_str()).c_str()); refcount = 1; const Context& ctx = Context::getDefault(); src = _src; diff --git a/modules/core/src/parallel.cpp b/modules/core/src/parallel.cpp index b805ab46b0..e4ee8f50ab 100644 --- a/modules/core/src/parallel.cpp +++ b/modules/core/src/parallel.cpp @@ -149,13 +149,25 @@ namespace public: ParallelLoopBodyWrapper(const cv::ParallelLoopBody& _body, const cv::Range& _r, double _nstripes) { + body = &_body; wholeRange = _r; double len = wholeRange.end - wholeRange.start; nstripes = cvRound(_nstripes <= 0 ? len : MIN(MAX(_nstripes, 1.), len)); + +#ifdef ENABLE_INSTRUMENTATION + pThreadRoot = cv::instr::getInstrumentTLSStruct().pCurrentNode; +#endif } void operator()(const cv::Range& sr) const { +#ifdef ENABLE_INSTRUMENTATION + { + cv::instr::InstrTLSStruct *pInstrTLS = &cv::instr::getInstrumentTLSStruct(); + pInstrTLS->pCurrentNode = pThreadRoot; // Initialize TLS node for thread + } +#endif + cv::Range r; r.start = (int)(wholeRange.start + ((uint64)sr.start*(wholeRange.end - wholeRange.start) + nstripes/2)/nstripes); @@ -169,6 +181,9 @@ namespace const cv::ParallelLoopBody* body; cv::Range wholeRange; int nstripes; +#ifdef ENABLE_INSTRUMENTATION + cv::instr::InstrNode *pThreadRoot; +#endif }; #if defined HAVE_TBB @@ -252,6 +267,8 @@ static SchedPtr pplScheduler; void cv::parallel_for_(const cv::Range& range, const cv::ParallelLoopBody& body, double nstripes) { + CV_INSTRUMENT_REGION() + #ifdef CV_PARALLEL_FRAMEWORK if(numThreads != 0) @@ -504,7 +521,7 @@ int cv::getNumberOfCPUs(void) { #if defined WIN32 || defined _WIN32 SYSTEM_INFO sysinfo; -#if defined(_M_ARM) || defined(_M_X64) || defined(WINRT) +#if (defined(_M_ARM) || defined(_M_X64) || defined(WINRT)) && _WIN32_WINNT >= 0x501 GetNativeSystemInfo( &sysinfo ); #else GetSystemInfo( &sysinfo ); diff --git a/modules/core/src/pca.cpp b/modules/core/src/pca.cpp index f8730475f6..0fa470005a 100644 --- a/modules/core/src/pca.cpp +++ b/modules/core/src/pca.cpp @@ -351,6 +351,8 @@ Mat PCA::backProject(InputArray data) const void cv::PCACompute(InputArray data, InputOutputArray mean, OutputArray eigenvectors, int maxComponents) { + CV_INSTRUMENT_REGION() + PCA pca; pca(data, mean, 0, maxComponents); pca.mean.copyTo(mean); @@ -360,6 +362,8 @@ void cv::PCACompute(InputArray data, InputOutputArray mean, void cv::PCACompute(InputArray data, InputOutputArray mean, OutputArray eigenvectors, double retainedVariance) { + CV_INSTRUMENT_REGION() + PCA pca; pca(data, mean, 0, retainedVariance); pca.mean.copyTo(mean); @@ -369,6 +373,8 @@ void cv::PCACompute(InputArray data, InputOutputArray mean, void cv::PCAProject(InputArray data, InputArray mean, InputArray eigenvectors, OutputArray result) { + CV_INSTRUMENT_REGION() + PCA pca; pca.mean = mean.getMat(); pca.eigenvectors = eigenvectors.getMat(); @@ -378,6 +384,8 @@ void cv::PCAProject(InputArray data, InputArray mean, void cv::PCABackProject(InputArray data, InputArray mean, InputArray eigenvectors, OutputArray result) { + CV_INSTRUMENT_REGION() + PCA pca; pca.mean = mean.getMat(); pca.eigenvectors = eigenvectors.getMat(); diff --git a/modules/core/src/persistence.cpp b/modules/core/src/persistence.cpp index f39cf044d5..4ddadc9923 100644 --- a/modules/core/src/persistence.cpp +++ b/modules/core/src/persistence.cpp @@ -117,6 +117,25 @@ static char* icv_itoa( int _val, char* buffer, int /*radix*/ ) return ptr; } +static inline bool cv_strcasecmp(const char * s1, const char * s2) +{ + if ( s1 == 0 && s2 == 0 ) + return true; + else if ( s1 == 0 || s2 == 0 ) + return false; + + size_t len1 = strlen(s1); + size_t len2 = strlen(s2); + if ( len1 != len2 ) + return false; + + for ( size_t i = 0U; i < len1; i++ ) + if ( tolower( static_cast(s1[i]) ) != tolower( static_cast(s2[i]) ) ) + return false; + + return true; +} + cv::String cv::FileStorage::getDefaultObjectName(const cv::String& _filename) { static const char* stubname = "unnamed"; @@ -183,7 +202,20 @@ typedef struct CvXMLStackRecord } CvXMLStackRecord; -namespace base64 { class Base64Writer; } +namespace base64 +{ + class Base64Writer; + + namespace fs + { + enum State + { + Uncertain, + NotUse, + InUse, + }; + } +} #define CV_XML_OPENING_TAG 1 #define CV_XML_CLOSING_TAG 2 @@ -243,6 +275,13 @@ typedef struct CvFileStorage std::deque* outbuf; base64::Base64Writer * base64_writer; + bool is_default_using_base64; + base64::fs::State state_of_writing_base64; /**< used in WriteRawData only */ + + bool is_write_struct_delayed; + char* delayed_struct_key; + int delayed_struct_flags; + char* delayed_type_name; bool is_opened; } @@ -270,23 +309,24 @@ namespace base64 bool base64_valid (uint8_t const * src, size_t off, size_t cnt); bool base64_valid ( char const * src, size_t off = 0U, size_t cnt = 0U); - size_t base64_encode_buffer_size(size_t cnt); + size_t base64_encode_buffer_size(size_t cnt, bool is_end_with_zero = true); - size_t base64_decode_buffer_size(size_t cnt); + size_t base64_decode_buffer_size(size_t cnt, bool is_end_with_zero = true); + size_t base64_decode_buffer_size(size_t cnt, char const * src, bool is_end_with_zero = true); + size_t base64_decode_buffer_size(size_t cnt, uchar const * src, bool is_end_with_zero = true); /* binary */ - template inline size_t to_binary(_uint_t val, uchar * cur); - template<> inline size_t to_binary(double val, uchar * cur); - template<> inline size_t to_binary(float val, uchar * cur); + template inline size_t to_binary(_uint_t val, uchar * cur); + template<> inline size_t to_binary(double val, uchar * cur); + template<> inline size_t to_binary(float val, uchar * cur); template inline size_t to_binary(uchar const * val, uchar * cur); - template inline size_t binary_to(uchar const * cur, _uint_t & val); - template<> inline size_t binary_to(uchar const * cur, double & val); - template<> inline size_t binary_to(uchar const * cur, float & val); - template inline size_t binary_to(uchar const * cur, uchar * val); + template inline size_t binary_to(uchar const * cur, _uint_t & val); + template<> inline size_t binary_to(uchar const * cur, double & val); + template<> inline size_t binary_to(uchar const * cur, float & val); + template inline size_t binary_to(uchar const * cur, uchar * val); - class MatToBinaryConvertor; class RawDataToBinaryConvertor; class BinaryToCvSeqConvertor; @@ -313,22 +353,34 @@ namespace base64 class Base64ContextEmitter; + class Base64Writer + { + public: + Base64Writer(::CvFileStorage * fs); + ~Base64Writer(); + void write(const void* _data, size_t len, const char* dt); + template void write(_to_binary_convertor_t & convertor, const char* dt); + + private: + void check_dt(const char* dt); + + private: + + Base64ContextEmitter * emitter; + std::string data_type_string; + }; + /* other */ - std::string make_base64_header(int byte_size, const char * dt); + std::string make_base64_header(const char * dt); - bool read_base64_header(std::string const & header, int & byte_size, std::string & dt); + bool read_base64_header(std::vector const & header, std::string & dt); void make_seq(void * binary_data, int elem_cnt, const char * dt, CvSeq & seq); /* sample */ - void cvStartWriteRawData_Base64(::CvFileStorage * fs, const char* name, int len, const char* dt); - void cvWriteRawData_Base64(::CvFileStorage * fs, const void* _data, int len); - void cvEndWriteRawData_Base64(::CvFileStorage * fs); - - void cvWriteRawData_Base64(::cv::FileStorage & fs, const void* _data, int len, const char* dt); - void cvWriteMat_Base64(CvFileStorage * fs, const char * name, ::cv::Mat const & mat); + void cvWriteRawDataBase64(::CvFileStorage* fs, const void* _data, int len, const char* dt); } @@ -588,8 +640,7 @@ icvFSFlush( CvFileStorage* fs ) if( fs->space != indent ) { - if( fs->space < indent ) - memset( fs->buffer_start + fs->space, ' ', indent - fs->space ); + memset( fs->buffer_start, ' ', indent ); fs->space = indent; } @@ -620,6 +671,8 @@ icvClose( CvFileStorage* fs, cv::String* out ) icvFSFlush(fs); if( fs->fmt == CV_STORAGE_FORMAT_XML ) icvPuts( fs, "\n" ); + else if ( fs->fmt == CV_STORAGE_FORMAT_JSON ) + icvPuts( fs, "}\n" ); } icvCloseFile(fs); @@ -650,8 +703,10 @@ cvReleaseFileStorage( CvFileStorage** p_fs ) cvFree( &fs->buffer_start ); cvReleaseMemStorage( &fs->memstorage ); - if( fs->outbuf ) - delete fs->outbuf; + delete fs->outbuf; + delete fs->base64_writer; + delete fs->delayed_struct_key; + delete fs->delayed_type_name; memset( fs, 0, sizeof(*fs) ); cvFree( &fs ); @@ -1031,6 +1086,185 @@ static double icv_strtod( CvFileStorage* fs, char* ptr, char** endptr ) return fval; } +// this function will convert "aa?bb&cc&dd" to {"aa", "bb", "cc", "dd"} +static std::vector analyze_file_name( std::string const & file_name ) +{ + static const char not_file_name = '\n'; + static const char parameter_begin = '?'; + static const char parameter_separator = '&'; + std::vector result; + + if ( file_name.find(not_file_name, 0U) != std::string::npos ) + return result; + + size_t beg = file_name.find_last_of(parameter_begin); + size_t end = file_name.size(); + result.push_back(file_name.substr(0U, beg)); + + if ( beg != std::string::npos ) + { + beg ++; + for ( size_t param_beg = beg, param_end = beg; + param_end < end; + param_beg = param_end + 1U ) + { + param_end = file_name.find_first_of( parameter_separator, param_beg ); + if ( (param_end == std::string::npos || param_end != param_beg) && param_beg + 1U < end ) + { + result.push_back( file_name.substr( param_beg, param_end - param_beg ) ); + } + } + } + + return result; +} + +static bool is_param_exist( const std::vector & params, const std::string & param ) +{ + if ( params.size() < 2U ) + return false; + + return std::find(params.begin(), params.end(), param) != params.end(); +} + +static void switch_to_Base64_state( CvFileStorage* fs, base64::fs::State state ) +{ + const char * err_unkonwn_state = "Unexpected error, unable to determine the Base64 state."; + const char * err_unable_to_switch = "Unexpected error, unable to switch to this state."; + + /* like a finite state machine */ + switch (fs->state_of_writing_base64) + { + case base64::fs::Uncertain: + switch (state) + { + case base64::fs::InUse: + CV_DbgAssert( fs->base64_writer == 0 ); + fs->base64_writer = new base64::Base64Writer( fs ); + break; + case base64::fs::Uncertain: + break; + case base64::fs::NotUse: + break; + default: + CV_Error( CV_StsError, err_unkonwn_state ); + break; + } + break; + case base64::fs::InUse: + switch (state) + { + case base64::fs::InUse: + case base64::fs::NotUse: + CV_Error( CV_StsError, err_unable_to_switch ); + break; + case base64::fs::Uncertain: + delete fs->base64_writer; + fs->base64_writer = 0; + break; + default: + CV_Error( CV_StsError, err_unkonwn_state ); + break; + } + break; + case base64::fs::NotUse: + switch (state) + { + case base64::fs::InUse: + case base64::fs::NotUse: + CV_Error( CV_StsError, err_unable_to_switch ); + break; + case base64::fs::Uncertain: + break; + default: + CV_Error( CV_StsError, err_unkonwn_state ); + break; + } + break; + default: + CV_Error( CV_StsError, err_unkonwn_state ); + break; + } + + fs->state_of_writing_base64 = state; +} + + +static void check_if_write_struct_is_delayed( CvFileStorage* fs, bool change_type_to_base64 = false ) +{ + if ( fs->is_write_struct_delayed ) + { + /* save data to prevent recursive call errors */ + std::string struct_key; + std::string type_name; + int struct_flags = fs->delayed_struct_flags; + + if ( fs->delayed_struct_key != 0 && *fs->delayed_struct_key != '\0' ) + { + struct_key.assign(fs->delayed_struct_key); + } + if ( fs->delayed_type_name != 0 && *fs->delayed_type_name != '\0' ) + { + type_name.assign(fs->delayed_type_name); + } + + /* reset */ + delete fs->delayed_struct_key; + delete fs->delayed_type_name; + fs->delayed_struct_key = 0; + fs->delayed_struct_flags = 0; + fs->delayed_type_name = 0; + + fs->is_write_struct_delayed = false; + + /* call */ + if ( change_type_to_base64 ) + { + fs->start_write_struct( fs, struct_key.c_str(), struct_flags, "binary"); + if ( fs->state_of_writing_base64 != base64::fs::Uncertain ) + switch_to_Base64_state( fs, base64::fs::Uncertain ); + switch_to_Base64_state( fs, base64::fs::InUse ); + } + else + { + fs->start_write_struct( fs, struct_key.c_str(), struct_flags, type_name.c_str()); + if ( fs->state_of_writing_base64 != base64::fs::Uncertain ) + switch_to_Base64_state( fs, base64::fs::Uncertain ); + switch_to_Base64_state( fs, base64::fs::NotUse ); + } + } +} + + +static void make_write_struct_delayed( + CvFileStorage* fs, + const char* key, + int struct_flags, + const char* type_name ) +{ + CV_Assert( fs->is_write_struct_delayed == false ); + CV_DbgAssert( fs->delayed_struct_key == 0 ); + CV_DbgAssert( fs->delayed_struct_flags == 0 ); + CV_DbgAssert( fs->delayed_type_name == 0 ); + + fs->delayed_struct_flags = struct_flags; + + if ( key != 0 ) + { + fs->delayed_struct_key = new char[strlen(key) + 1U]; + strcpy(fs->delayed_struct_key, key); + } + + if ( type_name != 0 ) + { + fs->delayed_type_name = new char[strlen(type_name) + 1U]; + strcpy(fs->delayed_type_name, type_name); + } + + fs->is_write_struct_delayed = true; +} + +static const size_t PARSER_BASE64_BUFFER_SIZE = 1024U * 1024U / 8U; /****************************************************************************************\ * YAML Parser * @@ -1119,40 +1353,43 @@ static char* icvYMLParseBase64(CvFileStorage* fs, char* ptr, int indent, CvFileN /* calc (decoded) total_byte_size from header */ std::string dt; - int total_byte_size = -1; { if (end - beg < static_cast(base64::ENCODED_HEADER_SIZE)) CV_PARSE_ERROR("Unrecognized Base64 header"); std::vector header(base64::HEADER_SIZE + 1, ' '); base64::base64_decode(beg, header.data(), 0U, base64::ENCODED_HEADER_SIZE); - std::istringstream iss(header.data()); - - if (!(iss >> total_byte_size) || total_byte_size < 0) - CV_PARSE_ERROR("Cannot parse size in Base64 header"); - if (!(iss >> dt) || dt.empty()) - CV_PARSE_ERROR("Cannot parse dt in Base64 header"); + if ( !base64::read_base64_header(header, dt) || dt.empty() ) + CV_PARSE_ERROR("Invalid `dt` in Base64 header"); beg += base64::ENCODED_HEADER_SIZE; } - /* buffer for decoded data(exclude header) */ - std::vector buffer(total_byte_size + 4); + /* get all Base64 data */ + std::string base64_buffer; + base64_buffer.reserve( PARSER_BASE64_BUFFER_SIZE ); + while( beg < end ) { - base64::Base64ContextParser parser(buffer.data(), total_byte_size + 4); - - /* decoding */ - while(beg < end) - { - /* save this part [beg, end) */ - parser.read((const uchar *)beg, (const uchar *)end); - - beg = end; - - /* find next part */ - icvYMLGetMultilineStringContent(fs, beg, indent, beg, end); - } + base64_buffer.append( beg, end ); + beg = end; + icvYMLGetMultilineStringContent( fs, beg, indent, beg, end ); } + if ( !base64::base64_valid(base64_buffer.data(), 0U, base64_buffer.size()) ) + CV_PARSE_ERROR( "Invalid Base64 data." ); + + /* buffer for decoded data(exclude header) */ + std::vector binary_buffer( base64::base64_decode_buffer_size(base64_buffer.size()) ); + int total_byte_size = static_cast( + base64::base64_decode_buffer_size( base64_buffer.size(), base64_buffer.data(), false ) + ); + { + base64::Base64ContextParser parser(binary_buffer.data(), binary_buffer.size() ); + const uchar * buffer_beg = reinterpret_cast( base64_buffer.data() ); + const uchar * buffer_end = buffer_beg + base64_buffer.size(); + parser.read( buffer_beg, buffer_end ); + parser.flush(); + } + /* save as CvSeq */ int elem_size = ::icvCalcStructSize(dt.c_str(), 0); if (total_byte_size % elem_size != 0) @@ -1160,9 +1397,10 @@ static char* icvYMLParseBase64(CvFileStorage* fs, char* ptr, int indent, CvFileN int elem_cnt = total_byte_size / elem_size; node->tag = CV_NODE_NONE; - int struct_flags = CV_NODE_FLOW + CV_NODE_SEQ; /* after icvFSCreateCollection, node->tag == struct_flags */ + int struct_flags = CV_NODE_FLOW | CV_NODE_SEQ; + /* after icvFSCreateCollection, node->tag == struct_flags */ icvFSCreateCollection(fs, struct_flags, node); - base64::make_seq(buffer.data(), elem_cnt, dt.c_str(), *node->data.seq); + base64::make_seq(binary_buffer.data(), elem_cnt, dt.c_str(), *node->data.seq); if (fs->dummy_eof) { /* end of file */ @@ -1621,6 +1859,16 @@ icvYMLParse( CvFileStorage* fs ) static void icvYMLWrite( CvFileStorage* fs, const char* key, const char* data ) { + check_if_write_struct_is_delayed( fs ); + if ( fs->state_of_writing_base64 == base64::fs::Uncertain ) + { + switch_to_Base64_state( fs, base64::fs::NotUse ); + } + else if ( fs->state_of_writing_base64 == base64::fs::InUse ) + { + CV_Error( CV_StsError, "At present, output Base64 data only." ); + } + int i, keylen = 0; int datalen = 0; int struct_flags; @@ -1724,6 +1972,9 @@ icvYMLStartWriteStruct( CvFileStorage* fs, const char* key, int struct_flags, char buf[CV_FS_MAX_LEN + 1024]; const char* data = 0; + if ( type_name && *type_name == '\0' ) + type_name = 0; + struct_flags = (struct_flags & (CV_NODE_TYPE_MASK|CV_NODE_FLOW)) | CV_NODE_EMPTY; if( !CV_NODE_IS_COLLECTION(struct_flags)) CV_Error( CV_StsBadArg, @@ -2034,17 +2285,17 @@ static void icvXMLGetMultilineStringContent(CvFileStorage* fs, ptr = icvXMLSkipSpaces(fs, ptr, CV_XML_INSIDE_TAG); beg = ptr; end = ptr; - if (fs->dummy_eof) + if ( fs->dummy_eof ) return ; /* end of file */ - if (*beg == '<') + if ( *beg == '<' ) return; /* end of string */ /* find end */ - while(cv_isprint(*ptr)) /* no check for base64 string */ + while( cv_isprint(*ptr) ) /* no check for base64 string */ ++ ptr; - if (*ptr == '\0') - CV_PARSE_ERROR("Unexpected end of line"); + if ( *ptr == '\0' ) + CV_PARSE_ERROR( "Unexpected end of line" ); end = ptr; } @@ -2061,48 +2312,54 @@ static char* icvXMLParseBase64(CvFileStorage* fs, char* ptr, CvFileNode * node) /* calc (decoded) total_byte_size from header */ std::string dt; - int total_byte_size = -1; { if (end - beg < static_cast(base64::ENCODED_HEADER_SIZE)) CV_PARSE_ERROR("Unrecognized Base64 header"); std::vector header(base64::HEADER_SIZE + 1, ' '); base64::base64_decode(beg, header.data(), 0U, base64::ENCODED_HEADER_SIZE); - std::istringstream iss(header.data()); - if (!(iss >> total_byte_size) || total_byte_size < 0) - CV_PARSE_ERROR("Cannot parse size in Base64 header"); - if (!(iss >> dt) || dt.empty()) - CV_PARSE_ERROR("Cannot parse dt in Base64 header"); + if ( !base64::read_base64_header(header, dt) || dt.empty() ) + CV_PARSE_ERROR("Invalid `dt` in Base64 header"); beg += base64::ENCODED_HEADER_SIZE; } - /* alloc buffer for all decoded data(include header) */ - std::vector buffer(total_byte_size + 4); + /* get all Base64 data */ + std::string base64_buffer; // not an efficient way. + base64_buffer.reserve( PARSER_BASE64_BUFFER_SIZE ); + while( beg < end ) { - base64::Base64ContextParser parser(buffer.data(), total_byte_size + 4); + base64_buffer.append( beg, end ); + beg = end; + icvXMLGetMultilineStringContent( fs, beg, beg, end ); + } + if ( !base64::base64_valid(base64_buffer.data(), 0U, base64_buffer.size()) ) + CV_PARSE_ERROR( "Invalid Base64 data." ); - /* decoding */ - while(beg < end) - { - /* save this part [beg, end) */ - parser.read((const uchar *)beg, (const uchar *)end); - beg = end; - /* find next part */ - icvXMLGetMultilineStringContent(fs, beg, beg, end); - } + /* alloc buffer for all decoded data(include header) */ + std::vector binary_buffer( base64::base64_decode_buffer_size(base64_buffer.size()) ); + int total_byte_size = static_cast( + base64::base64_decode_buffer_size( base64_buffer.size(), base64_buffer.data(), false ) + ); + { + base64::Base64ContextParser parser(binary_buffer.data(), binary_buffer.size() ); + const uchar * buffer_beg = reinterpret_cast( base64_buffer.data() ); + const uchar * buffer_end = buffer_beg + base64_buffer.size(); + parser.read( buffer_beg, buffer_end ); + parser.flush(); } /* save as CvSeq */ int elem_size = ::icvCalcStructSize(dt.c_str(), 0); if (total_byte_size % elem_size != 0) - CV_PARSE_ERROR("Byte size not match elememt size"); + CV_PARSE_ERROR("data size not matches elememt size"); int elem_cnt = total_byte_size / elem_size; node->tag = CV_NODE_NONE; - int struct_flags = CV_NODE_SEQ; /* after icvFSCreateCollection, node->tag == struct_flags */ + int struct_flags = CV_NODE_SEQ; + /* after icvFSCreateCollection, node->tag == struct_flags */ icvFSCreateCollection(fs, struct_flags, node); - base64::make_seq(buffer.data(), elem_cnt, dt.c_str(), *node->data.seq); + base64::make_seq(binary_buffer.data(), elem_cnt, dt.c_str(), *node->data.seq); if (fs->dummy_eof) { /* end of file */ @@ -2683,6 +2940,9 @@ icvXMLStartWriteStruct( CvFileStorage* fs, const char* key, int struct_flags, CV_Error( CV_StsBadArg, "Some collection type: CV_NODE_SEQ or CV_NODE_MAP must be specified" ); + if ( type_name && *type_name == '\0' ) + type_name = 0; + if( type_name ) { attr[idx++] = "type_id"; @@ -2757,6 +3017,16 @@ icvXMLStartNextStream( CvFileStorage* fs ) static void icvXMLWriteScalar( CvFileStorage* fs, const char* key, const char* data, int len ) { + check_if_write_struct_is_delayed( fs ); + if ( fs->state_of_writing_base64 == base64::fs::Uncertain ) + { + switch_to_Base64_state( fs, base64::fs::NotUse ); + } + else if ( fs->state_of_writing_base64 == base64::fs::InUse ) + { + CV_Error( CV_StsError, "Currently only Base64 data is allowed." ); + } + if( CV_NODE_IS_MAP(fs->struct_flags) || (!CV_NODE_IS_COLLECTION(fs->struct_flags) && key) ) { @@ -2959,20 +3229,914 @@ icvXMLWriteComment( CvFileStorage* fs, const char* comment, int eol_comment ) } +/****************************************************************************************\ +* JSON Parser * +\****************************************************************************************/ + +static char* +icvJSONSkipSpaces( CvFileStorage* fs, char* ptr ) +{ + bool is_eof = false; + bool is_completed = false; + + while ( is_eof == false && is_completed == false ) + { + switch ( *ptr ) + { + /* comment */ + case '/' : { + ptr++; + if ( *ptr == '\0' ) + { + ptr = icvGets( fs, fs->buffer_start, static_cast(fs->buffer_end - fs->buffer_start) ); + if ( !ptr ) { is_eof = true; break; } + } + + if ( *ptr == '/' ) + { + while ( *ptr != '\n' && *ptr != '\r' ) + { + if ( *ptr == '\0' ) + { + ptr = icvGets( fs, fs->buffer_start, static_cast(fs->buffer_end - fs->buffer_start) ); + if ( !ptr ) { is_eof = true; break; } + } + else + { + ptr++; + } + } + } + else if ( *ptr == '*' ) + { + ptr++; + for (;;) + { + if ( *ptr == '\0' ) + { + ptr = icvGets( fs, fs->buffer_start, static_cast(fs->buffer_end - fs->buffer_start) ); + if ( !ptr ) { is_eof = true; break; } + } + else if ( *ptr == '*' ) + { + ptr++; + if ( *ptr == '\0' ) + { + ptr = icvGets( fs, fs->buffer_start, static_cast(fs->buffer_end - fs->buffer_start) ); + if ( !ptr ) { is_eof = true; break; } + } + if ( *ptr == '/' ) + { + ptr++; + break; + } + } + else + { + ptr++; + } + } + } + else + { + CV_PARSE_ERROR( "Not supported escape character" ); + } + } break; + /* whitespace */ + case '\t': + case ' ' : { + ptr++; + } break; + /* newline || end mark */ + case '\0': + case '\n': + case '\r': { + ptr = icvGets( fs, fs->buffer_start, static_cast(fs->buffer_end - fs->buffer_start) ); + if ( !ptr ) { is_eof = true; break; } + } break; + /* other character */ + default: { + if ( !cv_isprint(*ptr) ) + CV_PARSE_ERROR( "Invalid character in the stream" ); + is_completed = true; + } break; + } + } + + if ( is_eof ) + { + ptr = fs->buffer_start; + *ptr = '\0'; + fs->dummy_eof = 1; + } + else if ( !is_completed ) + { + /* should not be executed */ + ptr = 0; + fs->dummy_eof = 1; + CV_PARSE_ERROR( "Abort at parse time" ); + } + return ptr; +} + + +static char* icvJSONParseKey( CvFileStorage* fs, char* ptr, CvFileNode* map, CvFileNode** value_placeholder ) +{ + if( *ptr != '"' ) + CV_PARSE_ERROR( "Key must start with \'\"\'" ); + + char * beg = ptr + 1; + char * end = beg; + + do ++ptr; + while( cv_isprint(*ptr) && *ptr != '"' ); + + if( *ptr != '"' ) + CV_PARSE_ERROR( "Key must end with \'\"\'" ); + + end = ptr; + ptr++; + ptr = icvJSONSkipSpaces( fs, ptr ); + if ( ptr == 0 || fs->dummy_eof ) + return 0; + + if( *ptr != ':' ) + CV_PARSE_ERROR( "Missing \':\' between key and value" ); + + /* [beg, end) */ + if( end <= beg ) + CV_PARSE_ERROR( "Key is empty" ); + + if ( end - beg == 7u && memcmp(beg, "type_id", 7u) == 0 ) + { + *value_placeholder = 0; + } + else + { + CvStringHashNode* str_hash_node = cvGetHashedKey( fs, beg, static_cast(end - beg), 1 ); + *value_placeholder = cvGetFileNode( fs, map, str_hash_node, 1 ); + } + + ptr++; + return ptr; +} + +static char* icvJSONParseValue( CvFileStorage* fs, char* ptr, CvFileNode* node ) +{ + ptr = icvJSONSkipSpaces( fs, ptr ); + if ( ptr == 0 || fs->dummy_eof ) + CV_PARSE_ERROR( "Unexpected End-Of-File" ); + + memset( node, 0, sizeof(*node) ); + + if ( *ptr == '"' ) + { /* must be string or Base64 string */ + ptr++; + char * beg = ptr; + size_t len = 0u; + for ( ; (cv_isalnum(*ptr) || *ptr == '$' ) && len <= 9u; ptr++ ) + len++; + + if ( len >= 8u && memcmp( beg, "$base64$", 8u ) == 0 ) + { /**************** Base64 string ****************/ + ptr = beg += 8; + + std::string base64_buffer; + base64_buffer.reserve( PARSER_BASE64_BUFFER_SIZE ); + + bool is_matching = false; + while ( !is_matching ) + { + switch ( *ptr ) + { + case '\0': + { + base64_buffer.append( beg, ptr ); + + ptr = icvGets( fs, fs->buffer_start, static_cast(fs->buffer_end - fs->buffer_start) ); + if ( !ptr ) + CV_PARSE_ERROR( "'\"' - right-quote of string is missing" ); + + beg = ptr; + break; + } + case '\"': + { + base64_buffer.append( beg, ptr ); + beg = ptr; + is_matching = true; + break; + } + case '\n': + case '\r': + { + CV_PARSE_ERROR( "'\"' - right-quote of string is missing" ); + break; + } + default: + { + ptr++; + break; + } + } + } + + if ( *ptr != '\"' ) + CV_PARSE_ERROR( "'\"' - right-quote of string is missing" ); + else + ptr++; + + if ( base64_buffer.size() >= base64::ENCODED_HEADER_SIZE ) + { + const char * base64_beg = base64_buffer.data(); + const char * base64_end = base64_beg + base64_buffer.size(); + + /* get dt from header */ + std::string dt; + { + std::vector header(base64::HEADER_SIZE + 1, ' '); + base64::base64_decode(base64_beg, header.data(), 0U, base64::ENCODED_HEADER_SIZE); + if ( !base64::read_base64_header(header, dt) || dt.empty() ) + CV_PARSE_ERROR("Invalid `dt` in Base64 header"); + } + + /* set base64_beg to beginning of base64 data */ + base64_beg = &base64_buffer.at( base64::ENCODED_HEADER_SIZE ); + + if ( base64_buffer.size() > base64::ENCODED_HEADER_SIZE ) + { + if ( !base64::base64_valid( base64_beg, 0U, base64_end - base64_beg ) ) + CV_PARSE_ERROR( "Invalid Base64 data." ); + + /* buffer for decoded data(exclude header) */ + std::vector binary_buffer( base64::base64_decode_buffer_size(base64_end - base64_beg) ); + int total_byte_size = static_cast( + base64::base64_decode_buffer_size( base64_end - base64_beg, base64_beg, false ) + ); + { + base64::Base64ContextParser parser(binary_buffer.data(), binary_buffer.size() ); + const uchar * binary_beg = reinterpret_cast( base64_beg ); + const uchar * binary_end = binary_beg + (base64_end - base64_beg); + parser.read( binary_beg, binary_end ); + parser.flush(); + } + + /* save as CvSeq */ + int elem_size = ::icvCalcStructSize(dt.c_str(), 0); + if (total_byte_size % elem_size != 0) + CV_PARSE_ERROR("Byte size not match elememt size"); + int elem_cnt = total_byte_size / elem_size; + + /* after icvFSCreateCollection, node->tag == struct_flags */ + icvFSCreateCollection(fs, CV_NODE_FLOW | CV_NODE_SEQ, node); + base64::make_seq(binary_buffer.data(), elem_cnt, dt.c_str(), *node->data.seq); + } + else + { + /* empty */ + icvFSCreateCollection(fs, CV_NODE_FLOW | CV_NODE_SEQ, node); + } + } + else if ( base64_buffer.empty() ) + { + /* empty */ + icvFSCreateCollection(fs, CV_NODE_FLOW | CV_NODE_SEQ, node); + } + else + { + CV_PARSE_ERROR("Unrecognized Base64 header"); + } + } + else + { /**************** normal string ****************/ + std::string string_buffer; + string_buffer.reserve( PARSER_BASE64_BUFFER_SIZE ); + + ptr = beg; + bool is_matching = false; + while ( !is_matching ) + { + switch ( *ptr ) + { + case '\\': + { + string_buffer.append( beg, ptr ); + ptr++; + switch ( *ptr ) + { + case '\\': + case '\"': + case '\'': { string_buffer.append( 1u, *ptr ); break; } + case 'n' : { string_buffer.append( 1u, '\n' ); break; } + case 'r' : { string_buffer.append( 1u, '\r' ); break; } + case 't' : { string_buffer.append( 1u, '\t' ); break; } + case 'b' : { string_buffer.append( 1u, '\b' ); break; } + case 'f' : { string_buffer.append( 1u, '\f' ); break; } + case 'u' : { CV_PARSE_ERROR( "'\\uXXXX' currently not supported" ); } + default : { CV_PARSE_ERROR( "Invalid escape character" ); } + break; + } + ptr++; + beg = ptr; + break; + } + case '\0': + { + string_buffer.append( beg, ptr ); + + ptr = icvGets( fs, fs->buffer_start, static_cast(fs->buffer_end - fs->buffer_start) ); + if ( !ptr ) + CV_PARSE_ERROR( "'\"' - right-quote of string is missing" ); + + beg = ptr; + break; + } + case '\"': + { + string_buffer.append( beg, ptr ); + beg = ptr; + is_matching = true; + break; + } + case '\n': + case '\r': + { + CV_PARSE_ERROR( "'\"' - right-quote of string is missing" ); + break; + } + default: + { + ptr++; + break; + } + } + } + + if ( *ptr != '\"' ) + CV_PARSE_ERROR( "'\"' - right-quote of string is missing" ); + else + ptr++; + + node->data.str = cvMemStorageAllocString + ( + fs->memstorage, + string_buffer.c_str(), + static_cast(string_buffer.size()) + ); + node->tag = CV_NODE_STRING; + } + } + else if ( cv_isdigit(*ptr) || *ptr == '-' || *ptr == '+' || *ptr == '.' ) + { /**************** number ****************/ + char * beg = ptr; + if ( *ptr == '+' || *ptr == '-' ) + ptr++; + while( cv_isdigit(*ptr) ) + ptr++; + if (*ptr == '.' || *ptr == 'e') + { + node->data.f = icv_strtod( fs, beg, &ptr ); + node->tag = CV_NODE_REAL; + } + else + { + node->data.i = static_cast(strtol( beg, &ptr, 0 )); + node->tag = CV_NODE_INT; + } + + if ( beg >= ptr ) + CV_PARSE_ERROR( "Invalid numeric value (inconsistent explicit type specification?)" ); + } + else + { /**************** other data ****************/ + const char * beg = ptr; + size_t len = 0u; + for ( ; cv_isalpha(*ptr) && len <= 6u; ptr++ ) + len++; + + if ( len >= 4u && memcmp( beg, "null", 4u ) == 0 ) + { + CV_PARSE_ERROR( "Value 'null' is not supported by this parser" ); + } + else if ( len >= 4u && memcmp( beg, "true", 4u ) == 0 ) + { + node->data.i = 1; + node->tag = CV_NODE_INT; + } + else if ( len >= 5u && memcmp( beg, "false", 5u ) == 0 ) + { + node->data.i = 0; + node->tag = CV_NODE_INT; + } + else + { + CV_PARSE_ERROR( "Unrecognized value" ); + } + ptr++; + } + + return ptr; +} + +static char* icvJSONParseSeq( CvFileStorage* fs, char* ptr, CvFileNode* node ); +static char* icvJSONParseMap( CvFileStorage* fs, char* ptr, CvFileNode* node ); + +static char* icvJSONParseSeq( CvFileStorage* fs, char* ptr, CvFileNode* node ) +{ + if ( *ptr != '[' ) + CV_PARSE_ERROR( "'[' - left-brace of seq is missing" ); + else + ptr++; + + memset( node, 0, sizeof(*node) ); + icvFSCreateCollection( fs, CV_NODE_SEQ, node ); + + for (;;) + { + ptr = icvJSONSkipSpaces( fs, ptr ); + if ( ptr == 0 || fs->dummy_eof ) + break; + + if ( *ptr != ']' ) + { + CvFileNode* child = (CvFileNode*)cvSeqPush( node->data.seq, 0 ); + + if ( *ptr == '[' ) + ptr = icvJSONParseSeq( fs, ptr, child ); + else if ( *ptr == '{' ) + ptr = icvJSONParseMap( fs, ptr, child ); + else + ptr = icvJSONParseValue( fs, ptr, child ); + } + + ptr = icvJSONSkipSpaces( fs, ptr ); + if ( ptr == 0 || fs->dummy_eof ) + break; + + if ( *ptr == ',' ) + ptr++; + else if ( *ptr == ']' ) + break; + else + CV_PARSE_ERROR( "Unexpected character" ); + } + + if ( *ptr != ']' ) + CV_PARSE_ERROR( "']' - right-brace of seq is missing" ); + else + ptr++; + + return ptr; +} + +static char* icvJSONParseMap( CvFileStorage* fs, char* ptr, CvFileNode* node ) +{ + if ( *ptr != '{' ) + CV_PARSE_ERROR( "'{' - left-brace of map is missing" ); + else + ptr++; + + memset( node, 0, sizeof(*node) ); + icvFSCreateCollection( fs, CV_NODE_MAP, node ); + + for ( ;; ) + { + ptr = icvJSONSkipSpaces( fs, ptr ); + if ( ptr == 0 || fs->dummy_eof ) + break; + + if ( *ptr == '"' ) + { + CvFileNode* child = 0; + ptr = icvJSONParseKey( fs, ptr, node, &child ); + ptr = icvJSONSkipSpaces( fs, ptr ); + if ( ptr == 0 || fs->dummy_eof ) + break; + + if ( child == 0 ) + { /* type_id */ + CvFileNode tmp; + ptr = icvJSONParseValue( fs, ptr, &tmp ); + if ( CV_NODE_IS_STRING(tmp.tag) ) + { + node->info = cvFindType( tmp.data.str.ptr ); + if ( node->info ) + node->tag |= CV_NODE_USER; + // delete tmp.data.str + } + else + { + CV_PARSE_ERROR( "\"type_id\" should be of type string" ); + } + } + else + { /* normal */ + if ( *ptr == '[' ) + ptr = icvJSONParseSeq( fs, ptr, child ); + else if ( *ptr == '{' ) + ptr = icvJSONParseMap( fs, ptr, child ); + else + ptr = icvJSONParseValue( fs, ptr, child ); + } + } + + ptr = icvJSONSkipSpaces( fs, ptr ); + if ( ptr == 0 || fs->dummy_eof ) + break; + + if ( *ptr == ',' ) + ptr++; + else if ( *ptr == '}' ) + break; + else + CV_PARSE_ERROR( "Unexpected character" ); + } + + if ( *ptr != '}' ) + CV_PARSE_ERROR( "'}' - right-brace of map is missing" ); + else + ptr++; + + return ptr; +} + + +static void +icvJSONParse( CvFileStorage* fs ) +{ + char* ptr = fs->buffer_start; + ptr = icvJSONSkipSpaces( fs, ptr ); + if ( ptr == 0 || fs->dummy_eof ) + return; + + if ( *ptr == '{' ) + { + CvFileNode* root_node = (CvFileNode*)cvSeqPush( fs->roots, 0 ); + ptr = icvJSONParseMap( fs, ptr, root_node ); + } + else if ( *ptr == '[' ) + { + CvFileNode* root_node = (CvFileNode*)cvSeqPush( fs->roots, 0 ); + ptr = icvJSONParseSeq( fs, ptr, root_node ); + } + else + { + CV_PARSE_ERROR( "left-brace of top level is missing" ); + } + + if ( fs->dummy_eof != 0 ) + CV_PARSE_ERROR( "Unexpected End-Of-File" ); +} + + +/****************************************************************************************\ +* JSON Emitter * +\****************************************************************************************/ + +static void +icvJSONWrite( CvFileStorage* fs, const char* key, const char* data ) +{ + /* check write_struct */ + + check_if_write_struct_is_delayed( fs ); + if ( fs->state_of_writing_base64 == base64::fs::Uncertain ) + { + switch_to_Base64_state( fs, base64::fs::NotUse ); + } + else if ( fs->state_of_writing_base64 == base64::fs::InUse ) + { + CV_Error( CV_StsError, "At present, output Base64 data only." ); + } + + /* check parameters */ + + size_t key_len = 0u; + if( key && *key == '\0' ) + key = 0; + if ( key ) + { + key_len = strlen(key); + if ( key_len == 0u ) + CV_Error( CV_StsBadArg, "The key is an empty" ); + else if ( static_cast(key_len) > CV_FS_MAX_LEN ) + CV_Error( CV_StsBadArg, "The key is too long" ); + } + + size_t data_len = 0u; + if ( data ) + data_len = strlen(data); + + int struct_flags = fs->struct_flags; + if( CV_NODE_IS_COLLECTION(struct_flags) ) + { + if ( (CV_NODE_IS_MAP(struct_flags) ^ (key != 0)) ) + CV_Error( CV_StsBadArg, "An attempt to add element without a key to a map, " + "or add element with key to sequence" ); + } else { + fs->is_first = 0; + struct_flags = CV_NODE_EMPTY | (key ? CV_NODE_MAP : CV_NODE_SEQ); + } + + /* start to write */ + + char* ptr = 0; + + if( CV_NODE_IS_FLOW(struct_flags) ) + { + int new_offset; + ptr = fs->buffer; + if( !CV_NODE_IS_EMPTY(struct_flags) ) + *ptr++ = ','; + new_offset = static_cast(ptr - fs->buffer_start + key_len + data_len); + if( new_offset > fs->wrap_margin && new_offset - fs->struct_indent > 10 ) + { + fs->buffer = ptr; + ptr = icvFSFlush(fs); + } + else + *ptr++ = ' '; + } + else + { + if ( !CV_NODE_IS_EMPTY(struct_flags) ) + { + ptr = fs->buffer; + *ptr++ = ','; + *ptr++ = '\n'; + *ptr++ = '\0'; + ::icvPuts( fs, fs->buffer_start ); + ptr = fs->buffer = fs->buffer_start; + } + ptr = icvFSFlush(fs); + } + + if( key ) + { + if( !cv_isalpha(key[0]) && key[0] != '_' ) + CV_Error( CV_StsBadArg, "Key must start with a letter or _" ); + + ptr = icvFSResizeWriteBuffer( fs, ptr, static_cast(key_len) ); + *ptr++ = '\"'; + + for( size_t i = 0u; i < key_len; i++ ) + { + char c = key[i]; + + ptr[i] = c; + if( !cv_isalnum(c) && c != '-' && c != '_' && c != ' ' ) + CV_Error( CV_StsBadArg, "Key names may only contain alphanumeric characters [a-zA-Z0-9], '-', '_' and ' '" ); + } + + ptr += key_len; + *ptr++ = '\"'; + *ptr++ = ':'; + *ptr++ = ' '; + } + + if( data ) + { + ptr = icvFSResizeWriteBuffer( fs, ptr, static_cast(data_len) ); + memcpy( ptr, data, data_len ); + ptr += data_len; + } + + fs->buffer = ptr; + fs->struct_flags = struct_flags & ~CV_NODE_EMPTY; +} + + +static void +icvJSONStartWriteStruct( CvFileStorage* fs, const char* key, int struct_flags, + const char* type_name CV_DEFAULT(0)) +{ + int parent_flags; + char data[CV_FS_MAX_LEN + 1024]; + + struct_flags = (struct_flags & (CV_NODE_TYPE_MASK|CV_NODE_FLOW)) | CV_NODE_EMPTY; + if( !CV_NODE_IS_COLLECTION(struct_flags)) + CV_Error( CV_StsBadArg, + "Some collection type - CV_NODE_SEQ or CV_NODE_MAP, must be specified" ); + + if ( type_name && *type_name == '\0' ) + type_name = 0; + + bool has_type_id = false; + bool is_real_collection = true; + if (type_name && memcmp(type_name, "binary", 6) == 0) + { + struct_flags = CV_NODE_STR; + data[0] = '\0'; + is_real_collection = false; + } + else if( type_name ) + { + has_type_id = true; + } + + if ( is_real_collection ) + { + char c = CV_NODE_IS_MAP(struct_flags) ? '{' : '['; + data[0] = c; + data[1] = '\0'; + } + + icvJSONWrite( fs, key, data ); + + parent_flags = fs->struct_flags; + cvSeqPush( fs->write_stack, &parent_flags ); + fs->struct_flags = struct_flags; + fs->struct_indent += 4; + + if ( has_type_id ) + fs->write_string( fs, "type_id", type_name, 1 ); +} + + +static void +icvJSONEndWriteStruct( CvFileStorage* fs ) +{ + if( fs->write_stack->total == 0 ) + CV_Error( CV_StsError, "EndWriteStruct w/o matching StartWriteStruct" ); + + int parent_flags = 0; + int struct_flags = fs->struct_flags; + cvSeqPop( fs->write_stack, &parent_flags ); + fs->struct_indent -= 4; + fs->struct_flags = parent_flags & ~CV_NODE_EMPTY; + assert( fs->struct_indent >= 0 ); + + if ( CV_NODE_IS_COLLECTION(struct_flags) ) + { + if ( !CV_NODE_IS_FLOW(struct_flags) ) + { + if ( fs->buffer <= fs->buffer_start + fs->space ) + { + /* some bad code for base64_writer... */ + *fs->buffer++ = '\n'; + *fs->buffer++ = '\0'; + icvPuts( fs, fs->buffer_start ); + fs->buffer = fs->buffer_start; + } + icvFSFlush(fs); + } + + char* ptr = fs->buffer; + if( ptr > fs->buffer_start + fs->struct_indent && !CV_NODE_IS_EMPTY(struct_flags) ) + *ptr++ = ' '; + *ptr++ = CV_NODE_IS_MAP(struct_flags) ? '}' : ']'; + fs->buffer = ptr; + } +} + + +static void +icvJSONStartNextStream( CvFileStorage* fs ) +{ + if( !fs->is_first ) + { + while( fs->write_stack->total > 0 ) + icvJSONEndWriteStruct(fs); + + fs->struct_indent = 4; + icvFSFlush(fs); + fs->buffer = fs->buffer_start; + } +} + + +static void +icvJSONWriteInt( CvFileStorage* fs, const char* key, int value ) +{ + char buf[128]; + icvJSONWrite( fs, key, icv_itoa( value, buf, 10 )); +} + + +static void +icvJSONWriteReal( CvFileStorage* fs, const char* key, double value ) +{ + char buf[128]; + icvJSONWrite( fs, key, icvDoubleToString( buf, value )); +} + + +static void +icvJSONWriteString( CvFileStorage* fs, const char* key, + const char* str, int quote CV_DEFAULT(0)) +{ + char buf[CV_FS_MAX_LEN*4+16]; + char* data = (char*)str; + int i, len; + + if( !str ) + CV_Error( CV_StsNullPtr, "Null string pointer" ); + + len = (int)strlen(str); + if( len > CV_FS_MAX_LEN ) + CV_Error( CV_StsBadArg, "The written string is too long" ); + + if( quote || len == 0 || str[0] != str[len-1] || (str[0] != '\"' && str[0] != '\'') ) + { + int need_quote = 1; + data = buf; + *data++ = '\"'; + for( i = 0; i < len; i++ ) + { + char c = str[i]; + + switch ( c ) + { + case '\\': + case '\"': + case '\'': { *data++ = '\\'; *data++ = c; break; } + case '\n': { *data++ = '\\'; *data++ = 'n'; break; } + case '\r': { *data++ = '\\'; *data++ = 'r'; break; } + case '\t': { *data++ = '\\'; *data++ = 't'; break; } + case '\b': { *data++ = '\\'; *data++ = 'b'; break; } + case '\f': { *data++ = '\\'; *data++ = 'f'; break; } + default : { *data++ = c; } + break; + } + } + + *data++ = '\"'; + *data++ = '\0'; + data = buf + !need_quote; + } + + icvJSONWrite( fs, key, data ); +} + + +static void +icvJSONWriteComment( CvFileStorage* fs, const char* comment, int eol_comment ) +{ + if( !comment ) + CV_Error( CV_StsNullPtr, "Null comment" ); + + int len = static_cast(strlen(comment)); + char* ptr = fs->buffer; + const char* eol = strchr(comment, '\n'); + bool multiline = eol != 0; + + if( !eol_comment || multiline || fs->buffer_end - ptr < len || ptr == fs->buffer_start ) + ptr = icvFSFlush( fs ); + else + *ptr++ = ' '; + + while( comment ) + { + *ptr++ = '/'; + *ptr++ = '/'; + *ptr++ = ' '; + if( eol ) + { + ptr = icvFSResizeWriteBuffer( fs, ptr, (int)(eol - comment) + 1 ); + memcpy( ptr, comment, eol - comment + 1 ); + fs->buffer = ptr + (eol - comment); + comment = eol + 1; + eol = strchr( comment, '\n' ); + } + else + { + len = (int)strlen(comment); + ptr = icvFSResizeWriteBuffer( fs, ptr, len ); + memcpy( ptr, comment, len ); + fs->buffer = ptr + len; + comment = 0; + } + ptr = icvFSFlush( fs ); + } +} + + /****************************************************************************************\ * Common High-Level Functions * \****************************************************************************************/ CV_IMPL CvFileStorage* -cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, const char* encoding ) +cvOpenFileStorage( const char* query, CvMemStorage* dststorage, int flags, const char* encoding ) { CvFileStorage* fs = 0; int default_block_size = 1 << 18; bool append = (flags & 3) == CV_STORAGE_APPEND; bool mem = (flags & CV_STORAGE_MEMORY) != 0; bool write_mode = (flags & 3) != 0; + bool write_base64 = (write_mode || append) && (flags & CV_STORAGE_BASE64) != 0; bool isGZ = false; size_t fnamelen = 0; + const char * filename = query; + + std::vector params; + if ( !mem ) + { + params = analyze_file_name( query ); + if ( !params.empty() ) + filename = params.begin()->c_str(); + + if ( write_base64 == false && is_param_exist( params, "base64" ) ) + write_base64 = (write_mode || append); + } if( !filename || filename[0] == '\0' ) { @@ -3051,13 +4215,23 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, co if( fmt == CV_STORAGE_FORMAT_AUTO && filename ) { - const char* dot_pos = filename + fnamelen - (isGZ ? 7 : 4); - fs->fmt = (dot_pos >= filename && (memcmp( dot_pos, ".xml", 4) == 0 || - memcmp(dot_pos, ".XML", 4) == 0 || memcmp(dot_pos, ".Xml", 4) == 0)) ? - CV_STORAGE_FORMAT_XML : CV_STORAGE_FORMAT_YAML; + const char* dot_pos = strrchr( filename, '.' ); + fs->fmt + = cv_strcasecmp( dot_pos, ".xml" ) + ? CV_STORAGE_FORMAT_XML + : cv_strcasecmp( dot_pos, ".json" ) + ? CV_STORAGE_FORMAT_JSON + : CV_STORAGE_FORMAT_YAML + ; + } + else if ( fmt != CV_STORAGE_FORMAT_AUTO ) + { + fs->fmt = fmt; } else - fs->fmt = fmt != CV_STORAGE_FORMAT_AUTO ? fmt : CV_STORAGE_FORMAT_XML; + { + fs->fmt = CV_STORAGE_FORMAT_XML; + } // we use factor=6 for XML (the longest characters (' and ") are encoded with 6 bytes (' and ") // and factor=4 for YAML ( as we use 4 bytes for non ASCII characters (e.g. \xAB)) @@ -3073,6 +4247,16 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, co fs->struct_flags = CV_NODE_EMPTY; fs->buffer_start = fs->buffer = (char*)cvAlloc( buf_size + 1024 ); fs->buffer_end = fs->buffer_start + buf_size; + + fs->base64_writer = 0; + fs->is_default_using_base64 = write_base64; + fs->state_of_writing_base64 = base64::fs::Uncertain; + + fs->is_write_struct_delayed = false; + fs->delayed_struct_key = 0; + fs->delayed_struct_flags = 0; + fs->delayed_type_name = 0; + if( fs->fmt == CV_STORAGE_FORMAT_XML ) { size_t file_size = fs->file ? (size_t)ftell( fs->file ) : (size_t)0; @@ -3145,7 +4329,7 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, co fs->write_comment = icvXMLWriteComment; fs->start_next_stream = icvXMLStartNextStream; } - else + else if( fs->fmt == CV_STORAGE_FORMAT_YAML ) { if( !append ) icvPuts( fs, "%YAML 1.0\n---\n" ); @@ -3159,6 +4343,48 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, co fs->write_comment = icvYMLWriteComment; fs->start_next_stream = icvYMLStartNextStream; } + else + { + if( !append ) + icvPuts( fs, "{\n" ); + else + { + bool valid = false; + long roffset = 0; + for ( ; + fseek( fs->file, roffset, SEEK_END ) == 0; + roffset -= 1 ) + { + const char end_mark = '}'; + if ( fgetc( fs->file ) == end_mark ) + { + fseek( fs->file, roffset, SEEK_END ); + valid = true; + break; + } + } + + if ( valid ) + { + icvCloseFile( fs ); + fs->file = fopen( fs->filename, "r+t" ); + fseek( fs->file, roffset, SEEK_END ); + fputs( ",", fs->file ); + } + else + { + CV_Error( CV_StsError, "Could not find '}' in the end of file.\n" ); + } + } + fs->struct_indent = 4; + fs->start_write_struct = icvJSONStartWriteStruct; + fs->end_write_struct = icvJSONEndWriteStruct; + fs->write_int = icvJSONWriteInt; + fs->write_real = icvJSONWriteReal; + fs->write_string = icvJSONWriteString; + fs->write_comment = icvJSONWriteComment; + fs->start_next_stream = icvJSONStartNextStream; + } } else { @@ -3170,10 +4396,16 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, co size_t buf_size = 1 << 20; const char* yaml_signature = "%YAML"; + const char* json_signature = "{"; char buf[16]; icvGets( fs, buf, sizeof(buf)-2 ); - fs->fmt = strncmp( buf, yaml_signature, strlen(yaml_signature) ) == 0 ? - CV_STORAGE_FORMAT_YAML : CV_STORAGE_FORMAT_XML; + fs->fmt + = strncmp( buf, yaml_signature, strlen(yaml_signature) ) == 0 + ? CV_STORAGE_FORMAT_YAML + : strncmp( buf, json_signature, strlen(json_signature) ) == 0 + ? CV_STORAGE_FORMAT_JSON + : CV_STORAGE_FORMAT_XML + ; if( !isGZ ) { @@ -3204,10 +4436,13 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, co //cvSetErrMode( CV_ErrModeSilent ); try { - if( fs->fmt == CV_STORAGE_FORMAT_XML ) - icvXMLParse( fs ); - else - icvYMLParse( fs ); + switch (fs->fmt) + { + case CV_STORAGE_FORMAT_XML : { icvXMLParse ( fs ); break; } + case CV_STORAGE_FORMAT_YAML: { icvYMLParse ( fs ); break; } + case CV_STORAGE_FORMAT_JSON: { icvJSONParse( fs ); break; } + default: break; + } } catch (...) { @@ -3247,7 +4482,48 @@ cvStartWriteStruct( CvFileStorage* fs, const char* key, int struct_flags, const char* type_name, CvAttrList /*attributes*/ ) { CV_CHECK_OUTPUT_FILE_STORAGE(fs); - fs->start_write_struct( fs, key, struct_flags, type_name ); + check_if_write_struct_is_delayed( fs ); + if ( fs->state_of_writing_base64 == base64::fs::NotUse ) + switch_to_Base64_state( fs, base64::fs::Uncertain ); + + if ( fs->state_of_writing_base64 == base64::fs::Uncertain + && + CV_NODE_IS_SEQ(struct_flags) + && + fs->is_default_using_base64 + && + type_name == 0 + ) + { + /* Uncertain whether output Base64 data */ + make_write_struct_delayed( fs, key, struct_flags, type_name ); + } + else if ( type_name && memcmp(type_name, "binary", 6) == 0 ) + { + /* Must output Base64 data */ + if ( !CV_NODE_IS_SEQ(struct_flags) ) + CV_Error( CV_StsBadArg, "must set 'struct_flags |= CV_NODE_SEQ' if using Base64."); + else if ( fs->state_of_writing_base64 != base64::fs::Uncertain ) + CV_Error( CV_StsError, "function \'cvStartWriteStruct\' calls cannot be nested if using Base64."); + + fs->start_write_struct( fs, key, struct_flags, type_name ); + + if ( fs->state_of_writing_base64 != base64::fs::Uncertain ) + switch_to_Base64_state( fs, base64::fs::Uncertain ); + switch_to_Base64_state( fs, base64::fs::InUse ); + } + else + { + /* Won't output Base64 data */ + if ( fs->state_of_writing_base64 == base64::fs::InUse ) + CV_Error( CV_StsError, "At the end of the output Base64, `cvEndWriteStruct` is needed."); + + fs->start_write_struct( fs, key, struct_flags, type_name ); + + if ( fs->state_of_writing_base64 != base64::fs::Uncertain ) + switch_to_Base64_state( fs, base64::fs::Uncertain ); + switch_to_Base64_state( fs, base64::fs::NotUse ); + } } @@ -3255,6 +4531,11 @@ CV_IMPL void cvEndWriteStruct( CvFileStorage* fs ) { CV_CHECK_OUTPUT_FILE_STORAGE(fs); + check_if_write_struct_is_delayed( fs ); + + if ( fs->state_of_writing_base64 != base64::fs::Uncertain ) + switch_to_Base64_state( fs, base64::fs::Uncertain ); + fs->end_write_struct( fs ); } @@ -3398,13 +4679,13 @@ icvCalcStructSize( const char* dt, int initial_size ) for ( const char * type = dt; *type != '\0'; type++ ) { switch ( *type ) { - case 'u': { if (elem_max_size < sizeof(uchar)) elem_max_size = sizeof(uchar); break; } - case 'c': { if (elem_max_size < sizeof(schar)) elem_max_size = sizeof(schar); break; } - case 'w': { if (elem_max_size < sizeof(ushort)) elem_max_size = sizeof(ushort); break; } - case 's': { if (elem_max_size < sizeof(short)) elem_max_size = sizeof(short); break; } - case 'i': { if (elem_max_size < sizeof(int)) elem_max_size = sizeof(int); break; } - case 'f': { if (elem_max_size < sizeof(float)) elem_max_size = sizeof(float); break; } - case 'd': { if (elem_max_size < sizeof(double)) elem_max_size = sizeof(double); break; } + case 'u': { elem_max_size = std::max( elem_max_size, sizeof(uchar ) ); break; } + case 'c': { elem_max_size = std::max( elem_max_size, sizeof(schar ) ); break; } + case 'w': { elem_max_size = std::max( elem_max_size, sizeof(ushort) ); break; } + case 's': { elem_max_size = std::max( elem_max_size, sizeof(short ) ); break; } + case 'i': { elem_max_size = std::max( elem_max_size, sizeof(int ) ); break; } + case 'f': { elem_max_size = std::max( elem_max_size, sizeof(float ) ); break; } + case 'd': { elem_max_size = std::max( elem_max_size, sizeof(double) ); break; } default: break; } } @@ -3432,6 +4713,17 @@ icvDecodeSimpleFormat( const char* dt ) CV_IMPL void cvWriteRawData( CvFileStorage* fs, const void* _data, int len, const char* dt ) { + if (fs->is_default_using_base64 || + fs->state_of_writing_base64 == base64::fs::InUse ) + { + base64::cvWriteRawDataBase64( fs, _data, len, dt ); + return; + } + else if ( fs->state_of_writing_base64 == base64::fs::Uncertain ) + { + switch_to_Base64_state( fs, base64::fs::NotUse ); + } + const char* data0 = (const char*)_data; int offset = 0; int fmt_pairs[CV_FS_MAX_FMT_PAIRS*2], k, fmt_pair_count; @@ -3514,8 +4806,14 @@ cvWriteRawData( CvFileStorage* fs, const void* _data, int len, const char* dt ) int buf_len = (int)strlen(ptr); icvXMLWriteScalar( fs, 0, ptr, buf_len ); } - else + else if ( fs->fmt == CV_STORAGE_FORMAT_YAML ) + { icvYMLWrite( fs, 0, ptr ); + } + else + { + icvJSONWrite( fs, 0, ptr ); + } } offset = (int)(data - data0); @@ -3760,15 +5058,15 @@ icvWriteFileNode( CvFileStorage* fs, const char* name, const CvFileNode* node ) break; case CV_NODE_SEQ: case CV_NODE_MAP: - fs->start_write_struct( fs, name, CV_NODE_TYPE(node->tag) + + cvStartWriteStruct( fs, name, CV_NODE_TYPE(node->tag) + (CV_NODE_SEQ_IS_SIMPLE(node->data.seq) ? CV_NODE_FLOW : 0), node->info ? node->info->type_name : 0 ); icvWriteCollection( fs, node ); - fs->end_write_struct( fs ); + cvEndWriteStruct( fs ); break; case CV_NODE_NONE: - fs->start_write_struct( fs, name, CV_NODE_SEQ, 0 ); - fs->end_write_struct( fs ); + cvStartWriteStruct( fs, name, CV_NODE_SEQ, 0 ); + cvEndWriteStruct( fs ); break; default: CV_Error( CV_StsBadFlag, "Unknown type of file node" ); @@ -5496,6 +6794,8 @@ FileStorage::~FileStorage() bool FileStorage::open(const String& filename, int flags, const String& encoding) { + CV_INSTRUMENT_REGION() + release(); fs.reset(cvOpenFileStorage( filename.c_str(), 0, flags, !encoding.empty() ? encoding.c_str() : 0)); @@ -5533,6 +6833,8 @@ FileNode FileStorage::root(int streamidx) const FileStorage& operator << (FileStorage& fs, const String& str) { + CV_INSTRUMENT_REGION() + enum { NAME_EXPECTED = FileStorage::NAME_EXPECTED, VALUE_EXPECTED = FileStorage::VALUE_EXPECTED, INSIDE_MAP = FileStorage::INSIDE_MAP }; @@ -6224,14 +7526,29 @@ bool base64::base64_valid(char const * src, size_t off, size_t cnt) return base64_valid(reinterpret_cast(src), off, cnt); } -size_t base64::base64_encode_buffer_size(size_t cnt) +size_t base64::base64_encode_buffer_size(size_t cnt, bool is_end_with_zero) { - return size_t((cnt + 2U) / 3U * 4U + 1U); + size_t additional = static_cast(is_end_with_zero == true); + return (cnt + 2U) / 3U * 4U + additional; } -size_t base64::base64_decode_buffer_size(size_t cnt) +size_t base64::base64_decode_buffer_size(size_t cnt, bool is_end_with_zero) { - return size_t(cnt / 4U * 3U + 1U); + size_t additional = static_cast(is_end_with_zero == true); + return cnt / 4U * 3U + additional; +} + +size_t base64::base64_decode_buffer_size(size_t cnt, char const * src, bool is_end_with_zero) +{ + return base64_decode_buffer_size(cnt, reinterpret_cast(src), is_end_with_zero); +} + +size_t base64::base64_decode_buffer_size(size_t cnt, uchar const * src, bool is_end_with_zero) +{ + size_t padding_cnt = 0U; + for (uchar const * ptr = src + cnt - 1U; *ptr == base64_padding; ptr--) + padding_cnt ++; + return base64_decode_buffer_size(cnt, is_end_with_zero) - padding_cnt; } /**************************************************************************** @@ -6306,13 +7623,10 @@ binary_to(uchar const * cur, uchar * val) * others ***************************************************************************/ -std::string base64::make_base64_header(int byte_size, const char * dt) +std::string base64::make_base64_header(const char * dt) { - int size = byte_size; - std::ostringstream oss; - oss << size << ' ' - << dt << ' '; + oss << dt << ' '; std::string buffer(oss.str()); CV_Assert(buffer.size() < HEADER_SIZE); @@ -6323,10 +7637,10 @@ std::string base64::make_base64_header(int byte_size, const char * dt) return buffer; } -bool base64::read_base64_header(std::string const & header, int & byte_size, std::string & dt) +bool base64::read_base64_header(std::vector const & header, std::string & dt) { - std::istringstream iss(header); - return static_cast(iss >> byte_size >> dt); + std::istringstream iss(header.data()); + return static_cast(iss >> dt); } /**************************************************************************** @@ -6349,10 +7663,9 @@ base64::Base64ContextParser::Base64ContextParser(uchar * buffer, size_t size) base64::Base64ContextParser::~Base64ContextParser() { - if (src_cur != src_beg) { - /* encode the rest binary data to base64 buffer */ + /* encode the rest binary data to base64 buffer */ + if (src_cur != src_beg) flush(); - } } base64::Base64ContextParser & base64::Base64ContextParser:: @@ -6381,9 +7694,12 @@ read(const uchar * beg, const uchar * end) bool base64::Base64ContextParser::flush() { - if (!base64_valid(src_beg, 0U, src_cur - src_beg)) + if ( !base64_valid(src_beg, 0U, src_cur - src_beg) ) return false; + if ( src_cur == src_beg ) + return true; + uchar * buffer = binary_buffer.data(); size_t len = base64_decode(src_beg, buffer, 0U, src_cur - src_beg); src_cur = src_beg; @@ -6429,7 +7745,19 @@ public: CV_CHECK_OUTPUT_FILE_STORAGE(fs); - ::icvFSFlush(file_storage); + if ( fs->fmt == CV_STORAGE_FORMAT_JSON ) + { + /* clean and break buffer */ + *fs->buffer++ = '\0'; + ::icvPuts( fs, fs->buffer_start ); + fs->buffer = fs->buffer_start; + memset( file_storage->buffer_start, 0, static_cast(file_storage->space) ); + ::icvPuts( fs, "\"$base64$" ); + } + else + { + ::icvFSFlush(file_storage); + } } ~Base64ContextEmitter() @@ -6437,6 +7765,16 @@ public: /* cleaning */ if (src_cur != src_beg) flush(); /* encode the rest binary data to base64 buffer */ + + if ( file_storage->fmt == CV_STORAGE_FORMAT_JSON ) + { + /* clean and break buffer */ + ::icvPuts(file_storage, "\""); + file_storage->buffer = file_storage->buffer_start; + ::icvFSFlush( file_storage ); + memset( file_storage->buffer_start, 0, static_cast(file_storage->space) ); + file_storage->buffer = file_storage->buffer_start; + } } Base64ContextEmitter & write(const uchar * beg, const uchar * end) @@ -6493,18 +7831,24 @@ public: src_cur = src_beg; { - // TODO: better solutions. - const char newline[] = "\n"; - char space[80]; + if ( file_storage->fmt == CV_STORAGE_FORMAT_JSON ) + { + ::icvPuts(file_storage, (const char*)base64_buffer.data()); + } + else + { + const char newline[] = "\n"; + char space[80]; + int ident = file_storage->struct_indent; + memset(space, ' ', static_cast(ident)); + space[ident] = '\0'; - int ident = file_storage->struct_indent; - memset(space, ' ', ident); - space[ident] = '\0'; + ::icvPuts(file_storage, space); + ::icvPuts(file_storage, (const char*)base64_buffer.data()); + ::icvPuts(file_storage, newline); + ::icvFSFlush(file_storage); + } - ::icvPuts(file_storage, space); - ::icvPuts(file_storage, (const char*)base64_buffer.data()); - ::icvPuts(file_storage, newline); - ::icvFSFlush(file_storage); } return true; @@ -6512,7 +7856,7 @@ public: private: /* because of Base64, we must keep its length a multiple of 3 */ - static const size_t BUFFER_LEN = 51U; + static const size_t BUFFER_LEN = 48U; // static_assert(BUFFER_LEN % 3 == 0, "BUFFER_LEN is invalid"); private: @@ -6525,111 +7869,6 @@ private: uchar * src_end; }; -class base64::MatToBinaryConvertor -{ -public: - - explicit MatToBinaryConvertor(const cv::Mat & src) - : y (0) - , y_max(0) - , x(0) - , x_max(0) - { - /* make sure each mat `mat.dims == 2` */ - if (src.dims > 2) { - const cv::Mat * arrays[] = { &src, 0 }; - cv::Mat plane; - cv::NAryMatIterator it(arrays, &plane, 1); - - CV_Assert(it.nplanes > 0U); /* make sure mats not empty */ - mats.reserve(it.nplanes); - for (size_t i = 0U; i < it.nplanes; ++i, ++it) - mats.push_back(*it.planes); - } else { - mats.push_back(src); - } - - /* set all to beginning */ - mat_iter = mats.begin(); - y_max = (mat_iter)->rows; - x_max = (mat_iter)->cols * (mat_iter)->elemSize(); - row_begin = (mat_iter)->ptr(0); - step = (mat_iter)->elemSize1(); - - /* choose a function */ - switch ((mat_iter)->depth()) - { - case CV_8U : - case CV_8S : { to_binary_func = to_binary ; break; } - case CV_16U: - case CV_16S: { to_binary_func = to_binary; break; } - case CV_32S: { to_binary_func = to_binary ; break; } - case CV_32F: { to_binary_func = to_binary ; break; } - case CV_64F: { to_binary_func = to_binary; break; } - case CV_USRTYPE1: - default: { CV_Assert(!"mat type is invalid"); break; } - }; - - /* check if empty */ - if (mats.empty() || mats.front().empty() || mats.front().data == 0) { - mat_iter = mats.end(); - CV_Assert(!(*this)); - } - - } - - inline MatToBinaryConvertor & operator >> (uchar * & dst) - { - CV_DbgAssert(*this); - - /* copy to dst */ - dst += to_binary_func(row_begin + x, dst); - - /* move to next */ - x += step; - if (x >= x_max) { - /* when x arrive end, reset it and increase y */ - x = 0U; - ++ y; - if (y >= y_max) { - /* when y arrive end, reset it and increase iter */ - y = 0U; - ++ mat_iter; - if (mat_iter == mats.end()) { - ;/* when iter arrive end, all done */ - } else { - /* usually x_max and y_max won't change */ - y_max = (mat_iter)->rows; - x_max = (mat_iter)->cols * (mat_iter)->elemSize(); - row_begin = (mat_iter)->ptr(static_cast(y)); - } - } else - row_begin = (mat_iter)->ptr(static_cast(y)); - } - - return *this; - } - - inline operator bool() const - { - return mat_iter != mats.end(); - } - -private: - - size_t y; - size_t y_max; - size_t x; - size_t x_max; - std::vector::iterator mat_iter; - std::vector mats; - - size_t step; - const uchar * row_begin; - - typedef size_t(*to_binary_t)(const uchar *, uchar *); - to_binary_t to_binary_func; -}; class base64::RawDataToBinaryConvertor { @@ -6933,68 +8172,53 @@ private: * Wapper ***************************************************************************/ -class base64::Base64Writer + +base64::Base64Writer::Base64Writer(::CvFileStorage * fs) + : emitter(new Base64ContextEmitter(fs)) + , data_type_string() { -public: + CV_CHECK_OUTPUT_FILE_STORAGE(fs); +} - Base64Writer(::CvFileStorage * fs, const char * name, int len, const char* dt) - : file_storage(fs) - , emitter(fs) - , remaining_data_length(len) - , data_type_string(dt) - { - CV_CHECK_OUTPUT_FILE_STORAGE(fs); +void base64::Base64Writer::write(const void* _data, size_t len, const char* dt) +{ + check_dt(dt); - cvStartWriteStruct(fs, name, CV_NODE_SEQ, "binary"); - icvFSFlush(fs); + RawDataToBinaryConvertor convertor( + _data, static_cast(len), data_type_string.c_str() + ); + emitter->write(convertor); +} + +template inline +void base64::Base64Writer::write(_to_binary_convertor_t & convertor, const char* dt) +{ + check_dt(dt); + emitter->write(convertor); +} + +base64::Base64Writer::~Base64Writer() +{ + delete emitter; +} + +void base64::Base64Writer::check_dt(const char* dt) +{ + if ( dt == 0 ) + CV_Error( CV_StsBadArg, "Invalid \'dt\'." ); + else if (data_type_string.empty()) { + data_type_string = dt; /* output header */ - - /* total byte size(before encode) */ - int size = len * ::icvCalcStructSize(dt, 0); - - std::string buffer = make_base64_header(size, dt); + std::string buffer = make_base64_header(dt); const uchar * beg = reinterpret_cast(buffer.data()); const uchar * end = beg + buffer.size(); - emitter.write(beg, end); - } + emitter->write(beg, end); + } else if ( data_type_string != dt ) + CV_Error( CV_StsBadArg, "\'dt\' does not match." ); +} - void write(const void* _data, int len) - { - CV_Assert(len >= 0); - CV_Assert(remaining_data_length >= static_cast(len)); - remaining_data_length -= static_cast(len); - - RawDataToBinaryConvertor convertor(_data, len, data_type_string); - emitter.write(convertor); - } - - template inline - void write(_to_binary_convertor_t & convertor, int data_length_of_convertor) - { - CV_Assert(data_length_of_convertor >= 0); - CV_Assert(remaining_data_length >= static_cast(data_length_of_convertor)); - remaining_data_length -= static_cast(data_length_of_convertor); - - emitter.write(convertor); - } - - ~Base64Writer() - { - CV_Assert(remaining_data_length == 0U); - emitter.flush(); - cvEndWriteStruct(file_storage); - icvFSFlush(file_storage); - } - -private: - - ::CvFileStorage * file_storage; - Base64ContextEmitter emitter; - size_t remaining_data_length; - const char* data_type_string; -}; void base64::make_seq(void * binary, int elem_cnt, const char * dt, ::CvSeq & seq) { @@ -7007,123 +8231,32 @@ void base64::make_seq(void * binary, int elem_cnt, const char * dt, ::CvSeq & se } } -void base64::cvStartWriteRawData_Base64(::CvFileStorage * fs, const char* name, int len, const char* dt) +void base64::cvWriteRawDataBase64(::CvFileStorage* fs, const void* _data, int len, const char* dt) { CV_Assert(fs); CV_CHECK_OUTPUT_FILE_STORAGE(fs); - CV_Assert(fs->base64_writer == 0); - fs->base64_writer = new Base64Writer(fs, name, len, dt); -} -void base64::cvWriteRawData_Base64(::CvFileStorage * fs, const void* _data, int len) -{ - CV_Assert(fs); - CV_CHECK_OUTPUT_FILE_STORAGE(fs); - CV_Assert(fs->base64_writer != 0); - fs->base64_writer->write(_data, len); -} + check_if_write_struct_is_delayed( fs, true ); -void base64::cvEndWriteRawData_Base64(::CvFileStorage * fs) -{ - CV_Assert(fs); - CV_CHECK_OUTPUT_FILE_STORAGE(fs); - CV_Assert(fs->base64_writer != 0); - delete fs->base64_writer; - fs->base64_writer = 0; -} - -void base64::cvWriteRawData_Base64(::cv::FileStorage & fs, const void* _data, int len, const char* dt) -{ - cvStartWriteStruct(*fs, fs.elname.c_str(), CV_NODE_SEQ, "binary"); + if ( fs->state_of_writing_base64 == base64::fs::Uncertain ) { - Base64ContextEmitter emitter(*fs); - { /* header */ - /* total byte size(before encode) */ - int size = len * ::icvCalcStructSize(dt, 0); - std::string buffer = make_base64_header(size, dt); - const uchar * beg = reinterpret_cast(buffer.data()); - const uchar * end = beg + buffer.size(); - - emitter.write(beg, end); - } - { /* body */ - RawDataToBinaryConvertor convert(_data, len, dt); - emitter.write(convert); - } + switch_to_Base64_state( fs, base64::fs::InUse ); } - cvEndWriteStruct(*fs); -} - -void base64::cvWriteMat_Base64(::CvFileStorage * fs, const char * name, ::cv::Mat const & mat) -{ - char dt[4]; - ::icvEncodeFormat(CV_MAT_TYPE(mat.type()), dt); - - { /* [1]output other attr */ - - if (mat.dims <= 2) { - cvStartWriteStruct(fs, name, CV_NODE_MAP, CV_TYPE_NAME_MAT); - - cvWriteInt(fs, "rows", mat.rows ); - cvWriteInt(fs, "cols", mat.cols ); - } else { - cvStartWriteStruct(fs, name, CV_NODE_MAP, CV_TYPE_NAME_MATND); - - cvStartWriteStruct(fs, "sizes", CV_NODE_SEQ | CV_NODE_FLOW); - cvWriteRawData(fs, mat.size.p, mat.dims, "i"); - cvEndWriteStruct(fs); - } - cvWriteString(fs, "dt", ::icvEncodeFormat(CV_MAT_TYPE(mat.type()), dt ), 0 ); + else if ( fs->state_of_writing_base64 != base64::fs::InUse ) + { + CV_Error( CV_StsError, "Base64 should not be used at present." ); } - { /* [2]deal with matrix's data */ - int len = static_cast(mat.total()); - MatToBinaryConvertor convertor(mat); - - cvStartWriteRawData_Base64(fs, "data", len, dt); - fs->base64_writer->write(convertor, len); - cvEndWriteRawData_Base64(fs); - } - - { /* [3]output end */ - cvEndWriteStruct(fs); - } + fs->base64_writer->write(_data, len, dt); } /**************************************************************************** * Interface ***************************************************************************/ -namespace cv +CV_IMPL void cvWriteRawDataBase64(::CvFileStorage* fs, const void* _data, int len, const char* dt) { - void cvWriteMat_Base64(::CvFileStorage* fs, const char* name, const ::CvMat* mat) - { - ::cv::Mat holder = ::cv::cvarrToMat(mat); - ::base64::cvWriteMat_Base64(fs, name, holder); - } - - void cvWriteMatND_Base64(::CvFileStorage* fs, const char* name, const ::CvMatND* mat) - { - ::cv::Mat holder = ::cv::cvarrToMat(mat); - ::base64::cvWriteMat_Base64(fs, name, holder); - } - - void cvStartWriteRawData_Base64(::CvFileStorage * fs, const char* name, int len, const char* dt) - { - ::base64::cvStartWriteRawData_Base64(fs, name, len, dt); - } - - void cvWriteRawData_Base64(::CvFileStorage * fs, const void* _data, int len) - { - ::base64::cvWriteRawData_Base64(fs, _data, len); - } - - void cvEndWriteRawData_Base64(::CvFileStorage * fs) - { - ::base64::cvEndWriteRawData_Base64(fs); - } - + ::base64::cvWriteRawDataBase64(fs, _data, len, dt); } - /* End of file. */ diff --git a/modules/core/src/rand.cpp b/modules/core/src/rand.cpp index 5d389c56d4..5247af8771 100644 --- a/modules/core/src/rand.cpp +++ b/modules/core/src/rand.cpp @@ -742,11 +742,15 @@ void cv::setRNGSeed(int seed) void cv::randu(InputOutputArray dst, InputArray low, InputArray high) { + CV_INSTRUMENT_REGION() + theRNG().fill(dst, RNG::UNIFORM, low, high); } void cv::randn(InputOutputArray dst, InputArray mean, InputArray stddev) { + CV_INSTRUMENT_REGION() + theRNG().fill(dst, RNG::NORMAL, mean, stddev); } @@ -793,6 +797,8 @@ typedef void (*RandShuffleFunc)( Mat& dst, RNG& rng, double iterFactor ); void cv::randShuffle( InputOutputArray _dst, double iterFactor, RNG* _rng ) { + CV_INSTRUMENT_REGION() + RandShuffleFunc tab[] = { 0, diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp index be0f89e1a2..abd7fef214 100644 --- a/modules/core/src/stat.cpp +++ b/modules/core/src/stat.cpp @@ -1137,6 +1137,8 @@ static bool ocl_sum( InputArray _src, Scalar & res, int sum_op, InputArray _mask #ifdef HAVE_IPP static bool ipp_sum(Mat &src, Scalar &_res) { + CV_INSTRUMENT_REGION_IPP() + #if IPP_VERSION_X100 >= 700 int cn = src.channels(); size_t total_size = src.total(); @@ -1147,12 +1149,12 @@ static bool ipp_sum(Mat &src, Scalar &_res) int type = src.type(); typedef IppStatus (CV_STDCALL* ippiSumFuncHint)(const void*, int, IppiSize, double *, IppHintAlgorithm); typedef IppStatus (CV_STDCALL* ippiSumFuncNoHint)(const void*, int, IppiSize, double *); - ippiSumFuncHint ippFuncHint = + ippiSumFuncHint ippiSumHint = type == CV_32FC1 ? (ippiSumFuncHint)ippiSum_32f_C1R : type == CV_32FC3 ? (ippiSumFuncHint)ippiSum_32f_C3R : type == CV_32FC4 ? (ippiSumFuncHint)ippiSum_32f_C4R : 0; - ippiSumFuncNoHint ippFuncNoHint = + ippiSumFuncNoHint ippiSum = type == CV_8UC1 ? (ippiSumFuncNoHint)ippiSum_8u_C1R : type == CV_8UC3 ? (ippiSumFuncNoHint)ippiSum_8u_C3R : type == CV_8UC4 ? (ippiSumFuncNoHint)ippiSum_8u_C4R : @@ -1163,12 +1165,13 @@ static bool ipp_sum(Mat &src, Scalar &_res) type == CV_16SC3 ? (ippiSumFuncNoHint)ippiSum_16s_C3R : type == CV_16SC4 ? (ippiSumFuncNoHint)ippiSum_16s_C4R : 0; - CV_Assert(!ippFuncHint || !ippFuncNoHint); - if( ippFuncHint || ippFuncNoHint ) + CV_Assert(!ippiSumHint || !ippiSum); + if( ippiSumHint || ippiSum ) { Ipp64f res[4]; - IppStatus ret = ippFuncHint ? ippFuncHint(src.ptr(), (int)src.step[0], sz, res, ippAlgHintAccurate) : - ippFuncNoHint(src.ptr(), (int)src.step[0], sz, res); + IppStatus ret = ippiSumHint ? + CV_INSTRUMENT_FUN_IPP(ippiSumHint, src.ptr(), (int)src.step[0], sz, res, ippAlgHintAccurate) : + CV_INSTRUMENT_FUN_IPP(ippiSum, src.ptr(), (int)src.step[0], sz, res); if( ret >= 0 ) { for( int i = 0; i < cn; i++ ) @@ -1188,6 +1191,8 @@ static bool ipp_sum(Mat &src, Scalar &_res) cv::Scalar cv::sum( InputArray _src ) { + CV_INSTRUMENT_REGION() + #if defined HAVE_OPENCL || defined HAVE_IPP Scalar _res; #endif @@ -1299,7 +1304,8 @@ namespace cv { static bool ipp_countNonZero( Mat &src, int &res ) { -#if !defined HAVE_IPP_ICV_ONLY + CV_INSTRUMENT_REGION_IPP() + Ipp32s count = 0; IppStatus status = ippStsNoErr; @@ -1314,18 +1320,15 @@ static bool ipp_countNonZero( Mat &src, int &res ) } if (depth == CV_8U) - status = ippiCountInRange_8u_C1R((const Ipp8u *)src.data, srcstep, roiSize, &count, 0, 0); + status = CV_INSTRUMENT_FUN_IPP(ippiCountInRange_8u_C1R, (const Ipp8u *)src.data, srcstep, roiSize, &count, 0, 0); else if (depth == CV_32F) - status = ippiCountInRange_32f_C1R((const Ipp32f *)src.data, srcstep, roiSize, &count, 0, 0); + status = CV_INSTRUMENT_FUN_IPP(ippiCountInRange_32f_C1R, (const Ipp32f *)src.data, srcstep, roiSize, &count, 0, 0); if (status >= 0) { res = ((Ipp32s)src.total() - count); return true; } -#else - CV_UNUSED(src); CV_UNUSED(res); -#endif return false; } } @@ -1334,6 +1337,8 @@ static bool ipp_countNonZero( Mat &src, int &res ) int cv::countNonZero( InputArray _src ) { + CV_INSTRUMENT_REGION() + int type = _src.type(), cn = CV_MAT_CN(type); CV_Assert( cn == 1 ); @@ -1369,6 +1374,8 @@ namespace cv { static bool ipp_mean( Mat &src, Mat &mask, Scalar &ret ) { + CV_INSTRUMENT_REGION_IPP() + #if IPP_VERSION_X100 >= 700 size_t total_size = src.total(); int rows = src.size[0], cols = rows ? (int)(total_size/rows) : 0; @@ -1379,32 +1386,32 @@ static bool ipp_mean( Mat &src, Mat &mask, Scalar &ret ) if( !mask.empty() ) { typedef IppStatus (CV_STDCALL* ippiMaskMeanFuncC1)(const void *, int, const void *, int, IppiSize, Ipp64f *); - ippiMaskMeanFuncC1 ippFuncC1 = + ippiMaskMeanFuncC1 ippiMean_C1MR = type == CV_8UC1 ? (ippiMaskMeanFuncC1)ippiMean_8u_C1MR : type == CV_16UC1 ? (ippiMaskMeanFuncC1)ippiMean_16u_C1MR : type == CV_32FC1 ? (ippiMaskMeanFuncC1)ippiMean_32f_C1MR : 0; - if( ippFuncC1 ) + if( ippiMean_C1MR ) { Ipp64f res; - if( ippFuncC1(src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, &res) >= 0 ) + if( CV_INSTRUMENT_FUN_IPP(ippiMean_C1MR, src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, &res) >= 0 ) { ret = Scalar(res); return true; } } typedef IppStatus (CV_STDCALL* ippiMaskMeanFuncC3)(const void *, int, const void *, int, IppiSize, int, Ipp64f *); - ippiMaskMeanFuncC3 ippFuncC3 = + ippiMaskMeanFuncC3 ippiMean_C3MR = type == CV_8UC3 ? (ippiMaskMeanFuncC3)ippiMean_8u_C3CMR : type == CV_16UC3 ? (ippiMaskMeanFuncC3)ippiMean_16u_C3CMR : type == CV_32FC3 ? (ippiMaskMeanFuncC3)ippiMean_32f_C3CMR : 0; - if( ippFuncC3 ) + if( ippiMean_C3MR ) { Ipp64f res1, res2, res3; - if( ippFuncC3(src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, 1, &res1) >= 0 && - ippFuncC3(src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, 2, &res2) >= 0 && - ippFuncC3(src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, 3, &res3) >= 0 ) + if( CV_INSTRUMENT_FUN_IPP(ippiMean_C3MR, src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, 1, &res1) >= 0 && + CV_INSTRUMENT_FUN_IPP(ippiMean_C3MR, src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, 2, &res2) >= 0 && + CV_INSTRUMENT_FUN_IPP(ippiMean_C3MR, src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, 3, &res3) >= 0 ) { ret = Scalar(res1, res2, res3); return true; @@ -1415,12 +1422,12 @@ static bool ipp_mean( Mat &src, Mat &mask, Scalar &ret ) { typedef IppStatus (CV_STDCALL* ippiMeanFuncHint)(const void*, int, IppiSize, double *, IppHintAlgorithm); typedef IppStatus (CV_STDCALL* ippiMeanFuncNoHint)(const void*, int, IppiSize, double *); - ippiMeanFuncHint ippFuncHint = + ippiMeanFuncHint ippiMeanHint = type == CV_32FC1 ? (ippiMeanFuncHint)ippiMean_32f_C1R : type == CV_32FC3 ? (ippiMeanFuncHint)ippiMean_32f_C3R : type == CV_32FC4 ? (ippiMeanFuncHint)ippiMean_32f_C4R : 0; - ippiMeanFuncNoHint ippFuncNoHint = + ippiMeanFuncNoHint ippiMean = type == CV_8UC1 ? (ippiMeanFuncNoHint)ippiMean_8u_C1R : type == CV_8UC3 ? (ippiMeanFuncNoHint)ippiMean_8u_C3R : type == CV_8UC4 ? (ippiMeanFuncNoHint)ippiMean_8u_C4R : @@ -1432,12 +1439,12 @@ static bool ipp_mean( Mat &src, Mat &mask, Scalar &ret ) type == CV_16SC4 ? (ippiMeanFuncNoHint)ippiMean_16s_C4R : 0; // Make sure only zero or one version of the function pointer is valid - CV_Assert(!ippFuncHint || !ippFuncNoHint); - if( ippFuncHint || ippFuncNoHint ) + CV_Assert(!ippiMeanHint || !ippiMean); + if( ippiMeanHint || ippiMean ) { Ipp64f res[4]; - IppStatus status = ippFuncHint ? ippFuncHint(src.ptr(), (int)src.step[0], sz, res, ippAlgHintAccurate) : - ippFuncNoHint(src.ptr(), (int)src.step[0], sz, res); + IppStatus status = ippiMeanHint ? CV_INSTRUMENT_FUN_IPP(ippiMeanHint, src.ptr(), (int)src.step[0], sz, res, ippAlgHintAccurate) : + CV_INSTRUMENT_FUN_IPP(ippiMean, src.ptr(), (int)src.step[0], sz, res); if( status >= 0 ) { for( int i = 0; i < src.channels(); i++ ) @@ -1457,6 +1464,8 @@ static bool ipp_mean( Mat &src, Mat &mask, Scalar &ret ) cv::Scalar cv::mean( InputArray _src, InputArray _mask ) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(), mask = _mask.getMat(); CV_Assert( mask.empty() || mask.type() == CV_8U ); @@ -1522,6 +1531,8 @@ namespace cv { static bool ocl_meanStdDev( InputArray _src, OutputArray _mean, OutputArray _sdv, InputArray _mask ) { + CV_INSTRUMENT_REGION_OPENCL() + bool haveMask = _mask.kind() != _InputArray::NONE; int nz = haveMask ? -1 : (int)_src.total(); Scalar mean, stddev; @@ -1585,7 +1596,8 @@ static bool ocl_meanStdDev( InputArray _src, OutputArray _mean, OutputArray _sdv k.args(srcarg, src.cols, (int)src.total(), groups, dbarg); size_t globalsize = groups * wgs; - if (!k.run(1, &globalsize, &wgs, false)) + + if(!CV_INSTRUMENT_FUN_OPENCL_KERNEL(k.run, 1, &globalsize, &wgs, false)) return false; typedef Scalar (* part_sum)(Mat m); @@ -1641,6 +1653,8 @@ namespace cv { static bool ipp_meanStdDev(Mat& src, OutputArray _mean, OutputArray _sdv, Mat& mask) { + CV_INSTRUMENT_REGION_IPP() + #if IPP_VERSION_X100 >= 700 int cn = src.channels(); size_t total_size = src.total(); @@ -1679,29 +1693,29 @@ static bool ipp_meanStdDev(Mat& src, OutputArray _mean, OutputArray _sdv, Mat& m if( !mask.empty() ) { typedef IppStatus (CV_STDCALL* ippiMaskMeanStdDevFuncC1)(const void *, int, const void *, int, IppiSize, Ipp64f *, Ipp64f *); - ippiMaskMeanStdDevFuncC1 ippFuncC1 = + ippiMaskMeanStdDevFuncC1 ippiMean_StdDev_C1MR = type == CV_8UC1 ? (ippiMaskMeanStdDevFuncC1)ippiMean_StdDev_8u_C1MR : type == CV_16UC1 ? (ippiMaskMeanStdDevFuncC1)ippiMean_StdDev_16u_C1MR : type == CV_32FC1 ? (ippiMaskMeanStdDevFuncC1)ippiMean_StdDev_32f_C1MR : 0; - if( ippFuncC1 ) + if( ippiMean_StdDev_C1MR ) { - if( ippFuncC1(src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, pmean, pstddev) >= 0 ) + if( CV_INSTRUMENT_FUN_IPP(ippiMean_StdDev_C1MR, src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, pmean, pstddev) >= 0 ) { return true; } } typedef IppStatus (CV_STDCALL* ippiMaskMeanStdDevFuncC3)(const void *, int, const void *, int, IppiSize, int, Ipp64f *, Ipp64f *); - ippiMaskMeanStdDevFuncC3 ippFuncC3 = + ippiMaskMeanStdDevFuncC3 ippiMean_StdDev_C3CMR = type == CV_8UC3 ? (ippiMaskMeanStdDevFuncC3)ippiMean_StdDev_8u_C3CMR : type == CV_16UC3 ? (ippiMaskMeanStdDevFuncC3)ippiMean_StdDev_16u_C3CMR : type == CV_32FC3 ? (ippiMaskMeanStdDevFuncC3)ippiMean_StdDev_32f_C3CMR : 0; - if( ippFuncC3 ) + if( ippiMean_StdDev_C3CMR ) { - if( ippFuncC3(src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, 1, &pmean[0], &pstddev[0]) >= 0 && - ippFuncC3(src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, 2, &pmean[1], &pstddev[1]) >= 0 && - ippFuncC3(src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, 3, &pmean[2], &pstddev[2]) >= 0 ) + if( CV_INSTRUMENT_FUN_IPP(ippiMean_StdDev_C3CMR, src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, 1, &pmean[0], &pstddev[0]) >= 0 && + CV_INSTRUMENT_FUN_IPP(ippiMean_StdDev_C3CMR, src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, 2, &pmean[1], &pstddev[1]) >= 0 && + CV_INSTRUMENT_FUN_IPP(ippiMean_StdDev_C3CMR, src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, 3, &pmean[2], &pstddev[2]) >= 0 ) { return true; } @@ -1710,31 +1724,31 @@ static bool ipp_meanStdDev(Mat& src, OutputArray _mean, OutputArray _sdv, Mat& m else { typedef IppStatus (CV_STDCALL* ippiMeanStdDevFuncC1)(const void *, int, IppiSize, Ipp64f *, Ipp64f *); - ippiMeanStdDevFuncC1 ippFuncC1 = + ippiMeanStdDevFuncC1 ippiMean_StdDev_C1R = type == CV_8UC1 ? (ippiMeanStdDevFuncC1)ippiMean_StdDev_8u_C1R : type == CV_16UC1 ? (ippiMeanStdDevFuncC1)ippiMean_StdDev_16u_C1R : #if (IPP_VERSION_X100 >= 810) type == CV_32FC1 ? (ippiMeanStdDevFuncC1)ippiMean_StdDev_32f_C1R ://Aug 2013: bug in IPP 7.1, 8.0 #endif 0; - if( ippFuncC1 ) + if( ippiMean_StdDev_C1R ) { - if( ippFuncC1(src.ptr(), (int)src.step[0], sz, pmean, pstddev) >= 0 ) + if( CV_INSTRUMENT_FUN_IPP(ippiMean_StdDev_C1R, src.ptr(), (int)src.step[0], sz, pmean, pstddev) >= 0 ) { return true; } } typedef IppStatus (CV_STDCALL* ippiMeanStdDevFuncC3)(const void *, int, IppiSize, int, Ipp64f *, Ipp64f *); - ippiMeanStdDevFuncC3 ippFuncC3 = + ippiMeanStdDevFuncC3 ippiMean_StdDev_C3CR = type == CV_8UC3 ? (ippiMeanStdDevFuncC3)ippiMean_StdDev_8u_C3CR : type == CV_16UC3 ? (ippiMeanStdDevFuncC3)ippiMean_StdDev_16u_C3CR : type == CV_32FC3 ? (ippiMeanStdDevFuncC3)ippiMean_StdDev_32f_C3CR : 0; - if( ippFuncC3 ) + if( ippiMean_StdDev_C3CR ) { - if( ippFuncC3(src.ptr(), (int)src.step[0], sz, 1, &pmean[0], &pstddev[0]) >= 0 && - ippFuncC3(src.ptr(), (int)src.step[0], sz, 2, &pmean[1], &pstddev[1]) >= 0 && - ippFuncC3(src.ptr(), (int)src.step[0], sz, 3, &pmean[2], &pstddev[2]) >= 0 ) + if( CV_INSTRUMENT_FUN_IPP(ippiMean_StdDev_C3CR, src.ptr(), (int)src.step[0], sz, 1, &pmean[0], &pstddev[0]) >= 0 && + CV_INSTRUMENT_FUN_IPP(ippiMean_StdDev_C3CR, src.ptr(), (int)src.step[0], sz, 2, &pmean[1], &pstddev[1]) >= 0 && + CV_INSTRUMENT_FUN_IPP(ippiMean_StdDev_C3CR, src.ptr(), (int)src.step[0], sz, 3, &pmean[2], &pstddev[2]) >= 0 ) { return true; } @@ -1751,6 +1765,8 @@ static bool ipp_meanStdDev(Mat& src, OutputArray _mean, OutputArray _sdv, Mat& m void cv::meanStdDev( InputArray _src, OutputArray _mean, OutputArray _sdv, InputArray _mask ) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(OCL_PERFORMANCE_CHECK(_src.isUMat()) && _src.dims() <= 2, ocl_meanStdDev(_src, _mean, _sdv, _mask)) @@ -2213,6 +2229,8 @@ static bool ocl_minMaxIdx( InputArray _src, double* minVal, double* maxVal, int* #ifdef HAVE_IPP static bool ipp_minMaxIdx( Mat &src, double* minVal, double* maxVal, int* minIdx, int* maxIdx, Mat &mask) { + CV_INSTRUMENT_REGION_IPP() + #if IPP_VERSION_X100 >= 700 int type = src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type); size_t total_size = src.total(); @@ -2227,7 +2245,7 @@ static bool ipp_minMaxIdx( Mat &src, double* minVal, double* maxVal, int* minIdx IppiSize, Ipp32f *, Ipp32f *, IppiPoint *, IppiPoint *); CV_SUPPRESS_DEPRECATED_START - ippiMaskMinMaxIndxFuncC1 ippFuncC1 = + ippiMaskMinMaxIndxFuncC1 ippiMinMaxIndx_C1MR = type == CV_8UC1 ? (ippiMaskMinMaxIndxFuncC1)ippiMinMaxIndx_8u_C1MR : #if IPP_VERSION_X100 < 900 type == CV_8SC1 ? (ippiMaskMinMaxIndxFuncC1)ippiMinMaxIndx_8s_C1MR : @@ -2236,11 +2254,11 @@ static bool ipp_minMaxIdx( Mat &src, double* minVal, double* maxVal, int* minIdx type == CV_32FC1 ? (ippiMaskMinMaxIndxFuncC1)ippiMinMaxIndx_32f_C1MR : 0; CV_SUPPRESS_DEPRECATED_END - if( ippFuncC1 ) + if( ippiMinMaxIndx_C1MR ) { Ipp32f min, max; IppiPoint minp, maxp; - if( ippFuncC1(src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, &min, &max, &minp, &maxp) >= 0 ) + if( CV_INSTRUMENT_FUN_IPP(ippiMinMaxIndx_C1MR, src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, &min, &max, &minp, &maxp) >= 0 ) { if( minVal ) *minVal = (double)min; @@ -2267,7 +2285,7 @@ static bool ipp_minMaxIdx( Mat &src, double* minVal, double* maxVal, int* minIdx typedef IppStatus (CV_STDCALL* ippiMinMaxIndxFuncC1)(const void *, int, IppiSize, Ipp32f *, Ipp32f *, IppiPoint *, IppiPoint *); CV_SUPPRESS_DEPRECATED_START - ippiMinMaxIndxFuncC1 ippFuncC1 = + ippiMinMaxIndxFuncC1 ippiMinMaxIndx_C1R = #if IPP_VERSION_X100 != 900 // bug in 9.0.0 avx2 optimization depth == CV_8U ? (ippiMinMaxIndxFuncC1)ippiMinMaxIndx_8u_C1R : #endif @@ -2275,19 +2293,19 @@ static bool ipp_minMaxIdx( Mat &src, double* minVal, double* maxVal, int* minIdx depth == CV_8S ? (ippiMinMaxIndxFuncC1)ippiMinMaxIndx_8s_C1R : #endif depth == CV_16U ? (ippiMinMaxIndxFuncC1)ippiMinMaxIndx_16u_C1R : -#if !((defined _MSC_VER && defined _M_IX86) || defined __i386__) +#if IPP_DISABLE_BLOCK && !((defined _MSC_VER && defined _M_IX86) || defined __i386__) // See bug #4955: the function fails with SEGFAULT when the source matrix contains NANs // IPPICV version is 9.0.1. - // depth == CV_32F ? (ippiMinMaxIndxFuncC1)ippiMinMaxIndx_32f_C1R : + depth == CV_32F ? (ippiMinMaxIndxFuncC1)ippiMinMaxIndx_32f_C1R : #endif 0; CV_SUPPRESS_DEPRECATED_END - if( ippFuncC1 ) + if( ippiMinMaxIndx_C1R ) { Ipp32f min, max; IppiPoint minp, maxp; - if( ippFuncC1(src.ptr(), (int)src.step[0], sz, &min, &max, &minp, &maxp) >= 0 ) + if( CV_INSTRUMENT_FUN_IPP(ippiMinMaxIndx_C1R, src.ptr(), (int)src.step[0], sz, &min, &max, &minp, &maxp) >= 0 ) { if( minVal ) *minVal = (double)min; @@ -2321,6 +2339,8 @@ void cv::minMaxIdx(InputArray _src, double* minVal, double* maxVal, int* minIdx, int* maxIdx, InputArray _mask) { + CV_INSTRUMENT_REGION() + int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type); CV_Assert( (cn == 1 && (_mask.empty() || _mask.type() == CV_8U)) || (cn > 1 && _mask.empty() && !minIdx && !maxIdx) ); @@ -2383,6 +2403,8 @@ void cv::minMaxIdx(InputArray _src, double* minVal, void cv::minMaxLoc( InputArray _img, double* minVal, double* maxVal, Point* minLoc, Point* maxLoc, InputArray mask ) { + CV_INSTRUMENT_REGION() + CV_Assert(_img.dims() <= 2); minMaxIdx(_img, minVal, maxVal, (int*)minLoc, (int*)maxLoc, mask); @@ -2662,6 +2684,8 @@ static bool ocl_norm( InputArray _src, int normType, InputArray _mask, double & #ifdef HAVE_IPP static bool ipp_norm(Mat &src, int normType, Mat &mask, double &result) { + CV_INSTRUMENT_REGION_IPP() + #if IPP_VERSION_X100 >= 700 int cn = src.channels(); size_t total_size = src.total(); @@ -2677,7 +2701,7 @@ static bool ipp_norm(Mat &src, int normType, Mat &mask, double &result) if( !mask.empty() ) { typedef IppStatus (CV_STDCALL* ippiMaskNormFuncC1)(const void *, int, const void *, int, IppiSize, Ipp64f *); - ippiMaskNormFuncC1 ippFuncC1 = + ippiMaskNormFuncC1 ippiNorm_C1MR = normType == NORM_INF ? (type == CV_8UC1 ? (ippiMaskNormFuncC1)ippiNorm_Inf_8u_C1MR : #if IPP_VERSION_X100 < 900 @@ -2702,10 +2726,10 @@ static bool ipp_norm(Mat &src, int normType, Mat &mask, double &result) type == CV_16UC1 ? (ippiMaskNormFuncC1)ippiNorm_L2_16u_C1MR : type == CV_32FC1 ? (ippiMaskNormFuncC1)ippiNorm_L2_32f_C1MR : 0) : 0; - if( ippFuncC1 ) + if( ippiNorm_C1MR ) { Ipp64f norm; - if( ippFuncC1(src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, &norm) >= 0 ) + if( CV_INSTRUMENT_FUN_IPP(ippiNorm_C1MR, src.ptr(), (int)src.step[0], mask.ptr(), (int)mask.step[0], sz, &norm) >= 0 ) { result = (normType == NORM_L2SQR ? (double)(norm * norm) : (double)norm); return true; @@ -2713,7 +2737,7 @@ static bool ipp_norm(Mat &src, int normType, Mat &mask, double &result) } #if IPP_DISABLE_BLOCK typedef IppStatus (CV_STDCALL* ippiMaskNormFuncC3)(const void *, int, const void *, int, IppiSize, int, Ipp64f *); - ippiMaskNormFuncC3 ippFuncC3 = + ippiMaskNormFuncC3 ippiNorm_C3CMR = normType == NORM_INF ? (type == CV_8UC3 ? (ippiMaskNormFuncC3)ippiNorm_Inf_8u_C3CMR : #if IPP_VERSION_X100 < 900 @@ -2738,12 +2762,12 @@ static bool ipp_norm(Mat &src, int normType, Mat &mask, double &result) type == CV_16UC3 ? (ippiMaskNormFuncC3)ippiNorm_L2_16u_C3CMR : type == CV_32FC3 ? (ippiMaskNormFuncC3)ippiNorm_L2_32f_C3CMR : 0) : 0; - if( ippFuncC3 ) + if( ippiNorm_C3CMR ) { Ipp64f norm1, norm2, norm3; - if( ippFuncC3(src.data, (int)src.step[0], mask.data, (int)mask.step[0], sz, 1, &norm1) >= 0 && - ippFuncC3(src.data, (int)src.step[0], mask.data, (int)mask.step[0], sz, 2, &norm2) >= 0 && - ippFuncC3(src.data, (int)src.step[0], mask.data, (int)mask.step[0], sz, 3, &norm3) >= 0) + if( CV_INSTRUMENT_FUN_IPP(ippiNorm_C3CMR, (src.data, (int)src.step[0], mask.data, (int)mask.step[0], sz, 1, &norm1)) >= 0 && + CV_INSTRUMENT_FUN_IPP(ippiNorm_C3CMR, (src.data, (int)src.step[0], mask.data, (int)mask.step[0], sz, 2, &norm2)) >= 0 && + CV_INSTRUMENT_FUN_IPP(ippiNorm_C3CMR, (src.data, (int)src.step[0], mask.data, (int)mask.step[0], sz, 3, &norm3)) >= 0) { Ipp64f norm = normType == NORM_INF ? std::max(std::max(norm1, norm2), norm3) : @@ -2760,7 +2784,7 @@ static bool ipp_norm(Mat &src, int normType, Mat &mask, double &result) { typedef IppStatus (CV_STDCALL* ippiNormFuncHint)(const void *, int, IppiSize, Ipp64f *, IppHintAlgorithm hint); typedef IppStatus (CV_STDCALL* ippiNormFuncNoHint)(const void *, int, IppiSize, Ipp64f *); - ippiNormFuncHint ippFuncHint = + ippiNormFuncHint ippiNormHint = normType == NORM_L1 ? (type == CV_32FC1 ? (ippiNormFuncHint)ippiNorm_L1_32f_C1R : type == CV_32FC3 ? (ippiNormFuncHint)ippiNorm_L1_32f_C3R : @@ -2771,7 +2795,7 @@ static bool ipp_norm(Mat &src, int normType, Mat &mask, double &result) type == CV_32FC3 ? (ippiNormFuncHint)ippiNorm_L2_32f_C3R : type == CV_32FC4 ? (ippiNormFuncHint)ippiNorm_L2_32f_C4R : 0) : 0; - ippiNormFuncNoHint ippFuncNoHint = + ippiNormFuncNoHint ippiNorm = normType == NORM_INF ? (type == CV_8UC1 ? (ippiNormFuncNoHint)ippiNorm_Inf_8u_C1R : type == CV_8UC3 ? (ippiNormFuncNoHint)ippiNorm_Inf_8u_C3R : @@ -2811,12 +2835,12 @@ static bool ipp_norm(Mat &src, int normType, Mat &mask, double &result) type == CV_16SC4 ? (ippiNormFuncNoHint)ippiNorm_L2_16s_C4R : 0) : 0; // Make sure only zero or one version of the function pointer is valid - CV_Assert(!ippFuncHint || !ippFuncNoHint); - if( ippFuncHint || ippFuncNoHint ) + CV_Assert(!ippiNormHint || !ippiNorm); + if( ippiNormHint || ippiNorm ) { Ipp64f norm_array[4]; - IppStatus ret = ippFuncHint ? ippFuncHint(src.ptr(), (int)src.step[0], sz, norm_array, ippAlgHintAccurate) : - ippFuncNoHint(src.ptr(), (int)src.step[0], sz, norm_array); + IppStatus ret = ippiNormHint ? CV_INSTRUMENT_FUN_IPP(ippiNormHint, src.ptr(), (int)src.step[0], sz, norm_array, ippAlgHintAccurate) : + CV_INSTRUMENT_FUN_IPP(ippiNorm, src.ptr(), (int)src.step[0], sz, norm_array); if( ret >= 0 ) { Ipp64f norm = (normType == NORM_L2 || normType == NORM_L2SQR) ? norm_array[0] * norm_array[0] : norm_array[0]; @@ -2844,6 +2868,8 @@ static bool ipp_norm(Mat &src, int normType, Mat &mask, double &result) double cv::norm( InputArray _src, int normType, InputArray _mask ) { + CV_INSTRUMENT_REGION() + normType &= NORM_TYPE_MASK; CV_Assert( normType == NORM_INF || normType == NORM_L1 || normType == NORM_L2 || normType == NORM_L2SQR || @@ -3064,6 +3090,8 @@ namespace cv { static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArray _mask, double &result) { + CV_INSTRUMENT_REGION_IPP() + #if IPP_VERSION_X100 >= 700 Mat src1 = _src1.getMat(), src2 = _src2.getMat(), mask = _mask.getMat(); @@ -3084,7 +3112,7 @@ static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArra if( !mask.empty() ) { typedef IppStatus (CV_STDCALL* ippiMaskNormRelFuncC1)(const void *, int, const void *, int, const void *, int, IppiSize, Ipp64f *); - ippiMaskNormRelFuncC1 ippFuncC1 = + ippiMaskNormRelFuncC1 ippiNormDiff_C1MR = normType == NORM_INF ? (type == CV_8UC1 ? (ippiMaskNormRelFuncC1)ippiNormRel_Inf_8u_C1MR : #if IPP_VERSION_X100 < 900 @@ -3113,10 +3141,10 @@ static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArra type == CV_16UC1 ? (ippiMaskNormRelFuncC1)ippiNormRel_L2_16u_C1MR : type == CV_32FC1 ? (ippiMaskNormRelFuncC1)ippiNormRel_L2_32f_C1MR : 0) : 0; - if( ippFuncC1 ) + if( ippiNormDiff_C1MR ) { Ipp64f norm; - if( ippFuncC1(src1.ptr(), (int)src1.step[0], src2.ptr(), (int)src2.step[0], mask.ptr(), (int)mask.step[0], sz, &norm) >= 0 ) + if( CV_INSTRUMENT_FUN_IPP(ippiNormDiff_C1MR, src1.ptr(), (int)src1.step[0], src2.ptr(), (int)src2.step[0], mask.ptr(), (int)mask.step[0], sz, &norm) >= 0 ) { result = (normType == NORM_L2SQR ? (double)(norm * norm) : (double)norm); return true; @@ -3127,7 +3155,7 @@ static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArra { typedef IppStatus (CV_STDCALL* ippiNormRelFuncNoHint)(const void *, int, const void *, int, IppiSize, Ipp64f *); typedef IppStatus (CV_STDCALL* ippiNormRelFuncHint)(const void *, int, const void *, int, IppiSize, Ipp64f *, IppHintAlgorithm hint); - ippiNormRelFuncNoHint ippFuncNoHint = + ippiNormRelFuncNoHint ippiNormDiff = normType == NORM_INF ? (type == CV_8UC1 ? (ippiNormRelFuncNoHint)ippiNormRel_Inf_8u_C1R : type == CV_16UC1 ? (ippiNormRelFuncNoHint)ippiNormRel_Inf_16u_C1R : @@ -3144,26 +3172,26 @@ static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArra type == CV_16UC1 ? (ippiNormRelFuncNoHint)ippiNormRel_L2_16u_C1R : type == CV_16SC1 ? (ippiNormRelFuncNoHint)ippiNormRel_L2_16s_C1R : 0) : 0; - ippiNormRelFuncHint ippFuncHint = + ippiNormRelFuncHint ippiNormDiffHint = normType == NORM_L1 ? (type == CV_32FC1 ? (ippiNormRelFuncHint)ippiNormRel_L1_32f_C1R : 0) : normType == NORM_L2 || normType == NORM_L2SQR ? (type == CV_32FC1 ? (ippiNormRelFuncHint)ippiNormRel_L2_32f_C1R : 0) : 0; - if (ippFuncNoHint) + if (ippiNormDiff) { Ipp64f norm; - if( ippFuncNoHint(src1.ptr(), (int)src1.step[0], src2.ptr(), (int)src2.step[0], sz, &norm) >= 0 ) + if( CV_INSTRUMENT_FUN_IPP(ippiNormDiff, src1.ptr(), (int)src1.step[0], src2.ptr(), (int)src2.step[0], sz, &norm) >= 0 ) { result = (double)norm; return true; } } - if (ippFuncHint) + if (ippiNormDiffHint) { Ipp64f norm; - if( ippFuncHint(src1.ptr(), (int)src1.step[0], src2.ptr(), (int)src2.step[0], sz, &norm, ippAlgHintAccurate) >= 0 ) + if( CV_INSTRUMENT_FUN_IPP(ippiNormDiffHint, src1.ptr(), (int)src1.step[0], src2.ptr(), (int)src2.step[0], sz, &norm, ippAlgHintAccurate) >= 0 ) { result = (double)norm; return true; @@ -3191,7 +3219,7 @@ static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArra if( !mask.empty() ) { typedef IppStatus (CV_STDCALL* ippiMaskNormDiffFuncC1)(const void *, int, const void *, int, const void *, int, IppiSize, Ipp64f *); - ippiMaskNormDiffFuncC1 ippFuncC1 = + ippiMaskNormDiffFuncC1 ippiNormDiff_C1MR = normType == NORM_INF ? (type == CV_8UC1 ? (ippiMaskNormDiffFuncC1)ippiNormDiff_Inf_8u_C1MR : #if IPP_VERSION_X100 < 900 @@ -3218,10 +3246,10 @@ static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArra type == CV_16UC1 ? (ippiMaskNormDiffFuncC1)ippiNormDiff_L2_16u_C1MR : type == CV_32FC1 ? (ippiMaskNormDiffFuncC1)ippiNormDiff_L2_32f_C1MR : 0) : 0; - if( ippFuncC1 ) + if( ippiNormDiff_C1MR ) { Ipp64f norm; - if( ippFuncC1(src1.ptr(), (int)src1.step[0], src2.ptr(), (int)src2.step[0], mask.ptr(), (int)mask.step[0], sz, &norm) >= 0 ) + if( CV_INSTRUMENT_FUN_IPP(ippiNormDiff_C1MR, src1.ptr(), (int)src1.step[0], src2.ptr(), (int)src2.step[0], mask.ptr(), (int)mask.step[0], sz, &norm) >= 0 ) { result = (normType == NORM_L2SQR ? (double)(norm * norm) : (double)norm); return true; @@ -3229,7 +3257,7 @@ static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArra } #ifndef __APPLE__ typedef IppStatus (CV_STDCALL* ippiMaskNormDiffFuncC3)(const void *, int, const void *, int, const void *, int, IppiSize, int, Ipp64f *); - ippiMaskNormDiffFuncC3 ippFuncC3 = + ippiMaskNormDiffFuncC3 ippiNormDiff_C3CMR = normType == NORM_INF ? (type == CV_8UC3 ? (ippiMaskNormDiffFuncC3)ippiNormDiff_Inf_8u_C3CMR : #if IPP_VERSION_X100 < 900 @@ -3254,12 +3282,12 @@ static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArra type == CV_16UC3 ? (ippiMaskNormDiffFuncC3)ippiNormDiff_L2_16u_C3CMR : type == CV_32FC3 ? (ippiMaskNormDiffFuncC3)ippiNormDiff_L2_32f_C3CMR : 0) : 0; - if( ippFuncC3 ) + if( ippiNormDiff_C3CMR ) { Ipp64f norm1, norm2, norm3; - if( ippFuncC3(src1.data, (int)src1.step[0], src2.data, (int)src2.step[0], mask.data, (int)mask.step[0], sz, 1, &norm1) >= 0 && - ippFuncC3(src1.data, (int)src1.step[0], src2.data, (int)src2.step[0], mask.data, (int)mask.step[0], sz, 2, &norm2) >= 0 && - ippFuncC3(src1.data, (int)src1.step[0], src2.data, (int)src2.step[0], mask.data, (int)mask.step[0], sz, 3, &norm3) >= 0) + if( CV_INSTRUMENT_FUN_IPP(ippiNormDiff_C3CMR, src1.data, (int)src1.step[0], src2.data, (int)src2.step[0], mask.data, (int)mask.step[0], sz, 1, &norm1) >= 0 && + CV_INSTRUMENT_FUN_IPP(ippiNormDiff_C3CMR, src1.data, (int)src1.step[0], src2.data, (int)src2.step[0], mask.data, (int)mask.step[0], sz, 2, &norm2) >= 0 && + CV_INSTRUMENT_FUN_IPP(ippiNormDiff_C3CMR, src1.data, (int)src1.step[0], src2.data, (int)src2.step[0], mask.data, (int)mask.step[0], sz, 3, &norm3) >= 0) { Ipp64f norm = normType == NORM_INF ? std::max(std::max(norm1, norm2), norm3) : @@ -3276,7 +3304,7 @@ static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArra { typedef IppStatus (CV_STDCALL* ippiNormDiffFuncHint)(const void *, int, const void *, int, IppiSize, Ipp64f *, IppHintAlgorithm hint); typedef IppStatus (CV_STDCALL* ippiNormDiffFuncNoHint)(const void *, int, const void *, int, IppiSize, Ipp64f *); - ippiNormDiffFuncHint ippFuncHint = + ippiNormDiffFuncHint ippiNormDiffHint = normType == NORM_L1 ? (type == CV_32FC1 ? (ippiNormDiffFuncHint)ippiNormDiff_L1_32f_C1R : type == CV_32FC3 ? (ippiNormDiffFuncHint)ippiNormDiff_L1_32f_C3R : @@ -3287,7 +3315,7 @@ static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArra type == CV_32FC3 ? (ippiNormDiffFuncHint)ippiNormDiff_L2_32f_C3R : type == CV_32FC4 ? (ippiNormDiffFuncHint)ippiNormDiff_L2_32f_C4R : 0) : 0; - ippiNormDiffFuncNoHint ippFuncNoHint = + ippiNormDiffFuncNoHint ippiNormDiff = normType == NORM_INF ? (type == CV_8UC1 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_8u_C1R : type == CV_8UC3 ? (ippiNormDiffFuncNoHint)ippiNormDiff_Inf_8u_C3R : @@ -3329,12 +3357,12 @@ static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArra type == CV_16SC4 ? (ippiNormDiffFuncNoHint)ippiNormDiff_L2_16s_C4R : 0) : 0; // Make sure only zero or one version of the function pointer is valid - CV_Assert(!ippFuncHint || !ippFuncNoHint); - if( ippFuncHint || ippFuncNoHint ) + CV_Assert(!ippiNormDiffHint || !ippiNormDiff); + if( ippiNormDiffHint || ippiNormDiff ) { Ipp64f norm_array[4]; - IppStatus ret = ippFuncHint ? ippFuncHint(src1.ptr(), (int)src1.step[0], src2.ptr(), (int)src2.step[0], sz, norm_array, ippAlgHintAccurate) : - ippFuncNoHint(src1.ptr(), (int)src1.step[0], src2.ptr(), (int)src2.step[0], sz, norm_array); + IppStatus ret = ippiNormDiffHint ? CV_INSTRUMENT_FUN_IPP(ippiNormDiffHint, src1.ptr(), (int)src1.step[0], src2.ptr(), (int)src2.step[0], sz, norm_array, ippAlgHintAccurate) : + CV_INSTRUMENT_FUN_IPP(ippiNormDiff, src1.ptr(), (int)src1.step[0], src2.ptr(), (int)src2.step[0], sz, norm_array); if( ret >= 0 ) { Ipp64f norm = (normType == NORM_L2 || normType == NORM_L2SQR) ? norm_array[0] * norm_array[0] : norm_array[0]; @@ -3363,6 +3391,8 @@ static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArra double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _mask ) { + CV_INSTRUMENT_REGION() + CV_Assert( _src1.sameSize(_src2) && _src1.type() == _src2.type() ); #if defined HAVE_OPENCL || defined HAVE_IPP @@ -3747,6 +3777,8 @@ void cv::batchDistance( InputArray _src1, InputArray _src2, int normType, int K, InputArray _mask, int update, bool crosscheck ) { + CV_INSTRUMENT_REGION() + Mat src1 = _src1.getMat(), src2 = _src2.getMat(), mask = _mask.getMat(); int type = src1.type(); CV_Assert( type == src2.type() && src1.cols == src2.cols && @@ -3856,6 +3888,8 @@ void cv::batchDistance( InputArray _src1, InputArray _src2, void cv::findNonZero( InputArray _src, OutputArray _idx ) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); CV_Assert( src.type() == CV_8UC1 ); int n = countNonZero(src); @@ -3882,6 +3916,8 @@ void cv::findNonZero( InputArray _src, OutputArray _idx ) double cv::PSNR(InputArray _src1, InputArray _src2) { + CV_INSTRUMENT_REGION() + CV_Assert( _src1.depth() == CV_8U ); double diff = std::sqrt(norm(_src1, _src2, NORM_L2SQR)/(_src1.total()*_src1.channels())); return 20*log10(255./(diff+DBL_EPSILON)); diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp index a3858c1d19..bd44fe3339 100644 --- a/modules/core/src/system.cpp +++ b/modules/core/src/system.cpp @@ -198,7 +198,7 @@ std::wstring GetTempFileNameWinRT(std::wstring prefix) #include -#if defined __linux__ || defined __APPLE__ || defined __EMSCRIPTEN__ +#if defined __linux__ || defined __APPLE__ || defined __EMSCRIPTEN__ || defined __FreeBSD__ #include #include #include @@ -1300,13 +1300,217 @@ void setUseCollection(bool flag) } #endif +namespace instr +{ +bool useInstrumentation() +{ +#ifdef ENABLE_INSTRUMENTATION + return getInstrumentStruct().useInstr; +#else + return false; +#endif +} + +void setUseInstrumentation(bool flag) +{ +#ifdef ENABLE_INSTRUMENTATION + getInstrumentStruct().useInstr = flag; +#else + CV_UNUSED(flag); +#endif +} + +InstrNode* getTrace() +{ +#ifdef ENABLE_INSTRUMENTATION + return &getInstrumentStruct().rootNode; +#else + return NULL; +#endif +} + +void resetTrace() +{ +#ifdef ENABLE_INSTRUMENTATION + getInstrumentStruct().rootNode.removeChilds(); + getInstrumentTLSStruct().pCurrentNode = &getInstrumentStruct().rootNode; +#endif +} + +void setFlags(FLAGS modeFlags) +{ +#ifdef ENABLE_INSTRUMENTATION + getInstrumentStruct().enableMapping = (modeFlags & FLAGS_MAPPING); +#else + CV_UNUSED(modeFlags); +#endif +} +FLAGS getFlags() +{ +#ifdef ENABLE_INSTRUMENTATION + int flags = 0; + if(getInstrumentStruct().enableMapping) + flags |= FLAGS_MAPPING; + return (FLAGS)flags; +#else + return (FLAGS)0; +#endif +} + +NodeData::NodeData(const char* funName, const char* fileName, int lineNum, cv::instr::TYPE instrType, cv::instr::IMPL implType) +{ + m_instrType = TYPE_GENERAL; + m_implType = IMPL_PLAIN; + + m_funName = funName; + m_instrType = instrType; + m_implType = implType; + m_fileName = fileName; + m_lineNum = lineNum; + + m_counter = 0; + m_ticksTotal = 0; + + m_funError = false; + m_stopPoint = false; +} +NodeData::NodeData(NodeData &ref) +{ + *this = ref; +} +NodeData& NodeData::operator=(const NodeData &right) +{ + this->m_funName = right.m_funName; + this->m_instrType = right.m_instrType; + this->m_implType = right.m_implType; + this->m_fileName = right.m_fileName; + this->m_lineNum = right.m_lineNum; + this->m_counter = right.m_counter; + this->m_ticksTotal = right.m_ticksTotal; + this->m_funError = right.m_funError; + this->m_stopPoint = right.m_stopPoint; + return *this; +} +NodeData::~NodeData() +{ +} +bool operator==(const NodeData& left, const NodeData& right) +{ + if(left.m_lineNum == right.m_lineNum && left.m_funName == right.m_funName && left.m_fileName == right.m_fileName) + return true; + return false; +} + +#ifdef ENABLE_INSTRUMENTATION +InstrStruct& getInstrumentStruct() +{ + static InstrStruct instr; + return instr; +} + +InstrTLSStruct& getInstrumentTLSStruct() +{ + return *getInstrumentStruct().tlsStruct.get(); +} + +InstrNode* getCurrentNode() +{ + return getInstrumentTLSStruct().pCurrentNode; +} + +IntrumentationRegion::IntrumentationRegion(const char* funName, const char* fileName, int lineNum, TYPE instrType, IMPL implType) +{ + m_disabled = false; + m_regionTicks = 0; + + InstrStruct *pStruct = &getInstrumentStruct(); + if(pStruct->useInstr) + { + InstrTLSStruct *pTLS = &getInstrumentTLSStruct(); + + // Disable in case of failure + if(!pTLS->pCurrentNode) + { + m_disabled = true; + return; + } + + m_disabled = pTLS->pCurrentNode->m_payload.m_stopPoint; + if(m_disabled) + return; + + NodeData payload(funName, fileName, lineNum, instrType, implType); + Node* pChild = NULL; + + if(pStruct->enableMapping) + { + // Critical section + cv::AutoLock guard(pStruct->mutexCreate); // Guard from concurrent child creation + pChild = pTLS->pCurrentNode->findChild(payload); + if(!pChild) + { + pChild = new Node(payload); + pTLS->pCurrentNode->addChild(pChild); + } + } + else + { + pChild = pTLS->pCurrentNode->findChild(payload); + if(!pChild) + { + pTLS->pCurrentNode->m_payload.m_stopPoint = true; + return; + } + } + pTLS->pCurrentNode = pChild; + + m_regionTicks = getTickCount(); + } +} + +IntrumentationRegion::~IntrumentationRegion() +{ + InstrStruct *pStruct = &getInstrumentStruct(); + if(pStruct->useInstr) + { + if(!m_disabled) + { + InstrTLSStruct *pTLS = &getInstrumentTLSStruct(); + if(pTLS->pCurrentNode->m_payload.m_stopPoint) + { + pTLS->pCurrentNode->m_payload.m_stopPoint = false; + } + else + { + if (pTLS->pCurrentNode->m_payload.m_implType == cv::instr::IMPL_OPENCL && + (pTLS->pCurrentNode->m_payload.m_instrType == cv::instr::TYPE_FUN || + pTLS->pCurrentNode->m_payload.m_instrType == cv::instr::TYPE_WRAPPER)) + { + cv::ocl::finish(); // TODO Support "async" OpenCL instrumentation + } + + uint64 ticks = (getTickCount() - m_regionTicks); + { + cv::AutoLock guard(pStruct->mutexCount); // Concurrent ticks accumulation + pTLS->pCurrentNode->m_payload.m_counter++; + pTLS->pCurrentNode->m_payload.m_ticksTotal += ticks; + } + + pTLS->pCurrentNode = pTLS->pCurrentNode->m_pParent; + } + } + } +} +#endif +} + namespace ipp { -struct IPPInitSingelton +struct IPPInitSingleton { public: - IPPInitSingelton() + IPPInitSingleton() { useIPP = true; ippStatus = 0; @@ -1360,15 +1564,15 @@ public: int ippFeatures; }; -static IPPInitSingelton& getIPPSingelton() +static IPPInitSingleton& getIPPSingleton() { - CV_SINGLETON_LAZY_INIT_REF(IPPInitSingelton, new IPPInitSingelton()) + CV_SINGLETON_LAZY_INIT_REF(IPPInitSingleton, new IPPInitSingleton()) } int getIppFeatures() { #ifdef HAVE_IPP - return getIPPSingelton().ippFeatures; + return getIPPSingleton().ippFeatures; #else return 0; #endif @@ -1376,20 +1580,20 @@ int getIppFeatures() void setIppStatus(int status, const char * const _funcname, const char * const _filename, int _line) { - getIPPSingelton().ippStatus = status; - getIPPSingelton().funcname = _funcname; - getIPPSingelton().filename = _filename; - getIPPSingelton().linen = _line; + getIPPSingleton().ippStatus = status; + getIPPSingleton().funcname = _funcname; + getIPPSingleton().filename = _filename; + getIPPSingleton().linen = _line; } int getIppStatus() { - return getIPPSingelton().ippStatus; + return getIPPSingleton().ippStatus; } String getIppErrorLocation() { - return format("%s:%d %s", getIPPSingelton().filename ? getIPPSingelton().filename : "", getIPPSingelton().linen, getIPPSingelton().funcname ? getIPPSingelton().funcname : ""); + return format("%s:%d %s", getIPPSingleton().filename ? getIPPSingleton().filename : "", getIPPSingleton().linen, getIPPSingleton().funcname ? getIPPSingleton().funcname : ""); } bool useIPP() @@ -1398,7 +1602,7 @@ bool useIPP() CoreTLSData* data = getCoreTlsData().get(); if(data->useIPP < 0) { - data->useIPP = getIPPSingelton().useIPP; + data->useIPP = getIPPSingleton().useIPP; } return (data->useIPP > 0); #else @@ -1410,7 +1614,7 @@ void setUseIPP(bool flag) { CoreTLSData* data = getCoreTlsData().get(); #ifdef HAVE_IPP - data->useIPP = flag; + data->useIPP = (getIPPSingleton().useIPP)?flag:false; #else (void)flag; data->useIPP = false; diff --git a/modules/core/src/types.cpp b/modules/core/src/types.cpp index 89e0042657..6cd47b6fdf 100644 --- a/modules/core/src/types.cpp +++ b/modules/core/src/types.cpp @@ -63,6 +63,8 @@ size_t KeyPoint::hash() const void KeyPoint::convert(const std::vector& keypoints, std::vector& points2f, const std::vector& keypointIndexes) { + CV_INSTRUMENT_REGION() + if( keypointIndexes.empty() ) { points2f.resize( keypoints.size() ); @@ -89,6 +91,8 @@ void KeyPoint::convert(const std::vector& keypoints, std::vector& points2f, std::vector& keypoints, float size, float response, int octave, int class_id ) { + CV_INSTRUMENT_REGION() + keypoints.resize(points2f.size()); for( size_t i = 0; i < points2f.size(); i++ ) keypoints[i] = KeyPoint(points2f[i], size, -1, response, octave, class_id); diff --git a/modules/core/src/umatrix.cpp b/modules/core/src/umatrix.cpp index 958723b7b5..997ee2b6ef 100644 --- a/modules/core/src/umatrix.cpp +++ b/modules/core/src/umatrix.cpp @@ -773,6 +773,8 @@ void UMat::ndoffset(size_t* ofs) const void UMat::copyTo(OutputArray _dst) const { + CV_INSTRUMENT_REGION() + int dtype = _dst.type(); if( _dst.fixedType() && dtype != type() ) { @@ -816,6 +818,8 @@ void UMat::copyTo(OutputArray _dst) const void UMat::copyTo(OutputArray _dst, InputArray _mask) const { + CV_INSTRUMENT_REGION() + if( _mask.empty() ) { copyTo(_dst); @@ -863,6 +867,8 @@ void UMat::copyTo(OutputArray _dst, InputArray _mask) const void UMat::convertTo(OutputArray _dst, int _type, double alpha, double beta) const { + CV_INSTRUMENT_REGION() + bool noScale = std::fabs(alpha - 1) < DBL_EPSILON && std::fabs(beta) < DBL_EPSILON; int stype = type(), cn = CV_MAT_CN(stype); @@ -924,6 +930,8 @@ void UMat::convertTo(OutputArray _dst, int _type, double alpha, double beta) con UMat& UMat::setTo(InputArray _value, InputArray _mask) { + CV_INSTRUMENT_REGION() + bool haveMask = !_mask.empty(); #ifdef HAVE_OPENCL int tp = type(), cn = CV_MAT_CN(tp), d = CV_MAT_DEPTH(tp); @@ -1062,6 +1070,8 @@ static bool ocl_dot( InputArray _src1, InputArray _src2, double & res ) double UMat::dot(InputArray m) const { + CV_INSTRUMENT_REGION() + CV_Assert(m.sameSize(*this) && m.type() == type()); #ifdef HAVE_OPENCL diff --git a/modules/core/test/test_ds.cpp b/modules/core/test/test_ds.cpp index def3fe20eb..b97b9d8d2d 100644 --- a/modules/core/test/test_ds.cpp +++ b/modules/core/test/test_ds.cpp @@ -56,7 +56,7 @@ static void cvTsSimpleSeqShiftAndCopy( CvTsSimpleSeq* seq, int from_idx, int to_ (seq->count - from_idx)*elem_size ); } seq->count += to_idx - from_idx; - if( elem && to_idx > from_idx ) + if( elem ) memcpy( seq->array + from_idx*elem_size, elem, (to_idx - from_idx)*elem_size ); } diff --git a/modules/core/test/test_intrin.cpp b/modules/core/test/test_intrin.cpp index ca9d3dc7b7..7ebd8e979c 100644 --- a/modules/core/test/test_intrin.cpp +++ b/modules/core/test/test_intrin.cpp @@ -1,3 +1,4 @@ +#include "test_precomp.hpp" #include "test_intrin_utils.hpp" #include @@ -132,6 +133,32 @@ template struct TheTest return *this; } + // float32x4 only + TheTest & test_interleave_2channel() + { + Data data1, data2; + data2 += 20; + + R a = data1, b = data2; + + LaneType buf2[R::nlanes * 2]; + + v_store_interleave(buf2, a, b); + + Data z(0); + a = b = z; + + v_load_deinterleave(buf2, a, b); + + for (int i = 0; i < R::nlanes; ++i) + { + EXPECT_EQ(data1, Data(a)); + EXPECT_EQ(data2, Data(b)); + } + + return *this; + } + // v_expand and v_load_expand TheTest & test_expand() { @@ -626,12 +653,18 @@ template struct TheTest dataA *= 1.1; R a = dataA; Rt b = v_cvt_f64(a); + Rt c = v_cvt_f64_high(a); Data resB = b; + Data resC = c; int n = std::min(Rt::nlanes, R::nlanes); for (int i = 0; i < n; ++i) { EXPECT_EQ((typename Rt::lane_type)dataA[i], resB[i]); } + for (int i = 0; i < n; ++i) + { + EXPECT_EQ((typename Rt::lane_type)dataA[i+n], resC[i]); + } #endif return *this; } @@ -678,6 +711,57 @@ template struct TheTest return *this; } + TheTest & test_loadstore_fp16() + { +#if CV_FP16 + AlignedData data; + AlignedData out; + + if(checkHardwareSupport(CV_CPU_FP16)) + { + // check if addresses are aligned and unaligned respectively + EXPECT_EQ((size_t)0, (size_t)&data.a.d % 16); + EXPECT_NE((size_t)0, (size_t)&data.u.d % 16); + EXPECT_EQ((size_t)0, (size_t)&out.a.d % 16); + EXPECT_NE((size_t)0, (size_t)&out.u.d % 16); + + // check some initialization methods + R r1 = data.u; + R r2 = v_load_f16(data.a.d); + R r3(r2); + EXPECT_EQ(data.u[0], r1.get0()); + EXPECT_EQ(data.a[0], r2.get0()); + EXPECT_EQ(data.a[0], r3.get0()); + + // check some store methods + out.a.clear(); + v_store_f16(out.a.d, r1); + EXPECT_EQ(data.a, out.a); + } + + return *this; +#endif + } + + TheTest & test_float_cvt_fp16() + { +#if CV_FP16 + AlignedData data; + + if(checkHardwareSupport(CV_CPU_FP16)) + { + // check conversion + v_float32x4 r1 = v_load(data.a.d); + v_float16x4 r2 = v_cvt_f16(r1); + v_float32x4 r3 = v_cvt_f32(r2); + EXPECT_EQ(0x3c00, r2.get0()); + EXPECT_EQ(r3.get0(), r1.get0()); + } + + return *this; +#endif + } + }; @@ -846,6 +930,7 @@ TEST(hal_intrin, float32x4) { TheTest() .test_loadstore() .test_interleave() + .test_interleave_2channel() .test_addsub() .test_mul() .test_div() @@ -882,6 +967,15 @@ TEST(hal_intrin, float64x2) { } #endif +#if CV_FP16 +TEST(hal_intrin, float16x4) { + TheTest() + .test_loadstore_fp16() + .test_float_cvt_fp16() + ; +} +#endif + }; }; diff --git a/modules/core/test/test_io.cpp b/modules/core/test/test_io.cpp index ffc1c319b1..a43356f0da 100644 --- a/modules/core/test/test_io.cpp +++ b/modules/core/test/test_io.cpp @@ -91,9 +91,10 @@ protected: {-1000000, 1000000}, {-10, 10}, {-10, 10}}; RNG& rng = ts->get_rng(); RNG rng0; - test_case_count = 4; int progress = 0; MemStorage storage(cvCreateMemStorage(0)); + const char * suffixs[3] = {".yml", ".xml", ".json" }; + test_case_count = 6; for( int idx = 0; idx < test_case_count; idx++ ) { @@ -102,8 +103,8 @@ protected: cvClearMemStorage(storage); - bool mem = (idx % 4) >= 2; - string filename = tempfile(idx % 2 ? ".yml" : ".xml"); + bool mem = (idx % test_case_count) >= (test_case_count >> 1); + string filename = tempfile(suffixs[idx % (test_case_count >> 1)]); FileStorage fs(filename, FileStorage::WRITE + (mem ? FileStorage::MEMORY : 0)); @@ -430,82 +431,91 @@ public: protected: void run(int) { - try - { - string fname = cv::tempfile(".xml"); - vector mi, mi2, mi3, mi4; - vector mv, mv2, mv3, mv4; - vector vudt, vudt2, vudt3, vudt4; - Mat m(10, 9, CV_32F); - Mat empty; - UserDefinedType udt = { 8, 3.3f }; - randu(m, 0, 1); - mi3.push_back(5); - mv3.push_back(m); - vudt3.push_back(udt); - Point_ p1(1.1f, 2.2f), op1; - Point3i p2(3, 4, 5), op2; - Size s1(6, 7), os1; - Complex c1(9, 10), oc1; - Rect r1(11, 12, 13, 14), or1; - Vec v1(15, 16, 17, 18, 19), ov1; - Scalar sc1(20.0, 21.1, 22.2, 23.3), osc1; - Range g1(7, 8), og1; + const char * suffix[3] = { + ".yml", + ".xml", + ".json" + }; - FileStorage fs(fname, FileStorage::WRITE); - fs << "mi" << mi; - fs << "mv" << mv; - fs << "mi3" << mi3; - fs << "mv3" << mv3; - fs << "vudt" << vudt; - fs << "vudt3" << vudt3; - fs << "empty" << empty; - fs << "p1" << p1; - fs << "p2" << p2; - fs << "s1" << s1; - fs << "c1" << c1; - fs << "r1" << r1; - fs << "v1" << v1; - fs << "sc1" << sc1; - fs << "g1" << g1; - fs.release(); - - fs.open(fname, FileStorage::READ); - fs["mi"] >> mi2; - fs["mv"] >> mv2; - fs["mi3"] >> mi4; - fs["mv3"] >> mv4; - fs["vudt"] >> vudt2; - fs["vudt3"] >> vudt4; - fs["empty"] >> empty; - fs["p1"] >> op1; - fs["p2"] >> op2; - fs["s1"] >> os1; - fs["c1"] >> oc1; - fs["r1"] >> or1; - fs["v1"] >> ov1; - fs["sc1"] >> osc1; - fs["g1"] >> og1; - CV_Assert( mi2.empty() ); - CV_Assert( mv2.empty() ); - CV_Assert( cvtest::norm(Mat(mi3), Mat(mi4), CV_C) == 0 ); - CV_Assert( mv4.size() == 1 ); - double n = cvtest::norm(mv3[0], mv4[0], CV_C); - CV_Assert( vudt2.empty() ); - CV_Assert( vudt3 == vudt4 ); - CV_Assert( n == 0 ); - CV_Assert( op1 == p1 ); - CV_Assert( op2 == p2 ); - CV_Assert( os1 == s1 ); - CV_Assert( oc1 == c1 ); - CV_Assert( or1 == r1 ); - CV_Assert( ov1 == v1 ); - CV_Assert( osc1 == sc1 ); - CV_Assert( og1 == g1 ); - } - catch(...) + for ( size_t i = 0u; i < 3u; i++ ) { - ts->set_failed_test_info(cvtest::TS::FAIL_MISMATCH); + try + { + string fname = cv::tempfile(suffix[i]); + vector mi, mi2, mi3, mi4; + vector mv, mv2, mv3, mv4; + vector vudt, vudt2, vudt3, vudt4; + Mat m(10, 9, CV_32F); + Mat empty; + UserDefinedType udt = { 8, 3.3f }; + randu(m, 0, 1); + mi3.push_back(5); + mv3.push_back(m); + vudt3.push_back(udt); + Point_ p1(1.1f, 2.2f), op1; + Point3i p2(3, 4, 5), op2; + Size s1(6, 7), os1; + Complex c1(9, 10), oc1; + Rect r1(11, 12, 13, 14), or1; + Vec v1(15, 16, 17, 18, 19), ov1; + Scalar sc1(20.0, 21.1, 22.2, 23.3), osc1; + Range g1(7, 8), og1; + + FileStorage fs(fname, FileStorage::WRITE); + fs << "mi" << mi; + fs << "mv" << mv; + fs << "mi3" << mi3; + fs << "mv3" << mv3; + fs << "vudt" << vudt; + fs << "vudt3" << vudt3; + fs << "empty" << empty; + fs << "p1" << p1; + fs << "p2" << p2; + fs << "s1" << s1; + fs << "c1" << c1; + fs << "r1" << r1; + fs << "v1" << v1; + fs << "sc1" << sc1; + fs << "g1" << g1; + fs.release(); + + fs.open(fname, FileStorage::READ); + fs["mi"] >> mi2; + fs["mv"] >> mv2; + fs["mi3"] >> mi4; + fs["mv3"] >> mv4; + fs["vudt"] >> vudt2; + fs["vudt3"] >> vudt4; + fs["empty"] >> empty; + fs["p1"] >> op1; + fs["p2"] >> op2; + fs["s1"] >> os1; + fs["c1"] >> oc1; + fs["r1"] >> or1; + fs["v1"] >> ov1; + fs["sc1"] >> osc1; + fs["g1"] >> og1; + CV_Assert( mi2.empty() ); + CV_Assert( mv2.empty() ); + CV_Assert( cvtest::norm(Mat(mi3), Mat(mi4), CV_C) == 0 ); + CV_Assert( mv4.size() == 1 ); + double n = cvtest::norm(mv3[0], mv4[0], CV_C); + CV_Assert( vudt2.empty() ); + CV_Assert( vudt3 == vudt4 ); + CV_Assert( n == 0 ); + CV_Assert( op1 == p1 ); + CV_Assert( op2 == p2 ); + CV_Assert( os1 == s1 ); + CV_Assert( oc1 == c1 ); + CV_Assert( or1 == r1 ); + CV_Assert( ov1 == v1 ); + CV_Assert( osc1 == sc1 ); + CV_Assert( og1 == g1 ); + } + catch(...) + { + ts->set_failed_test_info(cvtest::TS::FAIL_MISMATCH); + } } } }; @@ -594,150 +604,279 @@ TEST(Core_InputOutput, FileStorageSpaces) } } -TEST(Core_InputOutput, filestorage_yml_compatibility) +struct data_t { - // TODO: -} + typedef uchar u; + typedef char b; + typedef ushort w; + typedef short s; + typedef int i; + typedef float f; + typedef double d; -class CV_Base64IOTest : public cvtest::BaseTest -{ -private: - std::string file_name; + u u1 ;u u2 ; i i1 ; + i i2 ;i i3 ; + d d1 ; + d d2 ; + i i4 ; - struct data_t - { - uchar u1, u2; - int i1, i2, i3; - double d1, d2; - int i4; - }; - -public: - CV_Base64IOTest(std::string const & test_file_name) - : file_name(test_file_name) {} - ~CV_Base64IOTest() {} -protected: - void run(int) - { - try - { - std::vector rawdata; - - cv::Mat _em_out, _em_in; - cv::Mat _2d_out, _2d_in; - cv::Mat _nd_out, _nd_in; - - { /* init */ - - /* normal mat */ - _2d_out = cv::Mat(100, 100, CV_8UC3, cvScalar(1U, 2U, 127U)); - for (int i = 0; i < _2d_out.rows; ++i) - for (int j = 0; j < _2d_out.cols; ++j) - _2d_out.at(i, j)[1] = (i + j) % 256; - - /* 4d mat */ - const int Size[] = {4, 4, 4, 4}; - cv::Mat _4d(4, Size, CV_64FC4, cvScalar(0.888, 0.111, 0.666, 0.444)); - const cv::Range ranges[] = { - cv::Range(0, 2), - cv::Range(0, 2), - cv::Range(1, 2), - cv::Range(0, 2) }; - _nd_out = _4d(ranges); - - /* raw data */ - for (int i = 0; i < 1000; i++) { - data_t tmp; - tmp.u1 = 1; - tmp.u2 = 2; - tmp.i1 = 1; - tmp.i2 = 2; - tmp.i3 = 3; - tmp.d1 = 0.1; - tmp.d2 = 0.2; - tmp.i4 = i; - rawdata.push_back(tmp); - } - } - - { /* write */ - cv::FileStorage fs(file_name, cv::FileStorage::WRITE); - CvMat holder = _2d_out; - cv::cvWriteMat_Base64(*fs, "normal_2d_mat", &holder); - CvMatND holder_nd = _nd_out; - cv::cvWriteMatND_Base64(*fs, "normal_nd_mat", &holder_nd); - holder = _em_out; - cv::cvWriteMat_Base64(*fs, "empty_2d_mat", &holder); - - cv::cvStartWriteRawData_Base64(*fs, "rawdata", static_cast(rawdata.size()), "2u3i2di"); - for (int i = 0; i < 10; i++) - cv::cvWriteRawData_Base64(*fs, rawdata.data() + i * 100, 100); - cv::cvEndWriteRawData_Base64(*fs); - - fs.release(); - } - - { /* read */ - cv::FileStorage fs(file_name, cv::FileStorage::READ); - - /* mat */ - fs["empty_2d_mat"] >> _em_in; - fs["normal_2d_mat"] >> _2d_in; - fs["normal_nd_mat"] >> _nd_in; - - /* raw data */ - std::vector(1000).swap(rawdata); - cvReadRawData(*fs, fs["rawdata"].node, rawdata.data(), "2u3i2di"); - - fs.release(); - } - - for (int i = 0; i < 1000; i++) { - // TODO: Solve this bug in `cvReadRawData` - //EXPECT_EQ(rawdata[i].u1, 1); - //EXPECT_EQ(rawdata[i].u2, 2); - //EXPECT_EQ(rawdata[i].i1, 1); - //EXPECT_EQ(rawdata[i].i2, 2); - //EXPECT_EQ(rawdata[i].i3, 3); - //EXPECT_EQ(rawdata[i].d1, 0.1); - //EXPECT_EQ(rawdata[i].d2, 0.2); - //EXPECT_EQ(rawdata[i].i4, i); - } - - EXPECT_EQ(_em_in.rows , _em_out.rows); - EXPECT_EQ(_em_in.cols , _em_out.cols); - EXPECT_EQ(_em_in.depth(), _em_out.depth()); - EXPECT_TRUE(_em_in.empty()); - - EXPECT_EQ(_2d_in.rows , _2d_in.rows); - EXPECT_EQ(_2d_in.cols , _2d_in.cols); - EXPECT_EQ(_2d_in.dims , _2d_in.dims); - EXPECT_EQ(_2d_in.depth(), _2d_in.depth()); - for(int i = 0; i < _2d_in.rows; ++i) - for (int j = 0; j < _2d_in.cols; ++j) - EXPECT_EQ(_2d_in.at(i, j), _2d_out.at(i, j)); - - EXPECT_EQ(_nd_in.rows , _nd_in.rows); - EXPECT_EQ(_nd_in.cols , _nd_in.cols); - EXPECT_EQ(_nd_in.dims , _nd_in.dims); - EXPECT_EQ(_nd_in.depth(), _nd_in.depth()); - EXPECT_EQ(cv::countNonZero(cv::mean(_nd_in != _nd_out)), 0); - } - catch(...) - { - ts->set_failed_test_info(cvtest::TS::FAIL_MISMATCH); - } - } + static inline const char * signature() { return "2u3i2di"; } }; -TEST(Core_InputOutput, filestorage_yml_base64) +TEST(Core_InputOutput, filestorage_base64_basic) { - CV_Base64IOTest test("base64_test_tmp_file.yml"); test.safe_run(); + char const * filenames[] = { + "core_io_base64_basic_test.yml", + "core_io_base64_basic_test.xml", + "core_io_base64_basic_test.json", + 0 + }; + + for (char const ** ptr = filenames; *ptr; ptr++) + { + char const * name = *ptr; + + std::vector rawdata; + + cv::Mat _em_out, _em_in; + cv::Mat _2d_out, _2d_in; + cv::Mat _nd_out, _nd_in; + cv::Mat _rd_out(64, 64, CV_64FC1), _rd_in; + + bool no_type_id = true; + + { /* init */ + + /* a normal mat */ + _2d_out = cv::Mat(100, 100, CV_8UC3, cvScalar(1U, 2U, 127U)); + for (int i = 0; i < _2d_out.rows; ++i) + for (int j = 0; j < _2d_out.cols; ++j) + _2d_out.at(i, j)[1] = (i + j) % 256; + + /* a 4d mat */ + const int Size[] = {4, 4, 4, 4}; + cv::Mat _4d(4, Size, CV_64FC4, cvScalar(0.888, 0.111, 0.666, 0.444)); + const cv::Range ranges[] = { + cv::Range(0, 2), + cv::Range(0, 2), + cv::Range(1, 2), + cv::Range(0, 2) }; + _nd_out = _4d(ranges); + + /* a random mat */ + cv::randu(_rd_out, cv::Scalar(0.0), cv::Scalar(1.0)); + + /* raw data */ + for (int i = 0; i < 1000; i++) { + data_t tmp; + tmp.u1 = 1; + tmp.u2 = 2; + tmp.i1 = 1; + tmp.i2 = 2; + tmp.i3 = 3; + tmp.d1 = 0.1; + tmp.d2 = 0.2; + tmp.i4 = i; + rawdata.push_back(tmp); + } + } + + { /* write */ + cv::FileStorage fs(name, cv::FileStorage::WRITE_BASE64); + fs << "normal_2d_mat" << _2d_out; + fs << "normal_nd_mat" << _nd_out; + fs << "empty_2d_mat" << _em_out; + fs << "random_mat" << _rd_out; + + cvStartWriteStruct( *fs, "rawdata", CV_NODE_SEQ | CV_NODE_FLOW, "binary" ); + for (int i = 0; i < 10; i++) + cvWriteRawDataBase64(*fs, rawdata.data() + i * 100, 100, data_t::signature()); + cvEndWriteStruct( *fs ); + + fs.release(); + } + + { /* read */ + cv::FileStorage fs(name, cv::FileStorage::READ); + + /* mat */ + fs["empty_2d_mat"] >> _em_in; + fs["normal_2d_mat"] >> _2d_in; + fs["normal_nd_mat"] >> _nd_in; + fs["random_mat"] >> _rd_in; + + if ( !fs["empty_2d_mat"]["type_id"].empty() || + !fs["normal_2d_mat"]["type_id"].empty() || + !fs["normal_nd_mat"]["type_id"].empty() || + !fs[ "random_mat"]["type_id"].empty() ) + no_type_id = false; + + /* raw data */ + std::vector(1000).swap(rawdata); + cvReadRawData(*fs, fs["rawdata"].node, rawdata.data(), data_t::signature()); + + fs.release(); + } + + for (int i = 0; i < 1000; i++) { + // TODO: Solve this bug in `cvReadRawData` + //EXPECT_EQ(rawdata[i].u1, 1); + //EXPECT_EQ(rawdata[i].u2, 2); + //EXPECT_EQ(rawdata[i].i1, 1); + //EXPECT_EQ(rawdata[i].i2, 2); + //EXPECT_EQ(rawdata[i].i3, 3); + //EXPECT_EQ(rawdata[i].d1, 0.1); + //EXPECT_EQ(rawdata[i].d2, 0.2); + //EXPECT_EQ(rawdata[i].i4, i); + } + + EXPECT_TRUE(no_type_id); + + EXPECT_EQ(_em_in.rows , _em_out.rows); + EXPECT_EQ(_em_in.cols , _em_out.cols); + EXPECT_EQ(_em_in.depth(), _em_out.depth()); + EXPECT_TRUE(_em_in.empty()); + + EXPECT_EQ(_2d_in.rows , _2d_out.rows); + EXPECT_EQ(_2d_in.cols , _2d_out.cols); + EXPECT_EQ(_2d_in.dims , _2d_out.dims); + EXPECT_EQ(_2d_in.depth(), _2d_out.depth()); + for(int i = 0; i < _2d_out.rows; ++i) + for (int j = 0; j < _2d_out.cols; ++j) + EXPECT_EQ(_2d_in.at(i, j), _2d_out.at(i, j)); + + EXPECT_EQ(_nd_in.rows , _nd_out.rows); + EXPECT_EQ(_nd_in.cols , _nd_out.cols); + EXPECT_EQ(_nd_in.dims , _nd_out.dims); + EXPECT_EQ(_nd_in.depth(), _nd_out.depth()); + EXPECT_EQ(cv::countNonZero(cv::mean(_nd_in != _nd_out)), 0); + + EXPECT_EQ(_rd_in.rows , _rd_out.rows); + EXPECT_EQ(_rd_in.cols , _rd_out.cols); + EXPECT_EQ(_rd_in.dims , _rd_out.dims); + EXPECT_EQ(_rd_in.depth(), _rd_out.depth()); + EXPECT_EQ(cv::countNonZero(cv::mean(_rd_in != _rd_out)), 0); + + remove(name); + } } -TEST(Core_InputOutput, filestorage_xml_base64) +TEST(Core_InputOutput, filestorage_base64_valid_call) { - CV_Base64IOTest test("base64_test_tmp_file.xml"); test.safe_run(); + char const * filenames[] = { + "core_io_base64_other_test.yml", + "core_io_base64_other_test.xml", + "core_io_base64_other_test.json", + "core_io_base64_other_test.yml?base64", + "core_io_base64_other_test.xml?base64", + "core_io_base64_other_test.json?base64", + 0 + }; + char const * real_name[] = { + "core_io_base64_other_test.yml", + "core_io_base64_other_test.xml", + "core_io_base64_other_test.json", + "core_io_base64_other_test.yml", + "core_io_base64_other_test.xml", + "core_io_base64_other_test.json", + 0 + }; + + std::vector rawdata(10, static_cast(0x00010203)); + cv::String str_out = "test_string"; + + for (char const ** ptr = filenames; *ptr; ptr++) + { + char const * name = *ptr; + + EXPECT_NO_THROW( + { + cv::FileStorage fs(name, cv::FileStorage::WRITE_BASE64); + + cvStartWriteStruct(*fs, "manydata", CV_NODE_SEQ); + cvStartWriteStruct(*fs, 0, CV_NODE_SEQ | CV_NODE_FLOW); + for (int i = 0; i < 10; i++) + cvWriteRawData(*fs, rawdata.data(), static_cast(rawdata.size()), "i"); + cvEndWriteStruct(*fs); + cvWriteString(*fs, 0, str_out.c_str(), 1); + cvEndWriteStruct(*fs); + + fs.release(); + }); + + { + cv::FileStorage fs(name, cv::FileStorage::READ); + std::vector data_in(rawdata.size()); + fs["manydata"][0].readRaw("i", (uchar *)data_in.data(), data_in.size()); + EXPECT_TRUE(fs["manydata"][0].isSeq()); + EXPECT_TRUE(std::equal(rawdata.begin(), rawdata.end(), data_in.begin())); + cv::String str_in; + fs["manydata"][1] >> str_in; + EXPECT_TRUE(fs["manydata"][1].isString()); + EXPECT_EQ(str_in, str_out); + fs.release(); + } + + EXPECT_NO_THROW( + { + cv::FileStorage fs(name, cv::FileStorage::WRITE); + + cvStartWriteStruct(*fs, "manydata", CV_NODE_SEQ); + cvWriteString(*fs, 0, str_out.c_str(), 1); + cvStartWriteStruct(*fs, 0, CV_NODE_SEQ | CV_NODE_FLOW, "binary"); + for (int i = 0; i < 10; i++) + cvWriteRawData(*fs, rawdata.data(), static_cast(rawdata.size()), "i"); + cvEndWriteStruct(*fs); + cvEndWriteStruct(*fs); + + fs.release(); + }); + + { + cv::FileStorage fs(name, cv::FileStorage::READ); + cv::String str_in; + fs["manydata"][0] >> str_in; + EXPECT_TRUE(fs["manydata"][0].isString()); + EXPECT_EQ(str_in, str_out); + std::vector data_in(rawdata.size()); + fs["manydata"][1].readRaw("i", (uchar *)data_in.data(), data_in.size()); + EXPECT_TRUE(fs["manydata"][1].isSeq()); + EXPECT_TRUE(std::equal(rawdata.begin(), rawdata.end(), data_in.begin())); + fs.release(); + } + + remove(real_name[ptr - filenames]); + } +} + +TEST(Core_InputOutput, filestorage_base64_invalid_call) +{ + char const * filenames[] = { + "core_io_base64_other_test.yml", + "core_io_base64_other_test.xml", + "core_io_base64_other_test.json", + 0 + }; + + for (char const ** ptr = filenames; *ptr; ptr++) + { + char const * name = *ptr; + + EXPECT_ANY_THROW({ + cv::FileStorage fs(name, cv::FileStorage::WRITE); + cvStartWriteStruct(*fs, "rawdata", CV_NODE_SEQ, "binary"); + cvStartWriteStruct(*fs, 0, CV_NODE_SEQ | CV_NODE_FLOW); + }); + + EXPECT_ANY_THROW({ + cv::FileStorage fs(name, cv::FileStorage::WRITE); + cvStartWriteStruct(*fs, "rawdata", CV_NODE_SEQ); + cvStartWriteStruct(*fs, 0, CV_NODE_SEQ | CV_NODE_FLOW); + cvWriteRawDataBase64(*fs, name, 1, "u"); + }); + + remove(name); + } } TEST(Core_InputOutput, filestorage_yml_vec2i) @@ -764,3 +903,28 @@ TEST(Core_InputOutput, filestorage_yml_vec2i) remove(file_name.c_str()); } + +TEST(Core_InputOutput, filestorage_json_comment) +{ + String mem_str = + "{ /* comment */\n" + " \"key\": \"value\"\n" + " /************\n" + " * multiline comment\n" + " ************/\n" + " // 233\n" + " // \n" + "}\n" + ; + + String str; + + EXPECT_NO_THROW( + { + cv::FileStorage fs(mem_str, cv::FileStorage::READ | cv::FileStorage::MEMORY); + fs["key"] >> str; + fs.release(); + }); + + EXPECT_EQ(str, String("value")); +} diff --git a/modules/core/test/test_math.cpp b/modules/core/test/test_math.cpp index 5eb9fe267f..3870d31cd5 100644 --- a/modules/core/test/test_math.cpp +++ b/modules/core/test/test_math.cpp @@ -2977,4 +2977,68 @@ TEST(Core_Pow, special) } } +TEST(Core_Cholesky, accuracy64f) +{ + const int n = 5; + Mat A(n, n, CV_64F), refA; + Mat mean(1, 1, CV_64F); + *mean.ptr() = 10.0; + Mat dev(1, 1, CV_64F); + *dev.ptr() = 10.0; + RNG rng(10); + rng.fill(A, RNG::NORMAL, mean, dev); + A = A*A.t(); + A.copyTo(refA); + Cholesky(A.ptr(), A.step, n, NULL, 0, 0); + + for (int i = 0; i < A.rows; i++) + for (int j = i + 1; j < A.cols; j++) + A.at(i, j) = 0.0; + EXPECT_LE(norm(refA, A*A.t(), CV_RELATIVE_L2), FLT_EPSILON); +} + +TEST(Core_QR_Solver, accuracy64f) +{ + int m = 20, n = 18; + Mat A(m, m, CV_64F); + Mat B(m, n, CV_64F); + Mat mean(1, 1, CV_64F); + *mean.ptr() = 10.0; + Mat dev(1, 1, CV_64F); + *dev.ptr() = 10.0; + RNG rng(10); + rng.fill(A, RNG::NORMAL, mean, dev); + rng.fill(B, RNG::NORMAL, mean, dev); + A = A*A.t(); + Mat solutionQR; + + //solve system with square matrix + solve(A, B, solutionQR, DECOMP_QR); + EXPECT_LE(norm(A*solutionQR, B, CV_RELATIVE_L2), FLT_EPSILON); + + A = Mat(m, n, CV_64F); + B = Mat(m, n, CV_64F); + rng.fill(A, RNG::NORMAL, mean, dev); + rng.fill(B, RNG::NORMAL, mean, dev); + + //solve normal system + solve(A, B, solutionQR, DECOMP_QR | DECOMP_NORMAL); + EXPECT_LE(norm(A.t()*(A*solutionQR), A.t()*B, CV_RELATIVE_L2), FLT_EPSILON); + + //solve overdeterminated system as a least squares problem + Mat solutionSVD; + solve(A, B, solutionQR, DECOMP_QR); + solve(A, B, solutionSVD, DECOMP_SVD); + EXPECT_LE(norm(solutionQR, solutionSVD, CV_RELATIVE_L2), FLT_EPSILON); + + //solve system with singular matrix + A = Mat(10, 10, CV_64F); + B = Mat(10, 1, CV_64F); + rng.fill(A, RNG::NORMAL, mean, dev); + rng.fill(B, RNG::NORMAL, mean, dev); + for (int i = 0; i < A.cols; i++) + A.at(0, i) = A.at(1, i); + ASSERT_FALSE(solve(A, B, solutionQR, DECOMP_QR)); +} + /* End of file. */ diff --git a/modules/core/test/test_umat.cpp b/modules/core/test/test_umat.cpp index 26b1bbd2b8..9e9835f350 100644 --- a/modules/core/test/test_umat.cpp +++ b/modules/core/test/test_umat.cpp @@ -1304,20 +1304,18 @@ TEST(UMat, testTempObjects_UMat) ASSERT_EQ(0, countNonZero(uDiff)); } -// Disabled due to failure in VS 2015: -// C++11 is enabled by default ==> -// destructors have implicit 'noexcept(true)' specifier ==> -// throwing exception from destructor is not handled correctly -#if defined(_MSC_VER) && _MSC_VER >= 1900 /* MSVC 14 */ -TEST(UMat, DISABLED_testTempObjects_Mat) -#else TEST(UMat, testTempObjects_Mat) -#endif { Mat m(10, 10, CV_8UC1, Scalar(1)); { Mat m2; - ASSERT_ANY_THROW(m2 = m.getUMat(ACCESS_RW).getMat(ACCESS_RW)); + ASSERT_ANY_THROW({ + // Below is unwrapped version of this invalid expression: + // m2 = m.getUMat(ACCESS_RW).getMat(ACCESS_RW) + UMat u = m.getUMat(ACCESS_RW); + m2 = u.getMat(ACCESS_RW); + u.release(); + }); } } diff --git a/modules/cudev/test/test_cvt.cu b/modules/cudev/test/test_cvt.cu index 4e11b6319c..c659525971 100644 --- a/modules/cudev/test/test_cvt.cu +++ b/modules/cudev/test/test_cvt.cu @@ -101,11 +101,11 @@ public: GpuMat g_dst; // Fp32 -> Fp16 - convertFp16Cuda(g_src, g_dst); - convertFp16Cuda(g_dst.clone(), g_dst); + cuda::convertFp16(g_src, g_dst); + cv::convertFp16(src, dst); // Fp16 -> Fp32 - convertFp16(src, dst); - convertFp16(dst, ref); + cuda::convertFp16(g_dst.clone(), g_dst); + cv::convertFp16(dst, ref); g_dst.download(dst); EXPECT_MAT_NEAR(dst, ref, 0.0); @@ -127,8 +127,8 @@ public: GpuMat g_dst; // Fp32 -> Fp16 - convertFp16Cuda(g_src, g_dst); - convertFp16(src, ref); + cuda::convertFp16(g_src, g_dst); + cv::convertFp16(src, ref); g_dst.download(dst); EXPECT_MAT_NEAR(dst, ref, 0.0); diff --git a/modules/features2d/include/opencv2/features2d.hpp b/modules/features2d/include/opencv2/features2d.hpp index 32fdabd8a4..264090b07c 100644 --- a/modules/features2d/include/opencv2/features2d.hpp +++ b/modules/features2d/include/opencv2/features2d.hpp @@ -355,7 +355,7 @@ public: /** @brief Detect %MSER regions - @param image input image (8UC1, 8UC3 or 8UC4) + @param image input image (8UC1, 8UC3 or 8UC4, must be greater or equal than 3x3) @param msers resulting list of point sets @param bboxes resulting bounding boxes */ @@ -1022,7 +1022,7 @@ protected: /** @brief Flann-based descriptor matcher. -This matcher trains flann::Index_ on a train descriptor collection and calls its nearest search +This matcher trains cv::flann::Index on a train descriptor collection and calls its nearest search methods to find the best matches. So, this matcher may be faster when matching a large train collection than the brute force matcher. FlannBasedMatcher does not support masking permissible matches of descriptor sets because flann::Index does not support this. : diff --git a/modules/features2d/misc/python/pyopencv_features2d.hpp b/modules/features2d/misc/python/pyopencv_features2d.hpp new file mode 100644 index 0000000000..b865e361b6 --- /dev/null +++ b/modules/features2d/misc/python/pyopencv_features2d.hpp @@ -0,0 +1,3 @@ +#ifdef HAVE_OPENCV_FEATURES2D +typedef SimpleBlobDetector::Params SimpleBlobDetector_Params; +#endif \ No newline at end of file diff --git a/modules/features2d/src/agast.cpp b/modules/features2d/src/agast.cpp index a419e371e0..618998efc2 100644 --- a/modules/features2d/src/agast.cpp +++ b/modules/features2d/src/agast.cpp @@ -7940,6 +7940,8 @@ static void OAST_9_16(InputArray _img, std::vector& keypoints, int thr void AGAST(InputArray _img, std::vector& keypoints, int threshold, bool nonmax_suppression) { + CV_INSTRUMENT_REGION() + AGAST(_img, keypoints, threshold, nonmax_suppression, AgastFeatureDetector::OAST_9_16); } @@ -7952,6 +7954,8 @@ public: void detect( InputArray _image, std::vector& keypoints, InputArray _mask ) { + CV_INSTRUMENT_REGION() + Mat mask = _mask.getMat(), grayImage; UMat ugrayImage; _InputArray gray = _image; @@ -8007,6 +8011,7 @@ Ptr AgastFeatureDetector::create( int threshold, bool nonm void AGAST(InputArray _img, std::vector& keypoints, int threshold, bool nonmax_suppression, int type) { + CV_INSTRUMENT_REGION() std::vector kpts; diff --git a/modules/features2d/src/akaze.cpp b/modules/features2d/src/akaze.cpp index f4fe27c1e5..d598155275 100644 --- a/modules/features2d/src/akaze.cpp +++ b/modules/features2d/src/akaze.cpp @@ -167,6 +167,8 @@ namespace cv OutputArray descriptors, bool useProvidedKeypoints) { + CV_INSTRUMENT_REGION() + Mat img = image.getMat(); if (img.channels() > 1) cvtColor(image, img, COLOR_BGR2GRAY); diff --git a/modules/features2d/src/bagofwords.cpp b/modules/features2d/src/bagofwords.cpp index 991a620c8a..31fb19d837 100644 --- a/modules/features2d/src/bagofwords.cpp +++ b/modules/features2d/src/bagofwords.cpp @@ -89,6 +89,8 @@ BOWKMeansTrainer::BOWKMeansTrainer( int _clusterCount, const TermCriteria& _term Mat BOWKMeansTrainer::cluster() const { + CV_INSTRUMENT_REGION() + CV_Assert( !descriptors.empty() ); Mat mergedDescriptors( descriptorsCount(), descriptors[0].cols, descriptors[0].type() ); @@ -106,6 +108,8 @@ BOWKMeansTrainer::~BOWKMeansTrainer() Mat BOWKMeansTrainer::cluster( const Mat& _descriptors ) const { + CV_INSTRUMENT_REGION() + Mat labels, vocabulary; kmeans( _descriptors, clusterCount, labels, termcrit, attempts, flags, vocabulary ); return vocabulary; @@ -139,6 +143,8 @@ const Mat& BOWImgDescriptorExtractor::getVocabulary() const void BOWImgDescriptorExtractor::compute( InputArray image, std::vector& keypoints, OutputArray imgDescriptor, std::vector >* pointIdxsOfClusters, Mat* descriptors ) { + CV_INSTRUMENT_REGION() + imgDescriptor.release(); if( keypoints.empty() ) @@ -168,6 +174,8 @@ int BOWImgDescriptorExtractor::descriptorType() const void BOWImgDescriptorExtractor::compute( InputArray keypointDescriptors, OutputArray _imgDescriptor, std::vector >* pointIdxsOfClusters ) { + CV_INSTRUMENT_REGION() + CV_Assert( !vocabulary.empty() ); int clusterCount = descriptorSize(); // = vocabulary.rows diff --git a/modules/features2d/src/blobdetector.cpp b/modules/features2d/src/blobdetector.cpp index 23b6f2bd72..ac55341be9 100644 --- a/modules/features2d/src/blobdetector.cpp +++ b/modules/features2d/src/blobdetector.cpp @@ -190,6 +190,8 @@ void SimpleBlobDetectorImpl::write( cv::FileStorage& fs ) const void SimpleBlobDetectorImpl::findBlobs(InputArray _image, InputArray _binaryImage, std::vector
¢ers) const { + CV_INSTRUMENT_REGION() + Mat image = _image.getMat(), binaryImage = _binaryImage.getMat(); (void)image; centers.clear(); @@ -304,6 +306,8 @@ void SimpleBlobDetectorImpl::findBlobs(InputArray _image, InputArray _binaryImag void SimpleBlobDetectorImpl::detect(InputArray image, std::vector& keypoints, InputArray) { + CV_INSTRUMENT_REGION() + //TODO: support mask keypoints.clear(); Mat grayscaleImage; diff --git a/modules/features2d/src/draw.cpp b/modules/features2d/src/draw.cpp index 63410e713c..357662fc81 100644 --- a/modules/features2d/src/draw.cpp +++ b/modules/features2d/src/draw.cpp @@ -91,6 +91,8 @@ static inline void _drawKeypoint( InputOutputArray img, const KeyPoint& p, const void drawKeypoints( InputArray image, const std::vector& keypoints, InputOutputArray outImage, const Scalar& _color, int flags ) { + CV_INSTRUMENT_REGION() + if( !(flags & DrawMatchesFlags::DRAW_OVER_OUTIMG) ) { if( image.type() == CV_8UC3 ) diff --git a/modules/features2d/src/evaluation.cpp b/modules/features2d/src/evaluation.cpp index 3863203df7..5ea882153f 100644 --- a/modules/features2d/src/evaluation.cpp +++ b/modules/features2d/src/evaluation.cpp @@ -179,6 +179,8 @@ void EllipticKeyPoint::calcProjection( const Mat_& H, EllipticKeyPoint& void EllipticKeyPoint::convert( const std::vector& src, std::vector& dst ) { + CV_INSTRUMENT_REGION() + if( !src.empty() ) { dst.resize(src.size()); @@ -194,6 +196,8 @@ void EllipticKeyPoint::convert( const std::vector& src, std::vector& src, std::vector& dst ) { + CV_INSTRUMENT_REGION() + if( !src.empty() ) { dst.resize(src.size()); @@ -456,6 +460,8 @@ void cv::evaluateFeatureDetector( const Mat& img1, const Mat& img2, const Mat& H float& repeatability, int& correspCount, const Ptr& _fdetector ) { + CV_INSTRUMENT_REGION() + Ptr fdetector(_fdetector); std::vector *keypoints1, *keypoints2, buf1, buf2; keypoints1 = _keypoints1 != 0 ? _keypoints1 : &buf1; @@ -492,6 +498,8 @@ void cv::computeRecallPrecisionCurve( const std::vector >& m const std::vector >& correctMatches1to2Mask, std::vector& recallPrecisionCurve ) { + CV_INSTRUMENT_REGION() + CV_Assert( matches1to2.size() == correctMatches1to2Mask.size() ); std::vector allMatches; @@ -526,6 +534,8 @@ void cv::computeRecallPrecisionCurve( const std::vector >& m float cv::getRecall( const std::vector& recallPrecisionCurve, float l_precision ) { + CV_INSTRUMENT_REGION() + int nearestPointIndex = getNearestPoint( recallPrecisionCurve, l_precision ); float recall = -1.f; @@ -538,6 +548,8 @@ float cv::getRecall( const std::vector& recallPrecisionCurve, float l_p int cv::getNearestPoint( const std::vector& recallPrecisionCurve, float l_precision ) { + CV_INSTRUMENT_REGION() + int nearestPointIndex = -1; if( l_precision >= 0 && l_precision <= 1 ) diff --git a/modules/features2d/src/fast.cpp b/modules/features2d/src/fast.cpp index 42dacb5387..8fa6b79f77 100644 --- a/modules/features2d/src/fast.cpp +++ b/modules/features2d/src/fast.cpp @@ -331,6 +331,8 @@ static bool ocl_FAST( InputArray _img, std::vector& keypoints, void FAST(InputArray _img, std::vector& keypoints, int threshold, bool nonmax_suppression, int type) { + CV_INSTRUMENT_REGION() + #ifdef HAVE_OPENCL if( ocl::useOpenCL() && _img.isUMat() && type == FastFeatureDetector::TYPE_9_16 && ocl_FAST(_img, keypoints, threshold, nonmax_suppression, 10000)) @@ -360,6 +362,8 @@ void FAST(InputArray _img, std::vector& keypoints, int threshold, bool void FAST(InputArray _img, std::vector& keypoints, int threshold, bool nonmax_suppression) { + CV_INSTRUMENT_REGION() + FAST(_img, keypoints, threshold, nonmax_suppression, FastFeatureDetector::TYPE_9_16); } @@ -373,6 +377,8 @@ public: void detect( InputArray _image, std::vector& keypoints, InputArray _mask ) { + CV_INSTRUMENT_REGION() + Mat mask = _mask.getMat(), grayImage; UMat ugrayImage; _InputArray gray = _image; diff --git a/modules/features2d/src/feature2d.cpp b/modules/features2d/src/feature2d.cpp index 93b650bcb8..a992db7ce3 100644 --- a/modules/features2d/src/feature2d.cpp +++ b/modules/features2d/src/feature2d.cpp @@ -60,6 +60,8 @@ void Feature2D::detect( InputArray image, std::vector& keypoints, InputArray mask ) { + CV_INSTRUMENT_REGION() + if( image.empty() ) { keypoints.clear(); @@ -73,6 +75,8 @@ void Feature2D::detect( InputArrayOfArrays _images, std::vector >& keypoints, InputArrayOfArrays _masks ) { + CV_INSTRUMENT_REGION() + vector images, masks; _images.getMatVector(images); @@ -102,6 +106,8 @@ void Feature2D::compute( InputArray image, std::vector& keypoints, OutputArray descriptors ) { + CV_INSTRUMENT_REGION() + if( image.empty() ) { descriptors.release(); @@ -114,6 +120,8 @@ void Feature2D::compute( InputArrayOfArrays _images, std::vector >& keypoints, OutputArrayOfArrays _descriptors ) { + CV_INSTRUMENT_REGION() + if( !_descriptors.needed() ) return; @@ -141,6 +149,8 @@ void Feature2D::detectAndCompute( InputArray, InputArray, OutputArray, bool ) { + CV_INSTRUMENT_REGION() + CV_Error(Error::StsNotImplemented, ""); } diff --git a/modules/features2d/src/gftt.cpp b/modules/features2d/src/gftt.cpp index 17e26928c0..c61c96f596 100644 --- a/modules/features2d/src/gftt.cpp +++ b/modules/features2d/src/gftt.cpp @@ -75,6 +75,8 @@ public: void detect( InputArray _image, std::vector& keypoints, InputArray _mask ) { + CV_INSTRUMENT_REGION() + std::vector corners; if (_image.isUMat()) diff --git a/modules/features2d/src/kaze.cpp b/modules/features2d/src/kaze.cpp index 64778a08c7..63b48c3b41 100644 --- a/modules/features2d/src/kaze.cpp +++ b/modules/features2d/src/kaze.cpp @@ -110,6 +110,8 @@ namespace cv OutputArray descriptors, bool useProvidedKeypoints) { + CV_INSTRUMENT_REGION() + cv::Mat img = image.getMat(); if (img.channels() > 1) cvtColor(image, img, COLOR_BGR2GRAY); diff --git a/modules/features2d/src/matchers.cpp b/modules/features2d/src/matchers.cpp index 11dfa6d388..f0b1d610bc 100644 --- a/modules/features2d/src/matchers.cpp +++ b/modules/features2d/src/matchers.cpp @@ -567,6 +567,8 @@ void DescriptorMatcher::train() void DescriptorMatcher::match( InputArray queryDescriptors, InputArray trainDescriptors, std::vector& matches, InputArray mask ) const { + CV_INSTRUMENT_REGION() + Ptr tempMatcher = clone(true); tempMatcher->add(trainDescriptors); tempMatcher->match( queryDescriptors, matches, std::vector(1, mask.getMat()) ); @@ -576,6 +578,8 @@ void DescriptorMatcher::knnMatch( InputArray queryDescriptors, InputArray trainD std::vector >& matches, int knn, InputArray mask, bool compactResult ) const { + CV_INSTRUMENT_REGION() + Ptr tempMatcher = clone(true); tempMatcher->add(trainDescriptors); tempMatcher->knnMatch( queryDescriptors, matches, knn, std::vector(1, mask.getMat()), compactResult ); @@ -585,6 +589,8 @@ void DescriptorMatcher::radiusMatch( InputArray queryDescriptors, InputArray tra std::vector >& matches, float maxDistance, InputArray mask, bool compactResult ) const { + CV_INSTRUMENT_REGION() + Ptr tempMatcher = clone(true); tempMatcher->add(trainDescriptors); tempMatcher->radiusMatch( queryDescriptors, matches, maxDistance, std::vector(1, mask.getMat()), compactResult ); @@ -592,6 +598,8 @@ void DescriptorMatcher::radiusMatch( InputArray queryDescriptors, InputArray tra void DescriptorMatcher::match( InputArray queryDescriptors, std::vector& matches, InputArrayOfArrays masks ) { + CV_INSTRUMENT_REGION() + std::vector > knnMatches; knnMatch( queryDescriptors, knnMatches, 1, masks, true /*compactResult*/ ); convertMatches( knnMatches, matches ); @@ -613,8 +621,7 @@ void DescriptorMatcher::checkMasks( InputArrayOfArrays _masks, int queryDescript { int rows = trainDescCollection[i].empty() ? utrainDescCollection[i].rows : trainDescCollection[i].rows; CV_Assert( masks[i].rows == queryDescriptorsCount && - (masks[i].cols == rows || masks[i].cols == rows) && - masks[i].type() == CV_8UC1 ); + masks[i].cols == rows && masks[i].type() == CV_8UC1); } } } @@ -623,6 +630,8 @@ void DescriptorMatcher::checkMasks( InputArrayOfArrays _masks, int queryDescript void DescriptorMatcher::knnMatch( InputArray queryDescriptors, std::vector >& matches, int knn, InputArrayOfArrays masks, bool compactResult ) { + CV_INSTRUMENT_REGION() + if( empty() || queryDescriptors.empty() ) return; @@ -637,6 +646,8 @@ void DescriptorMatcher::knnMatch( InputArray queryDescriptors, std::vector >& matches, float maxDistance, InputArrayOfArrays masks, bool compactResult ) { + CV_INSTRUMENT_REGION() + matches.clear(); if( empty() || queryDescriptors.empty() ) return; @@ -1080,6 +1091,8 @@ void FlannBasedMatcher::clear() void FlannBasedMatcher::train() { + CV_INSTRUMENT_REGION() + if( !flannIndex || mergedDescriptors.size() < addedDescCount ) { // FIXIT: Workaround for 'utrainDescCollection' issue (PR #2142) @@ -1332,6 +1345,8 @@ void FlannBasedMatcher::convertToDMatches( const DescriptorCollection& collectio void FlannBasedMatcher::knnMatchImpl( InputArray _queryDescriptors, std::vector >& matches, int knn, InputArrayOfArrays /*masks*/, bool /*compactResult*/ ) { + CV_INSTRUMENT_REGION() + Mat queryDescriptors = _queryDescriptors.getMat(); Mat indices( queryDescriptors.rows, knn, CV_32SC1 ); Mat dists( queryDescriptors.rows, knn, CV_32FC1); @@ -1343,6 +1358,8 @@ void FlannBasedMatcher::knnMatchImpl( InputArray _queryDescriptors, std::vector< void FlannBasedMatcher::radiusMatchImpl( InputArray _queryDescriptors, std::vector >& matches, float maxDistance, InputArrayOfArrays /*masks*/, bool /*compactResult*/ ) { + CV_INSTRUMENT_REGION() + Mat queryDescriptors = _queryDescriptors.getMat(); const int count = mergedDescriptors.size(); // TODO do count as param? Mat indices( queryDescriptors.rows, count, CV_32SC1, Scalar::all(-1) ); @@ -1357,5 +1374,4 @@ void FlannBasedMatcher::radiusMatchImpl( InputArray _queryDescriptors, std::vect convertToDMatches( mergedDescriptors, indices, dists, matches ); } - } diff --git a/modules/features2d/src/mser.cpp b/modules/features2d/src/mser.cpp index 1143addc12..f16a0d2a8b 100644 --- a/modules/features2d/src/mser.cpp +++ b/modules/features2d/src/mser.cpp @@ -211,7 +211,7 @@ public: return; } } - if( parent_ && parent_->var >= 0.f && var >= parent_->var ) + if( var > 0.f && parent_ && parent_->var >= 0.f && var >= parent_->var ) return; int xmin = INT_MAX, ymin = INT_MAX, xmax = INT_MIN, ymax = INT_MIN, j = 0; wp.msers->push_back(vector()); @@ -270,12 +270,20 @@ public: if( !history || (history->size != size && size > 0 && (gray_level != history->val || force))) { - CompHistory* h = hptr++; - h->parent_ = 0; - h->child_ = history; - h->next_ = 0; - if( history ) - history->parent_ = h; + CompHistory* h; + + if (history && gray_level == history->val) + h = history; + else + { + h = hptr++; + h->parent_ = 0; + h->child_ = history; + h->next_ = 0; + if (history) + history->parent_ = h; + } + h->val = gray_level; h->size = size; h->head = head; @@ -283,7 +291,7 @@ public: history = h; h->var = FLT_MAX; h->checked = true; - if( h->size >= wp.p.minArea ) + if (h->size >= wp.p.minArea) { h->var = -1.f; h->checked = false; @@ -291,7 +299,7 @@ public: } } gray_level = new_gray_level; - if( update && history ) + if( update && history && gray_level != history->val ) history->updateTree(wp, 0, 0, final); } @@ -299,14 +307,13 @@ public: void merge( ConnectedComp* comp1, ConnectedComp* comp2, CompHistory*& hptr, WParams& wp ) { - comp1->growHistory( hptr, wp, -1, false ); - comp2->growHistory( hptr, wp, -1, false ); - if( comp1->size < comp2->size ) std::swap(comp1, comp2); if( comp2->size == 0 ) { + // only grow comp1's history + comp1->growHistory(hptr, wp, -1, false); gray_level = comp1->gray_level; head = comp1->head; tail = comp1->tail; @@ -315,21 +322,35 @@ public: return; } - CompHistory* h1 = comp1->history; - CompHistory* h2 = comp2->history; + comp1->growHistory( hptr, wp, -1, false ); + comp2->growHistory( hptr, wp, -1, false ); - gray_level = std::max(comp1->gray_level, comp2->gray_level); + if (comp1->gray_level < comp2->gray_level) + std::swap(comp1, comp2); + + gray_level = comp1->gray_level; history = comp1->history; wp.pix0[comp1->tail].setNext(comp2->head); head = comp1->head; tail = comp2->tail; size = comp1->size + comp2->size; - bool keep_2nd = h2->size > wp.p.minArea; - growHistory( hptr, wp, -1, false, keep_2nd ); - if( keep_2nd ) + + CompHistory *h1 = history->child_; + CompHistory *h2 = comp2->history; + if (h2->size > wp.p.minArea) { - h1->next_ = h2; + // the child_'s size should be the large one + if (h1 && h1->size > h2->size) + { + h2->next_ = h1->next_; + h1->next_ = h2; + } + else + { + history->child_ = h2; + h2->next_ = h1; + } h2->parent_ = history; } } @@ -390,7 +411,7 @@ public: int step = cols; for( i = 1; i < rows-1; i++ ) { - Pixel* pptr = &pixbuf[i*step + 1]; + Pixel* pptr = &pixbuf[i*step]; for( j = 1; j < cols-1; j++ ) { pptr[j].val = 0; @@ -1019,14 +1040,15 @@ extractMSER_8uC3( const Mat& src, void MSER_Impl::detectRegions( InputArray _src, vector >& msers, vector& bboxes ) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); - size_t npix = src.total(); msers.clear(); bboxes.clear(); - if( npix == 0 ) - return; + if( src.rows < 3 || src.cols < 3 ) + CV_Error(Error::StsBadArg, "Input image is too small. Expected at least 3x3"); Size size = src.size(); @@ -1056,6 +1078,8 @@ void MSER_Impl::detectRegions( InputArray _src, vector >& msers, v void MSER_Impl::detect( InputArray _image, vector& keypoints, InputArray _mask ) { + CV_INSTRUMENT_REGION() + vector bboxes; vector > msers; Mat mask = _mask.getMat(); diff --git a/modules/features2d/src/orb.cpp b/modules/features2d/src/orb.cpp index 7775b84f40..219e86e109 100644 --- a/modules/features2d/src/orb.cpp +++ b/modules/features2d/src/orb.cpp @@ -957,6 +957,8 @@ void ORB_Impl::detectAndCompute( InputArray _image, InputArray _mask, std::vector& keypoints, OutputArray _descriptors, bool useProvidedKeypoints ) { + CV_INSTRUMENT_REGION() + CV_Assert(patchSize >= 2); bool do_keypoints = !useProvidedKeypoints; diff --git a/modules/features2d/test/test_mser.cpp b/modules/features2d/test/test_mser.cpp index 89b8ddbade..a52c3c3b81 100644 --- a/modules/features2d/test/test_mser.cpp +++ b/modules/features2d/test/test_mser.cpp @@ -132,7 +132,7 @@ TEST(Features2d_MSER, cases) GaussianBlur(src, src, Size(5, 5), 1.5, 1.5); int minRegs = use_big_image ? 7 : 2; - int maxRegs = use_big_image ? 1000 : 15; + int maxRegs = use_big_image ? 1000 : 20; if( binarize && (thresh == 0 || thresh == 255) ) minRegs = maxRegs = 0; diff --git a/modules/flann/include/opencv2/flann.hpp b/modules/flann/include/opencv2/flann.hpp index 4f92d57e3e..b647766cce 100644 --- a/modules/flann/include/opencv2/flann.hpp +++ b/modules/flann/include/opencv2/flann.hpp @@ -338,164 +338,134 @@ int GenericIndex::radiusSearch(const Mat& query, Mat& indices, Mat& di * @deprecated Use GenericIndex class instead */ template -class -#ifndef _MSC_VER - FLANN_DEPRECATED -#endif - Index_ { +class Index_ +{ public: - typedef typename L2::ElementType ElementType; - typedef typename L2::ResultType DistanceType; + typedef typename L2::ElementType ElementType; + typedef typename L2::ResultType DistanceType; - Index_(const Mat& features, const ::cvflann::IndexParams& params); - - ~Index_(); - - void knnSearch(const std::vector& query, std::vector& indices, std::vector& dists, int knn, const ::cvflann::SearchParams& params); - void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& params); - - int radiusSearch(const std::vector& query, std::vector& indices, std::vector& dists, DistanceType radius, const ::cvflann::SearchParams& params); - int radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& params); - - void save(String filename) - { - if (nnIndex_L1) nnIndex_L1->save(filename); - if (nnIndex_L2) nnIndex_L2->save(filename); - } - - int veclen() const + FLANN_DEPRECATED Index_(const Mat& dataset, const ::cvflann::IndexParams& params) { - if (nnIndex_L1) return nnIndex_L1->veclen(); - if (nnIndex_L2) return nnIndex_L2->veclen(); - } + printf("[WARNING] The cv::flann::Index_ class is deperecated, use cv::flann::GenericIndex instead\n"); - int size() const + CV_Assert(dataset.type() == CvType::type()); + CV_Assert(dataset.isContinuous()); + ::cvflann::Matrix m_dataset((ElementType*)dataset.ptr(0), dataset.rows, dataset.cols); + + if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L2 ) { + nnIndex_L1 = NULL; + nnIndex_L2 = new ::cvflann::Index< L2 >(m_dataset, params); + } + else if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L1 ) { + nnIndex_L1 = new ::cvflann::Index< L1 >(m_dataset, params); + nnIndex_L2 = NULL; + } + else { + printf("[ERROR] cv::flann::Index_ only provides backwards compatibility for the L1 and L2 distances. " + "For other distance types you must use cv::flann::GenericIndex\n"); + CV_Assert(0); + } + if (nnIndex_L1) nnIndex_L1->buildIndex(); + if (nnIndex_L2) nnIndex_L2->buildIndex(); + } + FLANN_DEPRECATED ~Index_() { - if (nnIndex_L1) return nnIndex_L1->size(); - if (nnIndex_L2) return nnIndex_L2->size(); - } + if (nnIndex_L1) delete nnIndex_L1; + if (nnIndex_L2) delete nnIndex_L2; + } - ::cvflann::IndexParams getParameters() - { - if (nnIndex_L1) return nnIndex_L1->getParameters(); - if (nnIndex_L2) return nnIndex_L2->getParameters(); + FLANN_DEPRECATED void knnSearch(const std::vector& query, std::vector& indices, std::vector& dists, int knn, const ::cvflann::SearchParams& searchParams) + { + ::cvflann::Matrix m_query((ElementType*)&query[0], 1, query.size()); + ::cvflann::Matrix m_indices(&indices[0], 1, indices.size()); + ::cvflann::Matrix m_dists(&dists[0], 1, dists.size()); - } + if (nnIndex_L1) nnIndex_L1->knnSearch(m_query,m_indices,m_dists,knn,searchParams); + if (nnIndex_L2) nnIndex_L2->knnSearch(m_query,m_indices,m_dists,knn,searchParams); + } + FLANN_DEPRECATED void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& searchParams) + { + CV_Assert(queries.type() == CvType::type()); + CV_Assert(queries.isContinuous()); + ::cvflann::Matrix m_queries((ElementType*)queries.ptr(0), queries.rows, queries.cols); - FLANN_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() - { - if (nnIndex_L1) return nnIndex_L1->getIndexParameters(); - if (nnIndex_L2) return nnIndex_L2->getIndexParameters(); - } + CV_Assert(indices.type() == CV_32S); + CV_Assert(indices.isContinuous()); + ::cvflann::Matrix m_indices((int*)indices.ptr(0), indices.rows, indices.cols); + + CV_Assert(dists.type() == CvType::type()); + CV_Assert(dists.isContinuous()); + ::cvflann::Matrix m_dists((DistanceType*)dists.ptr(0), dists.rows, dists.cols); + + if (nnIndex_L1) nnIndex_L1->knnSearch(m_queries,m_indices,m_dists,knn, searchParams); + if (nnIndex_L2) nnIndex_L2->knnSearch(m_queries,m_indices,m_dists,knn, searchParams); + } + + FLANN_DEPRECATED int radiusSearch(const std::vector& query, std::vector& indices, std::vector& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) + { + ::cvflann::Matrix m_query((ElementType*)&query[0], 1, query.size()); + ::cvflann::Matrix m_indices(&indices[0], 1, indices.size()); + ::cvflann::Matrix m_dists(&dists[0], 1, dists.size()); + + if (nnIndex_L1) return nnIndex_L1->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); + if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); + } + + FLANN_DEPRECATED int radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) + { + CV_Assert(query.type() == CvType::type()); + CV_Assert(query.isContinuous()); + ::cvflann::Matrix m_query((ElementType*)query.ptr(0), query.rows, query.cols); + + CV_Assert(indices.type() == CV_32S); + CV_Assert(indices.isContinuous()); + ::cvflann::Matrix m_indices((int*)indices.ptr(0), indices.rows, indices.cols); + + CV_Assert(dists.type() == CvType::type()); + CV_Assert(dists.isContinuous()); + ::cvflann::Matrix m_dists((DistanceType*)dists.ptr(0), dists.rows, dists.cols); + + if (nnIndex_L1) return nnIndex_L1->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); + if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); + } + + FLANN_DEPRECATED void save(String filename) + { + if (nnIndex_L1) nnIndex_L1->save(filename); + if (nnIndex_L2) nnIndex_L2->save(filename); + } + + FLANN_DEPRECATED int veclen() const + { + if (nnIndex_L1) return nnIndex_L1->veclen(); + if (nnIndex_L2) return nnIndex_L2->veclen(); + } + + FLANN_DEPRECATED int size() const + { + if (nnIndex_L1) return nnIndex_L1->size(); + if (nnIndex_L2) return nnIndex_L2->size(); + } + + FLANN_DEPRECATED ::cvflann::IndexParams getParameters() + { + if (nnIndex_L1) return nnIndex_L1->getParameters(); + if (nnIndex_L2) return nnIndex_L2->getParameters(); + + } + + FLANN_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() + { + if (nnIndex_L1) return nnIndex_L1->getIndexParameters(); + if (nnIndex_L2) return nnIndex_L2->getIndexParameters(); + } private: - // providing backwards compatibility for L2 and L1 distances (most common) - ::cvflann::Index< L2 >* nnIndex_L2; - ::cvflann::Index< L1 >* nnIndex_L1; + // providing backwards compatibility for L2 and L1 distances (most common) + ::cvflann::Index< L2 >* nnIndex_L2; + ::cvflann::Index< L1 >* nnIndex_L1; }; -#ifdef _MSC_VER -template -class FLANN_DEPRECATED Index_; -#endif - -//! @cond IGNORED - -template -Index_::Index_(const Mat& dataset, const ::cvflann::IndexParams& params) -{ - printf("[WARNING] The cv::flann::Index_ class is deperecated, use cv::flann::GenericIndex instead\n"); - - CV_Assert(dataset.type() == CvType::type()); - CV_Assert(dataset.isContinuous()); - ::cvflann::Matrix m_dataset((ElementType*)dataset.ptr(0), dataset.rows, dataset.cols); - - if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L2 ) { - nnIndex_L1 = NULL; - nnIndex_L2 = new ::cvflann::Index< L2 >(m_dataset, params); - } - else if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L1 ) { - nnIndex_L1 = new ::cvflann::Index< L1 >(m_dataset, params); - nnIndex_L2 = NULL; - } - else { - printf("[ERROR] cv::flann::Index_ only provides backwards compatibility for the L1 and L2 distances. " - "For other distance types you must use cv::flann::GenericIndex\n"); - CV_Assert(0); - } - if (nnIndex_L1) nnIndex_L1->buildIndex(); - if (nnIndex_L2) nnIndex_L2->buildIndex(); -} - -template -Index_::~Index_() -{ - if (nnIndex_L1) delete nnIndex_L1; - if (nnIndex_L2) delete nnIndex_L2; -} - -template -void Index_::knnSearch(const std::vector& query, std::vector& indices, std::vector& dists, int knn, const ::cvflann::SearchParams& searchParams) -{ - ::cvflann::Matrix m_query((ElementType*)&query[0], 1, query.size()); - ::cvflann::Matrix m_indices(&indices[0], 1, indices.size()); - ::cvflann::Matrix m_dists(&dists[0], 1, dists.size()); - - if (nnIndex_L1) nnIndex_L1->knnSearch(m_query,m_indices,m_dists,knn,searchParams); - if (nnIndex_L2) nnIndex_L2->knnSearch(m_query,m_indices,m_dists,knn,searchParams); -} - - -template -void Index_::knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& searchParams) -{ - CV_Assert(queries.type() == CvType::type()); - CV_Assert(queries.isContinuous()); - ::cvflann::Matrix m_queries((ElementType*)queries.ptr(0), queries.rows, queries.cols); - - CV_Assert(indices.type() == CV_32S); - CV_Assert(indices.isContinuous()); - ::cvflann::Matrix m_indices((int*)indices.ptr(0), indices.rows, indices.cols); - - CV_Assert(dists.type() == CvType::type()); - CV_Assert(dists.isContinuous()); - ::cvflann::Matrix m_dists((DistanceType*)dists.ptr(0), dists.rows, dists.cols); - - if (nnIndex_L1) nnIndex_L1->knnSearch(m_queries,m_indices,m_dists,knn, searchParams); - if (nnIndex_L2) nnIndex_L2->knnSearch(m_queries,m_indices,m_dists,knn, searchParams); -} - -template -int Index_::radiusSearch(const std::vector& query, std::vector& indices, std::vector& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) -{ - ::cvflann::Matrix m_query((ElementType*)&query[0], 1, query.size()); - ::cvflann::Matrix m_indices(&indices[0], 1, indices.size()); - ::cvflann::Matrix m_dists(&dists[0], 1, dists.size()); - - if (nnIndex_L1) return nnIndex_L1->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); - if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); -} - -template -int Index_::radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) -{ - CV_Assert(query.type() == CvType::type()); - CV_Assert(query.isContinuous()); - ::cvflann::Matrix m_query((ElementType*)query.ptr(0), query.rows, query.cols); - - CV_Assert(indices.type() == CV_32S); - CV_Assert(indices.isContinuous()); - ::cvflann::Matrix m_indices((int*)indices.ptr(0), indices.rows, indices.cols); - - CV_Assert(dists.type() == CvType::type()); - CV_Assert(dists.isContinuous()); - ::cvflann::Matrix m_dists((DistanceType*)dists.ptr(0), dists.rows, dists.cols); - - if (nnIndex_L1) return nnIndex_L1->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); - if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); -} - -//! @endcond /** @brief Clusters features using hierarchical k-means algorithm. diff --git a/modules/flann/include/opencv2/flann/lsh_table.h b/modules/flann/include/opencv2/flann/lsh_table.h index 582dcdb2fc..8ef2bd3810 100644 --- a/modules/flann/include/opencv2/flann/lsh_table.h +++ b/modules/flann/include/opencv2/flann/lsh_table.h @@ -265,7 +265,7 @@ private: { const size_t key_size_lower_bound = 1; //a value (size_t(1) << key_size) must fit the size_t type so key_size has to be strictly less than size of size_t - const size_t key_size_upper_bound = std::min(sizeof(BucketKey) * CHAR_BIT + 1, sizeof(size_t) * CHAR_BIT); + const size_t key_size_upper_bound = (std::min)(sizeof(BucketKey) * CHAR_BIT + 1, sizeof(size_t) * CHAR_BIT); if (key_size < key_size_lower_bound || key_size >= key_size_upper_bound) { CV_Error(cv::Error::StsBadArg, cv::format("Invalid key_size (=%d). Valid values for your system are %d <= key_size < %d.", (int)key_size, (int)key_size_lower_bound, (int)key_size_upper_bound)); diff --git a/modules/flann/misc/python/pyopencv_flann.hpp b/modules/flann/misc/python/pyopencv_flann.hpp new file mode 100644 index 0000000000..a9da8d0f00 --- /dev/null +++ b/modules/flann/misc/python/pyopencv_flann.hpp @@ -0,0 +1,79 @@ +#ifdef HAVE_OPENCV_FLANN +typedef cvflann::flann_distance_t cvflann_flann_distance_t; +typedef cvflann::flann_algorithm_t cvflann_flann_algorithm_t; + +template<> +PyObject* pyopencv_from(const cvflann_flann_algorithm_t& value) +{ + return PyInt_FromLong(int(value)); +} + +template<> +PyObject* pyopencv_from(const cvflann_flann_distance_t& value) +{ + return PyInt_FromLong(int(value)); +} + +template<> +bool pyopencv_to(PyObject *o, cv::flann::IndexParams& p, const char *name) +{ + (void)name; + bool ok = true; + PyObject* key = NULL; + PyObject* item = NULL; + Py_ssize_t pos = 0; + + if(PyDict_Check(o)) { + while(PyDict_Next(o, &pos, &key, &item)) { + if( !PyString_Check(key) ) { + ok = false; + break; + } + + String k = PyString_AsString(key); + if( PyString_Check(item) ) + { + const char* value = PyString_AsString(item); + p.setString(k, value); + } + else if( !!PyBool_Check(item) ) + p.setBool(k, item == Py_True); + else if( PyInt_Check(item) ) + { + int value = (int)PyInt_AsLong(item); + if( strcmp(k.c_str(), "algorithm") == 0 ) + p.setAlgorithm(value); + else + p.setInt(k, value); + } + else if( PyFloat_Check(item) ) + { + double value = PyFloat_AsDouble(item); + p.setDouble(k, value); + } + else + { + ok = false; + break; + } + } + } + + return ok && !PyErr_Occurred(); +} + +template<> +bool pyopencv_to(PyObject* obj, cv::flann::SearchParams & value, const char * name) +{ + return pyopencv_to(obj, value, name); +} + +template<> +bool pyopencv_to(PyObject *o, cvflann::flann_distance_t& dist, const char *name) +{ + int d = (int)dist; + bool ok = pyopencv_to(o, d, name); + dist = (cvflann::flann_distance_t)d; + return ok; +} +#endif \ No newline at end of file diff --git a/modules/flann/src/miniflann.cpp b/modules/flann/src/miniflann.cpp index b7661752c0..8aca73c230 100644 --- a/modules/flann/src/miniflann.cpp +++ b/modules/flann/src/miniflann.cpp @@ -365,6 +365,8 @@ Index::Index(InputArray _data, const IndexParams& params, flann_distance_t _dist void Index::build(InputArray _data, const IndexParams& params, flann_distance_t _distType) { + CV_INSTRUMENT_REGION() + release(); algo = getParam(params, "algorithm", FLANN_INDEX_LINEAR); if( algo == FLANN_INDEX_SAVED ) @@ -433,6 +435,8 @@ Index::~Index() void Index::release() { + CV_INSTRUMENT_REGION() + if( !index ) return; @@ -563,6 +567,8 @@ static void createIndicesDists(OutputArray _indices, OutputArray _dists, void Index::knnSearch(InputArray _query, OutputArray _indices, OutputArray _dists, int knn, const SearchParams& params) { + CV_INSTRUMENT_REGION() + Mat query = _query.getMat(), indices, dists; int dtype = distType == FLANN_DIST_HAMMING ? CV_32S : CV_32F; @@ -605,6 +611,8 @@ int Index::radiusSearch(InputArray _query, OutputArray _indices, OutputArray _dists, double radius, int maxResults, const SearchParams& params) { + CV_INSTRUMENT_REGION() + Mat query = _query.getMat(), indices, dists; int dtype = distType == FLANN_DIST_HAMMING ? CV_32S : CV_32F; CV_Assert( maxResults > 0 ); @@ -668,6 +676,8 @@ template void saveIndex(const Index* index0, const void* inde void Index::save(const String& filename) const { + CV_INSTRUMENT_REGION() + FILE* fout = fopen(filename.c_str(), "wb"); if (fout == NULL) CV_Error_( Error::StsError, ("Can not open file %s for writing FLANN index\n", filename.c_str()) ); diff --git a/modules/highgui/CMakeLists.txt b/modules/highgui/CMakeLists.txt index eee6a934ac..eb5617751e 100644 --- a/modules/highgui/CMakeLists.txt +++ b/modules/highgui/CMakeLists.txt @@ -1,5 +1,5 @@ set(the_description "High-level GUI and Media I/O") -ocv_add_module(highgui opencv_imgproc opencv_imgcodecs opencv_videoio WRAP python) +ocv_add_module(highgui opencv_imgproc OPTIONAL opencv_imgcodecs opencv_videoio WRAP python) # ---------------------------------------------------------------------------- # CMake file for highgui. See root CMakeLists.txt diff --git a/modules/highgui/include/opencv2/highgui.hpp b/modules/highgui/include/opencv2/highgui.hpp index 7f963a5cdf..d29afbe75b 100644 --- a/modules/highgui/include/opencv2/highgui.hpp +++ b/modules/highgui/include/opencv2/highgui.hpp @@ -44,8 +44,12 @@ #define __OPENCV_HIGHGUI_HPP__ #include "opencv2/core.hpp" +#ifdef HAVE_OPENCV_IMGCODECS #include "opencv2/imgcodecs.hpp" +#endif +#ifdef HAVE_OPENCV_VIDEOIO #include "opencv2/videoio.hpp" +#endif /** @defgroup highgui High-level GUI @@ -239,9 +243,10 @@ enum QtFontStyles { //! Qt "button" type enum QtButtonTypes { - QT_PUSH_BUTTON = 0, //!< Push button. - QT_CHECKBOX = 1, //!< Checkbox button. - QT_RADIOBOX = 2 //!< Radiobox button. + QT_PUSH_BUTTON = 0, //!< Push button. + QT_CHECKBOX = 1, //!< Checkbox button. + QT_RADIOBOX = 2, //!< Radiobox button. + QT_NEW_BUTTONBAR = 1024 //!< Button should create a new buttonbar }; /** @brief Callback function for mouse events. see cv::setMouseCallback @@ -719,7 +724,8 @@ CV_EXPORTS void stopLoop(); The function createButton attaches a button to the control panel. Each button is added to a buttonbar to the right of the last button. A new buttonbar is created if nothing was attached to the -control panel before, or if the last element attached to the control panel was a trackbar. +control panel before, or if the last element attached to the control panel was a trackbar or if the +QT_NEW_BUTTONBAR flag is added to the type. See below various examples of the cv::createButton function call: : @code @@ -728,6 +734,7 @@ See below various examples of the cv::createButton function call: : createButton("button3",callbackButton,&value); createButton("button5",callbackButton1,NULL,QT_RADIOBOX); createButton("button6",callbackButton2,NULL,QT_PUSH_BUTTON,1); + createButton("button6",callbackButton2,NULL,QT_PUSH_BUTTON|QT_NEW_BUTTONBAR);// create a push button in a new row @endcode @param bar_name Name of the button. diff --git a/modules/highgui/include/opencv2/highgui/highgui_c.h b/modules/highgui/include/opencv2/highgui/highgui_c.h index 47fdb84a4e..8ddb819a7a 100644 --- a/modules/highgui/include/opencv2/highgui/highgui_c.h +++ b/modules/highgui/include/opencv2/highgui/highgui_c.h @@ -44,8 +44,12 @@ #include "opencv2/core/core_c.h" #include "opencv2/imgproc/imgproc_c.h" +#ifdef HAVE_OPENCV_IMGCODECS #include "opencv2/imgcodecs/imgcodecs_c.h" +#endif +#ifdef HAVE_OPENCV_VIDEOIO #include "opencv2/videoio/videoio_c.h" +#endif #ifdef __cplusplus extern "C" { diff --git a/modules/highgui/src/precomp.hpp b/modules/highgui/src/precomp.hpp index 796af39768..0b63c3a01b 100644 --- a/modules/highgui/src/precomp.hpp +++ b/modules/highgui/src/precomp.hpp @@ -47,12 +47,14 @@ #include "opencv2/core/utility.hpp" #include "opencv2/core/private.hpp" -#include "opencv2/imgcodecs.hpp" - #include "opencv2/imgproc/imgproc_c.h" -#include "opencv2/imgcodecs/imgcodecs_c.h" #include "opencv2/highgui/highgui_c.h" +#ifdef HAVE_OPENCV_IMGCODECS +#include "opencv2/imgcodecs.hpp" +#include "opencv2/imgcodecs/imgcodecs_c.h" +#endif + #include #include #include @@ -61,14 +63,6 @@ #include #if defined WIN32 || defined WINCE - #if !defined _WIN32_WINNT - #ifdef HAVE_MSMF - #define _WIN32_WINNT 0x0600 // Windows Vista - #else - #define _WIN32_WINNT 0x0500 // Windows 2000 - #endif - #endif - #include #undef small #undef min diff --git a/modules/highgui/src/window_QT.cpp b/modules/highgui/src/window_QT.cpp index 7388a44b8d..e64922f8f3 100644 --- a/modules/highgui/src/window_QT.cpp +++ b/modules/highgui/src/window_QT.cpp @@ -1139,13 +1139,18 @@ void GuiReceiver::addButton(QString button_name, int button_type, int initial_bu { CvBar* lastbar = (CvBar*) global_control_panel->myLayout->itemAt(global_control_panel->myLayout->count() - 1); - if (lastbar->type == type_CvTrackbar) //if last bar is a trackbar, create a new buttonbar, else, attach to the current bar + // if last bar is a trackbar or the user requests a new buttonbar, create a new buttonbar + // else, attach to the current bar + if (lastbar->type == type_CvTrackbar || cv::QT_NEW_BUTTONBAR & button_type) b = CvWindow::createButtonBar(button_name); //the bar has the name of the first button attached to it else b = (CvButtonbar*) lastbar; } + // unset buttonbar flag + button_type = button_type & ~cv::QT_NEW_BUTTONBAR; + b->addButton(button_name, (CvButtonCallback) on_change, userdata, button_type, initial_button_state); } @@ -2295,11 +2300,90 @@ void CvWindow::icvSaveTrackbars(QSettings* settings) } +////////////////////////////////////////////////////// +// OCVViewPort + +OCVViewPort::OCVViewPort() +{ + mouseCallback = 0; + mouseData = 0; +} + +void OCVViewPort::setMouseCallBack(CvMouseCallback callback, void* param) +{ + mouseCallback = callback; + mouseData = param; +} + +void OCVViewPort::icvmouseEvent(QMouseEvent* evnt, type_mouse_event category) +{ + int cv_event = -1, flags = 0; + + icvmouseHandler(evnt, category, cv_event, flags); + icvmouseProcessing(QPointF(evnt->pos()), cv_event, flags); +} + +void OCVViewPort::icvmouseHandler(QMouseEvent* evnt, type_mouse_event category, int& cv_event, int& flags) +{ + Qt::KeyboardModifiers modifiers = evnt->modifiers(); + Qt::MouseButtons buttons = evnt->buttons(); + + // This line gives excess flags flushing, with it you cannot predefine flags value. + // icvmouseHandler called with flags == 0 where it really need. + //flags = 0; + if(modifiers & Qt::ShiftModifier) + flags |= CV_EVENT_FLAG_SHIFTKEY; + if(modifiers & Qt::ControlModifier) + flags |= CV_EVENT_FLAG_CTRLKEY; + if(modifiers & Qt::AltModifier) + flags |= CV_EVENT_FLAG_ALTKEY; + + if(buttons & Qt::LeftButton) + flags |= CV_EVENT_FLAG_LBUTTON; + if(buttons & Qt::RightButton) + flags |= CV_EVENT_FLAG_RBUTTON; + if(buttons & Qt::MidButton) + flags |= CV_EVENT_FLAG_MBUTTON; + + if (cv_event == -1) { + if (category == mouse_wheel) { + QWheelEvent *we = (QWheelEvent *) evnt; + cv_event = ((we->orientation() == Qt::Vertical) ? CV_EVENT_MOUSEWHEEL : CV_EVENT_MOUSEHWHEEL); + flags |= (we->delta() & 0xffff)<<16; + return; + } + switch(evnt->button()) + { + case Qt::LeftButton: + cv_event = tableMouseButtons[category][0]; + flags |= CV_EVENT_FLAG_LBUTTON; + break; + case Qt::RightButton: + cv_event = tableMouseButtons[category][1]; + flags |= CV_EVENT_FLAG_RBUTTON; + break; + case Qt::MidButton: + cv_event = tableMouseButtons[category][2]; + flags |= CV_EVENT_FLAG_MBUTTON; + break; + default: + cv_event = CV_EVENT_MOUSEMOVE; + } + } +} + +void OCVViewPort::icvmouseProcessing(QPointF pt, int cv_event, int flags) +{ + if (mouseCallback) + mouseCallback(cv_event, pt.x(), pt.y(), flags, mouseData); +} + + ////////////////////////////////////////////////////// // DefaultViewPort -DefaultViewPort::DefaultViewPort(CvWindow* arg, int arg2) : QGraphicsView(arg), image2Draw_mat(0) +DefaultViewPort::DefaultViewPort(CvWindow* arg, int arg2) : QGraphicsView(arg), OCVViewPort(), image2Draw_mat(0) { centralWidget = arg; param_keepRatio = arg2; @@ -2315,12 +2399,10 @@ DefaultViewPort::DefaultViewPort(CvWindow* arg, int arg2) : QGraphicsView(arg), connect(timerDisplay, SIGNAL(timeout()), this, SLOT(stopDisplayInfo())); drawInfo = false; + mouseCoordinate = QPoint(-1, -1); positionGrabbing = QPointF(0, 0); - positionCorners = QRect(0, 0, size().width(), size().height()); + positionCorners = QRect(0, 0, size().width(), size().height()); - on_mouse = 0; - on_mouse_param = 0; - mouseCoordinate = QPoint(-1, -1); //no border setStyleSheet( "QGraphicsView { border-style: none; }" ); @@ -2348,13 +2430,6 @@ QWidget* DefaultViewPort::getWidget() } -void DefaultViewPort::setMouseCallBack(CvMouseCallback m, void* param) -{ - on_mouse = m; - - on_mouse_param = param; -} - void DefaultViewPort::writeSettings(QSettings& settings) { settings.setValue("matrix_view.m11", param_matrixWorld.m11()); @@ -2629,13 +2704,10 @@ void DefaultViewPort::resizeEvent(QResizeEvent* evnt) void DefaultViewPort::wheelEvent(QWheelEvent* evnt) { - int delta = evnt->delta(); - int cv_event = ((evnt->orientation() == Qt::Vertical) ? CV_EVENT_MOUSEWHEEL : CV_EVENT_MOUSEHWHEEL); - int flags = (delta & 0xffff)<<16; - QPoint pt = evnt->pos(); + icvmouseEvent((QMouseEvent *)evnt, mouse_wheel); - icvmouseHandler((QMouseEvent*)evnt, mouse_wheel, cv_event, flags); - icvmouseProcessing(QPointF(pt), cv_event, flags); + scaleView(evnt->delta() / 240.0, evnt->pos()); + viewport()->update(); QWidget::wheelEvent(evnt); } @@ -2643,12 +2715,7 @@ void DefaultViewPort::wheelEvent(QWheelEvent* evnt) void DefaultViewPort::mousePressEvent(QMouseEvent* evnt) { - int cv_event = -1, flags = 0; - QPoint pt = evnt->pos(); - - //icvmouseHandler: pass parameters for cv_event, flags - icvmouseHandler(evnt, mouse_down, cv_event, flags); - icvmouseProcessing(QPointF(pt), cv_event, flags); + icvmouseEvent(evnt, mouse_down); if (param_matrixWorld.m11()>1) { @@ -2662,12 +2729,7 @@ void DefaultViewPort::mousePressEvent(QMouseEvent* evnt) void DefaultViewPort::mouseReleaseEvent(QMouseEvent* evnt) { - int cv_event = -1, flags = 0; - QPoint pt = evnt->pos(); - - //icvmouseHandler: pass parameters for cv_event, flags - icvmouseHandler(evnt, mouse_up, cv_event, flags); - icvmouseProcessing(QPointF(pt), cv_event, flags); + icvmouseEvent(evnt, mouse_up); if (param_matrixWorld.m11()>1) setCursor(Qt::OpenHandCursor); @@ -2678,30 +2740,20 @@ void DefaultViewPort::mouseReleaseEvent(QMouseEvent* evnt) void DefaultViewPort::mouseDoubleClickEvent(QMouseEvent* evnt) { - int cv_event = -1, flags = 0; - QPoint pt = evnt->pos(); - - //icvmouseHandler: pass parameters for cv_event, flags - icvmouseHandler(evnt, mouse_dbclick, cv_event, flags); - icvmouseProcessing(QPointF(pt), cv_event, flags); - + icvmouseEvent(evnt, mouse_dbclick); QWidget::mouseDoubleClickEvent(evnt); } void DefaultViewPort::mouseMoveEvent(QMouseEvent* evnt) { - int cv_event = CV_EVENT_MOUSEMOVE, flags = 0; - QPoint pt = evnt->pos(); - - //icvmouseHandler: pass parameters for cv_event, flags - icvmouseHandler(evnt, mouse_move, cv_event, flags); - icvmouseProcessing(QPointF(pt), cv_event, flags); + icvmouseEvent(evnt, mouse_move); if (param_matrixWorld.m11() > 1 && evnt->buttons() == Qt::LeftButton) { + QPoint pt = evnt->pos(); QPointF dxy = (pt - positionGrabbing)/param_matrixWorld.m11(); - positionGrabbing = evnt->pos(); + positionGrabbing = pt; moveView(dxy); } @@ -2848,48 +2900,6 @@ void DefaultViewPort::scaleView(qreal factor,QPointF center) } -//up, down, dclick, move -void DefaultViewPort::icvmouseHandler(QMouseEvent *evnt, type_mouse_event category, int &cv_event, int &flags) -{ - Qt::KeyboardModifiers modifiers = evnt->modifiers(); - Qt::MouseButtons buttons = evnt->buttons(); - - // This line gives excess flags flushing, with it you cannot predefine flags value. - // icvmouseHandler called with flags == 0 where it really need. - //flags = 0; - if(modifiers & Qt::ShiftModifier) - flags |= CV_EVENT_FLAG_SHIFTKEY; - if(modifiers & Qt::ControlModifier) - flags |= CV_EVENT_FLAG_CTRLKEY; - if(modifiers & Qt::AltModifier) - flags |= CV_EVENT_FLAG_ALTKEY; - - if(buttons & Qt::LeftButton) - flags |= CV_EVENT_FLAG_LBUTTON; - if(buttons & Qt::RightButton) - flags |= CV_EVENT_FLAG_RBUTTON; - if(buttons & Qt::MidButton) - flags |= CV_EVENT_FLAG_MBUTTON; - - if (cv_event == -1) - switch(evnt->button()) - { - case Qt::LeftButton: - cv_event = tableMouseButtons[category][0]; - flags |= CV_EVENT_FLAG_LBUTTON; - break; - case Qt::RightButton: - cv_event = tableMouseButtons[category][1]; - flags |= CV_EVENT_FLAG_RBUTTON; - break; - case Qt::MidButton: - cv_event = tableMouseButtons[category][2]; - flags |= CV_EVENT_FLAG_MBUTTON; - break; - default: - cv_event = CV_EVENT_MOUSEMOVE; - } -} void DefaultViewPort::icvmouseProcessing(QPointF pt, int cv_event, int flags) @@ -2901,9 +2911,7 @@ void DefaultViewPort::icvmouseProcessing(QPointF pt, int cv_event, int flags) mouseCoordinate.rx()=floor(pfx/ratioX); mouseCoordinate.ry()=floor(pfy/ratioY); - if (on_mouse) - on_mouse( cv_event, mouseCoordinate.x(), - mouseCoordinate.y(), flags, on_mouse_param ); + OCVViewPort::icvmouseProcessing(QPointF(mouseCoordinate), cv_event, flags); } @@ -3108,11 +3116,8 @@ void DefaultViewPort::setSize(QSize /*size_*/) #ifdef HAVE_QT_OPENGL -OpenGlViewPort::OpenGlViewPort(QWidget* _parent) : QGLWidget(_parent), size(-1, -1) +OpenGlViewPort::OpenGlViewPort(QWidget* _parent) : QGLWidget(_parent), OCVViewPort(), size(-1, -1) { - mouseCallback = 0; - mouseData = 0; - glDrawCallback = 0; glDrawData = 0; } @@ -3126,11 +3131,6 @@ QWidget* OpenGlViewPort::getWidget() return this; } -void OpenGlViewPort::setMouseCallBack(CvMouseCallback callback, void* param) -{ - mouseCallback = callback; - mouseData = param; -} void OpenGlViewPort::writeSettings(QSettings& /*settings*/) { @@ -3191,116 +3191,37 @@ void OpenGlViewPort::paintGL() glDrawCallback(glDrawData); } + void OpenGlViewPort::wheelEvent(QWheelEvent* evnt) { - int delta = evnt->delta(); - int cv_event = ((evnt->orientation() == Qt::Vertical) ? CV_EVENT_MOUSEWHEEL : CV_EVENT_MOUSEHWHEEL); - int flags = (delta & 0xffff)<<16; - QPoint pt = evnt->pos(); - - icvmouseHandler((QMouseEvent*)evnt, mouse_wheel, cv_event, flags); - icvmouseProcessing(QPointF(pt), cv_event, flags); - - QWidget::wheelEvent(evnt); + icvmouseEvent((QMouseEvent *)evnt, mouse_wheel); + QGLWidget::wheelEvent(evnt); } void OpenGlViewPort::mousePressEvent(QMouseEvent* evnt) { - int cv_event = -1, flags = 0; - QPoint pt = evnt->pos(); - - icvmouseHandler(evnt, mouse_down, cv_event, flags); - icvmouseProcessing(QPointF(pt), cv_event, flags); - + icvmouseEvent(evnt, mouse_down); QGLWidget::mousePressEvent(evnt); } - void OpenGlViewPort::mouseReleaseEvent(QMouseEvent* evnt) { - int cv_event = -1, flags = 0; - QPoint pt = evnt->pos(); - - icvmouseHandler(evnt, mouse_up, cv_event, flags); - icvmouseProcessing(QPointF(pt), cv_event, flags); - + icvmouseEvent(evnt, mouse_up); QGLWidget::mouseReleaseEvent(evnt); } - void OpenGlViewPort::mouseDoubleClickEvent(QMouseEvent* evnt) { - int cv_event = -1, flags = 0; - QPoint pt = evnt->pos(); - - icvmouseHandler(evnt, mouse_dbclick, cv_event, flags); - icvmouseProcessing(QPointF(pt), cv_event, flags); - + icvmouseEvent(evnt, mouse_dbclick); QGLWidget::mouseDoubleClickEvent(evnt); } - void OpenGlViewPort::mouseMoveEvent(QMouseEvent* evnt) { - int cv_event = CV_EVENT_MOUSEMOVE, flags = 0; - QPoint pt = evnt->pos(); - - //icvmouseHandler: pass parameters for cv_event, flags - icvmouseHandler(evnt, mouse_move, cv_event, flags); - icvmouseProcessing(QPointF(pt), cv_event, flags); - + icvmouseEvent(evnt, mouse_move); QGLWidget::mouseMoveEvent(evnt); } -void OpenGlViewPort::icvmouseHandler(QMouseEvent* evnt, type_mouse_event category, int& cv_event, int& flags) -{ - Qt::KeyboardModifiers modifiers = evnt->modifiers(); - Qt::MouseButtons buttons = evnt->buttons(); - - // This line gives excess flags flushing, with it you cannot predefine flags value. - // icvmouseHandler called with flags == 0 where it really need. - //flags = 0; - if(modifiers & Qt::ShiftModifier) - flags |= CV_EVENT_FLAG_SHIFTKEY; - if(modifiers & Qt::ControlModifier) - flags |= CV_EVENT_FLAG_CTRLKEY; - if(modifiers & Qt::AltModifier) - flags |= CV_EVENT_FLAG_ALTKEY; - - if(buttons & Qt::LeftButton) - flags |= CV_EVENT_FLAG_LBUTTON; - if(buttons & Qt::RightButton) - flags |= CV_EVENT_FLAG_RBUTTON; - if(buttons & Qt::MidButton) - flags |= CV_EVENT_FLAG_MBUTTON; - - if (cv_event == -1) - switch(evnt->button()) - { - case Qt::LeftButton: - cv_event = tableMouseButtons[category][0]; - flags |= CV_EVENT_FLAG_LBUTTON; - break; - case Qt::RightButton: - cv_event = tableMouseButtons[category][1]; - flags |= CV_EVENT_FLAG_RBUTTON; - break; - case Qt::MidButton: - cv_event = tableMouseButtons[category][2]; - flags |= CV_EVENT_FLAG_MBUTTON; - break; - default: - cv_event = CV_EVENT_MOUSEMOVE; - } -} - - -void OpenGlViewPort::icvmouseProcessing(QPointF pt, int cv_event, int flags) -{ - if (mouseCallback) - mouseCallback(cv_event, pt.x(), pt.y(), flags, mouseData); -} - QSize OpenGlViewPort::sizeHint() const { diff --git a/modules/highgui/src/window_QT.h b/modules/highgui/src/window_QT.h index 16cc9e3853..df80568cf0 100644 --- a/modules/highgui/src/window_QT.h +++ b/modules/highgui/src/window_QT.h @@ -403,10 +403,26 @@ public: }; +class OCVViewPort : public ViewPort +{ +public: + explicit OCVViewPort(); + ~OCVViewPort() {}; + void setMouseCallBack(CvMouseCallback callback, void* param); + +protected: + void icvmouseEvent(QMouseEvent* event, type_mouse_event category); + void icvmouseHandler(QMouseEvent* event, type_mouse_event category, int& cv_event, int& flags); + void icvmouseProcessing(QPointF pt, int cv_event, int flags); + + CvMouseCallback mouseCallback; + void* mouseData; +}; + #ifdef HAVE_QT_OPENGL -class OpenGlViewPort : public QGLWidget, public ViewPort +class OpenGlViewPort : public QGLWidget, public OCVViewPort { public: explicit OpenGlViewPort(QWidget* parent); @@ -414,8 +430,6 @@ public: QWidget* getWidget(); - void setMouseCallBack(CvMouseCallback callback, void* param); - void writeSettings(QSettings& settings); void readSettings(QSettings& settings); @@ -448,20 +462,14 @@ protected: private: QSize size; - CvMouseCallback mouseCallback; - void* mouseData; - CvOpenGlDrawCallback glDrawCallback; void* glDrawData; - - void icvmouseHandler(QMouseEvent* event, type_mouse_event category, int& cv_event, int& flags); - void icvmouseProcessing(QPointF pt, int cv_event, int flags); }; #endif // HAVE_QT_OPENGL -class DefaultViewPort : public QGraphicsView, public ViewPort +class DefaultViewPort : public QGraphicsView, public OCVViewPort { Q_OBJECT @@ -471,8 +479,6 @@ public: QWidget* getWidget(); - void setMouseCallBack(CvMouseCallback callback, void* param); - void writeSettings(QSettings& settings); void readSettings(QSettings& settings); @@ -510,6 +516,7 @@ protected: void contextMenuEvent(QContextMenuEvent* event); void resizeEvent(QResizeEvent* event); void paintEvent(QPaintEvent* paintEventInfo); + void wheelEvent(QWheelEvent* event); void mouseMoveEvent(QMouseEvent* event); void mousePressEvent(QMouseEvent* event); @@ -526,17 +533,13 @@ private: QImage image2Draw_qt; int nbChannelOriginImage; - //for mouse callback - CvMouseCallback on_mouse; - void* on_mouse_param; - void scaleView(qreal scaleFactor, QPointF center); void moveView(QPointF delta); - QPoint mouseCoordinate; + QPoint mouseCoordinate; QPointF positionGrabbing; - QRect positionCorners; + QRect positionCorners; QTransform matrixWorld_inv; float ratioX, ratioY; @@ -555,7 +558,7 @@ private: void draw2D(QPainter *painter); void drawStatusBar(); void controlImagePosition(); - void icvmouseHandler(QMouseEvent *event, type_mouse_event category, int &cv_event, int &flags); + void icvmouseProcessing(QPointF pt, int cv_event, int flags); private slots: diff --git a/modules/highgui/src/window_cocoa.mm b/modules/highgui/src/window_cocoa.mm index a653cd355c..a1befc3352 100644 --- a/modules/highgui/src/window_cocoa.mm +++ b/modules/highgui/src/window_cocoa.mm @@ -82,42 +82,26 @@ static NSAutoreleasePool *pool = nil; static NSMutableDictionary *windows = nil; static bool wasInitialized = false; -@interface CVView : NSView { - NSImage *image; -} -@property(retain) NSImage *image; +@interface CVView : NSView +@property(strong) NSImage *image; - (void)setImageData:(CvArr *)arr; @end -@interface CVSlider : NSView { - NSSlider *slider; - NSTextField *name; - int *value; - void *userData; - CvTrackbarCallback callback; - CvTrackbarCallback2 callback2; -} -@property(retain) NSSlider *slider; -@property(retain) NSTextField *name; +@interface CVSlider : NSView +@property(strong) NSSlider *slider; +@property(strong) NSTextField *name; @property(assign) int *value; @property(assign) void *userData; @property(assign) CvTrackbarCallback callback; @property(assign) CvTrackbarCallback2 callback2; @end -@interface CVWindow : NSWindow { - NSMutableDictionary *sliders; - CvMouseCallback mouseCallback; - void *mouseParam; - BOOL autosize; - BOOL firstContent; - int status; -} +@interface CVWindow : NSWindow @property(assign) CvMouseCallback mouseCallback; @property(assign) void *mouseParam; @property(assign) BOOL autosize; @property(assign) BOOL firstContent; -@property(retain) NSMutableDictionary *sliders; +@property(strong) NSMutableDictionary *sliders; @property(readwrite) int status; - (CVView *)contentView; - (void)cvSendMouseEvent:(NSEvent *)event type:(int)type flags:(int)flags; diff --git a/modules/highgui/test/test_precomp.hpp b/modules/highgui/test/test_precomp.hpp index e4d7797158..40945acbfe 100644 --- a/modules/highgui/test/test_precomp.hpp +++ b/modules/highgui/test/test_precomp.hpp @@ -6,16 +6,4 @@ # endif #endif -#ifndef __OPENCV_TEST_PRECOMP_HPP__ -#define __OPENCV_TEST_PRECOMP_HPP__ - -#include #include "opencv2/ts.hpp" -//#include "opencv2/imgproc.hpp" -//#include "opencv2/imgcodecs.hpp" -//#include "opencv2/highgui.hpp" -//#include "opencv2/imgproc/imgproc_c.h" - -//#include "opencv2/core/private.hpp" - -#endif diff --git a/modules/imgcodecs/include/opencv2/imgcodecs.hpp b/modules/imgcodecs/include/opencv2/imgcodecs.hpp index ce827a7e0f..d797737733 100644 --- a/modules/imgcodecs/include/opencv2/imgcodecs.hpp +++ b/modules/imgcodecs/include/opencv2/imgcodecs.hpp @@ -88,7 +88,8 @@ enum ImwriteFlags { IMWRITE_PNG_STRATEGY = 17, //!< One of cv::ImwritePNGFlags, default is IMWRITE_PNG_STRATEGY_DEFAULT. IMWRITE_PNG_BILEVEL = 18, //!< Binary level PNG, 0 or 1, default is 0. IMWRITE_PXM_BINARY = 32, //!< For PPM, PGM, or PBM, it can be a binary format flag, 0 or 1. Default value is 1. - IMWRITE_WEBP_QUALITY = 64 //!< For WEBP, it can be a quality from 1 to 100 (the higher is the better). By default (without any parameter) and for quality above 100 the lossless compression is used. + IMWRITE_WEBP_QUALITY = 64, //!< For WEBP, it can be a quality from 1 to 100 (the higher is the better). By default (without any parameter) and for quality above 100 the lossless compression is used. + IMWRITE_PAM_TUPLETYPE = 128,//!< For PAM, sets the TUPLETYPE field to the corresponding string value that is defined for the format }; //! Imwrite PNG specific flags used to tune the compression algorithm. @@ -107,6 +108,16 @@ enum ImwritePNGFlags { IMWRITE_PNG_STRATEGY_FIXED = 4 //!< Using this value prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications. }; +//! Imwrite PAM specific tupletype flags used to define the 'TUPETYPE' field of a PAM file. +enum ImwritePAMFlags { + IMWRITE_PAM_FORMAT_NULL = 0, + IMWRITE_PAM_FORMAT_BLACKANDWHITE = 1, + IMWRITE_PAM_FORMAT_GRAYSCALE = 2, + IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA = 3, + IMWRITE_PAM_FORMAT_RGB = 4, + IMWRITE_PAM_FORMAT_RGB_ALPHA = 5, + }; + /** @brief Loads an image from a file. @anchor imread diff --git a/modules/imgcodecs/include/opencv2/imgcodecs/imgcodecs_c.h b/modules/imgcodecs/include/opencv2/imgcodecs/imgcodecs_c.h index ad793cc94a..27ab35d8f1 100644 --- a/modules/imgcodecs/include/opencv2/imgcodecs/imgcodecs_c.h +++ b/modules/imgcodecs/include/opencv2/imgcodecs/imgcodecs_c.h @@ -92,9 +92,18 @@ enum CV_IMWRITE_PNG_STRATEGY_RLE =3, CV_IMWRITE_PNG_STRATEGY_FIXED =4, CV_IMWRITE_PXM_BINARY =32, - CV_IMWRITE_WEBP_QUALITY =64 + CV_IMWRITE_WEBP_QUALITY =64, + CV_IMWRITE_PAM_TUPLETYPE = 128, + CV_IMWRITE_PAM_FORMAT_NULL = 0, + CV_IMWRITE_PAM_FORMAT_BLACKANDWHITE = 1, + CV_IMWRITE_PAM_FORMAT_GRAYSCALE = 2, + CV_IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA = 3, + CV_IMWRITE_PAM_FORMAT_RGB = 4, + CV_IMWRITE_PAM_FORMAT_RGB_ALPHA = 5, }; + + /* save image to file */ CVAPI(int) cvSaveImage( const char* filename, const CvArr* image, const int* params CV_DEFAULT(0) ); diff --git a/modules/imgcodecs/src/grfmt_gdal.cpp b/modules/imgcodecs/src/grfmt_gdal.cpp index 1094b91b38..8865ae4948 100644 --- a/modules/imgcodecs/src/grfmt_gdal.cpp +++ b/modules/imgcodecs/src/grfmt_gdal.cpp @@ -559,7 +559,7 @@ bool GdalDecoder::checkSignature( const String& signature )const{ // look for NITF - std::string str = signature.c_str(); + std::string str(signature); if( str.substr(0,4).find("NITF") != std::string::npos ){ return true; } diff --git a/modules/imgcodecs/src/grfmt_pam.cpp b/modules/imgcodecs/src/grfmt_pam.cpp new file mode 100644 index 0000000000..ac7198a66f --- /dev/null +++ b/modules/imgcodecs/src/grfmt_pam.cpp @@ -0,0 +1,719 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// (3-clause BSD License) +// +// Copyright (C) 2000-2016, Intel Corporation, all rights reserved. +// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. +// Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved. +// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. +// Copyright (C) 2015-2016, OpenCV Foundation, all rights reserved. +// Copyright (C) 2015-2016, Itseez Inc., all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * Neither the names of the copyright holders nor the names of the contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall copyright holders or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + + +#include + +#include "precomp.hpp" +#include "utils.hpp" +#include "grfmt_pam.hpp" + +/* the PAM related fields */ +#define MAX_PAM_HEADER_IDENITFIER_LENGTH 8 +#define MAX_PAM_HEADER_VALUE_LENGTH 255 + +/* PAM header fileds */ +typedef enum { + PAM_HEADER_NONE, + PAM_HEADER_COMMENT, + PAM_HEADER_ENDHDR, + PAM_HEADER_HEIGHT, + PAM_HEADER_WIDTH, + PAM_HEADER_DEPTH, + PAM_HEADER_MAXVAL, + PAM_HEADER_TUPLTYPE, +} PamHeaderFieldType; + +struct pam_header_field { + PamHeaderFieldType type; + char identifier[MAX_PAM_HEADER_IDENITFIER_LENGTH+1]; +}; + +const static struct pam_header_field fields[] = { + {PAM_HEADER_ENDHDR, "ENDHDR"}, + {PAM_HEADER_HEIGHT, "HEIGHT"}, + {PAM_HEADER_WIDTH, "WIDTH"}, + {PAM_HEADER_DEPTH, "DEPTH"}, + {PAM_HEADER_MAXVAL, "MAXVAL"}, + {PAM_HEADER_TUPLTYPE, "TUPLTYPE"}, +}; +#define PAM_FIELDS_NO (sizeof (fields) / sizeof ((fields)[0])) + +typedef bool (*cvtFunc) (void *src, void *target, int width, int target_channels, + int target_depth); + +struct channel_layout { + uint rchan, gchan, bchan, graychan; +}; + +struct pam_format { + uint fmt; + char name[MAX_PAM_HEADER_VALUE_LENGTH+1]; + cvtFunc cvt_func; + /* the channel layout that should be used when + * imread_ creates a 3 channel or 1 channel image + * used when no conversion function is available + */ + struct channel_layout layout; +}; + +static bool rgb_convert (void *src, void *target, int width, int target_channels, + int target_depth); + +const static struct pam_format formats[] = { + {CV_IMWRITE_PAM_FORMAT_NULL, "", NULL, {0, 0, 0, 0} }, + {CV_IMWRITE_PAM_FORMAT_BLACKANDWHITE, "BLACKANDWHITE", NULL, {0, 0, 0, 0} }, + {CV_IMWRITE_PAM_FORMAT_GRAYSCALE, "GRAYSCALE", NULL, {0, 0, 0, 0} }, + {CV_IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA, "GRAYSCALE_ALPHA", NULL, {0, 0, 0, 0} }, + {CV_IMWRITE_PAM_FORMAT_RGB, "RGB", rgb_convert, {0, 1, 2, 0} }, + {CV_IMWRITE_PAM_FORMAT_RGB_ALPHA, "RGB_ALPHA", NULL, {0, 1, 2, 0} }, +}; +#define PAM_FORMATS_NO (sizeof (fields) / sizeof ((fields)[0])) + +/* + * conversion functions + */ + +static bool +rgb_convert (void *src, void *target, int width, int target_channels, int target_depth) +{ + bool ret = false; + if (target_channels == 3) { + switch (target_depth) { + case CV_8U: + icvCvt_RGB2BGR_8u_C3R( (uchar*) src, 0, (uchar*) target, 0, + cvSize(width,1) ); + ret = true; + break; + case CV_16U: + icvCvt_RGB2BGR_16u_C3R( (ushort *)src, 0, (ushort *)target, 0, + cvSize(width,1) ); + ret = true; + break; + default: + break; + } + } else if (target_channels == 1) { + switch (target_depth) { + case CV_8U: + icvCvt_BGR2Gray_8u_C3C1R( (uchar*) src, 0, (uchar*) target, 0, + cvSize(width,1), 2 ); + ret = true; + break; + case CV_16U: + icvCvt_BGRA2Gray_16u_CnC1R( (ushort *)src, 0, (ushort *)target, 0, + cvSize(width,1), 3, 2 ); + ret = true; + break; + default: + break; + } + } + return ret; +} + +/* + * copy functions used as a fall back for undefined formats + * or simpler conversion options + */ + +static void +basic_conversion (void *src, const struct channel_layout *layout, int src_sampe_size, + int src_width, void *target, int target_channels, int target_depth) +{ + switch (target_depth) { + case CV_8U: + { + uchar *d = (uchar *)target, *s = (uchar *)src, + *end = ((uchar *)src) + src_width; + switch (target_channels) { + case 1: + for( ; s < end; d += 3, s += src_sampe_size ) + d[0] = d[1] = d[2] = s[layout->graychan]; + break; + case 3: + for( ; s < end; d += 3, s += src_sampe_size ) { + d[0] = s[layout->bchan]; + d[1] = s[layout->gchan]; + d[2] = s[layout->rchan]; + } + break; + default: + assert (0); + } + break; + } + case CV_16U: + { + ushort *d = (ushort *)target, *s = (ushort *)src, + *end = ((ushort *)src) + src_width; + switch (target_channels) { + case 1: + for( ; s < end; d += 3, s += src_sampe_size ) + d[0] = d[1] = d[2] = s[layout->graychan]; + break; + case 3: + for( ; s < end; d += 3, s += src_sampe_size ) { + d[0] = s[layout->bchan]; + d[1] = s[layout->gchan]; + d[2] = s[layout->rchan]; + } + break; + default: + assert (0); + } + break; + } + default: + assert (0); + } +} + + +static bool ReadPAMHeaderLine (cv::RLByteStream& strm, + PamHeaderFieldType &fieldtype, + char value[MAX_PAM_HEADER_VALUE_LENGTH+1]) +{ + int code, pos; + bool ident_found = false; + uint i; + char ident[MAX_PAM_HEADER_IDENITFIER_LENGTH+1] = { 0 }; + + do { + code = strm.getByte(); + } while ( isspace(code) ); + + if (code == '#') { + /* we are in a comment, eat characters until linebreak */ + do + { + code = strm.getByte(); + } while( code != '\n' && code != '\r' ); + fieldtype = PAM_HEADER_COMMENT; + return true; + } else if (code == '\n' || code == '\r' ) { + fieldtype = PAM_HEADER_NONE; + return true; + } + + /* nul-ify buffers before writing to them */ + memset (ident, '\0', sizeof(char) * MAX_PAM_HEADER_IDENITFIER_LENGTH); + for (i=0; i= 0 && isspace(value[pos])) + value[pos--] = '\0'; + + return true; +} + +static bool ParseNumber (char *str, int *retval) +{ + char *endptr; + long lval = strtol (str, &endptr, 0); + + if ((errno == ERANGE && (lval == LONG_MAX || lval == LONG_MIN)) + || (errno != 0 && lval == 0)) { + return false; + } + if (endptr == str) { + return false; + } + + *retval = (int) lval; + + return true; +} + +namespace cv +{ + +PAMDecoder::PAMDecoder() +{ + m_offset = -1; + m_buf_supported = true; + bit_mode = false; + selected_fmt = CV_IMWRITE_PAM_FORMAT_NULL; +} + + +PAMDecoder::~PAMDecoder() +{ + m_strm.close(); +} + +size_t PAMDecoder::signatureLength() const +{ + return 3; +} + +bool PAMDecoder::checkSignature( const String& signature ) const +{ + return signature.size() >= 3 && signature[0] == 'P' && + signature[1] == '7' && + isspace(signature[2]); +} + +ImageDecoder PAMDecoder::newDecoder() const +{ + return makePtr(); +} + +struct parsed_fields +{ + bool endhdr, height, width, depth, maxval; +}; + +#define HEADER_READ_CORRECT(pf) (pf.endhdr && pf.height && pf.width \ + && pf.depth && pf.maxval) + + +bool PAMDecoder::readHeader() +{ + PamHeaderFieldType fieldtype = PAM_HEADER_NONE; + char value[MAX_PAM_HEADER_VALUE_LENGTH+1]; + int byte; + struct parsed_fields flds; + if( !m_buf.empty() ) + { + if( !m_strm.open(m_buf) ) + return false; + } + else if( !m_strm.open( m_filename )) + return false; + try + { + byte = m_strm.getByte(); + if( byte != 'P' ) + throw RBS_BAD_HEADER; + + byte = m_strm.getByte(); + if (byte != '7') + throw RBS_BAD_HEADER; + + byte = m_strm.getByte(); + if (byte != '\n' && byte != '\r') + throw RBS_BAD_HEADER; + + uint i; + memset (&flds, 0x00, sizeof (struct parsed_fields)); + do { + if (!ReadPAMHeaderLine(m_strm, fieldtype, value)) + throw RBS_BAD_HEADER; + switch (fieldtype) { + case PAM_HEADER_NONE: + case PAM_HEADER_COMMENT: + continue; + case PAM_HEADER_ENDHDR: + flds.endhdr = true; + break; + case PAM_HEADER_HEIGHT: + if (flds.height) + throw RBS_BAD_HEADER; + if (!ParseNumber (value, &m_height)) + throw RBS_BAD_HEADER; + flds.height = true; + break; + case PAM_HEADER_WIDTH: + if (flds.width) + throw RBS_BAD_HEADER; + if (!ParseNumber (value, &m_width)) + throw RBS_BAD_HEADER; + flds.width = true; + break; + case PAM_HEADER_DEPTH: + if (flds.depth) + throw RBS_BAD_HEADER; + if (!ParseNumber (value, &m_channels)) + throw RBS_BAD_HEADER; + flds.depth = true; + break; + case PAM_HEADER_MAXVAL: + if (flds.maxval) + throw RBS_BAD_HEADER; + if (!ParseNumber (value, &m_maxval)) + throw RBS_BAD_HEADER; + if ( m_maxval > 65535 ) + throw RBS_BAD_HEADER; + if ( m_maxval > 255 ) { + m_sampledepth = CV_16U; + } + else + m_sampledepth = CV_8U; + if (m_maxval == 1) + bit_mode = true; + flds.maxval = true; + break; + case PAM_HEADER_TUPLTYPE: + for (i=0; i _src(src_elems_per_row * 2); + uchar* src = _src; + AutoBuffer _gray_palette; + uchar* gray_palette = _gray_palette; + + if( m_offset < 0 || !m_strm.isOpened()) + return false; + + if (selected_fmt != CV_IMWRITE_PAM_FORMAT_NULL) + fmt = &formats[selected_fmt]; + else { + /* default layout handling */ + if (m_channels >= 3) { + layout.bchan = 0; + layout.gchan = 1; + layout.rchan = 2; + } else + layout.bchan = layout.gchan = layout.rchan = 0; + layout.graychan = 0; + } + + try + { + m_strm.setPos( m_offset ); + + /* the case where data fits the opencv matrix */ + if (m_sampledepth == img.depth() && target_channels == m_channels && !bit_mode) { + /* special case for 16bit images with wrong endianess */ + if (m_sampledepth == CV_16U && !isBigEndian()) + { + for (y = 0; y < m_height; y++, data += imp_stride ) + { + m_strm.getBytes( src, src_stride ); + for( x = 0; x < src_elems_per_row; x++ ) + { + uchar v = src[x * 2]; + data[x * 2] = src[x * 2 + 1]; + data[x * 2 + 1] = v; + } + } + } + else { + m_strm.getBytes( data, src_stride * m_height ); + } + + } + else { + /* black and white mode */ + if (bit_mode) { + if( target_channels == 1 ) + { + _gray_palette.allocate(2); + gray_palette = _gray_palette; + gray_palette[0] = 0; + gray_palette[1] = 255; + for( y = 0; y < m_height; y++, data += imp_stride ) + { + m_strm.getBytes( src, src_stride ); + FillGrayRow1( data, src, m_width, gray_palette ); + } + } else if ( target_channels == 3 ) + { + FillGrayPalette( palette, 1 , false ); + for( y = 0; y < m_height; y++, data += imp_stride ) + { + m_strm.getBytes( src, src_stride ); + FillColorRow1( data, src, m_width, palette ); + } + } + } else { + for (y = 0; y < m_height; y++, data += imp_stride ) + { + m_strm.getBytes( src, src_stride ); + + /* endianess correction */ + if( m_sampledepth == CV_16U && !isBigEndian() ) + { + for( x = 0; x < src_elems_per_row; x++ ) + { + uchar v = src[x * 2]; + src[x * 2] = src[x * 2 + 1]; + src[x * 2 + 1] = v; + } + } + + /* scale down */ + if( img.depth() == CV_8U && m_sampledepth == CV_16U ) + { + for( x = 0; x < src_elems_per_row; x++ ) + { + int v = ((ushort *)src)[x]; + src[x] = (uchar)(v >> 8); + } + } + + /* if we are only scaling up/down then we can then copy the data */ + if (target_channels == m_channels) { + memcpy (data, src, imp_stride); + } + /* perform correct conversion based on format */ + else if (fmt) { + funcout = false; + if (fmt->cvt_func) + funcout = fmt->cvt_func (src, data, m_width, target_channels, + img.depth()); + /* fall back to default if there is no conversion function or it + * can't handle the specified characteristics + */ + if (!funcout) + basic_conversion (src, &fmt->layout, m_channels, + m_width, data, target_channels, img.depth()); + + /* default to selecting the first available channels */ + } else { + basic_conversion (src, &layout, m_channels, + m_width, data, target_channels, img.depth()); + } + } + } + } + + res = true; + } catch(...) + { + } + + return res; +} + + +////////////////////////////////////////////////////////////////////////////////////////// + +PAMEncoder::PAMEncoder() +{ + m_description = "Portable arbitrary format (*.pam)"; + m_buf_supported = true; +} + + +PAMEncoder::~PAMEncoder() +{ +} + + +ImageEncoder PAMEncoder::newEncoder() const +{ + return makePtr(); +} + + +bool PAMEncoder::isFormatSupported( int depth ) const +{ + return depth == CV_8U || depth == CV_16U; +} + + +bool PAMEncoder::write( const Mat& img, const std::vector& params ) +{ + + WLByteStream strm; + + int width = img.cols, height = img.rows; + int stride = width*(int)img.elemSize(); + const uchar* data = img.ptr(); + const struct pam_format *fmt = NULL; + int x, y, tmp, bufsize = 256; + + /* parse save file type */ + for( size_t i = 0; i < params.size(); i += 2 ) + if( params[i] == CV_IMWRITE_PAM_TUPLETYPE ) { + if ( params[i+1] > CV_IMWRITE_PAM_FORMAT_NULL && + params[i+1] < (int) PAM_FORMATS_NO) + fmt = &formats[params[i+1]]; + } + + if( m_buf ) + { + if( !strm.open(*m_buf) ) + return false; + m_buf->reserve( alignSize(256 + stride*height, 256)); + } + else if( !strm.open(m_filename) ) + return false; + + tmp = width * (int)img.elemSize(); + + if (bufsize < tmp) + bufsize = tmp; + + AutoBuffer _buffer(bufsize); + char* buffer = _buffer; + + /* write header */ + tmp = 0; + tmp += sprintf( buffer, "P7\n"); + tmp += sprintf( buffer + tmp, "WIDTH %d\n", width); + tmp += sprintf( buffer + tmp, "HEIGHT %d\n", height); + tmp += sprintf( buffer + tmp, "DEPTH %d\n", img.channels()); + tmp += sprintf( buffer + tmp, "MAXVAL %d\n", (1 << img.elemSize1()*8) - 1); + if (fmt) + tmp += sprintf( buffer + tmp, "TUPLTYPE %s\n", fmt->name ); + tmp += sprintf( buffer + tmp, "ENDHDR\n" ); + + strm.putBytes( buffer, (int)strlen(buffer) ); + /* write data */ + if (img.depth() == CV_8U) + strm.putBytes( data, stride*height ); + else if (img.depth() == CV_16U) { + /* fix endianess */ + if (!isBigEndian()) { + for( y = 0; y < height; y++ ) { + memcpy( buffer, img.ptr(y), stride ); + for( x = 0; x < stride; x += 2 ) + { + uchar v = buffer[x]; + buffer[x] = buffer[x + 1]; + buffer[x + 1] = v; + } + strm.putBytes( buffer, stride ); + } + } else + strm.putBytes( data, stride*height ); + } else + assert (0); + + strm.close(); + return true; +} + +} diff --git a/modules/imgcodecs/src/grfmt_pam.hpp b/modules/imgcodecs/src/grfmt_pam.hpp new file mode 100644 index 0000000000..8b3b1f10c9 --- /dev/null +++ b/modules/imgcodecs/src/grfmt_pam.hpp @@ -0,0 +1,99 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// (3-clause BSD License) +// +// Copyright (C) 2000-2016, Intel Corporation, all rights reserved. +// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. +// Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved. +// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. +// Copyright (C) 2015-2016, OpenCV Foundation, all rights reserved. +// Copyright (C) 2015-2016, Itseez Inc., all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * Neither the names of the copyright holders nor the names of the contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall copyright holders or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +// +//M*/ + +//Based on "imgcodecs/src/grfmt_pxm.hpp" +//Written by Dimitrios Katsaros + +#ifndef _OPENCV_PAM_HPP_ +#define _OPENCV_PAM_HPP_ + +#include "grfmt_base.hpp" +#include "bitstrm.hpp" + +namespace cv +{ + +class PAMDecoder : public BaseImageDecoder +{ +public: + + PAMDecoder(); + virtual ~PAMDecoder(); + + bool readData( Mat& img ); + bool readHeader(); + + size_t signatureLength() const; + bool checkSignature( const String& signature ) const; + ImageDecoder newDecoder() const; + +protected: + + RLByteStream m_strm; + int m_maxval, m_channels, m_sampledepth, m_offset, + selected_fmt; + bool bit_mode; +}; + + +class PAMEncoder : public BaseImageEncoder +{ +public: + PAMEncoder(); + virtual ~PAMEncoder(); + + bool isFormatSupported( int depth ) const; + bool write( const Mat& img, const std::vector& params ); + + ImageEncoder newEncoder() const; +}; + +} + +#endif /* _OPENCV_PAM_HPP_ */ \ No newline at end of file diff --git a/modules/imgcodecs/src/grfmts.hpp b/modules/imgcodecs/src/grfmts.hpp index 7db1ac94a2..10bd88264e 100644 --- a/modules/imgcodecs/src/grfmts.hpp +++ b/modules/imgcodecs/src/grfmts.hpp @@ -55,5 +55,6 @@ #include "grfmt_hdr.hpp" #include "grfmt_gdal.hpp" #include "grfmt_gdcm.hpp" +#include "grfmt_pam.hpp" #endif/*_GRFMTS_H_*/ diff --git a/modules/imgcodecs/src/ios_conversions.mm b/modules/imgcodecs/src/ios_conversions.mm index 8f2b4e84fc..eed867a790 100644 --- a/modules/imgcodecs/src/ios_conversions.mm +++ b/modules/imgcodecs/src/ios_conversions.mm @@ -100,12 +100,14 @@ void UIImageToMat(const UIImage* image, CGFloat cols = image.size.width, rows = image.size.height; CGContextRef contextRef; CGBitmapInfo bitmapInfo = kCGImageAlphaPremultipliedLast; - if (CGColorSpaceGetModel(colorSpace) == 0) + if (CGColorSpaceGetModel(colorSpace) == kCGColorSpaceModelMonochrome) { m.create(rows, cols, CV_8UC1); // 8 bits per component, 1 channel bitmapInfo = kCGImageAlphaNone; if (!alphaExist) bitmapInfo = kCGImageAlphaNone; + else + m = cv::Scalar(0); contextRef = CGBitmapContextCreate(m.data, m.cols, m.rows, 8, m.step[0], colorSpace, bitmapInfo); @@ -116,6 +118,8 @@ void UIImageToMat(const UIImage* image, if (!alphaExist) bitmapInfo = kCGImageAlphaNoneSkipLast | kCGBitmapByteOrderDefault; + else + m = cv::Scalar(0); contextRef = CGBitmapContextCreate(m.data, m.cols, m.rows, 8, m.step[0], colorSpace, bitmapInfo); diff --git a/modules/imgcodecs/src/loadsave.cpp b/modules/imgcodecs/src/loadsave.cpp index 1c0b794b8e..6cd3106583 100644 --- a/modules/imgcodecs/src/loadsave.cpp +++ b/modules/imgcodecs/src/loadsave.cpp @@ -109,6 +109,8 @@ struct ImageCodecInitializer /// Attach the GDAL Decoder decoders.push_back( makePtr() ); #endif/*HAVE_GDAL*/ + decoders.push_back( makePtr() ); + encoders.push_back( makePtr() ); } std::vector decoders; @@ -514,8 +516,14 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 ) if( !decoder->readHeader() ) { - if( !filename.empty() ) - remove(filename.c_str()); + decoder.release(); + if ( !filename.empty() ) + { + if ( remove(filename.c_str()) != 0 ) + { + CV_Error( CV_StsError, "unable to remove temporary file" ); + } + } return 0; } @@ -556,8 +564,14 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 ) } bool code = decoder->readData( *data ); - if( !filename.empty() ) - remove(filename.c_str()); + decoder.release(); + if ( !filename.empty() ) + { + if ( remove(filename.c_str()) != 0 ) + { + CV_Error( CV_StsError, "unable to remove temporary file" ); + } + } if( !code ) { diff --git a/modules/imgcodecs/src/precomp.hpp b/modules/imgcodecs/src/precomp.hpp index 101f01577c..6a16ca865a 100644 --- a/modules/imgcodecs/src/precomp.hpp +++ b/modules/imgcodecs/src/precomp.hpp @@ -59,14 +59,6 @@ #include #if defined WIN32 || defined WINCE - #if !defined _WIN32_WINNT - #ifdef HAVE_MSMF - #define _WIN32_WINNT 0x0600 // Windows Vista - #else - #define _WIN32_WINNT 0x0500 // Windows 2000 - #endif - #endif - #include #undef small #undef min diff --git a/modules/imgcodecs/test/test_grfmt.cpp b/modules/imgcodecs/test/test_grfmt.cpp index f305ca137a..faca3d7528 100644 --- a/modules/imgcodecs/test/test_grfmt.cpp +++ b/modules/imgcodecs/test/test_grfmt.cpp @@ -44,6 +44,7 @@ #include #include +#include using namespace cv; using namespace std; @@ -92,6 +93,12 @@ TEST(Imgcodecs_imread, regression) { #ifdef HAVE_JASPER "Rome.jp2", +#endif +#ifdef HAVE_GDCM + "int16-mono1.dcm", + "uint8-mono2.dcm", + "uint16-mono2.dcm", + "uint8-rgb.dcm", #endif "color_palette_alpha.png", "multipage.tif", @@ -111,9 +118,10 @@ TEST(Imgcodecs_imread, regression) ASSERT_TRUE(imread_compare(path, IMREAD_COLOR)); ASSERT_TRUE(imread_compare(path, IMREAD_ANYDEPTH)); ASSERT_TRUE(imread_compare(path, IMREAD_ANYCOLOR)); - if (path.substr(path.length() - 3) != "hdr") + const string ext = path.substr( path.length() - 3 ); + if ( ext != "hdr" && ext != "dcm" ) { - // GDAL does not support hdr + // GDAL does not support hdr nor dcm ASSERT_TRUE(imread_compare(path, IMREAD_LOAD_GDAL)); } } @@ -308,6 +316,7 @@ string ext_from_int(int ext) #ifdef HAVE_TIFF if (ext == 3) return ".tiff"; #endif + if (ext == 4) return ".pam"; return ""; } @@ -323,7 +332,7 @@ public: for (int k = 1; k <= 5; ++k) { - for (int ext = 0; ext < 4; ++ext) // 0 - png, 1 - bmp, 2 - pgm, 3 - tiff + for (int ext = 0; ext < 5; ++ext) // 0 - png, 1 - bmp, 2 - pgm, 3 - tiff { if(ext_from_int(ext).empty()) continue; @@ -890,6 +899,19 @@ TEST(Imgcodecs_Tiff, decode_multipage) CV_GrfmtReadTifMultiPage test; test.safe_run(); } +TEST(Imgcodecs_Tiff, imdecode_no_exception_temporary_file_removed) +{ + cvtest::TS& ts = *cvtest::TS::ptr(); + string input = string(ts.get_data_path()) + "../cv/shared/lena.png"; + cv::Mat img = cv::imread(input); + ASSERT_FALSE(img.empty()); + + std::vector buf; + EXPECT_NO_THROW(cv::imencode(".tiff", img, buf)); + + EXPECT_NO_THROW(cv::imdecode(buf, IMREAD_UNCHANGED)); +} + #endif #ifdef HAVE_WEBP @@ -1017,3 +1039,27 @@ TEST(Imgcodecs_Hdr, regression) ASSERT_FALSE(max > DBL_EPSILON); } } + +TEST(Imgcodecs_Pam, readwrite) +{ + string folder = string(cvtest::TS::ptr()->get_data_path()) + "readwrite/"; + string filepath = folder + "lena.pam"; + + cv::Mat img = cv::imread(filepath); + ASSERT_FALSE(img.empty()); + + std::vector params; + params.push_back(IMWRITE_PAM_TUPLETYPE); + params.push_back(IMWRITE_PAM_FORMAT_RGB); + + string writefile = cv::tempfile(".pam"); + EXPECT_NO_THROW(cv::imwrite(writefile, img, params)); + cv::Mat reread = cv::imread(writefile); + + string writefile_no_param = cv::tempfile(".pam"); + EXPECT_NO_THROW(cv::imwrite(writefile_no_param, img)); + cv::Mat reread_no_param = cv::imread(writefile_no_param); + + EXPECT_EQ(0, cvtest::norm(reread, reread_no_param, NORM_INF)); + EXPECT_EQ(0, cvtest::norm(img, reread, NORM_INF)); +} diff --git a/modules/imgproc/doc/pics/polar_remap_doc.png b/modules/imgproc/doc/pics/polar_remap_doc.png new file mode 100644 index 0000000000..e3e4105bb8 Binary files /dev/null and b/modules/imgproc/doc/pics/polar_remap_doc.png differ diff --git a/modules/imgproc/doc/pics/polar_remap_doc.svg b/modules/imgproc/doc/pics/polar_remap_doc.svg new file mode 100644 index 0000000000..544221569d --- /dev/null +++ b/modules/imgproc/doc/pics/polar_remap_doc.svg @@ -0,0 +1,3776 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + maxRadius + angle° + magnitude + + + + + + dx + dy + centerC(xc , yc) + A(xA , yA) + + BOUNDING CIRCLE + + + + + + a) Source Image + + Ï: 0 .. Kx * maxRadius = src.cols + centerC(0,0) + + + centerC(0,0) + + ÏA = Kx * magnitude + + Ï•A = Ky * angle° + + A(ÏA , Ï•A) + if 2 * maxRadius > min(srcSize)CV_WARP_FILL_OUTLIERS + + + M = src.cols / loge(maxRadius)Ky = src.rows / 360.0 + + Blue cross in the center + + + if 2 * maxRadius > min(srcSize)CV_WARP_FILL_OUTLIERS + Blue cross in the center + + + + c) linearPolar Result Image + + d) logPolar Result Image + + + + + + Ï•A = Ky * angle° + + A(ÏA , Ï•A) + + + Kx = src.cols / maxRadiusKy = src.rows / 360.0 + + Ï: 0 .. M * loge(maxRadius) = src.cols + + Ï•: 0 .. Ky * 360 = src.rows + + ÏA = M * loge(magnitude ) + + + + + + + + + + + + + + + + + + 270 + 240 + 210 + 180 + 150 + 120 + 90 + 60 + 30 + 300 + 330 + 0 + + + + + + + + + + + Size: W:600 H:440 pxCenter = x:240, y:220magnitude=100pxangle = 60degmaxRadius= 230px + Kx = 600px / 230px = 2.609 => rho = 260.869pxKy = 440px / 360deg = 1.222 pix/deg = phi = 73.333pxM = 600px / ln(230px) = 110.33 pn/ln(px) => rho = 508.103px + + + b) Params References + + + + + image/svg+xml + + + + + OpenCV + + + + 2016-08-08 + + + + + PkLab.net + + + + + linearPolar + logPolar + image processing + OpenCV + + + + + + + + + + + diff --git a/modules/imgproc/include/opencv2/imgproc.hpp b/modules/imgproc/include/opencv2/imgproc.hpp index ee022476f0..279bb6d9be 100644 --- a/modules/imgproc/include/opencv2/imgproc.hpp +++ b/modules/imgproc/include/opencv2/imgproc.hpp @@ -284,9 +284,9 @@ enum InterpolationFlags{ WARP_FILL_OUTLIERS = 8, /** flag, inverse transformation - For example, polar transforms: - - flag is __not__ set: \f$dst( \phi , \rho ) = src(x,y)\f$ - - flag is set: \f$dst(x,y) = src( \phi , \rho )\f$ + For example, @ref cv::linearPolar or @ref cv::logPolar transforms: + - flag is __not__ set: \f$dst( \rho , \phi ) = src(x,y)\f$ + - flag is set: \f$dst(x,y) = src( \rho , \phi )\f$ */ WARP_INVERSE_MAP = 16 }; @@ -413,6 +413,13 @@ enum ConnectedComponentsTypes { CC_STAT_MAX = 5 }; +//! connected components algorithm +enum ConnectedComponentsAlgorithmsTypes { + CCL_WU = 0, //!< SAUF algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity + CCL_DEFAULT = -1, //!< BBDT algortihm for 8-way connectivity, SAUF algorithm for 4-way connectivity + CCL_GRANA = 1 //!< BBDT algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity +}; + //! mode of the contour retrieval algorithm enum RetrievalModes { /** retrieves only the extreme outer contours. It sets `hierarchy[i][2]=hierarchy[i][3]=-1` for @@ -2289,13 +2296,13 @@ The function converts a pair of maps for remap from one representation to anothe options ( (map1.type(), map2.type()) \f$\rightarrow\f$ (dstmap1.type(), dstmap2.type()) ) are supported: -- \f$\texttt{(CV\_32FC1, CV\_32FC1)} \rightarrow \texttt{(CV\_16SC2, CV\_16UC1)}\f$. This is the +- \f$\texttt{(CV_32FC1, CV_32FC1)} \rightarrow \texttt{(CV_16SC2, CV_16UC1)}\f$. This is the most frequently used conversion operation, in which the original floating-point maps (see remap ) are converted to a more compact and much faster fixed-point representation. The first output array contains the rounded coordinates and the second array (created only when nninterpolation=false ) contains indices in the interpolation tables. -- \f$\texttt{(CV\_32FC2)} \rightarrow \texttt{(CV\_16SC2, CV\_16UC1)}\f$. The same as above but +- \f$\texttt{(CV_32FC2)} \rightarrow \texttt{(CV_16SC2, CV_16UC1)}\f$. The same as above but the original maps are stored in one 2-channel matrix. - Reverse conversion. Obviously, the reconstructed floating-point maps will not be exactly the same @@ -2345,7 +2352,7 @@ CV_EXPORTS Mat getPerspectiveTransform( const Point2f src[], const Point2f dst[] The function calculates the \f$2 \times 3\f$ matrix of an affine transform so that: -\f[\begin{bmatrix} x'_i \\ y'_i \end{bmatrix} = \texttt{map\_matrix} \cdot \begin{bmatrix} x_i \\ y_i \\ 1 \end{bmatrix}\f] +\f[\begin{bmatrix} x'_i \\ y'_i \end{bmatrix} = \texttt{map_matrix} \cdot \begin{bmatrix} x_i \\ y_i \\ 1 \end{bmatrix}\f] where @@ -2375,7 +2382,7 @@ CV_EXPORTS_W void invertAffineTransform( InputArray M, OutputArray iM ); The function calculates the \f$3 \times 3\f$ matrix of a perspective transform so that: -\f[\begin{bmatrix} t_i x'_i \\ t_i y'_i \\ t_i \end{bmatrix} = \texttt{map\_matrix} \cdot \begin{bmatrix} x_i \\ y_i \\ 1 \end{bmatrix}\f] +\f[\begin{bmatrix} t_i x'_i \\ t_i y'_i \\ t_i \end{bmatrix} = \texttt{map_matrix} \cdot \begin{bmatrix} x_i \\ y_i \\ 1 \end{bmatrix}\f] where @@ -2418,41 +2425,78 @@ CV_EXPORTS_W void getRectSubPix( InputArray image, Size patchSize, An example using the cv::linearPolar and cv::logPolar operations */ -/** @brief Remaps an image to log-polar space. +/** @brief Remaps an image to semilog-polar coordinates space. + +Transform the source image using the following transformation (See @ref polar_remaps_reference_image "Polar remaps reference image"): +\f[\begin{array}{l} + dst( \rho , \phi ) = src(x,y) \\ + dst.size() \leftarrow src.size() +\end{array}\f] -transforms the source image using the following transformation: -\f[dst( \phi , \rho ) = src(x,y)\f] where -\f[\rho = M \cdot \log{\sqrt{x^2 + y^2}} , \phi =atan(y/x)\f] +\f[\begin{array}{l} + I = (dx,dy) = (x - center.x,y - center.y) \\ + \rho = M \cdot log_e(\texttt{magnitude} (I)) ,\\ + \phi = Ky \cdot \texttt{angle} (I)_{0..360 deg} \\ +\end{array}\f] + +and +\f[\begin{array}{l} + M = src.cols / log_e(maxRadius) \\ + Ky = src.rows / 360 \\ +\end{array}\f] The function emulates the human "foveal" vision and can be used for fast scale and -rotation-invariant template matching, for object tracking and so forth. The function can not operate -in-place. - +rotation-invariant template matching, for object tracking and so forth. @param src Source image -@param dst Destination image +@param dst Destination image. It will have same size and type as src. @param center The transformation center; where the output precision is maximal -@param M Magnitude scale parameter. +@param M Magnitude scale parameter. It determines the radius of the bounding circle to transform too. @param flags A combination of interpolation methods, see cv::InterpolationFlags - */ + +@note +- The function can not operate in-place. +- To calculate magnitude and angle in degrees @ref cv::cartToPolar is used internally thus angles are measured from 0 to 360 with accuracy about 0.3 degrees. +*/ CV_EXPORTS_W void logPolar( InputArray src, OutputArray dst, Point2f center, double M, int flags ); -/** @brief Remaps an image to polar space. +/** @brief Remaps an image to polar coordinates space. + +@anchor polar_remaps_reference_image +![Polar remaps reference](pics/polar_remap_doc.png) + +Transform the source image using the following transformation: +\f[\begin{array}{l} + dst( \rho , \phi ) = src(x,y) \\ + dst.size() \leftarrow src.size() +\end{array}\f] -transforms the source image using the following transformation: -\f[dst( \phi , \rho ) = src(x,y)\f] where -\f[\rho = (src.width/maxRadius) \cdot \sqrt{x^2 + y^2} , \phi =atan(y/x)\f] +\f[\begin{array}{l} + I = (dx,dy) = (x - center.x,y - center.y) \\ + \rho = Kx \cdot \texttt{magnitude} (I) ,\\ + \phi = Ky \cdot \texttt{angle} (I)_{0..360 deg} +\end{array}\f] + +and +\f[\begin{array}{l} + Kx = src.cols / maxRadius \\ + Ky = src.rows / 360 +\end{array}\f] -The function can not operate in-place. @param src Source image -@param dst Destination image +@param dst Destination image. It will have same size and type as src. @param center The transformation center; -@param maxRadius Inverse magnitude scale parameter +@param maxRadius The radius of the bounding circle to transform. It determines the inverse magnitude scale parameter too. @param flags A combination of interpolation methods, see cv::InterpolationFlags - */ + +@note +- The function can not operate in-place. +- To calculate magnitude and angle in degrees @ref cv::cartToPolar is used internally thus angles are measured from 0 to 360 with accuracy about 0.3 degrees. + +*/ CV_EXPORTS_W void linearPolar( InputArray src, OutputArray dst, Point2f center, double maxRadius, int flags ); @@ -2470,7 +2514,7 @@ CV_EXPORTS_AS(integral2) void integral( InputArray src, OutputArray sum, /** @brief Calculates the integral of an image. -The functions calculate one or more integral images for the source image as follows: +The function calculates one or more integral images for the source image as follows: \f[\texttt{sum} (X,Y) = \sum _{x @@ -3817,7 +3907,7 @@ An example using the convexHull functionality /** @brief Finds the convex hull of a point set. -The functions find the convex hull of a 2D point set using the Sklansky's algorithm @cite Sklansky82 +The function cv::convexHull finds the convex hull of a 2D point set using the Sklansky's algorithm @cite Sklansky82 that has *O(N logN)* complexity in the current implementation. See the OpenCV sample convexhull.cpp that demonstrates the usage of different function variants. @@ -4086,7 +4176,7 @@ CV_EXPORTS_W void circle(InputOutputArray img, Point center, int radius, /** @brief Draws a simple or thick elliptic arc or fills an ellipse sector. -The functions ellipse with less parameters draw an ellipse outline, a filled ellipse, an elliptic +The function cv::ellipse with less parameters draws an ellipse outline, a filled ellipse, an elliptic arc, or a filled ellipse sector. A piecewise-linear curve is used to approximate the elliptic arc boundary. If you need more control of the ellipse rendering, you can retrieve the curve using ellipse2Poly and then render it with polylines or fill it with fillPoly . If you use the first @@ -4307,9 +4397,9 @@ CV_EXPORTS_W void drawContours( InputOutputArray image, InputArrayOfArrays conto /** @brief Clips the line against the image rectangle. -The functions clipLine calculate a part of the line segment that is entirely within the specified -rectangle. They return false if the line segment is completely outside the rectangle. Otherwise, -they return true . +The function cv::clipLine calculates a part of the line segment that is entirely within the specified +rectangle. it returns false if the line segment is completely outside the rectangle. Otherwise, +it returns true . @param imgSize Image size. The image rectangle is Rect(0, 0, imgSize.width, imgSize.height) . @param pt1 First line point. @param pt2 Second line point. diff --git a/modules/imgproc/include/opencv2/imgproc/hal/hal.hpp b/modules/imgproc/include/opencv2/imgproc/hal/hal.hpp index 0943a2dfa2..23ed10c88d 100644 --- a/modules/imgproc/include/opencv2/imgproc/hal/hal.hpp +++ b/modules/imgproc/include/opencv2/imgproc/hal/hal.hpp @@ -30,10 +30,8 @@ struct CV_EXPORTS Filter2D struct CV_EXPORTS SepFilter2D { static Ptr create(int stype, int dtype, int ktype, - uchar * kernelx_data, size_t kernelx_step, - int kernelx_width, int kernelx_height, - uchar * kernely_data, size_t kernely_step, - int kernely_width, int kernely_height, + uchar * kernelx_data, int kernelx_len, + uchar * kernely_data, int kernely_len, int anchor_x, int anchor_y, double delta, int borderType); virtual void apply(uchar * src_data, size_t src_step, diff --git a/modules/imgproc/perf/opencl/perf_imgproc.cpp b/modules/imgproc/perf/opencl/perf_imgproc.cpp index f441bd9b32..6d9b1a0287 100644 --- a/modules/imgproc/perf/opencl/perf_imgproc.cpp +++ b/modules/imgproc/perf/opencl/perf_imgproc.cpp @@ -299,33 +299,30 @@ OCL_PERF_TEST_P(CLAHEFixture, CLAHE, OCL_TEST_SIZES) ///////////// Canny //////////////////////// -typedef tuple CannyParams; +typedef tuple CannyParams; typedef TestBaseWithParam CannyFixture; -OCL_PERF_TEST_P(CannyFixture, Canny, ::testing::Combine(OCL_PERF_ENUM(3, 5), Bool())) +OCL_PERF_TEST_P(CannyFixture, Canny, ::testing::Combine(OCL_TEST_SIZES, OCL_PERF_ENUM(3, 5), Bool())) { - const CannyParams params = GetParam(); - int apertureSize = get<0>(params); - bool L2Grad = get<1>(params); + const CannyParams& params = GetParam(); + cv::Size imgSize = get<0>(params); + int apertureSize = get<1>(params); + bool L2Grad = get<2>(params); Mat _img = imread(getDataPath("gpu/stereobm/aloe-L.png"), cv::IMREAD_GRAYSCALE); ASSERT_TRUE(!_img.empty()) << "can't open aloe-L.png"; UMat img; - _img.copyTo(img); + cv::resize(_img, img, imgSize); UMat edges(img.size(), CV_8UC1); - declare.in(img, WARMUP_RNG).out(edges); + declare.in(img).out(edges); OCL_TEST_CYCLE() cv::Canny(img, edges, 50.0, 100.0, apertureSize, L2Grad); - if (apertureSize == 3) - SANITY_CHECK(edges); - else - SANITY_CHECK_NOTHING(); + SANITY_CHECK_NOTHING(); } - } } // namespace cvtest::ocl #endif // HAVE_OPENCL diff --git a/modules/imgproc/perf/perf_blur.cpp b/modules/imgproc/perf/perf_blur.cpp index 58a0c7cbab..2a284dc5b9 100644 --- a/modules/imgproc/perf/perf_blur.cpp +++ b/modules/imgproc/perf/perf_blur.cpp @@ -100,9 +100,7 @@ PERF_TEST_P(Size_MatType_BorderType, blur16x16, BorderType btype = get<2>(GetParam()); double eps = 1e-3; -#if CV_NEON eps = CV_MAT_DEPTH(type) <= CV_32S ? 1 : eps; -#endif Mat src(size, type); Mat dst(size, type); diff --git a/modules/imgproc/perf/perf_houghLines.cpp b/modules/imgproc/perf/perf_houghLines.cpp index 6dfaa56aa3..a6ab50e644 100644 --- a/modules/imgproc/perf/perf_houghLines.cpp +++ b/modules/imgproc/perf/perf_houghLines.cpp @@ -37,7 +37,7 @@ PERF_TEST_P(Image_RhoStep_ThetaStep_Threshold, HoughLines, TEST_CYCLE() HoughLines(image, lines, rhoStep, thetaStep, threshold); transpose(lines, lines); -#if (0 && defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 810) +#if (0 && defined(HAVE_IPP) && IPP_VERSION_X100 >= 810) SANITY_CHECK_NOTHING(); #else SANITY_CHECK(lines); diff --git a/modules/imgproc/src/accum.cpp b/modules/imgproc/src/accum.cpp index e1f1ce71e8..eaf85a2654 100644 --- a/modules/imgproc/src/accum.cpp +++ b/modules/imgproc/src/accum.cpp @@ -43,6 +43,7 @@ #include "precomp.hpp" #include "opencl_kernels_imgproc.hpp" +#include "opencv2/core/hal/intrin.hpp" namespace cv { @@ -394,7 +395,7 @@ struct AccW_SIMD return x; } }; -#elif CV_SSE2 +#elif CV_SIMD128 template <> struct Acc_SIMD { @@ -407,8 +408,8 @@ struct Acc_SIMD len *= cn; for ( ; x <= len - 8; x += 8) { - _mm_storeu_ps(dst + x, _mm_add_ps(_mm_loadu_ps(dst + x), _mm_loadu_ps(src + x))); - _mm_storeu_ps(dst + x + 4, _mm_add_ps(_mm_loadu_ps(dst + x + 4), _mm_loadu_ps(src + x + 4))); + v_store(dst + x, v_load(dst + x) + v_load(src + x)); + v_store(dst + x + 4, v_load(dst + x + 4) + v_load(src + x + 4)); } } @@ -416,6 +417,7 @@ struct Acc_SIMD } }; +#if CV_SIMD128_64F template <> struct Acc_SIMD { @@ -428,17 +430,12 @@ struct Acc_SIMD len *= cn; for ( ; x <= len - 4; x += 4) { - __m128 v_src = _mm_loadu_ps(src + x); - __m128d v_src0 = _mm_cvtps_pd(v_src); - __m128d v_src1 = _mm_cvtps_pd(_mm_shuffle_ps(v_src, v_src, _MM_SHUFFLE(1, 0, 3, 2))); + v_float32x4 v_src = v_load(src + x); + v_float64x2 v_src0 = v_cvt_f64(v_src); + v_float64x2 v_src1 = v_cvt_f64_high(v_src); - __m128d v_dst0 = _mm_loadu_pd(dst + x); - __m128d v_dst1 = _mm_loadu_pd(dst + x + 2); - - v_dst0 = _mm_add_pd(v_dst0, v_src0); - v_dst1 = _mm_add_pd(v_dst1, v_src1); - _mm_storeu_pd(dst + x, v_dst0); - _mm_storeu_pd(dst + x + 2, v_dst1); + v_store(dst + x, v_load(dst + x) + v_src0); + v_store(dst + x + 2, v_load(dst + x + 2) + v_src1); } } return x; @@ -457,21 +454,17 @@ struct Acc_SIMD len *= cn; for ( ; x <= len - 4; x += 4) { - __m128d v_src0 = _mm_loadu_pd(src + x); - __m128d v_src1 = _mm_loadu_pd(src + x + 2); + v_float64x2 v_src0 = v_load(src + x); + v_float64x2 v_src1 = v_load(src + x + 2); - __m128d v_dst0 = _mm_loadu_pd(dst + x); - __m128d v_dst1 = _mm_loadu_pd(dst + x + 2); - - v_dst0 = _mm_add_pd(v_dst0, v_src0); - v_dst1 = _mm_add_pd(v_dst1, v_src1); - _mm_storeu_pd(dst + x, v_dst0); - _mm_storeu_pd(dst + x + 2, v_dst1); + v_store(dst + x, v_load(dst + x) + v_src0); + v_store(dst + x + 2, v_load(dst + x + 2) + v_src1); } } return x; } }; +#endif //CV_SIMD128_64F template <> struct AccSqr_SIMD @@ -485,12 +478,13 @@ struct AccSqr_SIMD len *= cn; for ( ; x <= len - 8; x += 8) { - __m128 v_src0 = _mm_loadu_ps(src + x); - __m128 v_src1 = _mm_loadu_ps(src + x + 4); - v_src0 = _mm_mul_ps(v_src0, v_src0); - v_src1 = _mm_mul_ps(v_src1, v_src1); - _mm_storeu_ps(dst + x, _mm_add_ps(_mm_loadu_ps(dst + x), v_src0)); - _mm_storeu_ps(dst + x + 4, _mm_add_ps(_mm_loadu_ps(dst + x + 4), v_src1)); + v_float32x4 v_src0 = v_load(src + x); + v_float32x4 v_src1 = v_load(src + x + 4); + v_src0 = v_src0 * v_src0; + v_src1 = v_src1 * v_src1; + + v_store(dst + x, v_load(dst + x) + v_src0); + v_store(dst + x + 4, v_load(dst + x + 4) + v_src1); } } @@ -498,6 +492,7 @@ struct AccSqr_SIMD } }; +#if CV_SIMD128_64F template <> struct AccSqr_SIMD { @@ -510,19 +505,14 @@ struct AccSqr_SIMD len *= cn; for ( ; x <= len - 4; x += 4) { - __m128 v_src = _mm_loadu_ps(src + x); - __m128d v_src0 = _mm_cvtps_pd(v_src); - __m128d v_src1 = _mm_cvtps_pd(_mm_shuffle_ps(v_src, v_src, _MM_SHUFFLE(1, 0, 3, 2))); - v_src0 = _mm_mul_pd(v_src0, v_src0); - v_src1 = _mm_mul_pd(v_src1, v_src1); + v_float32x4 v_src = v_load(src + x); + v_float64x2 v_src0 = v_cvt_f64(v_src); + v_float64x2 v_src1 = v_cvt_f64_high(v_src); + v_src0 = v_src0 * v_src0; + v_src1 = v_src1 * v_src1; - __m128d v_dst0 = _mm_loadu_pd(dst + x); - __m128d v_dst1 = _mm_loadu_pd(dst + x + 2); - v_dst0 = _mm_add_pd(v_dst0, v_src0); - v_dst1 = _mm_add_pd(v_dst1, v_src1); - - _mm_storeu_pd(dst + x, v_dst0); - _mm_storeu_pd(dst + x + 2, v_dst1); + v_store(dst + x, v_load(dst + x) + v_src0); + v_store(dst + x + 2, v_load(dst + x + 2) + v_src1); } } return x; @@ -541,23 +531,19 @@ struct AccSqr_SIMD len *= cn; for ( ; x <= len - 4; x += 4) { - __m128d v_src0 = _mm_loadu_pd(src + x); - __m128d v_src1 = _mm_loadu_pd(src + x + 2); - v_src0 = _mm_mul_pd(v_src0, v_src0); - v_src1 = _mm_mul_pd(v_src1, v_src1); + v_float64x2 v_src0 = v_load(src + x); + v_float64x2 v_src1 = v_load(src + x + 2); + v_src0 = v_src0 * v_src0; + v_src1 = v_src1 * v_src1; - __m128d v_dst0 = _mm_loadu_pd(dst + x); - __m128d v_dst1 = _mm_loadu_pd(dst + x + 2); - - v_dst0 = _mm_add_pd(v_dst0, v_src0); - v_dst1 = _mm_add_pd(v_dst1, v_src1); - _mm_storeu_pd(dst + x, v_dst0); - _mm_storeu_pd(dst + x + 2, v_dst1); + v_store(dst + x, v_load(dst + x) + v_src0); + v_store(dst + x + 2, v_load(dst + x + 2) + v_src1); } } return x; } }; +#endif //CV_SIMD128_64F template <> struct AccProd_SIMD @@ -571,8 +557,8 @@ struct AccProd_SIMD len *= cn; for ( ; x <= len - 8; x += 8) { - _mm_storeu_ps(dst + x, _mm_add_ps(_mm_loadu_ps(dst + x), _mm_mul_ps(_mm_loadu_ps(src1 + x), _mm_loadu_ps(src2 + x)))); - _mm_storeu_ps(dst + x + 4, _mm_add_ps(_mm_loadu_ps(dst + x + 4), _mm_mul_ps(_mm_loadu_ps(src1 + x + 4), _mm_loadu_ps(src2 + x + 4)))); + v_store(dst + x, v_load(dst + x) + v_load(src1 + x) * v_load(src2 + x)); + v_store(dst + x + 4, v_load(dst + x + 4) + v_load(src1 + x + 4) * v_load(src2 + x + 4)); } } @@ -580,6 +566,7 @@ struct AccProd_SIMD } }; +#if CV_SIMD128_64F template <> struct AccProd_SIMD { @@ -592,22 +579,16 @@ struct AccProd_SIMD len *= cn; for ( ; x <= len - 4; x += 4) { - __m128 v_1src = _mm_loadu_ps(src1 + x); - __m128 v_2src = _mm_loadu_ps(src2 + x); + v_float32x4 v_1src = v_load(src1 + x); + v_float32x4 v_2src = v_load(src2 + x); - __m128d v_1src0 = _mm_cvtps_pd(v_1src); - __m128d v_1src1 = _mm_cvtps_pd(_mm_shuffle_ps(v_1src, v_1src, _MM_SHUFFLE(0, 0, 3, 2))); - __m128d v_2src0 = _mm_cvtps_pd(v_2src); - __m128d v_2src1 = _mm_cvtps_pd(_mm_shuffle_ps(v_2src, v_2src, _MM_SHUFFLE(0, 0, 3, 2))); + v_float64x2 v_1src0 = v_cvt_f64(v_1src); + v_float64x2 v_1src1 = v_cvt_f64_high(v_1src); + v_float64x2 v_2src0 = v_cvt_f64(v_2src); + v_float64x2 v_2src1 = v_cvt_f64_high(v_2src); - __m128d v_dst0 = _mm_loadu_pd(dst + x); - __m128d v_dst1 = _mm_loadu_pd(dst + x + 2); - - v_dst0 = _mm_add_pd(v_dst0, _mm_mul_pd(v_1src0, v_2src0)); - v_dst1 = _mm_add_pd(v_dst1, _mm_mul_pd(v_1src1, v_2src1)); - - _mm_storeu_pd(dst + x, v_dst0); - _mm_storeu_pd(dst + x + 2, v_dst1); + v_store(dst + x, v_load(dst + x) + (v_1src0 * v_2src0)); + v_store(dst + x + 2, v_load(dst + x + 2) + (v_1src1 * v_2src1)); } } return x; @@ -626,25 +607,19 @@ struct AccProd_SIMD len *= cn; for ( ; x <= len - 4; x += 4) { - __m128d v_src00 = _mm_loadu_pd(src1 + x); - __m128d v_src01 = _mm_loadu_pd(src1 + x + 2); - __m128d v_src10 = _mm_loadu_pd(src2 + x); - __m128d v_src11 = _mm_loadu_pd(src2 + x + 2); - __m128d v_src0 = _mm_mul_pd(v_src00, v_src10); - __m128d v_src1 = _mm_mul_pd(v_src01, v_src11); + v_float64x2 v_src00 = v_load(src1 + x); + v_float64x2 v_src01 = v_load(src1 + x + 2); + v_float64x2 v_src10 = v_load(src2 + x); + v_float64x2 v_src11 = v_load(src2 + x + 2); - __m128d v_dst0 = _mm_loadu_pd(dst + x); - __m128d v_dst1 = _mm_loadu_pd(dst + x + 2); - - v_dst0 = _mm_add_pd(v_dst0, v_src0); - v_dst1 = _mm_add_pd(v_dst1, v_src1); - _mm_storeu_pd(dst + x, v_dst0); - _mm_storeu_pd(dst + x + 2, v_dst1); + v_store(dst + x, v_load(dst + x) + (v_src00 * v_src10)); + v_store(dst + x + 2, v_load(dst + x + 2) + (v_src01 * v_src11)); } } return x; } }; +#endif //CV_SIMD128_64F template <> struct AccW_SIMD @@ -652,16 +627,16 @@ struct AccW_SIMD int operator() (const float * src, float * dst, const uchar * mask, int len, int cn, float alpha) const { int x = 0; - __m128 v_alpha = _mm_set1_ps(alpha); - __m128 v_beta = _mm_set1_ps(1.0f - alpha); + v_float32x4 v_alpha = v_setall_f32(alpha); + v_float32x4 v_beta = v_setall_f32(1.0f - alpha); if (!mask) { len *= cn; for ( ; x <= len - 8; x += 8) { - _mm_storeu_ps(dst + x, _mm_add_ps(_mm_mul_ps(_mm_loadu_ps(dst + x), v_beta), _mm_mul_ps(_mm_loadu_ps(src + x), v_alpha))); - _mm_storeu_ps(dst + x + 4, _mm_add_ps(_mm_mul_ps(_mm_loadu_ps(dst + x + 4), v_beta), _mm_mul_ps(_mm_loadu_ps(src + x + 4), v_alpha))); + v_store(dst + x, ((v_load(dst + x) * v_beta) + (v_load(src + x) * v_alpha))); + v_store(dst + x + 4, ((v_load(dst + x + 4) * v_beta) + (v_load(src + x + 4) * v_alpha))); } } @@ -669,31 +644,32 @@ struct AccW_SIMD } }; +#if CV_SIMD128_64F template <> struct AccW_SIMD { int operator() (const float * src, double * dst, const uchar * mask, int len, int cn, double alpha) const { int x = 0; - __m128d v_alpha = _mm_set1_pd(alpha); - __m128d v_beta = _mm_set1_pd(1.0f - alpha); + v_float64x2 v_alpha = v_setall_f64(alpha); + v_float64x2 v_beta = v_setall_f64(1.0f - alpha); if (!mask) { len *= cn; for ( ; x <= len - 8; x += 8) { - __m128 v_src0 = _mm_loadu_ps(src + x); - __m128 v_src1 = _mm_loadu_ps(src + x + 4); - __m128d v_src00 = _mm_cvtps_pd(v_src0); - __m128d v_src01 = _mm_cvtps_pd(_mm_shuffle_ps(v_src0, v_src0, _MM_SHUFFLE(0, 0, 3, 2))); - __m128d v_src10 = _mm_cvtps_pd(v_src1); - __m128d v_src11 = _mm_cvtps_pd(_mm_shuffle_ps(v_src1, v_src1, _MM_SHUFFLE(0, 0, 3, 2))); + v_float32x4 v_src0 = v_load(src + x); + v_float32x4 v_src1 = v_load(src + x + 4); + v_float64x2 v_src00 = v_cvt_f64(v_src0); + v_float64x2 v_src01 = v_cvt_f64_high(v_src0); + v_float64x2 v_src10 = v_cvt_f64(v_src1); + v_float64x2 v_src11 = v_cvt_f64_high(v_src1); - _mm_storeu_pd(dst + x, _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(dst + x), v_beta), _mm_mul_pd(v_src00, v_alpha))); - _mm_storeu_pd(dst + x + 2, _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(dst + x + 2), v_beta), _mm_mul_pd(v_src01, v_alpha))); - _mm_storeu_pd(dst + x + 4, _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(dst + x + 4), v_beta), _mm_mul_pd(v_src10, v_alpha))); - _mm_storeu_pd(dst + x + 6, _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(dst + x + 6), v_beta), _mm_mul_pd(v_src11, v_alpha))); + v_store(dst + x, ((v_load(dst + x) * v_beta) + (v_src00 * v_alpha))); + v_store(dst + x + 2, ((v_load(dst + x + 2) * v_beta) + (v_src01 * v_alpha))); + v_store(dst + x + 4, ((v_load(dst + x + 4) * v_beta) + (v_src10 * v_alpha))); + v_store(dst + x + 6, ((v_load(dst + x + 6) * v_beta) + (v_src11 * v_alpha))); } } @@ -707,65 +683,76 @@ struct AccW_SIMD int operator() (const double * src, double * dst, const uchar * mask, int len, int cn, double alpha) const { int x = 0; - __m128d v_alpha = _mm_set1_pd(alpha); - __m128d v_beta = _mm_set1_pd(1.0f - alpha); + v_float64x2 v_alpha = v_setall_f64(alpha); + v_float64x2 v_beta = v_setall_f64(1.0f - alpha); if (!mask) { len *= cn; for ( ; x <= len - 4; x += 4) { - __m128d v_src0 = _mm_loadu_pd(src + x); - __m128d v_src1 = _mm_loadu_pd(src + x + 2); + v_float64x2 v_src0 = v_load(src + x); + v_float64x2 v_src1 = v_load(src + x + 2); - _mm_storeu_pd(dst + x, _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(dst + x), v_beta), _mm_mul_pd(v_src0, v_alpha))); - _mm_storeu_pd(dst + x + 2, _mm_add_pd(_mm_mul_pd(_mm_loadu_pd(dst + x + 2), v_beta), _mm_mul_pd(v_src1, v_alpha))); + v_store(dst + x, ((v_load(dst + x) * v_beta) + (v_src0 * v_alpha))); + v_store(dst + x + 2, ((v_load(dst + x + 2) * v_beta) + (v_src1 * v_alpha))); } } return x; } }; -#endif +#endif //CV_SIMD128_64F +#endif //CV_SIMD128 -#if CV_SSE2 +#if CV_SIMD128 template <> struct Acc_SIMD { int operator() (const uchar * src, float * dst, const uchar * mask, int len, int cn) const { int x = 0; - __m128i v_0 = _mm_setzero_si128(); if (!mask) { len *= cn; for ( ; x <= len - 16; x += 16) { - __m128i v_src = _mm_loadu_si128((const __m128i*)(src + x)); - __m128i v_src0 = _mm_unpacklo_epi8(v_src, v_0); - __m128i v_src1 = _mm_unpackhi_epi8(v_src, v_0); + v_uint8x16 v_src = v_load(src + x); + v_uint16x8 v_src0, v_src1; + v_expand(v_src, v_src0, v_src1); - _mm_storeu_ps(dst + x, _mm_add_ps(_mm_loadu_ps(dst + x), _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_src0, v_0)))); - _mm_storeu_ps(dst + x + 4, _mm_add_ps(_mm_loadu_ps(dst + x + 4), _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_src0, v_0)))); - _mm_storeu_ps(dst + x + 8, _mm_add_ps(_mm_loadu_ps(dst + x + 8), _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_src1, v_0)))); - _mm_storeu_ps(dst + x + 12, _mm_add_ps(_mm_loadu_ps(dst + x + 12), _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_src1, v_0)))); + v_uint32x4 v_src00, v_src01, v_src10, v_src11; + v_expand(v_src0, v_src00, v_src01); + v_expand(v_src1, v_src10, v_src11); + + v_store(dst + x, v_load(dst + x) + v_cvt_f32(v_reinterpret_as_s32(v_src00))); + v_store(dst + x + 4, v_load(dst + x + 4) + v_cvt_f32(v_reinterpret_as_s32(v_src01))); + v_store(dst + x + 8, v_load(dst + x + 8) + v_cvt_f32(v_reinterpret_as_s32(v_src10))); + v_store(dst + x + 12, v_load(dst + x + 12) + v_cvt_f32(v_reinterpret_as_s32(v_src11))); } } else if (cn == 1) { - __m128i v_255 = _mm_set1_epi8(-1); + v_uint8x16 v_0 = v_setall_u8(0); for ( ; x <= len - 16; x += 16) { - __m128i v_src = _mm_and_si128(_mm_loadu_si128((const __m128i*)(src + x)), _mm_xor_si128(v_255, _mm_cmpeq_epi8(_mm_loadu_si128((const __m128i*)(mask + x)), v_0))); - __m128i v_src0 = _mm_unpacklo_epi8(v_src, v_0); - __m128i v_src1 = _mm_unpackhi_epi8(v_src, v_0); + v_uint8x16 v_mask = v_load(mask + x); + v_mask = ~(v_0 == v_mask); + v_uint8x16 v_src = v_load(src + x); + v_src = v_src & v_mask; + v_uint16x8 v_src0, v_src1; + v_expand(v_src, v_src0, v_src1); - _mm_storeu_ps(dst + x, _mm_add_ps(_mm_loadu_ps(dst + x), _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_src0, v_0)))); - _mm_storeu_ps(dst + x + 4, _mm_add_ps(_mm_loadu_ps(dst + x + 4), _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_src0, v_0)))); - _mm_storeu_ps(dst + x + 8, _mm_add_ps(_mm_loadu_ps(dst + x + 8), _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_src1, v_0)))); - _mm_storeu_ps(dst + x + 12, _mm_add_ps(_mm_loadu_ps(dst + x + 12), _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_src1, v_0)))); + v_uint32x4 v_src00, v_src01, v_src10, v_src11; + v_expand(v_src0, v_src00, v_src01); + v_expand(v_src1, v_src10, v_src11); + + v_store(dst + x, v_load(dst + x) + v_cvt_f32(v_reinterpret_as_s32(v_src00))); + v_store(dst + x + 4, v_load(dst + x + 4) + v_cvt_f32(v_reinterpret_as_s32(v_src01))); + v_store(dst + x + 8, v_load(dst + x + 8) + v_cvt_f32(v_reinterpret_as_s32(v_src10))); + v_store(dst + x + 12, v_load(dst + x + 12) + v_cvt_f32(v_reinterpret_as_s32(v_src11))); } } @@ -779,19 +766,17 @@ struct Acc_SIMD int operator() (const ushort * src, float * dst, const uchar * mask, int len, int cn) const { int x = 0; - __m128i v_0 = _mm_setzero_si128(); - if (!mask) { len *= cn; for ( ; x <= len - 8; x += 8) { - __m128i v_src = _mm_loadu_si128((const __m128i*)(src + x)); - __m128i v_src0 = _mm_unpacklo_epi16(v_src, v_0); - __m128i v_src1 = _mm_unpackhi_epi16(v_src, v_0); + v_uint16x8 v_src = v_load(src + x); + v_uint32x4 v_src0, v_src1; + v_expand(v_src, v_src0, v_src1); - _mm_storeu_ps(dst + x, _mm_add_ps(_mm_loadu_ps(dst + x), _mm_cvtepi32_ps(v_src0))); - _mm_storeu_ps(dst + x + 4, _mm_add_ps(_mm_loadu_ps(dst + x + 4), _mm_cvtepi32_ps(v_src1))); + v_store(dst + x, v_load(dst + x) + v_cvt_f32(v_reinterpret_as_s32(v_src0))); + v_store(dst + x + 4, v_load(dst + x + 4) + v_cvt_f32(v_reinterpret_as_s32(v_src1))); } } @@ -799,6 +784,7 @@ struct Acc_SIMD } }; +#if CV_SIMD128_64F template <> struct Acc_SIMD { @@ -808,52 +794,52 @@ struct Acc_SIMD if (!mask) { - __m128i v_0 = _mm_setzero_si128(); len *= cn; for ( ; x <= len - 16; x += 16) { - __m128i v_src = _mm_loadu_si128((const __m128i*)(src + x)); - __m128i v_int0 = _mm_unpacklo_epi8(v_src, v_0); - __m128i v_int1 = _mm_unpackhi_epi8(v_src, v_0); - __m128i v_int00 = _mm_unpacklo_epi16(v_int0, v_0); - __m128i v_int01 = _mm_unpackhi_epi16(v_int0, v_0); - __m128i v_int10 = _mm_unpacklo_epi16(v_int1, v_0); - __m128i v_int11 = _mm_unpackhi_epi16(v_int1, v_0); - __m128d v_src0 = _mm_cvtepi32_pd(v_int00); - __m128d v_src1 = _mm_cvtepi32_pd(_mm_shuffle_epi32(v_int00, _MM_SHUFFLE(0, 0, 3, 2))); - __m128d v_src2 = _mm_cvtepi32_pd(v_int01); - __m128d v_src3 = _mm_cvtepi32_pd(_mm_shuffle_epi32(v_int01, _MM_SHUFFLE(0, 0, 3, 2))); - __m128d v_src4 = _mm_cvtepi32_pd(v_int10); - __m128d v_src5 = _mm_cvtepi32_pd(_mm_shuffle_epi32(v_int10, _MM_SHUFFLE(0, 0, 3, 2))); - __m128d v_src6 = _mm_cvtepi32_pd(v_int11); - __m128d v_src7 = _mm_cvtepi32_pd(_mm_shuffle_epi32(v_int11, _MM_SHUFFLE(0, 0, 3, 2))); + v_uint8x16 v_src = v_load(src + x); + v_uint16x8 v_int0, v_int1; + v_expand(v_src, v_int0, v_int1); - __m128d v_dst0 = _mm_loadu_pd(dst + x); - __m128d v_dst1 = _mm_loadu_pd(dst + x + 2); - __m128d v_dst2 = _mm_loadu_pd(dst + x + 4); - __m128d v_dst3 = _mm_loadu_pd(dst + x + 6); - __m128d v_dst4 = _mm_loadu_pd(dst + x + 8); - __m128d v_dst5 = _mm_loadu_pd(dst + x + 10); - __m128d v_dst6 = _mm_loadu_pd(dst + x + 12); - __m128d v_dst7 = _mm_loadu_pd(dst + x + 14); + v_uint32x4 v_int00, v_int01, v_int10, v_int11; + v_expand(v_int0, v_int00, v_int01); + v_expand(v_int1, v_int10, v_int11); - v_dst0 = _mm_add_pd(v_dst0, v_src0); - v_dst1 = _mm_add_pd(v_dst1, v_src1); - v_dst2 = _mm_add_pd(v_dst2, v_src2); - v_dst3 = _mm_add_pd(v_dst3, v_src3); - v_dst4 = _mm_add_pd(v_dst4, v_src4); - v_dst5 = _mm_add_pd(v_dst5, v_src5); - v_dst6 = _mm_add_pd(v_dst6, v_src6); - v_dst7 = _mm_add_pd(v_dst7, v_src7); + v_float64x2 v_src0 = v_cvt_f64(v_reinterpret_as_s32(v_int00)); + v_float64x2 v_src1 = v_cvt_f64_high(v_reinterpret_as_s32(v_int00)); + v_float64x2 v_src2 = v_cvt_f64(v_reinterpret_as_s32(v_int01)); + v_float64x2 v_src3 = v_cvt_f64_high(v_reinterpret_as_s32(v_int01)); + v_float64x2 v_src4 = v_cvt_f64(v_reinterpret_as_s32(v_int10)); + v_float64x2 v_src5 = v_cvt_f64_high(v_reinterpret_as_s32(v_int10)); + v_float64x2 v_src6 = v_cvt_f64(v_reinterpret_as_s32(v_int11)); + v_float64x2 v_src7 = v_cvt_f64_high(v_reinterpret_as_s32(v_int11)); - _mm_storeu_pd(dst + x, v_dst0); - _mm_storeu_pd(dst + x + 2, v_dst1); - _mm_storeu_pd(dst + x + 4, v_dst2); - _mm_storeu_pd(dst + x + 6, v_dst3); - _mm_storeu_pd(dst + x + 8, v_dst4); - _mm_storeu_pd(dst + x + 10, v_dst5); - _mm_storeu_pd(dst + x + 12, v_dst6); - _mm_storeu_pd(dst + x + 14, v_dst7); + v_float64x2 v_dst0 = v_load(dst + x); + v_float64x2 v_dst1 = v_load(dst + x + 2); + v_float64x2 v_dst2 = v_load(dst + x + 4); + v_float64x2 v_dst3 = v_load(dst + x + 6); + v_float64x2 v_dst4 = v_load(dst + x + 8); + v_float64x2 v_dst5 = v_load(dst + x + 10); + v_float64x2 v_dst6 = v_load(dst + x + 12); + v_float64x2 v_dst7 = v_load(dst + x + 14); + + v_dst0 = v_dst0 + v_src0; + v_dst1 = v_dst1 + v_src1; + v_dst2 = v_dst2 + v_src2; + v_dst3 = v_dst3 + v_src3; + v_dst4 = v_dst4 + v_src4; + v_dst5 = v_dst5 + v_src5; + v_dst6 = v_dst6 + v_src6; + v_dst7 = v_dst7 + v_src7; + + v_store(dst + x, v_dst0); + v_store(dst + x + 2, v_dst1); + v_store(dst + x + 4, v_dst2); + v_store(dst + x + 6, v_dst3); + v_store(dst + x + 8, v_dst4); + v_store(dst + x + 10, v_dst5); + v_store(dst + x + 12, v_dst6); + v_store(dst + x + 14, v_dst7); } } return x; @@ -869,37 +855,38 @@ struct Acc_SIMD if (!mask) { - __m128i v_0 = _mm_setzero_si128(); len *= cn; for ( ; x <= len - 8; x += 8) { - __m128i v_src = _mm_loadu_si128((const __m128i*)(src + x)); - __m128i v_int0 = _mm_unpacklo_epi16(v_src, v_0); - __m128i v_int1 = _mm_unpackhi_epi16(v_src, v_0); - __m128d v_src0 = _mm_cvtepi32_pd(v_int0); - __m128d v_src1 = _mm_cvtepi32_pd(_mm_shuffle_epi32(v_int0, _MM_SHUFFLE(0, 0, 3, 2))); - __m128d v_src2 = _mm_cvtepi32_pd(v_int1); - __m128d v_src3 = _mm_cvtepi32_pd(_mm_shuffle_epi32(v_int1, _MM_SHUFFLE(0, 0, 3, 2))); + v_uint16x8 v_src = v_load(src + x); + v_uint32x4 v_int0, v_int1; + v_expand(v_src, v_int0, v_int1); - __m128d v_dst0 = _mm_loadu_pd(dst + x); - __m128d v_dst1 = _mm_loadu_pd(dst + x + 2); - __m128d v_dst2 = _mm_loadu_pd(dst + x + 4); - __m128d v_dst3 = _mm_loadu_pd(dst + x + 6); + v_float64x2 v_src0 = v_cvt_f64(v_reinterpret_as_s32(v_int0)); + v_float64x2 v_src1 = v_cvt_f64_high(v_reinterpret_as_s32(v_int0)); + v_float64x2 v_src2 = v_cvt_f64(v_reinterpret_as_s32(v_int1)); + v_float64x2 v_src3 = v_cvt_f64_high(v_reinterpret_as_s32(v_int1)); - v_dst0 = _mm_add_pd(v_dst0, v_src0); - v_dst1 = _mm_add_pd(v_dst1, v_src1); - v_dst2 = _mm_add_pd(v_dst2, v_src2); - v_dst3 = _mm_add_pd(v_dst3, v_src3); + v_float64x2 v_dst0 = v_load(dst + x); + v_float64x2 v_dst1 = v_load(dst + x + 2); + v_float64x2 v_dst2 = v_load(dst + x + 4); + v_float64x2 v_dst3 = v_load(dst + x + 6); - _mm_storeu_pd(dst + x, v_dst0); - _mm_storeu_pd(dst + x + 2, v_dst1); - _mm_storeu_pd(dst + x + 4, v_dst2); - _mm_storeu_pd(dst + x + 6, v_dst3); + v_dst0 = v_dst0 + v_src0; + v_dst1 = v_dst1 + v_src1; + v_dst2 = v_dst2 + v_src2; + v_dst3 = v_dst3 + v_src3; + + v_store(dst + x, v_dst0); + v_store(dst + x + 2, v_dst1); + v_store(dst + x + 4, v_dst2); + v_store(dst + x + 6, v_dst3); } } return x; } }; +#endif template <> struct AccSqr_SIMD @@ -907,42 +894,50 @@ struct AccSqr_SIMD int operator() (const uchar * src, float * dst, const uchar * mask, int len, int cn) const { int x = 0; - __m128i v_0 = _mm_setzero_si128(); if (!mask) { len *= cn; for ( ; x <= len - 16; x += 16) { - __m128i v_src = _mm_loadu_si128((const __m128i*)(src + x)); - __m128i v_src0 = _mm_unpacklo_epi8(v_src, v_0); - __m128i v_src1 = _mm_unpackhi_epi8(v_src, v_0); - v_src0 = _mm_mullo_epi16(v_src0, v_src0); - v_src1 = _mm_mullo_epi16(v_src1, v_src1); + v_uint8x16 v_src = v_load(src + x); + v_uint16x8 v_src0, v_src1; + v_expand(v_src, v_src0, v_src1); + v_src0 = v_src0 * v_src0; + v_src1 = v_src1 * v_src1; - _mm_storeu_ps(dst + x, _mm_add_ps(_mm_loadu_ps(dst + x), _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_src0, v_0)))); - _mm_storeu_ps(dst + x + 4, _mm_add_ps(_mm_loadu_ps(dst + x + 4), _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_src0, v_0)))); - _mm_storeu_ps(dst + x + 8, _mm_add_ps(_mm_loadu_ps(dst + x + 8), _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_src1, v_0)))); - _mm_storeu_ps(dst + x + 12, _mm_add_ps(_mm_loadu_ps(dst + x + 12), _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_src1, v_0)))); + v_uint32x4 v_src00, v_src01, v_src10, v_src11; + v_expand(v_src0, v_src00, v_src01); + v_expand(v_src1, v_src10, v_src11); + + v_store(dst + x, v_load(dst + x) + v_cvt_f32(v_reinterpret_as_s32(v_src00))); + v_store(dst + x + 4, v_load(dst + x + 4) + v_cvt_f32(v_reinterpret_as_s32(v_src01))); + v_store(dst + x + 8, v_load(dst + x + 8) + v_cvt_f32(v_reinterpret_as_s32(v_src10))); + v_store(dst + x + 12, v_load(dst + x + 12) + v_cvt_f32(v_reinterpret_as_s32(v_src11))); } } else if (cn == 1) { - - __m128i v_255 = _mm_set1_epi8(-1); + v_uint8x16 v_0 = v_setall_u8(0); for ( ; x <= len - 16; x += 16) { + v_uint8x16 v_mask = v_load(mask + x); + v_mask = ~(v_0 == v_mask); + v_uint8x16 v_src = v_load(src + x); + v_src = v_src & v_mask; + v_uint16x8 v_src0, v_src1; + v_expand(v_src, v_src0, v_src1); + v_src0 = v_src0 * v_src0; + v_src1 = v_src1 * v_src1; - __m128i v_src = _mm_and_si128(_mm_loadu_si128((const __m128i*)(src + x)), _mm_xor_si128(v_255, _mm_cmpeq_epi8(_mm_loadu_si128((const __m128i*)(mask + x)), v_0))); - __m128i v_src0 = _mm_unpacklo_epi8(v_src, v_0); - __m128i v_src1 = _mm_unpackhi_epi8(v_src, v_0); - v_src0 = _mm_mullo_epi16(v_src0, v_src0); - v_src1 = _mm_mullo_epi16(v_src1, v_src1); + v_uint32x4 v_src00, v_src01, v_src10, v_src11; + v_expand(v_src0, v_src00, v_src01); + v_expand(v_src1, v_src10, v_src11); - _mm_storeu_ps(dst + x, _mm_add_ps(_mm_loadu_ps(dst + x), _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_src0, v_0)))); - _mm_storeu_ps(dst + x + 4, _mm_add_ps(_mm_loadu_ps(dst + x + 4), _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_src0, v_0)))); - _mm_storeu_ps(dst + x + 8, _mm_add_ps(_mm_loadu_ps(dst + x + 8), _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_src1, v_0)))); - _mm_storeu_ps(dst + x + 12, _mm_add_ps(_mm_loadu_ps(dst + x + 12), _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_src1, v_0)))); + v_store(dst + x, v_load(dst + x) + v_cvt_f32(v_reinterpret_as_s32(v_src00))); + v_store(dst + x + 4, v_load(dst + x + 4) + v_cvt_f32(v_reinterpret_as_s32(v_src01))); + v_store(dst + x + 8, v_load(dst + x + 8) + v_cvt_f32(v_reinterpret_as_s32(v_src10))); + v_store(dst + x + 12, v_load(dst + x + 12) + v_cvt_f32(v_reinterpret_as_s32(v_src11))); } } @@ -956,21 +951,24 @@ struct AccSqr_SIMD int operator() (const ushort * src, float * dst, const uchar * mask, int len, int cn) const { int x = 0; - __m128i v_0 = _mm_setzero_si128(); if (!mask) { len *= cn; for ( ; x <= len - 8; x += 8) { - __m128i v_src = _mm_loadu_si128((const __m128i*)(src + x)); - __m128i v_src0 = _mm_unpacklo_epi16(v_src, v_0); - __m128i v_src1 = _mm_unpackhi_epi16(v_src, v_0); - v_src0 = _mm_mullo_epi16(v_src0, v_src0); - v_src1 = _mm_mullo_epi16(v_src1, v_src1); + v_uint16x8 v_src = v_load(src + x); + v_uint32x4 v_src0, v_src1; + v_expand(v_src, v_src0, v_src1); - _mm_storeu_ps(dst + x, _mm_add_ps(_mm_loadu_ps(dst + x), _mm_cvtepi32_ps(v_src0))); - _mm_storeu_ps(dst + x + 4, _mm_add_ps(_mm_loadu_ps(dst + x + 4), _mm_cvtepi32_ps(v_src1))); + v_float32x4 v_float0, v_float1; + v_float0 = v_cvt_f32(v_reinterpret_as_s32(v_src0)); + v_float1 = v_cvt_f32(v_reinterpret_as_s32(v_src1)); + v_float0 = v_float0 * v_float0; + v_float1 = v_float1 * v_float1; + + v_store(dst + x, v_load(dst + x) + v_float0); + v_store(dst + x + 4, v_load(dst + x + 4) + v_float1); } } @@ -978,6 +976,7 @@ struct AccSqr_SIMD } }; +#if CV_SIMD128_64F template <> struct AccSqr_SIMD { @@ -987,37 +986,39 @@ struct AccSqr_SIMD if (!mask) { - __m128i v_0 = _mm_setzero_si128(); len *= cn; for ( ; x <= len - 8; x += 8) { - __m128i v_src = _mm_loadl_epi64((const __m128i*)(src + x)); - __m128i v_int = _mm_unpacklo_epi8(v_src, v_0); - __m128i v_int0 = _mm_unpacklo_epi16(v_int, v_0); - __m128i v_int1 = _mm_unpackhi_epi16(v_int, v_0); - __m128d v_src0 = _mm_cvtepi32_pd(v_int0); - __m128d v_src1 = _mm_cvtepi32_pd(_mm_shuffle_epi32(v_int0, _MM_SHUFFLE(0, 0, 3, 2))); - __m128d v_src2 = _mm_cvtepi32_pd(v_int1); - __m128d v_src3 = _mm_cvtepi32_pd(_mm_shuffle_epi32(v_int1, _MM_SHUFFLE(0, 0, 3, 2))); - v_src0 = _mm_mul_pd(v_src0, v_src0); - v_src1 = _mm_mul_pd(v_src1, v_src1); - v_src2 = _mm_mul_pd(v_src2, v_src2); - v_src3 = _mm_mul_pd(v_src3, v_src3); + v_uint8x16 v_src = v_load(src + x); + v_uint16x8 v_int, dummy; + v_expand(v_src, v_int, dummy); - __m128d v_dst0 = _mm_loadu_pd(dst + x); - __m128d v_dst1 = _mm_loadu_pd(dst + x + 2); - __m128d v_dst2 = _mm_loadu_pd(dst + x + 4); - __m128d v_dst3 = _mm_loadu_pd(dst + x + 6); + v_uint32x4 v_int0, v_int1; + v_expand(v_int, v_int0, v_int1); - v_dst0 = _mm_add_pd(v_dst0, v_src0); - v_dst1 = _mm_add_pd(v_dst1, v_src1); - v_dst2 = _mm_add_pd(v_dst2, v_src2); - v_dst3 = _mm_add_pd(v_dst3, v_src3); + v_float64x2 v_src0 = v_cvt_f64(v_reinterpret_as_s32(v_int0)); + v_float64x2 v_src1 = v_cvt_f64_high(v_reinterpret_as_s32(v_int0)); + v_float64x2 v_src2 = v_cvt_f64(v_reinterpret_as_s32(v_int1)); + v_float64x2 v_src3 = v_cvt_f64_high(v_reinterpret_as_s32(v_int1)); + v_src0 = v_src0 * v_src0; + v_src1 = v_src1 * v_src1; + v_src2 = v_src2 * v_src2; + v_src3 = v_src3 * v_src3; - _mm_storeu_pd(dst + x, v_dst0); - _mm_storeu_pd(dst + x + 2, v_dst1); - _mm_storeu_pd(dst + x + 4, v_dst2); - _mm_storeu_pd(dst + x + 6, v_dst3); + v_float64x2 v_dst0 = v_load(dst + x); + v_float64x2 v_dst1 = v_load(dst + x + 2); + v_float64x2 v_dst2 = v_load(dst + x + 4); + v_float64x2 v_dst3 = v_load(dst + x + 6); + + v_dst0 += v_src0; + v_dst1 += v_src1; + v_dst2 += v_src2; + v_dst3 += v_src3; + + v_store(dst + x, v_dst0); + v_store(dst + x + 2, v_dst1); + v_store(dst + x + 4, v_dst2); + v_store(dst + x + 6, v_dst3); } } return x; @@ -1033,41 +1034,45 @@ struct AccSqr_SIMD if (!mask) { - __m128i v_0 = _mm_setzero_si128(); len *= cn; for ( ; x <= len - 8; x += 8) { - __m128i v_src = _mm_loadu_si128((const __m128i*)(src + x)); - __m128i v_int0 = _mm_unpacklo_epi16(v_src, v_0); - __m128i v_int1 = _mm_unpackhi_epi16(v_src, v_0); - __m128d v_src0 = _mm_cvtepi32_pd(v_int0); - __m128d v_src1 = _mm_cvtepi32_pd(_mm_shuffle_epi32(v_int0, _MM_SHUFFLE(0, 0, 3, 2))); - __m128d v_src2 = _mm_cvtepi32_pd(v_int1); - __m128d v_src3 = _mm_cvtepi32_pd(_mm_shuffle_epi32(v_int1, _MM_SHUFFLE(0, 0, 3, 2))); - v_src0 = _mm_mul_pd(v_src0, v_src0); - v_src1 = _mm_mul_pd(v_src1, v_src1); - v_src2 = _mm_mul_pd(v_src2, v_src2); - v_src3 = _mm_mul_pd(v_src3, v_src3); + v_uint16x8 v_src = v_load(src + x); + v_uint32x4 v_int_0, v_int_1; + v_expand(v_src, v_int_0, v_int_1); - __m128d v_dst0 = _mm_loadu_pd(dst + x); - __m128d v_dst1 = _mm_loadu_pd(dst + x + 2); - __m128d v_dst2 = _mm_loadu_pd(dst + x + 4); - __m128d v_dst3 = _mm_loadu_pd(dst + x + 6); + v_int32x4 v_int0 = v_reinterpret_as_s32(v_int_0); + v_int32x4 v_int1 = v_reinterpret_as_s32(v_int_1); - v_dst0 = _mm_add_pd(v_dst0, v_src0); - v_dst1 = _mm_add_pd(v_dst1, v_src1); - v_dst2 = _mm_add_pd(v_dst2, v_src2); - v_dst3 = _mm_add_pd(v_dst3, v_src3); + v_float64x2 v_src0 = v_cvt_f64(v_int0); + v_float64x2 v_src1 = v_cvt_f64_high(v_int0); + v_float64x2 v_src2 = v_cvt_f64(v_int1); + v_float64x2 v_src3 = v_cvt_f64_high(v_int1); + v_src0 = v_src0 * v_src0; + v_src1 = v_src1 * v_src1; + v_src2 = v_src2 * v_src2; + v_src3 = v_src3 * v_src3; - _mm_storeu_pd(dst + x, v_dst0); - _mm_storeu_pd(dst + x + 2, v_dst1); - _mm_storeu_pd(dst + x + 4, v_dst2); - _mm_storeu_pd(dst + x + 6, v_dst3); + v_float64x2 v_dst0 = v_load(dst + x); + v_float64x2 v_dst1 = v_load(dst + x + 2); + v_float64x2 v_dst2 = v_load(dst + x + 4); + v_float64x2 v_dst3 = v_load(dst + x + 6); + + v_dst0 += v_src0; + v_dst1 += v_src1; + v_dst2 += v_src2; + v_dst3 += v_src3; + + v_store(dst + x, v_dst0); + v_store(dst + x + 2, v_dst1); + v_store(dst + x + 4, v_dst2); + v_store(dst + x + 6, v_dst3); } } return x; } }; +#endif template <> struct AccProd_SIMD @@ -1076,58 +1081,60 @@ struct AccProd_SIMD { int x = 0; - __m128i v_0 = _mm_setzero_si128(); len *= cn; if (!mask) { for ( ; x <= len - 16; x += 16) { - __m128i v_1src = _mm_loadu_si128((const __m128i*)(src1 + x)); - __m128i v_2src = _mm_loadu_si128((const __m128i*)(src2 + x)); + v_uint8x16 v_1src = v_load(src1 + x); + v_uint8x16 v_2src = v_load(src2 + x); - __m128i v_1src0 = _mm_unpacklo_epi8(v_1src, v_0); - __m128i v_1src1 = _mm_unpackhi_epi8(v_1src, v_0); - __m128i v_2src0 = _mm_unpacklo_epi8(v_2src, v_0); - __m128i v_2src1 = _mm_unpackhi_epi8(v_2src, v_0); - __m128i v_src0 = _mm_mullo_epi16(v_1src0, v_2src0); - __m128i v_src1 = _mm_mullo_epi16(v_1src1, v_2src1); - __m128 v_src00 = _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_src0, v_0)); - __m128 v_src01 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_src0, v_0)); - __m128 v_src10 = _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_src1, v_0)); - __m128 v_src11 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_src1, v_0)); + v_uint16x8 v_1src0, v_1src1, v_2src0, v_2src1; + v_expand(v_1src, v_1src0, v_1src1); + v_expand(v_2src, v_2src0, v_2src1); - _mm_storeu_ps(dst + x, _mm_add_ps(_mm_loadu_ps(dst + x), v_src00)); - _mm_storeu_ps(dst + x + 4, _mm_add_ps(_mm_loadu_ps(dst + x + 4), v_src01)); - _mm_storeu_ps(dst + x + 8, _mm_add_ps(_mm_loadu_ps(dst + x + 8), v_src10)); - _mm_storeu_ps(dst + x + 12, _mm_add_ps(_mm_loadu_ps(dst + x + 12), v_src11)); + v_uint16x8 v_src0, v_src1; + v_src0 = v_1src0 * v_2src0; + v_src1 = v_1src1 * v_2src1; + + v_uint32x4 v_src00, v_src01, v_src10, v_src11; + v_expand(v_src0, v_src00, v_src01); + v_expand(v_src1, v_src10, v_src11); + + v_store(dst + x, v_load(dst + x) + v_cvt_f32(v_reinterpret_as_s32(v_src00))); + v_store(dst + x + 4, v_load(dst + x + 4) + v_cvt_f32(v_reinterpret_as_s32(v_src01))); + v_store(dst + x + 8, v_load(dst + x + 8) + v_cvt_f32(v_reinterpret_as_s32(v_src10))); + v_store(dst + x + 12, v_load(dst + x + 12) + v_cvt_f32(v_reinterpret_as_s32(v_src11))); } } else if (cn == 1) { - __m128i v_255 = _mm_set1_epi8(-1); + v_uint8x16 v_0 = v_setzero_u8(); for ( ; x <= len - 16; x += 16) { - __m128i v_mask = _mm_loadu_si128((const __m128i*)(mask + x)); - v_mask = _mm_xor_si128(v_255, _mm_cmpeq_epi8(v_mask, v_0)); - __m128i v_1src = _mm_and_si128(_mm_loadu_si128((const __m128i*)(src1 + x)), v_mask); - __m128i v_2src = _mm_and_si128(_mm_loadu_si128((const __m128i*)(src2 + x)), v_mask); + v_uint8x16 v_mask = v_load(mask + x); + v_mask = ~(v_0 == v_mask); - __m128i v_1src0 = _mm_unpacklo_epi8(v_1src, v_0); - __m128i v_1src1 = _mm_unpackhi_epi8(v_1src, v_0); - __m128i v_2src0 = _mm_unpacklo_epi8(v_2src, v_0); - __m128i v_2src1 = _mm_unpackhi_epi8(v_2src, v_0); - __m128i v_src0 = _mm_mullo_epi16(v_1src0, v_2src0); - __m128i v_src1 = _mm_mullo_epi16(v_1src1, v_2src1); - __m128 v_src00 = _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_src0, v_0)); - __m128 v_src01 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_src0, v_0)); - __m128 v_src10 = _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_src1, v_0)); - __m128 v_src11 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_src1, v_0)); + v_uint8x16 v_1src = v_load(src1 + x) & v_mask; + v_uint8x16 v_2src = v_load(src2 + x) & v_mask; - _mm_storeu_ps(dst + x, _mm_add_ps(_mm_loadu_ps(dst + x), v_src00)); - _mm_storeu_ps(dst + x + 4, _mm_add_ps(_mm_loadu_ps(dst + x + 4), v_src01)); - _mm_storeu_ps(dst + x + 8, _mm_add_ps(_mm_loadu_ps(dst + x + 8), v_src10)); - _mm_storeu_ps(dst + x + 12, _mm_add_ps(_mm_loadu_ps(dst + x + 12), v_src11)); + v_uint16x8 v_1src0, v_1src1, v_2src0, v_2src1; + v_expand(v_1src, v_1src0, v_1src1); + v_expand(v_2src, v_2src0, v_2src1); + + v_uint16x8 v_src0, v_src1; + v_src0 = v_1src0 * v_2src0; + v_src1 = v_1src1 * v_2src1; + + v_uint32x4 v_src00, v_src01, v_src10, v_src11; + v_expand(v_src0, v_src00, v_src01); + v_expand(v_src1, v_src10, v_src11); + + v_store(dst + x, v_load(dst + x) + v_cvt_f32(v_reinterpret_as_s32(v_src00))); + v_store(dst + x + 4, v_load(dst + x + 4) + v_cvt_f32(v_reinterpret_as_s32(v_src01))); + v_store(dst + x + 8, v_load(dst + x + 8) + v_cvt_f32(v_reinterpret_as_s32(v_src10))); + v_store(dst + x + 12, v_load(dst + x + 12) + v_cvt_f32(v_reinterpret_as_s32(v_src11))); } } @@ -1141,47 +1148,59 @@ struct AccProd_SIMD int operator() (const ushort * src1, const ushort * src2, float * dst, const uchar * mask, int len, int cn) const { int x = 0; - __m128i v_0 = _mm_setzero_si128(); if (!mask) { len *= cn; for ( ; x <= len - 8; x += 8) { - __m128i v_1src = _mm_loadu_si128((const __m128i*)(src1 + x)); - __m128i v_2src = _mm_loadu_si128((const __m128i*)(src2 + x)); - __m128 v_1src0 = _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_1src, v_0)); - __m128 v_1src1 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_1src, v_0)); - __m128 v_2src0 = _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_2src, v_0)); - __m128 v_2src1 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_2src, v_0)); - __m128 v_src0 = _mm_mul_ps(v_1src0, v_2src0); - __m128 v_src1 = _mm_mul_ps(v_1src1, v_2src1); + v_uint16x8 v_1src = v_load(src1 + x); + v_uint16x8 v_2src = v_load(src2 + x); - _mm_storeu_ps(dst + x, _mm_add_ps(_mm_loadu_ps(dst + x), v_src0)); - _mm_storeu_ps(dst + x + 4, _mm_add_ps(_mm_loadu_ps(dst + x + 4), v_src1)); + v_uint32x4 v_1src0, v_1src1, v_2src0, v_2src1; + v_expand(v_1src, v_1src0, v_1src1); + v_expand(v_2src, v_2src0, v_2src1); + + v_float32x4 v_1float0 = v_cvt_f32(v_reinterpret_as_s32(v_1src0)); + v_float32x4 v_1float1 = v_cvt_f32(v_reinterpret_as_s32(v_1src1)); + v_float32x4 v_2float0 = v_cvt_f32(v_reinterpret_as_s32(v_2src0)); + v_float32x4 v_2float1 = v_cvt_f32(v_reinterpret_as_s32(v_2src1)); + + v_float32x4 v_src0 = v_1float0 * v_2float0; + v_float32x4 v_src1 = v_1float1 * v_2float1; + + v_store(dst + x, v_load(dst + x) + v_src0); + v_store(dst + x + 4, v_load(dst + x + 4) + v_src1); } } else if (cn == 1) { - __m128i v_65535 = _mm_set1_epi16(-1); + v_uint16x8 v_0 = v_setzero_u16(); for ( ; x <= len - 8; x += 8) { - __m128i v_mask = _mm_loadl_epi64((const __m128i*)(mask + x)); - __m128i v_mask0 = _mm_unpacklo_epi8(v_mask, v_0); - v_mask0 = _mm_xor_si128(v_65535, _mm_cmpeq_epi16(v_mask0, v_0)); + v_uint8x16 v_mask = v_load_halves(mask + x, mask + x); + v_uint16x8 v_mask0, v_mask1; + v_expand(v_mask, v_mask0, v_mask1); + v_mask0 = ~(v_0 == v_mask0); - __m128i v_1src = _mm_and_si128(_mm_loadu_si128((const __m128i*)(src1 + x)), v_mask0); - __m128i v_2src = _mm_and_si128(_mm_loadu_si128((const __m128i*)(src2 + x)), v_mask0); - __m128 v_1src0 = _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_1src, v_0)); - __m128 v_1src1 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_1src, v_0)); - __m128 v_2src0 = _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_2src, v_0)); - __m128 v_2src1 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_2src, v_0)); - __m128 v_src0 = _mm_mul_ps(v_1src0, v_2src0); - __m128 v_src1 = _mm_mul_ps(v_1src1, v_2src1); + v_uint16x8 v_1src = v_load(src1 + x) & v_mask0; + v_uint16x8 v_2src = v_load(src2 + x) & v_mask0; - _mm_storeu_ps(dst + x, _mm_add_ps(_mm_loadu_ps(dst + x), v_src0)); - _mm_storeu_ps(dst + x + 4, _mm_add_ps(_mm_loadu_ps(dst + x + 4), v_src1)); + v_uint32x4 v_1src0, v_1src1, v_2src0, v_2src1; + v_expand(v_1src, v_1src0, v_1src1); + v_expand(v_2src, v_2src0, v_2src1); + + v_float32x4 v_1float0 = v_cvt_f32(v_reinterpret_as_s32(v_1src0)); + v_float32x4 v_1float1 = v_cvt_f32(v_reinterpret_as_s32(v_1src1)); + v_float32x4 v_2float0 = v_cvt_f32(v_reinterpret_as_s32(v_2src0)); + v_float32x4 v_2float1 = v_cvt_f32(v_reinterpret_as_s32(v_2src1)); + + v_float32x4 v_src0 = v_1float0 * v_2float0; + v_float32x4 v_src1 = v_1float1 * v_2float1; + + v_store(dst + x, v_load(dst + x) + v_src0); + v_store(dst + x + 4, v_load(dst + x + 4) + v_src1); } } @@ -1189,6 +1208,7 @@ struct AccProd_SIMD } }; +#if CV_SIMD128_64F template <> struct AccProd_SIMD { @@ -1198,38 +1218,44 @@ struct AccProd_SIMD if (!mask) { - __m128i v_0 = _mm_setzero_si128(); len *= cn; for ( ; x <= len - 8; x += 8) { - __m128i v_1src = _mm_loadl_epi64((const __m128i*)(src1 + x)); - __m128i v_2src = _mm_loadl_epi64((const __m128i*)(src2 + x)); + v_uint8x16 v_1src = v_load(src1 + x); + v_uint8x16 v_2src = v_load(src2 + x); - __m128i v_1int = _mm_unpacklo_epi8(v_1src, v_0); - __m128i v_2int = _mm_unpacklo_epi8(v_2src, v_0); - __m128i v_1int0 = _mm_unpacklo_epi16(v_1int, v_0); - __m128i v_1int1 = _mm_unpackhi_epi16(v_1int, v_0); - __m128i v_2int0 = _mm_unpacklo_epi16(v_2int, v_0); - __m128i v_2int1 = _mm_unpackhi_epi16(v_2int, v_0); - __m128d v_src0 = _mm_mul_pd(_mm_cvtepi32_pd(v_1int0),_mm_cvtepi32_pd(v_2int0)); - __m128d v_src1 = _mm_mul_pd(_mm_cvtepi32_pd(_mm_shuffle_epi32(v_1int0, _MM_SHUFFLE(0, 0, 3, 2))),_mm_cvtepi32_pd(_mm_shuffle_epi32(v_2int0, _MM_SHUFFLE(0, 0, 3, 2)))); - __m128d v_src2 = _mm_mul_pd(_mm_cvtepi32_pd(v_1int1),_mm_cvtepi32_pd(v_2int1)); - __m128d v_src3 = _mm_mul_pd(_mm_cvtepi32_pd(_mm_shuffle_epi32(v_1int1, _MM_SHUFFLE(0, 0, 3, 2))),_mm_cvtepi32_pd(_mm_shuffle_epi32(v_2int1, _MM_SHUFFLE(0, 0, 3, 2)))); + v_uint16x8 v_1int, v_2int, dummy; + v_expand(v_1src, v_1int, dummy); + v_expand(v_2src, v_2int, dummy); - __m128d v_dst0 = _mm_loadu_pd(dst + x); - __m128d v_dst1 = _mm_loadu_pd(dst + x + 2); - __m128d v_dst2 = _mm_loadu_pd(dst + x + 4); - __m128d v_dst3 = _mm_loadu_pd(dst + x + 6); + v_uint32x4 v_1int_0, v_1int_1, v_2int_0, v_2int_1; + v_expand(v_1int, v_1int_0, v_1int_1); + v_expand(v_2int, v_2int_0, v_2int_1); - v_dst0 = _mm_add_pd(v_dst0, v_src0); - v_dst1 = _mm_add_pd(v_dst1, v_src1); - v_dst2 = _mm_add_pd(v_dst2, v_src2); - v_dst3 = _mm_add_pd(v_dst3, v_src3); + v_int32x4 v_1int0 = v_reinterpret_as_s32(v_1int_0); + v_int32x4 v_1int1 = v_reinterpret_as_s32(v_1int_1); + v_int32x4 v_2int0 = v_reinterpret_as_s32(v_2int_0); + v_int32x4 v_2int1 = v_reinterpret_as_s32(v_2int_1); - _mm_storeu_pd(dst + x, v_dst0); - _mm_storeu_pd(dst + x + 2, v_dst1); - _mm_storeu_pd(dst + x + 4, v_dst2); - _mm_storeu_pd(dst + x + 6, v_dst3); + v_float64x2 v_src0 = v_cvt_f64(v_1int0) * v_cvt_f64(v_2int0); + v_float64x2 v_src1 = v_cvt_f64_high(v_1int0) * v_cvt_f64_high(v_2int0); + v_float64x2 v_src2 = v_cvt_f64(v_1int1) * v_cvt_f64(v_2int1); + v_float64x2 v_src3 = v_cvt_f64_high(v_1int1) * v_cvt_f64_high(v_2int1); + + v_float64x2 v_dst0 = v_load(dst + x); + v_float64x2 v_dst1 = v_load(dst + x + 2); + v_float64x2 v_dst2 = v_load(dst + x + 4); + v_float64x2 v_dst3 = v_load(dst + x + 6); + + v_dst0 += v_src0; + v_dst1 += v_src1; + v_dst2 += v_src2; + v_dst3 += v_src3; + + v_store(dst + x, v_dst0); + v_store(dst + x + 2, v_dst1); + v_store(dst + x + 4, v_dst2); + v_store(dst + x + 6, v_dst3); } } return x; @@ -1245,40 +1271,46 @@ struct AccProd_SIMD if (!mask) { - __m128i v_0 = _mm_setzero_si128(); len *= cn; for ( ; x <= len - 8; x += 8) { - __m128i v_1src = _mm_loadu_si128((const __m128i*)(src1 + x)); - __m128i v_2src = _mm_loadu_si128((const __m128i*)(src2 + x)); - __m128i v_1int0 = _mm_unpacklo_epi16(v_1src, v_0); - __m128i v_1int1 = _mm_unpackhi_epi16(v_1src, v_0); - __m128i v_2int0 = _mm_unpacklo_epi16(v_2src, v_0); - __m128i v_2int1 = _mm_unpackhi_epi16(v_2src, v_0); - __m128d v_src0 = _mm_mul_pd(_mm_cvtepi32_pd(v_1int0),_mm_cvtepi32_pd(v_2int0)); - __m128d v_src1 = _mm_mul_pd(_mm_cvtepi32_pd(_mm_shuffle_epi32(v_1int0, _MM_SHUFFLE(0, 0, 3, 2))),_mm_cvtepi32_pd(_mm_shuffle_epi32(v_2int0, _MM_SHUFFLE(0, 0, 3, 2)))); - __m128d v_src2 = _mm_mul_pd(_mm_cvtepi32_pd(v_1int1),_mm_cvtepi32_pd(v_2int1)); - __m128d v_src3 = _mm_mul_pd(_mm_cvtepi32_pd(_mm_shuffle_epi32(v_1int1, _MM_SHUFFLE(0, 0, 3, 2))),_mm_cvtepi32_pd(_mm_shuffle_epi32(v_2int1, _MM_SHUFFLE(0, 0, 3, 2)))); + v_uint16x8 v_1src = v_load(src1 + x); + v_uint16x8 v_2src = v_load(src2 + x); - __m128d v_dst0 = _mm_loadu_pd(dst + x); - __m128d v_dst1 = _mm_loadu_pd(dst + x + 2); - __m128d v_dst2 = _mm_loadu_pd(dst + x + 4); - __m128d v_dst3 = _mm_loadu_pd(dst + x + 6); + v_uint32x4 v_1int_0, v_1int_1, v_2int_0, v_2int_1; + v_expand(v_1src, v_1int_0, v_1int_1); + v_expand(v_2src, v_2int_0, v_2int_1); - v_dst0 = _mm_add_pd(v_dst0, v_src0); - v_dst1 = _mm_add_pd(v_dst1, v_src1); - v_dst2 = _mm_add_pd(v_dst2, v_src2); - v_dst3 = _mm_add_pd(v_dst3, v_src3); + v_int32x4 v_1int0 = v_reinterpret_as_s32(v_1int_0); + v_int32x4 v_1int1 = v_reinterpret_as_s32(v_1int_1); + v_int32x4 v_2int0 = v_reinterpret_as_s32(v_2int_0); + v_int32x4 v_2int1 = v_reinterpret_as_s32(v_2int_1); - _mm_storeu_pd(dst + x, v_dst0); - _mm_storeu_pd(dst + x + 2, v_dst1); - _mm_storeu_pd(dst + x + 4, v_dst2); - _mm_storeu_pd(dst + x + 6, v_dst3); + v_float64x2 v_src0 = v_cvt_f64(v_1int0) * v_cvt_f64(v_2int0); + v_float64x2 v_src1 = v_cvt_f64_high(v_1int0) * v_cvt_f64_high(v_2int0); + v_float64x2 v_src2 = v_cvt_f64(v_1int1) * v_cvt_f64(v_2int1); + v_float64x2 v_src3 = v_cvt_f64_high(v_1int1) * v_cvt_f64_high(v_2int1); + + v_float64x2 v_dst0 = v_load(dst + x); + v_float64x2 v_dst1 = v_load(dst + x + 2); + v_float64x2 v_dst2 = v_load(dst + x + 4); + v_float64x2 v_dst3 = v_load(dst + x + 6); + + v_dst0 = v_dst0 + v_src0; + v_dst1 = v_dst1 + v_src1; + v_dst2 = v_dst2 + v_src2; + v_dst3 = v_dst3 + v_src3; + + v_store(dst + x, v_dst0); + v_store(dst + x + 2, v_dst1); + v_store(dst + x + 4, v_dst2); + v_store(dst + x + 6, v_dst3); } } return x; } }; +#endif template <> struct AccW_SIMD @@ -1286,37 +1318,37 @@ struct AccW_SIMD int operator() (const uchar * src, float * dst, const uchar * mask, int len, int cn, float alpha) const { int x = 0; - __m128 v_alpha = _mm_set1_ps(alpha); - __m128 v_beta = _mm_set1_ps(1.0f - alpha); - __m128i v_0 = _mm_setzero_si128(); + v_float32x4 v_alpha = v_setall_f32(alpha); + v_float32x4 v_beta = v_setall_f32(1.0f - alpha); if (!mask) { len *= cn; for ( ; x <= len - 16; x += 16) { - __m128i v_src = _mm_loadu_si128((const __m128i*)(src + x)); - __m128i v_src0 = _mm_unpacklo_epi8(v_src, v_0); - __m128i v_src1 = _mm_unpackhi_epi8(v_src, v_0); - __m128 v_src00 = _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_src0, v_0)); - __m128 v_src01 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_src0, v_0)); - __m128 v_src10 = _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_src1, v_0)); - __m128 v_src11 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_src1, v_0)); + v_uint8x16 v_src = v_load(src + x); - __m128 v_dst00 = _mm_loadu_ps(dst + x); - __m128 v_dst01 = _mm_loadu_ps(dst + x + 4); - __m128 v_dst10 = _mm_loadu_ps(dst + x + 8); - __m128 v_dst11 = _mm_loadu_ps(dst + x + 12); + v_uint16x8 v_src0, v_src1; + v_expand(v_src, v_src0, v_src1); - v_dst00 = _mm_add_ps(_mm_mul_ps(v_dst00, v_beta), _mm_mul_ps(v_src00, v_alpha)); - v_dst01 = _mm_add_ps(_mm_mul_ps(v_dst01, v_beta), _mm_mul_ps(v_src01, v_alpha)); - v_dst10 = _mm_add_ps(_mm_mul_ps(v_dst10, v_beta), _mm_mul_ps(v_src10, v_alpha)); - v_dst11 = _mm_add_ps(_mm_mul_ps(v_dst11, v_beta), _mm_mul_ps(v_src11, v_alpha)); + v_uint32x4 v_src00, v_src01, v_src10, v_src11; + v_expand(v_src0, v_src00, v_src01); + v_expand(v_src1, v_src10, v_src11); - _mm_storeu_ps(dst + x, v_dst00); - _mm_storeu_ps(dst + x + 4, v_dst01); - _mm_storeu_ps(dst + x + 8, v_dst10); - _mm_storeu_ps(dst + x + 12, v_dst11); + v_float32x4 v_dst00 = v_load(dst + x); + v_float32x4 v_dst01 = v_load(dst + x + 4); + v_float32x4 v_dst10 = v_load(dst + x + 8); + v_float32x4 v_dst11 = v_load(dst + x + 12); + + v_dst00 = (v_dst00 * v_beta) + (v_cvt_f32(v_reinterpret_as_s32(v_src00)) * v_alpha); + v_dst01 = (v_dst01 * v_beta) + (v_cvt_f32(v_reinterpret_as_s32(v_src01)) * v_alpha); + v_dst10 = (v_dst10 * v_beta) + (v_cvt_f32(v_reinterpret_as_s32(v_src10)) * v_alpha); + v_dst11 = (v_dst11 * v_beta) + (v_cvt_f32(v_reinterpret_as_s32(v_src11)) * v_alpha); + + v_store(dst + x, v_dst00); + v_store(dst + x + 4, v_dst01); + v_store(dst + x + 8, v_dst10); + v_store(dst + x + 12, v_dst11); } } @@ -1330,26 +1362,28 @@ struct AccW_SIMD int operator() (const ushort * src, float * dst, const uchar * mask, int len, int cn, float alpha) const { int x = 0; - __m128 v_alpha = _mm_set1_ps(alpha); - __m128 v_beta = _mm_set1_ps(1.0f - alpha); - __m128i v_0 = _mm_setzero_si128(); + v_float32x4 v_alpha = v_setall_f32(alpha); + v_float32x4 v_beta = v_setall_f32(1.0f - alpha); if (!mask) { len *= cn; for ( ; x <= len - 8; x += 8) { - __m128i v_src = _mm_loadu_si128((const __m128i*)(src + x)); - __m128 v_src0 = _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_src, v_0)); - __m128 v_src1 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_src, v_0)); - v_src0 = _mm_mul_ps(v_src0, v_alpha); - v_src1 = _mm_mul_ps(v_src1, v_alpha); + v_uint16x8 v_src = v_load(src + x); + v_uint32x4 v_int0, v_int1; + v_expand(v_src, v_int0, v_int1); - __m128 v_dst0 = _mm_mul_ps(_mm_loadu_ps(dst + x), v_beta); - __m128 v_dst1 = _mm_mul_ps(_mm_loadu_ps(dst + x + 4), v_beta); + v_float32x4 v_src0 = v_cvt_f32(v_reinterpret_as_s32(v_int0)); + v_float32x4 v_src1 = v_cvt_f32(v_reinterpret_as_s32(v_int1)); + v_src0 = v_src0 * v_alpha; + v_src1 = v_src1 * v_alpha; - _mm_storeu_ps(dst + x, _mm_add_ps(v_dst0, v_src0)); - _mm_storeu_ps(dst + x + 4, _mm_add_ps(v_dst1, v_src1)); + v_float32x4 v_dst0 = v_load(dst + x) * v_beta; + v_float32x4 v_dst1 = v_load(dst + x + 4) * v_beta; + + v_store(dst + x, v_dst0 + v_src0); + v_store(dst + x + 4, v_dst1 + v_src1); } } @@ -1357,44 +1391,50 @@ struct AccW_SIMD } }; +#if CV_SIMD128_64F template <> struct AccW_SIMD { int operator() (const uchar * src, double * dst, const uchar * mask, int len, int cn, double alpha) const { int x = 0; - __m128d v_alpha = _mm_set1_pd(alpha); - __m128d v_beta = _mm_set1_pd(1.0f - alpha); - __m128i v_0 = _mm_setzero_si128(); + v_float64x2 v_alpha = v_setall_f64(alpha); + v_float64x2 v_beta = v_setall_f64(1.0f - alpha); if (!mask) { len *= cn; for ( ; x <= len - 8; x += 8) { - __m128i v_src = _mm_loadl_epi64((const __m128i*)(src + x)); - __m128i v_int = _mm_unpacklo_epi8(v_src, v_0); - __m128i v_int0 = _mm_unpacklo_epi16(v_int, v_0); - __m128i v_int1 = _mm_unpackhi_epi16(v_int, v_0); - __m128d v_src0 = _mm_cvtepi32_pd(v_int0); - __m128d v_src1 = _mm_cvtepi32_pd(_mm_shuffle_epi32(v_int0, _MM_SHUFFLE(0, 0, 3, 2))); - __m128d v_src2 = _mm_cvtepi32_pd(v_int1); - __m128d v_src3 = _mm_cvtepi32_pd(_mm_shuffle_epi32(v_int1, _MM_SHUFFLE(0, 0, 3, 2))); + v_uint8x16 v_src = v_load(src + x); + v_uint16x8 v_int, dummy; + v_expand(v_src, v_int, dummy); - __m128d v_dst0 = _mm_loadu_pd(dst + x); - __m128d v_dst1 = _mm_loadu_pd(dst + x + 2); - __m128d v_dst2 = _mm_loadu_pd(dst + x + 4); - __m128d v_dst3 = _mm_loadu_pd(dst + x + 6); + v_uint32x4 v_int_0, v_int_1; + v_expand(v_int, v_int_0, v_int_1); - v_dst0 = _mm_add_pd(_mm_mul_pd(v_dst0, v_beta), _mm_mul_pd(v_src0, v_alpha)); - v_dst1 = _mm_add_pd(_mm_mul_pd(v_dst1, v_beta), _mm_mul_pd(v_src1, v_alpha)); - v_dst2 = _mm_add_pd(_mm_mul_pd(v_dst2, v_beta), _mm_mul_pd(v_src2, v_alpha)); - v_dst3 = _mm_add_pd(_mm_mul_pd(v_dst3, v_beta), _mm_mul_pd(v_src3, v_alpha)); + v_int32x4 v_int0 = v_reinterpret_as_s32(v_int_0); + v_int32x4 v_int1 = v_reinterpret_as_s32(v_int_1); - _mm_storeu_pd(dst + x, v_dst0); - _mm_storeu_pd(dst + x + 2, v_dst1); - _mm_storeu_pd(dst + x + 4, v_dst2); - _mm_storeu_pd(dst + x + 6, v_dst3); + v_float64x2 v_src0 = v_cvt_f64(v_int0); + v_float64x2 v_src1 = v_cvt_f64_high(v_int0); + v_float64x2 v_src2 = v_cvt_f64(v_int1); + v_float64x2 v_src3 = v_cvt_f64_high(v_int1); + + v_float64x2 v_dst0 = v_load(dst + x); + v_float64x2 v_dst1 = v_load(dst + x + 2); + v_float64x2 v_dst2 = v_load(dst + x + 4); + v_float64x2 v_dst3 = v_load(dst + x + 6); + + v_dst0 = (v_dst0 * v_beta) + (v_src0 * v_alpha); + v_dst1 = (v_dst1 * v_beta) + (v_src1 * v_alpha); + v_dst2 = (v_dst2 * v_beta) + (v_src2 * v_alpha); + v_dst3 = (v_dst3 * v_beta) + (v_src3 * v_alpha); + + v_store(dst + x, v_dst0); + v_store(dst + x + 2, v_dst1); + v_store(dst + x + 4, v_dst2); + v_store(dst + x + 6, v_dst3); } } @@ -1408,431 +1448,48 @@ struct AccW_SIMD int operator() (const ushort * src, double * dst, const uchar * mask, int len, int cn, double alpha) const { int x = 0; - __m128d v_alpha = _mm_set1_pd(alpha); - __m128d v_beta = _mm_set1_pd(1.0f - alpha); - __m128i v_0 = _mm_setzero_si128(); + v_float64x2 v_alpha = v_setall_f64(alpha); + v_float64x2 v_beta = v_setall_f64(1.0f - alpha); if (!mask) { len *= cn; for ( ; x <= len - 8; x += 8) { - __m128i v_src = _mm_loadu_si128((const __m128i*)(src + x)); - __m128i v_int0 = _mm_unpacklo_epi16(v_src, v_0); - __m128i v_int1 = _mm_unpackhi_epi16(v_src, v_0); - __m128d v_src00 = _mm_cvtepi32_pd(v_int0); - __m128d v_src01 = _mm_cvtepi32_pd(_mm_shuffle_epi32(v_int0, _MM_SHUFFLE(0, 0, 3, 2))); - __m128d v_src10 = _mm_cvtepi32_pd(v_int1); - __m128d v_src11 = _mm_cvtepi32_pd(_mm_shuffle_epi32(v_int1, _MM_SHUFFLE(0, 0, 3, 2))); + v_uint16x8 v_src = v_load(src + x); + v_uint32x4 v_int_0, v_int_1; + v_expand(v_src, v_int_0, v_int_1); - __m128d v_dst00 = _mm_loadu_pd(dst + x); - __m128d v_dst01 = _mm_loadu_pd(dst + x + 2); - __m128d v_dst10 = _mm_loadu_pd(dst + x + 4); - __m128d v_dst11 = _mm_loadu_pd(dst + x + 6); + v_int32x4 v_int0 = v_reinterpret_as_s32(v_int_0); + v_int32x4 v_int1 = v_reinterpret_as_s32(v_int_1); - v_dst00 = _mm_add_pd(_mm_mul_pd(v_dst00, v_beta), _mm_mul_pd(v_src00, v_alpha)); - v_dst01 = _mm_add_pd(_mm_mul_pd(v_dst01, v_beta), _mm_mul_pd(v_src01, v_alpha)); - v_dst10 = _mm_add_pd(_mm_mul_pd(v_dst10, v_beta), _mm_mul_pd(v_src10, v_alpha)); - v_dst11 = _mm_add_pd(_mm_mul_pd(v_dst11, v_beta), _mm_mul_pd(v_src11, v_alpha)); + v_float64x2 v_src00 = v_cvt_f64(v_int0); + v_float64x2 v_src01 = v_cvt_f64_high(v_int0); + v_float64x2 v_src10 = v_cvt_f64(v_int1); + v_float64x2 v_src11 = v_cvt_f64_high(v_int1); - _mm_storeu_pd(dst + x, v_dst00); - _mm_storeu_pd(dst + x + 2, v_dst01); - _mm_storeu_pd(dst + x + 4, v_dst10); - _mm_storeu_pd(dst + x + 6, v_dst11); + v_float64x2 v_dst00 = v_load(dst + x); + v_float64x2 v_dst01 = v_load(dst + x + 2); + v_float64x2 v_dst10 = v_load(dst + x + 4); + v_float64x2 v_dst11 = v_load(dst + x + 6); + + v_dst00 = (v_dst00 * v_beta) + (v_src00 * v_alpha); + v_dst01 = (v_dst01 * v_beta) + (v_src01 * v_alpha); + v_dst10 = (v_dst10 * v_beta) + (v_src10 * v_alpha); + v_dst11 = (v_dst11 * v_beta) + (v_src11 * v_alpha); + + v_store(dst + x, v_dst00); + v_store(dst + x + 2, v_dst01); + v_store(dst + x + 4, v_dst10); + v_store(dst + x + 6, v_dst11); } } return x; } }; -#endif //CV_SSE2 - -#if CV_NEON - -template <> -struct Acc_SIMD -{ - int operator() (const uchar * src, float * dst, const uchar * mask, int len, int cn) const - { - int x = 0; - - if (!mask) - { - len *= cn; - for ( ; x <= len - 16; x += 16) - { - uint8x16_t v_src = vld1q_u8(src + x); - uint16x8_t v_src0 = vmovl_u8(vget_low_u8(v_src)), v_src1 = vmovl_u8(vget_high_u8(v_src)); - - vst1q_f32(dst + x, vaddq_f32(vld1q_f32(dst + x), vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src0))))); - vst1q_f32(dst + x + 4, vaddq_f32(vld1q_f32(dst + x + 4), vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src0))))); - vst1q_f32(dst + x + 8, vaddq_f32(vld1q_f32(dst + x + 8), vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src1))))); - vst1q_f32(dst + x + 12, vaddq_f32(vld1q_f32(dst + x + 12), vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src1))))); - } - } - else if (cn == 1) - { - uint8x16_t v_255 = vdupq_n_u8(255), v_0 = vdupq_n_u8(0); - - for ( ; x <= len - 16; x += 16) - { - uint8x16_t v_src = vandq_u8(vld1q_u8(src + x), veorq_u8(v_255, vceqq_u8(vld1q_u8(mask + x), v_0))); - uint16x8_t v_src0 = vmovl_u8(vget_low_u8(v_src)), v_src1 = vmovl_u8(vget_high_u8(v_src)); - - vst1q_f32(dst + x, vaddq_f32(vld1q_f32(dst + x), vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src0))))); - vst1q_f32(dst + x + 4, vaddq_f32(vld1q_f32(dst + x + 4), vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src0))))); - vst1q_f32(dst + x + 8, vaddq_f32(vld1q_f32(dst + x + 8), vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src1))))); - vst1q_f32(dst + x + 12, vaddq_f32(vld1q_f32(dst + x + 12), vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src1))))); - } - } - - return x; - } -}; - -template <> -struct Acc_SIMD -{ - int operator() (const ushort * src, float * dst, const uchar * mask, int len, int cn) const - { - int x = 0; - - if (!mask) - { - len *= cn; - for ( ; x <= len - 8; x += 8) - { - uint16x8_t v_src = vld1q_u16(src + x); - uint32x4_t v_src0 = vmovl_u16(vget_low_u16(v_src)), v_src1 = vmovl_u16(vget_high_u16(v_src)); - - vst1q_f32(dst + x, vaddq_f32(vld1q_f32(dst + x), vcvtq_f32_u32(v_src0))); - vst1q_f32(dst + x + 4, vaddq_f32(vld1q_f32(dst + x + 4), vcvtq_f32_u32(v_src1))); - } - } - - return x; - } -}; - -template <> -struct Acc_SIMD -{ - int operator() (const float * src, float * dst, const uchar * mask, int len, int cn) const - { - int x = 0; - - if (!mask) - { - len *= cn; - for ( ; x <= len - 8; x += 8) - { - vst1q_f32(dst + x, vaddq_f32(vld1q_f32(dst + x), vld1q_f32(src + x))); - vst1q_f32(dst + x + 4, vaddq_f32(vld1q_f32(dst + x + 4), vld1q_f32(src + x + 4))); - } - } - - return x; - } -}; - -template <> -struct AccSqr_SIMD -{ - int operator() (const uchar * src, float * dst, const uchar * mask, int len, int cn) const - { - int x = 0; - - if (!mask) - { - len *= cn; - for ( ; x <= len - 16; x += 16) - { - uint8x16_t v_src = vld1q_u8(src + x); - uint8x8_t v_src_0 = vget_low_u8(v_src), v_src_1 = vget_high_u8(v_src); - uint16x8_t v_src0 = vmull_u8(v_src_0, v_src_0), v_src1 = vmull_u8(v_src_1, v_src_1); - - vst1q_f32(dst + x, vaddq_f32(vld1q_f32(dst + x), vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src0))))); - vst1q_f32(dst + x + 4, vaddq_f32(vld1q_f32(dst + x + 4), vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src0))))); - vst1q_f32(dst + x + 8, vaddq_f32(vld1q_f32(dst + x + 8), vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src1))))); - vst1q_f32(dst + x + 12, vaddq_f32(vld1q_f32(dst + x + 12), vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src1))))); - } - } - else if (cn == 1) - { - uint8x16_t v_255 = vdupq_n_u8(255), v_0 = vdupq_n_u8(0); - - for ( ; x <= len - 16; x += 16) - { - uint8x16_t v_src = vandq_u8(vld1q_u8(src + x), veorq_u8(v_255, vceqq_u8(vld1q_u8(mask + x), v_0))); - uint8x8_t v_src_0 = vget_low_u8(v_src), v_src_1 = vget_high_u8(v_src); - uint16x8_t v_src0 = vmull_u8(v_src_0, v_src_0), v_src1 = vmull_u8(v_src_1, v_src_1); - - vst1q_f32(dst + x, vaddq_f32(vld1q_f32(dst + x), vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src0))))); - vst1q_f32(dst + x + 4, vaddq_f32(vld1q_f32(dst + x + 4), vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src0))))); - vst1q_f32(dst + x + 8, vaddq_f32(vld1q_f32(dst + x + 8), vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src1))))); - vst1q_f32(dst + x + 12, vaddq_f32(vld1q_f32(dst + x + 12), vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src1))))); - } - } - - return x; - } -}; - -template <> -struct AccSqr_SIMD -{ - int operator() (const ushort * src, float * dst, const uchar * mask, int len, int cn) const - { - int x = 0; - - if (!mask) - { - len *= cn; - for ( ; x <= len - 8; x += 8) - { - uint16x8_t v_src = vld1q_u16(src + x); - uint16x4_t v_src_0 = vget_low_u16(v_src), v_src_1 = vget_high_u16(v_src); - uint32x4_t v_src0 = vmull_u16(v_src_0, v_src_0), v_src1 = vmull_u16(v_src_1, v_src_1); - - vst1q_f32(dst + x, vaddq_f32(vld1q_f32(dst + x), vcvtq_f32_u32(v_src0))); - vst1q_f32(dst + x + 4, vaddq_f32(vld1q_f32(dst + x + 4), vcvtq_f32_u32(v_src1))); - } - } - else if (cn == 1) - { - uint8x8_t v_255 = vdup_n_u8(255), v_0 = vdup_n_u8(0); - - for ( ; x <= len - 8; x += 8) - { - uint8x8_t v_mask_src = veor_u8(v_255, vceq_u8(vld1_u8(mask + x), v_0)); - uint8x8x2_t v_mask_zp = vzip_u8(v_mask_src, v_mask_src); - uint16x8_t v_mask = vreinterpretq_u16_u8(vcombine_u8(v_mask_zp.val[0], v_mask_zp.val[1])), - v_src = vandq_u16(vld1q_u16(src + x), v_mask); - - uint16x4_t v_src_0 = vget_low_u16(v_src), v_src_1 = vget_high_u16(v_src); - uint32x4_t v_src0 = vmull_u16(v_src_0, v_src_0), v_src1 = vmull_u16(v_src_1, v_src_1); - - vst1q_f32(dst + x, vaddq_f32(vld1q_f32(dst + x), vcvtq_f32_u32(v_src0))); - vst1q_f32(dst + x + 4, vaddq_f32(vld1q_f32(dst + x + 4), vcvtq_f32_u32(v_src1))); - } - } - - return x; - } -}; - -template <> -struct AccSqr_SIMD -{ - int operator() (const float * src, float * dst, const uchar * mask, int len, int cn) const - { - int x = 0; - - if (!mask) - { - len *= cn; - for ( ; x <= len - 8; x += 8) - { - float32x4_t v_src = vld1q_f32(src + x); - vst1q_f32(dst + x, vmlaq_f32(vld1q_f32(dst + x), v_src, v_src)); - - v_src = vld1q_f32(src + x + 4); - vst1q_f32(dst + x + 4, vmlaq_f32(vld1q_f32(dst + x + 4), v_src, v_src)); - } - } - - return x; - } -}; - -template <> -struct AccProd_SIMD -{ - int operator() (const uchar * src1, const uchar * src2, float * dst, const uchar * mask, int len, int cn) const - { - int x = 0; - - if (!mask) - { - len *= cn; - for ( ; x <= len - 16; x += 16) - { - uint8x16_t v_1src = vld1q_u8(src1 + x), v_2src = vld1q_u8(src2 + x); - uint16x8_t v_src0 = vmull_u8(vget_low_u8(v_1src), vget_low_u8(v_2src)), - v_src1 = vmull_u8(vget_high_u8(v_1src), vget_high_u8(v_2src)); - - vst1q_f32(dst + x, vaddq_f32(vld1q_f32(dst + x), vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src0))))); - vst1q_f32(dst + x + 4, vaddq_f32(vld1q_f32(dst + x + 4), vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src0))))); - vst1q_f32(dst + x + 8, vaddq_f32(vld1q_f32(dst + x + 8), vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src1))))); - vst1q_f32(dst + x + 12, vaddq_f32(vld1q_f32(dst + x + 12), vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src1))))); - } - } - else if (cn == 1) - { - uint8x16_t v_255 = vdupq_n_u8(255), v_0 = vdupq_n_u8(0); - - for ( ; x <= len - 16; x += 16) - { - uint8x16_t v_mask = veorq_u8(v_255, vceqq_u8(vld1q_u8(mask + x), v_0)); - uint8x16_t v_1src = vandq_u8(vld1q_u8(src1 + x), v_mask), v_2src = vandq_u8(vld1q_u8(src2 + x), v_mask); - uint16x8_t v_src0 = vmull_u8(vget_low_u8(v_1src), vget_low_u8(v_2src)), - v_src1 = vmull_u8(vget_high_u8(v_1src), vget_high_u8(v_2src)); - - vst1q_f32(dst + x, vaddq_f32(vld1q_f32(dst + x), vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src0))))); - vst1q_f32(dst + x + 4, vaddq_f32(vld1q_f32(dst + x + 4), vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src0))))); - vst1q_f32(dst + x + 8, vaddq_f32(vld1q_f32(dst + x + 8), vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src1))))); - vst1q_f32(dst + x + 12, vaddq_f32(vld1q_f32(dst + x + 12), vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src1))))); - } - } - - return x; - } -}; - -template <> -struct AccProd_SIMD -{ - int operator() (const ushort * src1, const ushort * src2, float * dst, const uchar * mask, int len, int cn) const - { - int x = 0; - - if (!mask) - { - len *= cn; - for ( ; x <= len - 8; x += 8) - { - uint16x8_t v_1src = vld1q_u16(src1 + x), v_2src = vld1q_u16(src2 + x); - uint32x4_t v_src0 = vmull_u16(vget_low_u16(v_1src), vget_low_u16(v_2src)), - v_src1 = vmull_u16(vget_high_u16(v_1src), vget_high_u16(v_2src)); - - vst1q_f32(dst + x, vaddq_f32(vld1q_f32(dst + x), vcvtq_f32_u32(v_src0))); - vst1q_f32(dst + x + 4, vaddq_f32(vld1q_f32(dst + x + 4), vcvtq_f32_u32(v_src1))); - } - } - else if (cn == 1) - { - uint8x8_t v_255 = vdup_n_u8(255), v_0 = vdup_n_u8(0); - - for ( ; x <= len - 8; x += 8) - { - uint8x8_t v_mask_src = veor_u8(v_255, vceq_u8(vld1_u8(mask + x), v_0)); - uint8x8x2_t v_mask_zp = vzip_u8(v_mask_src, v_mask_src); - uint16x8_t v_mask = vreinterpretq_u16_u8(vcombine_u8(v_mask_zp.val[0], v_mask_zp.val[1])), - v_1src = vandq_u16(vld1q_u16(src1 + x), v_mask), - v_2src = vandq_u16(vld1q_u16(src2 + x), v_mask); - - uint32x4_t v_src0 = vmull_u16(vget_low_u16(v_1src), vget_low_u16(v_2src)), - v_src1 = vmull_u16(vget_high_u16(v_1src), vget_high_u16(v_2src)); - - vst1q_f32(dst + x, vaddq_f32(vld1q_f32(dst + x), vcvtq_f32_u32(v_src0))); - vst1q_f32(dst + x + 4, vaddq_f32(vld1q_f32(dst + x + 4), vcvtq_f32_u32(v_src1))); - } - } - - return x; - } -}; - -template <> -struct AccProd_SIMD -{ - int operator() (const float * src1, const float * src2, float * dst, const uchar * mask, int len, int cn) const - { - int x = 0; - - if (!mask) - { - len *= cn; - for ( ; x <= len - 8; x += 8) - { - vst1q_f32(dst + x, vmlaq_f32(vld1q_f32(dst + x), vld1q_f32(src1 + x), vld1q_f32(src2 + x))); - vst1q_f32(dst + x + 4, vmlaq_f32(vld1q_f32(dst + x + 4), vld1q_f32(src1 + x + 4), vld1q_f32(src2 + x + 4))); - } - } - - return x; - } -}; - -template <> -struct AccW_SIMD -{ - int operator() (const uchar * src, float * dst, const uchar * mask, int len, int cn, float alpha) const - { - int x = 0; - float32x4_t v_alpha = vdupq_n_f32(alpha), v_beta = vdupq_n_f32(1.0f - alpha); - - if (!mask) - { - len *= cn; - for ( ; x <= len - 16; x += 16) - { - uint8x16_t v_src = vld1q_u8(src + x); - uint16x8_t v_src0 = vmovl_u8(vget_low_u8(v_src)), v_src1 = vmovl_u8(vget_high_u8(v_src)); - - vst1q_f32(dst + x, vmlaq_f32(vmulq_f32(vld1q_f32(dst + x), v_beta), - vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src0))), v_alpha)); - vst1q_f32(dst + x + 4, vmlaq_f32(vmulq_f32(vld1q_f32(dst + x + 4), v_beta), - vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src0))), v_alpha)); - vst1q_f32(dst + x + 8, vmlaq_f32(vmulq_f32(vld1q_f32(dst + x + 8), v_beta), - vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src1))), v_alpha)); - vst1q_f32(dst + x + 12, vmlaq_f32(vmulq_f32(vld1q_f32(dst + x + 12), v_beta), - vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src1))), v_alpha)); - } - } - - return x; - } -}; - -template <> -struct AccW_SIMD -{ - int operator() (const ushort * src, float * dst, const uchar * mask, int len, int cn, float alpha) const - { - int x = 0; - float32x4_t v_alpha = vdupq_n_f32(alpha), v_beta = vdupq_n_f32(1.0f - alpha); - - if (!mask) - { - len *= cn; - for ( ; x <= len - 8; x += 8) - { - uint16x8_t v_src = vld1q_u16(src + x); - uint32x4_t v_src0 = vmovl_u16(vget_low_u16(v_src)), v_src1 = vmovl_u16(vget_high_u16(v_src)); - - vst1q_f32(dst + x, vmlaq_f32(vmulq_f32(vld1q_f32(dst + x), v_beta), vcvtq_f32_u32(v_src0), v_alpha)); - vst1q_f32(dst + x + 4, vmlaq_f32(vmulq_f32(vld1q_f32(dst + x + 4), v_beta), vcvtq_f32_u32(v_src1), v_alpha)); - } - } - - return x; - } -}; - -template <> -struct AccW_SIMD -{ - int operator() (const float * src, float * dst, const uchar * mask, int len, int cn, float alpha) const - { - int x = 0; - float32x4_t v_alpha = vdupq_n_f32(alpha), v_beta = vdupq_n_f32(1.0f - alpha); - - if (!mask) - { - len *= cn; - for ( ; x <= len - 8; x += 8) - { - vst1q_f32(dst + x, vmlaq_f32(vmulq_f32(vld1q_f32(dst + x), v_beta), vld1q_f32(src + x), v_alpha)); - vst1q_f32(dst + x + 4, vmlaq_f32(vmulq_f32(vld1q_f32(dst + x + 4), v_beta), vld1q_f32(src + x + 4), v_alpha)); - } - } - - return x; - } -}; - -#endif +#endif //CV_SIMD128_64F +#endif //CV_SIMD128 template void acc_( const T* src, AT* dst, const uchar* mask, int len, int cn ) @@ -2212,6 +1869,8 @@ namespace cv { static bool ipp_accumulate(InputArray _src, InputOutputArray _dst, InputArray _mask) { + CV_INSTRUMENT_REGION_IPP() + int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype); int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype); @@ -2219,28 +1878,28 @@ static bool ipp_accumulate(InputArray _src, InputOutputArray _dst, InputArray _m if (src.dims <= 2 || (src.isContinuous() && dst.isContinuous() && (mask.empty() || mask.isContinuous()))) { - typedef IppStatus (CV_STDCALL * ippiAdd)(const void * pSrc, int srcStep, Ipp32f * pSrcDst, int srcdstStep, IppiSize roiSize); - typedef IppStatus (CV_STDCALL * ippiAddMask)(const void * pSrc, int srcStep, const Ipp8u * pMask, int maskStep, Ipp32f * pSrcDst, + typedef IppStatus (CV_STDCALL * IppiAdd)(const void * pSrc, int srcStep, Ipp32f * pSrcDst, int srcdstStep, IppiSize roiSize); + typedef IppStatus (CV_STDCALL * IppiAddMask)(const void * pSrc, int srcStep, const Ipp8u * pMask, int maskStep, Ipp32f * pSrcDst, int srcDstStep, IppiSize roiSize); - ippiAdd ippFunc = 0; - ippiAddMask ippFuncMask = 0; + IppiAdd ippiAdd_I = 0; + IppiAddMask ippiAdd_IM = 0; if (mask.empty()) { CV_SUPPRESS_DEPRECATED_START - ippFunc = sdepth == CV_8U && ddepth == CV_32F ? (ippiAdd)ippiAdd_8u32f_C1IR : - sdepth == CV_16U && ddepth == CV_32F ? (ippiAdd)ippiAdd_16u32f_C1IR : - sdepth == CV_32F && ddepth == CV_32F ? (ippiAdd)ippiAdd_32f_C1IR : 0; + ippiAdd_I = sdepth == CV_8U && ddepth == CV_32F ? (IppiAdd)ippiAdd_8u32f_C1IR : + sdepth == CV_16U && ddepth == CV_32F ? (IppiAdd)ippiAdd_16u32f_C1IR : + sdepth == CV_32F && ddepth == CV_32F ? (IppiAdd)ippiAdd_32f_C1IR : 0; CV_SUPPRESS_DEPRECATED_END } else if (scn == 1) { - ippFuncMask = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddMask)ippiAdd_8u32f_C1IMR : - sdepth == CV_16U && ddepth == CV_32F ? (ippiAddMask)ippiAdd_16u32f_C1IMR : - sdepth == CV_32F && ddepth == CV_32F ? (ippiAddMask)ippiAdd_32f_C1IMR : 0; + ippiAdd_IM = sdepth == CV_8U && ddepth == CV_32F ? (IppiAddMask)ippiAdd_8u32f_C1IMR : + sdepth == CV_16U && ddepth == CV_32F ? (IppiAddMask)ippiAdd_16u32f_C1IMR : + sdepth == CV_32F && ddepth == CV_32F ? (IppiAddMask)ippiAdd_32f_C1IMR : 0; } - if (ippFunc || ippFuncMask) + if (ippiAdd_I || ippiAdd_IM) { IppStatus status = ippStsErr; @@ -2256,11 +1915,11 @@ static bool ipp_accumulate(InputArray _src, InputOutputArray _dst, InputArray _m } size.width *= scn; - if (ippFunc) - status = ippFunc(src.ptr(), srcstep, dst.ptr(), dststep, ippiSize(size.width, size.height)); - else if(ippFuncMask) - status = ippFuncMask(src.ptr(), srcstep, mask.ptr(), maskstep, - dst.ptr(), dststep, ippiSize(size.width, size.height)); + if (ippiAdd_I) + status = CV_INSTRUMENT_FUN_IPP(ippiAdd_I, src.ptr(), srcstep, dst.ptr(), dststep, ippiSize(size.width, size.height)); + else if (ippiAdd_IM) + status = CV_INSTRUMENT_FUN_IPP(ippiAdd_IM, src.ptr(), srcstep, mask.ptr(), maskstep, + dst.ptr(), dststep, ippiSize(size.width, size.height)); if (status >= 0) return true; @@ -2273,6 +1932,8 @@ static bool ipp_accumulate(InputArray _src, InputOutputArray _dst, InputArray _m void cv::accumulate( InputArray _src, InputOutputArray _dst, InputArray _mask ) { + CV_INSTRUMENT_REGION() + int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype); int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype), dcn = CV_MAT_CN(dtype); @@ -2306,6 +1967,8 @@ namespace cv { static bool ipp_accumulate_square(InputArray _src, InputOutputArray _dst, InputArray _mask) { + CV_INSTRUMENT_REGION_IPP() + int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype); int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype); @@ -2316,23 +1979,23 @@ static bool ipp_accumulate_square(InputArray _src, InputOutputArray _dst, InputA typedef IppStatus (CV_STDCALL * ippiAddSquare)(const void * pSrc, int srcStep, Ipp32f * pSrcDst, int srcdstStep, IppiSize roiSize); typedef IppStatus (CV_STDCALL * ippiAddSquareMask)(const void * pSrc, int srcStep, const Ipp8u * pMask, int maskStep, Ipp32f * pSrcDst, int srcDstStep, IppiSize roiSize); - ippiAddSquare ippFunc = 0; - ippiAddSquareMask ippFuncMask = 0; + ippiAddSquare ippiAddSquare_I = 0; + ippiAddSquareMask ippiAddSquare_IM = 0; if (mask.empty()) { - ippFunc = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddSquare)ippiAddSquare_8u32f_C1IR : + ippiAddSquare_I = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddSquare)ippiAddSquare_8u32f_C1IR : sdepth == CV_16U && ddepth == CV_32F ? (ippiAddSquare)ippiAddSquare_16u32f_C1IR : sdepth == CV_32F && ddepth == CV_32F ? (ippiAddSquare)ippiAddSquare_32f_C1IR : 0; } else if (scn == 1) { - ippFuncMask = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddSquareMask)ippiAddSquare_8u32f_C1IMR : + ippiAddSquare_IM = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddSquareMask)ippiAddSquare_8u32f_C1IMR : sdepth == CV_16U && ddepth == CV_32F ? (ippiAddSquareMask)ippiAddSquare_16u32f_C1IMR : sdepth == CV_32F && ddepth == CV_32F ? (ippiAddSquareMask)ippiAddSquare_32f_C1IMR : 0; } - if (ippFunc || ippFuncMask) + if (ippiAddSquare_I || ippiAddSquare_IM) { IppStatus status = ippStsErr; @@ -2348,11 +2011,11 @@ static bool ipp_accumulate_square(InputArray _src, InputOutputArray _dst, InputA } size.width *= scn; - if (ippFunc) - status = ippFunc(src.ptr(), srcstep, dst.ptr(), dststep, ippiSize(size.width, size.height)); - else if(ippFuncMask) - status = ippFuncMask(src.ptr(), srcstep, mask.ptr(), maskstep, - dst.ptr(), dststep, ippiSize(size.width, size.height)); + if (ippiAddSquare_I) + status = CV_INSTRUMENT_FUN_IPP(ippiAddSquare_I, src.ptr(), srcstep, dst.ptr(), dststep, ippiSize(size.width, size.height)); + else if (ippiAddSquare_IM) + status = CV_INSTRUMENT_FUN_IPP(ippiAddSquare_IM, src.ptr(), srcstep, mask.ptr(), maskstep, + dst.ptr(), dststep, ippiSize(size.width, size.height)); if (status >= 0) return true; @@ -2365,6 +2028,8 @@ static bool ipp_accumulate_square(InputArray _src, InputOutputArray _dst, InputA void cv::accumulateSquare( InputArray _src, InputOutputArray _dst, InputArray _mask ) { + CV_INSTRUMENT_REGION() + int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype); int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype), dcn = CV_MAT_CN(dtype); @@ -2398,6 +2063,8 @@ namespace cv static bool ipp_accumulate_product(InputArray _src1, InputArray _src2, InputOutputArray _dst, InputArray _mask) { + CV_INSTRUMENT_REGION_IPP() + int stype = _src1.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype); int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype); @@ -2409,23 +2076,23 @@ static bool ipp_accumulate_product(InputArray _src1, InputArray _src2, int src2Step, Ipp32f * pSrcDst, int srcDstStep, IppiSize roiSize); typedef IppStatus (CV_STDCALL * ippiAddProductMask)(const void * pSrc1, int src1Step, const void * pSrc2, int src2Step, const Ipp8u * pMask, int maskStep, Ipp32f * pSrcDst, int srcDstStep, IppiSize roiSize); - ippiAddProduct ippFunc = 0; - ippiAddProductMask ippFuncMask = 0; + ippiAddProduct ippiAddProduct_I = 0; + ippiAddProductMask ippiAddProduct_IM = 0; if (mask.empty()) { - ippFunc = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddProduct)ippiAddProduct_8u32f_C1IR : + ippiAddProduct_I = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddProduct)ippiAddProduct_8u32f_C1IR : sdepth == CV_16U && ddepth == CV_32F ? (ippiAddProduct)ippiAddProduct_16u32f_C1IR : sdepth == CV_32F && ddepth == CV_32F ? (ippiAddProduct)ippiAddProduct_32f_C1IR : 0; } else if (scn == 1) { - ippFuncMask = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddProductMask)ippiAddProduct_8u32f_C1IMR : + ippiAddProduct_IM = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddProductMask)ippiAddProduct_8u32f_C1IMR : sdepth == CV_16U && ddepth == CV_32F ? (ippiAddProductMask)ippiAddProduct_16u32f_C1IMR : sdepth == CV_32F && ddepth == CV_32F ? (ippiAddProductMask)ippiAddProduct_32f_C1IMR : 0; } - if (ippFunc || ippFuncMask) + if (ippiAddProduct_I || ippiAddProduct_IM) { IppStatus status = ippStsErr; @@ -2442,12 +2109,12 @@ static bool ipp_accumulate_product(InputArray _src1, InputArray _src2, } size.width *= scn; - if (ippFunc) - status = ippFunc(src1.ptr(), src1step, src2.ptr(), src2step, dst.ptr(), - dststep, ippiSize(size.width, size.height)); - else if(ippFuncMask) - status = ippFuncMask(src1.ptr(), src1step, src2.ptr(), src2step, mask.ptr(), maskstep, - dst.ptr(), dststep, ippiSize(size.width, size.height)); + if (ippiAddProduct_I) + status = CV_INSTRUMENT_FUN_IPP(ippiAddProduct_I, src1.ptr(), src1step, src2.ptr(), src2step, dst.ptr(), + dststep, ippiSize(size.width, size.height)); + else if (ippiAddProduct_IM) + status = CV_INSTRUMENT_FUN_IPP(ippiAddProduct_IM, src1.ptr(), src1step, src2.ptr(), src2step, mask.ptr(), maskstep, + dst.ptr(), dststep, ippiSize(size.width, size.height)); if (status >= 0) return true; @@ -2463,6 +2130,8 @@ static bool ipp_accumulate_product(InputArray _src1, InputArray _src2, void cv::accumulateProduct( InputArray _src1, InputArray _src2, InputOutputArray _dst, InputArray _mask ) { + CV_INSTRUMENT_REGION() + int stype = _src1.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype); int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype), dcn = CV_MAT_CN(dtype); @@ -2497,6 +2166,8 @@ namespace cv static bool ipp_accumulate_weighted( InputArray _src, InputOutputArray _dst, double alpha, InputArray _mask ) { + CV_INSTRUMENT_REGION_IPP() + int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype); int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype); @@ -2509,23 +2180,23 @@ static bool ipp_accumulate_weighted( InputArray _src, InputOutputArray _dst, typedef IppStatus (CV_STDCALL * ippiAddWeightedMask)(const void * pSrc, int srcStep, const Ipp8u * pMask, int maskStep, Ipp32f * pSrcDst, int srcDstStep, IppiSize roiSize, Ipp32f alpha); - ippiAddWeighted ippFunc = 0; - ippiAddWeightedMask ippFuncMask = 0; + ippiAddWeighted ippiAddWeighted_I = 0; + ippiAddWeightedMask ippiAddWeighted_IM = 0; if (mask.empty()) { - ippFunc = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddWeighted)ippiAddWeighted_8u32f_C1IR : + ippiAddWeighted_I = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddWeighted)ippiAddWeighted_8u32f_C1IR : sdepth == CV_16U && ddepth == CV_32F ? (ippiAddWeighted)ippiAddWeighted_16u32f_C1IR : sdepth == CV_32F && ddepth == CV_32F ? (ippiAddWeighted)ippiAddWeighted_32f_C1IR : 0; } else if (scn == 1) { - ippFuncMask = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddWeightedMask)ippiAddWeighted_8u32f_C1IMR : + ippiAddWeighted_IM = sdepth == CV_8U && ddepth == CV_32F ? (ippiAddWeightedMask)ippiAddWeighted_8u32f_C1IMR : sdepth == CV_16U && ddepth == CV_32F ? (ippiAddWeightedMask)ippiAddWeighted_16u32f_C1IMR : sdepth == CV_32F && ddepth == CV_32F ? (ippiAddWeightedMask)ippiAddWeighted_32f_C1IMR : 0; } - if (ippFunc || ippFuncMask) + if (ippiAddWeighted_I || ippiAddWeighted_IM) { IppStatus status = ippStsErr; @@ -2541,11 +2212,11 @@ static bool ipp_accumulate_weighted( InputArray _src, InputOutputArray _dst, } size.width *= scn; - if (ippFunc) - status = ippFunc(src.ptr(), srcstep, dst.ptr(), dststep, ippiSize(size.width, size.height), (Ipp32f)alpha); - else if(ippFuncMask) - status = ippFuncMask(src.ptr(), srcstep, mask.ptr(), maskstep, - dst.ptr(), dststep, ippiSize(size.width, size.height), (Ipp32f)alpha); + if (ippiAddWeighted_I) + status = CV_INSTRUMENT_FUN_IPP(ippiAddWeighted_I, src.ptr(), srcstep, dst.ptr(), dststep, ippiSize(size.width, size.height), (Ipp32f)alpha); + else if (ippiAddWeighted_IM) + status = CV_INSTRUMENT_FUN_IPP(ippiAddWeighted_IM, src.ptr(), srcstep, mask.ptr(), maskstep, + dst.ptr(), dststep, ippiSize(size.width, size.height), (Ipp32f)alpha); if (status >= 0) return true; @@ -2559,6 +2230,8 @@ static bool ipp_accumulate_weighted( InputArray _src, InputOutputArray _dst, void cv::accumulateWeighted( InputArray _src, InputOutputArray _dst, double alpha, InputArray _mask ) { + CV_INSTRUMENT_REGION() + int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype); int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype), dcn = CV_MAT_CN(dtype); diff --git a/modules/imgproc/src/approx.cpp b/modules/imgproc/src/approx.cpp index 54b5dd07ab..ec0db30179 100644 --- a/modules/imgproc/src/approx.cpp +++ b/modules/imgproc/src/approx.cpp @@ -674,6 +674,8 @@ approxPolyDP_( const Point_* src_contour, int count0, Point_* dst_contour, void cv::approxPolyDP( InputArray _curve, OutputArray _approxCurve, double epsilon, bool closed ) { + CV_INSTRUMENT_REGION() + Mat curve = _curve.getMat(); int npoints = curve.checkVector(2), depth = curve.depth(); CV_Assert( npoints >= 0 && (depth == CV_32S || depth == CV_32F)); diff --git a/modules/imgproc/src/blend.cpp b/modules/imgproc/src/blend.cpp index 2393f26db7..17e31aa4ab 100644 --- a/modules/imgproc/src/blend.cpp +++ b/modules/imgproc/src/blend.cpp @@ -121,6 +121,8 @@ static bool ocl_blendLinear( InputArray _src1, InputArray _src2, InputArray _wei void cv::blendLinear( InputArray _src1, InputArray _src2, InputArray _weights1, InputArray _weights2, OutputArray _dst ) { + CV_INSTRUMENT_REGION() + int type = _src1.type(), depth = CV_MAT_DEPTH(type); Size size = _src1.size(); diff --git a/modules/imgproc/src/canny.cpp b/modules/imgproc/src/canny.cpp index 5ba15a3ffe..22ec1f39c8 100644 --- a/modules/imgproc/src/canny.cpp +++ b/modules/imgproc/src/canny.cpp @@ -42,6 +42,7 @@ #include "precomp.hpp" #include "opencl_kernels_imgproc.hpp" +#include #ifdef _MSC_VER #pragma warning( disable: 4127 ) // conditional expression is constant @@ -65,7 +66,12 @@ static void CannyImpl(Mat& dx_, Mat& dy_, Mat& _dst, double low_thresh, double h template static bool ippCanny(const Mat& _src, const Mat& dx_, const Mat& dy_, Mat& _dst, float low, float high) { + CV_INSTRUMENT_REGION_IPP() + #if USE_IPP_CANNY + if (!useCustomDeriv && _src.isSubmatrix()) + return false; // IPP Sobel doesn't support transparent ROI border + int size = 0, size1 = 0; IppiSize roi = { _src.cols, _src.rows }; @@ -97,13 +103,13 @@ static bool ippCanny(const Mat& _src, const Mat& dx_, const Mat& dy_, Mat& _dst, if (!useCustomDeriv) { Mat _dx(_src.rows, _src.cols, CV_16S); - if( ippiFilterSobelNegVertBorder_8u16s_C1R(_src.ptr(), (int)_src.step, + if( CV_INSTRUMENT_FUN_IPP(ippiFilterSobelNegVertBorder_8u16s_C1R, _src.ptr(), (int)_src.step, _dx.ptr(), (int)_dx.step, roi, ippMskSize3x3, ippBorderRepl, 0, buffer) < 0 ) return false; Mat _dy(_src.rows, _src.cols, CV_16S); - if( ippiFilterSobelHorizBorder_8u16s_C1R(_src.ptr(), (int)_src.step, + if( CV_INSTRUMENT_FUN_IPP(ippiFilterSobelHorizBorder_8u16s_C1R, _src.ptr(), (int)_src.step, _dy.ptr(), (int)_dy.step, roi, ippMskSize3x3, ippBorderRepl, 0, buffer) < 0 ) return false; @@ -117,7 +123,7 @@ static bool ippCanny(const Mat& _src, const Mat& dx_, const Mat& dy_, Mat& _dst, dy = dy_; } - if( ippiCanny_16s8u_C1R(dx.ptr(), (int)dx.step, + if( CV_INSTRUMENT_FUN_IPP(ippiCanny_16s8u_C1R, dx.ptr(), (int)dx.step, dy.ptr(), (int)dy.step, _dst.ptr(), (int)_dst.step, roi, low, high, buffer) < 0 ) return false; @@ -276,25 +282,22 @@ static bool ocl_Canny(InputArray _src, const UMat& dx_, const UMat& dy_, OutputA #endif -#ifdef HAVE_TBB - -// Queue with peaks that will processed serially. -static tbb::concurrent_queue borderPeaks; - -class tbbCanny +class parallelCanny : public ParallelLoopBody { -public: - tbbCanny(const Range _boundaries, const Mat& _src, uchar* _map, int _low, - int _high, int _aperture_size, bool _L2gradient) - : boundaries(_boundaries), src(_src), map(_map), low(_low), high(_high), - aperture_size(_aperture_size), L2gradient(_L2gradient) - {} - // This parallel version of Canny algorithm splits the src image in threadsNumber horizontal slices. - // The first row of each slice contains the last row of the previous slice and - // the last row of each slice contains the first row of the next slice - // so that each slice is independent and no mutexes are required. - void operator()() const +public: + parallelCanny(const Mat& _src, uchar* _map, int _low, int _high, int _aperture_size, bool _L2gradient, std::queue *borderPeaksParallel) : + src(_src), map(_map), low(_low), high(_high), aperture_size(_aperture_size), L2gradient(_L2gradient), _borderPeaksParallel(borderPeaksParallel) + { + } + + ~parallelCanny() + { + } + + parallelCanny& operator=(const parallelCanny&) { return *this; } + + void operator()(const Range &boundaries) const { #if CV_SSE2 bool haveSSE2 = checkHardwareSupport(CV_CPU_SSE2); @@ -303,13 +306,19 @@ public: const int type = src.type(), cn = CV_MAT_CN(type); Mat dx, dy; + std::queue borderPeaksLocal; ptrdiff_t mapstep = src.cols + 2; // In sobel transform we calculate ksize2 extra lines for the first and last rows of each slice // because IPPDerivSobel expects only isolated ROIs, in contrast with the opencv version which // uses the pixels outside of the ROI to form a border. - uchar ksize2 = aperture_size / 2; + int ksize2 = aperture_size / 2; + // If Scharr filter: aperture_size is 3 and ksize2 is 1 + if(aperture_size == -1) + { + ksize2 = 1; + } if (boundaries.start == 0 && boundaries.end == src.rows) { @@ -408,14 +417,20 @@ public: { __m128i v_dx = _mm_loadu_si128((const __m128i *)(_dx + j)); __m128i v_dy = _mm_loadu_si128((const __m128i *)(_dy + j)); - v_dx = _mm_max_epi16(v_dx, _mm_sub_epi16(v_zero, v_dx)); - v_dy = _mm_max_epi16(v_dy, _mm_sub_epi16(v_zero, v_dy)); - __m128i v_norm = _mm_add_epi32(_mm_unpacklo_epi16(v_dx, v_zero), _mm_unpacklo_epi16(v_dy, v_zero)); - _mm_storeu_si128((__m128i *)(_norm + j), v_norm); + __m128i v_dx_abs = _mm_max_epi16(v_dx, _mm_sub_epi16(v_zero, v_dx)); + __m128i v_dy_abs = _mm_max_epi16(v_dy, _mm_sub_epi16(v_zero, v_dy)); - v_norm = _mm_add_epi32(_mm_unpackhi_epi16(v_dx, v_zero), _mm_unpackhi_epi16(v_dy, v_zero)); - _mm_storeu_si128((__m128i *)(_norm + j + 4), v_norm); + __m128i v_dx_ml = _mm_unpacklo_epi16(v_dx_abs, v_zero); + __m128i v_dy_ml = _mm_unpacklo_epi16(v_dy_abs, v_zero); + __m128i v_dx_mh = _mm_unpackhi_epi16(v_dx_abs, v_zero); + __m128i v_dy_mh = _mm_unpackhi_epi16(v_dy_abs, v_zero); + + __m128i v_norm_ml = _mm_add_epi32(v_dx_ml, v_dy_ml); + __m128i v_norm_mh = _mm_add_epi32(v_dx_mh, v_dy_mh); + + _mm_storeu_si128((__m128i *)(_norm + j), v_norm_ml); + _mm_storeu_si128((__m128i *)(_norm + j + 4), v_norm_mh); } } #elif CV_NEON @@ -444,8 +459,10 @@ public: __m128i v_dx_dy_ml = _mm_unpacklo_epi16(v_dx, v_dy); __m128i v_dx_dy_mh = _mm_unpackhi_epi16(v_dx, v_dy); + __m128i v_norm_ml = _mm_madd_epi16(v_dx_dy_ml, v_dx_dy_ml); __m128i v_norm_mh = _mm_madd_epi16(v_dx_dy_mh, v_dx_dy_mh); + _mm_storeu_si128((__m128i *)(_norm + j), v_norm_ml); _mm_storeu_si128((__m128i *)(_norm + j + 4), v_norm_mh); } @@ -508,13 +525,92 @@ public: #define CANNY_PUSH(d) *(d) = uchar(2), *stack_top++ = (d) #define CANNY_POP(d) (d) = *--stack_top - int prev_flag = 0; - bool canny_push = false; - for (int j = 0; j < src.cols; j++) - { - #define CANNY_SHIFT 15 - const int TG22 = (int)(0.4142135623730950488016887242097*(1<>= 1) + { + if (mask & 0x00000001) + { + m = _mag[k]; + int xs = _x[k]; + int ys = _y[k]; + int x = std::abs(xs); + int y = std::abs(ys) << CANNY_SHIFT; + + int tg22x = x * TG22; + + if (y < tg22x) + { + if (m > _mag[k - 1] && m >= _mag[k + 1]) goto _canny_push_sse; + } + else + { + int tg67x = tg22x + (x << (CANNY_SHIFT + 1)); + if (y > tg67x) + { + if (m > _mag[k + magstep2] && m >= _mag[k + magstep1]) goto _canny_push_sse; + } else + { + int s = (xs ^ ys) < 0 ? -1 : 1; + if (m > _mag[k + magstep2 - s] && m > _mag[k + magstep1 + s]) goto _canny_push_sse; + } + } + } + + prev_flag = 0; + continue; + +_canny_push_sse: + // _map[k-mapstep] is short-circuited at the start because previous thread is + // responsible for initializing it. + if (m > high && !prev_flag && (i <= boundaries.start + 1 || _map[k - mapstep] != 2)) + { + CANNY_PUSH(_map + k); + prev_flag = 1; + } else + _map[k] = 0; + + } + + if (prev_flag && ((k < j+16) || (k < src.cols && _mag[k] <= high))) + prev_flag = 0; + } + } + } +#endif + for (; j < src.cols; j++) + { int m = _mag[j]; if (m > low) @@ -528,42 +624,37 @@ public: if (y < tg22x) { - if (m > _mag[j-1] && m >= _mag[j+1]) canny_push = true; + if (m > _mag[j-1] && m >= _mag[j+1]) goto _canny_push; } else { int tg67x = tg22x + (x << (CANNY_SHIFT+1)); if (y > tg67x) { - if (m > _mag[j+magstep2] && m >= _mag[j+magstep1]) canny_push = true; + if (m > _mag[j+magstep2] && m >= _mag[j+magstep1]) goto _canny_push; } else { int s = (xs ^ ys) < 0 ? -1 : 1; - if (m > _mag[j+magstep2-s] && m > _mag[j+magstep1+s]) canny_push = true; + if (m > _mag[j+magstep2-s] && m > _mag[j+magstep1+s]) goto _canny_push; } } } - if (!canny_push) + + prev_flag = 0; + _map[j] = uchar(1); + continue; + +_canny_push: + // _map[j-mapstep] is short-circuited at the start because previous thread is + // responsible for initializing it. + if (!prev_flag && m > high && (i <= boundaries.start+1 || _map[j-mapstep] != 2) ) { - prev_flag = 0; - _map[j] = uchar(1); - continue; + CANNY_PUSH(_map + j); + prev_flag = 1; } else - { - // _map[j-mapstep] is short-circuited at the start because previous thread is - // responsible for initializing it. - if (!prev_flag && m > high && (i <= boundaries.start+1 || _map[j-mapstep] != 2) ) - { - CANNY_PUSH(_map + j); - prev_flag = 1; - } - else - _map[j] = 0; - - canny_push = false; - } + _map[j] = 0; } // scroll the ring buffer @@ -592,7 +683,7 @@ public: // slice in a queue to be serially processed later. if ( (m < map + (boundaries.start + 2) * mapstep) || (m >= map + boundaries.end * mapstep) ) { - borderPeaks.push(m); + borderPeaksLocal.push(m); continue; } @@ -605,24 +696,108 @@ public: if (!m[mapstep]) CANNY_PUSH(m + mapstep); if (!m[mapstep+1]) CANNY_PUSH(m + mapstep + 1); } + + AutoLock lock(mutex); + while (!borderPeaksLocal.empty()) { + _borderPeaksParallel->push(borderPeaksLocal.front()); + borderPeaksLocal.pop(); + } } private: - const Range boundaries; const Mat& src; uchar* map; - int low; - int high; - int aperture_size; + int low, high, aperture_size; bool L2gradient; + std::queue *_borderPeaksParallel; + mutable Mutex mutex; }; +class finalPass : public ParallelLoopBody +{ + +public: + finalPass(uchar *_map, Mat &_dst, ptrdiff_t _mapstep) : + map(_map), dst(_dst), mapstep(_mapstep) {} + + ~finalPass() {} + + finalPass& operator=(const finalPass&) {return *this;} + + void operator()(const Range &boundaries) const + { + // the final pass, form the final image + const uchar* pmap = map + mapstep + 1 + (ptrdiff_t)(mapstep * boundaries.start); + uchar* pdst = dst.ptr() + (ptrdiff_t)(dst.step * boundaries.start); + +#if CV_SSE2 + bool haveSSE2 = checkHardwareSupport(CV_CPU_SSE2); #endif + for (int i = boundaries.start; i < boundaries.end; i++, pmap += mapstep, pdst += dst.step) + { + int j = 0; +#if CV_SSE2 + if(haveSSE2) { + const __m128i v_zero = _mm_setzero_si128(); + + for(; j <= dst.cols - 32; j += 32) { + __m128i v_pmap1 = _mm_loadu_si128((const __m128i*)(pmap + j)); + __m128i v_pmap2 = _mm_loadu_si128((const __m128i*)(pmap + j + 16)); + + __m128i v_pmaplo1 = _mm_unpacklo_epi8(v_pmap1, v_zero); + __m128i v_pmaphi1 = _mm_unpackhi_epi8(v_pmap1, v_zero); + __m128i v_pmaplo2 = _mm_unpacklo_epi8(v_pmap2, v_zero); + __m128i v_pmaphi2 = _mm_unpackhi_epi8(v_pmap2, v_zero); + + v_pmaplo1 = _mm_srli_epi16(v_pmaplo1, 1); + v_pmaphi1 = _mm_srli_epi16(v_pmaphi1, 1); + v_pmaplo2 = _mm_srli_epi16(v_pmaplo2, 1); + v_pmaphi2 = _mm_srli_epi16(v_pmaphi2, 1); + + v_pmap1 = _mm_packus_epi16(v_pmaplo1, v_pmaphi1); + v_pmap2 = _mm_packus_epi16(v_pmaplo2, v_pmaphi2); + + v_pmap1 = _mm_sub_epi8(v_zero, v_pmap1); + v_pmap2 = _mm_sub_epi8(v_zero, v_pmap2); + + _mm_storeu_si128((__m128i*)(pdst + j), v_pmap1); + _mm_storeu_si128((__m128i*)(pdst + j + 16), v_pmap2); + } + + for(; j <= dst.cols - 16; j += 16) { + __m128i v_pmap = _mm_loadu_si128((const __m128i*)(pmap + j)); + + __m128i v_pmaplo = _mm_unpacklo_epi8(v_pmap, v_zero); + __m128i v_pmaphi = _mm_unpackhi_epi8(v_pmap, v_zero); + + v_pmaplo = _mm_srli_epi16(v_pmaplo, 1); + v_pmaphi = _mm_srli_epi16(v_pmaphi, 1); + + v_pmap = _mm_packus_epi16(v_pmaplo, v_pmaphi); + v_pmap = _mm_sub_epi8(v_zero, v_pmap); + + _mm_storeu_si128((__m128i*)(pdst + j), v_pmap); + } + } +#endif + for (; j < dst.cols; j++) + pdst[j] = (uchar)-(pmap[j] >> 1); + } + } + +private: + uchar *map; + Mat &dst; + ptrdiff_t mapstep; +}; + void Canny( InputArray _src, OutputArray _dst, double low_thresh, double high_thresh, int aperture_size, bool L2gradient ) { + CV_INSTRUMENT_REGION() + const int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type); const Size size = _src.size(); @@ -654,8 +829,6 @@ void Canny( InputArray _src, OutputArray _dst, CV_IPP_RUN(USE_IPP_CANNY && (aperture_size == 3 && !L2gradient && 1 == cn), ippCanny(src, Mat(), Mat(), dst, (float)low_thresh, (float)high_thresh)) -#ifdef HAVE_TBB - if (L2gradient) { low_thresh = std::min(32767.0, low_thresh); @@ -667,44 +840,49 @@ if (L2gradient) int low = cvFloor(low_thresh); int high = cvFloor(high_thresh); -ptrdiff_t mapstep = src.cols + 2; -AutoBuffer buffer((src.cols+2)*(src.rows+2)); + ptrdiff_t mapstep = src.cols + 2; + AutoBuffer buffer((src.cols+2)*(src.rows+2) + cn * mapstep * 3 * sizeof(int)); -uchar* map = (uchar*)buffer; -memset(map, 1, mapstep); -memset(map + mapstep*(src.rows + 1), 1, mapstep); + int* mag_buf[3]; + mag_buf[0] = (int*)(uchar*)buffer; + mag_buf[1] = mag_buf[0] + mapstep*cn; + mag_buf[2] = mag_buf[1] + mapstep*cn; + memset(mag_buf[0], 0, /* cn* */mapstep*sizeof(int)); -int threadsNumber = tbb::task_scheduler_init::default_num_threads(); -int grainSize = src.rows / threadsNumber; + uchar *map = (uchar*)(mag_buf[2] + mapstep*cn); + memset(map, 1, mapstep); + memset(map + mapstep*(src.rows + 1), 1, mapstep); -// Make a fallback for pictures with too few rows. -uchar ksize2 = aperture_size / 2; -int minGrainSize = 1 + ksize2; -int maxGrainSize = src.rows - 2 - 2*ksize2; -if ( !( minGrainSize <= grainSize && grainSize <= maxGrainSize ) ) -{ - threadsNumber = 1; - grainSize = src.rows; -} + // Minimum number of threads should be 1, maximum should not exceed number of CPU's, because of overhead + int numOfThreads = std::max(1, std::min(getNumThreads(), getNumberOfCPUs())); -tbb::task_group g; + // Make a fallback for pictures with too few rows. + int grainSize = src.rows / numOfThreads; + int ksize2 = aperture_size / 2; + // If Scharr filter: aperture size is 3, ksize2 is 1 + if(aperture_size == -1) + { + ksize2 = 1; + } -for (int i = 0; i < threadsNumber; ++i) -{ - if (i < threadsNumber - 1) - g.run(tbbCanny(Range(i * grainSize, (i + 1) * grainSize), src, map, low, high, aperture_size, L2gradient)); - else - g.run(tbbCanny(Range(i * grainSize, src.rows), src, map, low, high, aperture_size, L2gradient)); -} + int minGrainSize = 2 * (ksize2 + 1); + if (grainSize < minGrainSize) + { + numOfThreads = std::max(1, src.rows / minGrainSize); + } -g.wait(); + std::queue borderPeaksParallel; -#define CANNY_PUSH_SERIAL(d) *(d) = uchar(2), borderPeaks.push(d) + parallel_for_(Range(0, src.rows), parallelCanny(src, map, low, high, aperture_size, L2gradient, &borderPeaksParallel), numOfThreads); -// now track the edges (hysteresis thresholding) -uchar* m; -while (borderPeaks.try_pop(m)) -{ +#define CANNY_PUSH_SERIAL(d) *(d) = uchar(2), borderPeaksParallel.push(d) + + // now track the edges (hysteresis thresholding) + uchar* m; + while (!borderPeaksParallel.empty()) + { + m = borderPeaksParallel.front(); + borderPeaksParallel.pop(); if (!m[-1]) CANNY_PUSH_SERIAL(m - 1); if (!m[1]) CANNY_PUSH_SERIAL(m + 1); if (!m[-mapstep-1]) CANNY_PUSH_SERIAL(m - mapstep - 1); @@ -715,24 +893,7 @@ while (borderPeaks.try_pop(m)) if (!m[mapstep+1]) CANNY_PUSH_SERIAL(m + mapstep + 1); } -// the final pass, form the final image -const uchar* pmap = map + mapstep + 1; -uchar* pdst = dst.ptr(); -for (int i = 0; i < src.rows; i++, pmap += mapstep, pdst += dst.step) -{ - for (int j = 0; j < src.cols; j++) - pdst[j] = (uchar)-(pmap[j] >> 1); -} - -#else - Mat dx(src.rows, src.cols, CV_16SC(cn)); - Mat dy(src.rows, src.cols, CV_16SC(cn)); - - Sobel(src, dx, CV_16S, 1, 0, aperture_size, 1, 0, BORDER_REPLICATE); - Sobel(src, dy, CV_16S, 0, 1, aperture_size, 1, 0, BORDER_REPLICATE); - - CannyImpl(dx, dy, dst, low_thresh, high_thresh, L2gradient); -#endif + parallel_for_(Range(0, dst.rows), finalPass(map, dst, mapstep), dst.total()/(double)(1<<16)); } void Canny( InputArray _dx, InputArray _dy, OutputArray _dst, @@ -947,12 +1108,92 @@ static void CannyImpl(Mat& dx, Mat& dy, Mat& dst, stack_top = stack_bottom + sz; } - int prev_flag = 0; - for (int j = 0; j < cols; j++) - { - #define CANNY_SHIFT 15 - const int TG22 = (int)(0.4142135623730950488016887242097*(1<>= 1) + { + if (mask & 0x00000001) + { + m = _mag[k]; + int xs = _x[k]; + int ys = _y[k]; + int x = std::abs(xs); + int y = std::abs(ys) << CANNY_SHIFT; + + int tg22x = x * TG22; + + if (y < tg22x) + { + if (m > _mag[k - 1] && m >= _mag[k + 1]) goto ocv_canny_push_sse; + } + else + { + int tg67x = tg22x + (x << (CANNY_SHIFT + 1)); + if (y > tg67x) + { + if (m > _mag[k + magstep2] && m >= _mag[k + magstep1]) goto ocv_canny_push_sse; + } else + { + int s = (xs ^ ys) < 0 ? -1 : 1; + if (m > _mag[k + magstep2 - s] && m > _mag[k + magstep1 + s]) goto ocv_canny_push_sse; + } + } + } + + prev_flag = 0; + continue; + +ocv_canny_push_sse: + // _map[k-mapstep] is short-circuited at the start because previous thread is + // responsible for initializing it. + if (!prev_flag && m > high && _map[k-mapstep] != 2) + { + CANNY_PUSH(_map + k); + prev_flag = 1; + } else + _map[k] = 0; + + } + + if (prev_flag && ((k < j+16) || (k < cols && _mag[k] <= high))) + prev_flag = 0; + } + } + } +#endif + for (; j < cols; j++) + { int m = _mag[j]; if (m > low) @@ -1027,14 +1268,7 @@ __ocv_canny_push: if (!m[mapstep+1]) CANNY_PUSH(m + mapstep + 1); } - // the final pass, form the final image - const uchar* pmap = map + mapstep + 1; - uchar* pdst = dst.ptr(); - for (int i = 0; i < rows; i++, pmap += mapstep, pdst += dst.step) - { - for (int j = 0; j < cols; j++) - pdst[j] = (uchar)-(pmap[j] >> 1); - } + parallel_for_(Range(0, dst.rows), finalPass(map, dst, mapstep), dst.total()/(double)(1<<16)); } } // namespace cv diff --git a/modules/imgproc/src/clahe.cpp b/modules/imgproc/src/clahe.cpp index 8481834e1b..342b393577 100644 --- a/modules/imgproc/src/clahe.cpp +++ b/modules/imgproc/src/clahe.cpp @@ -351,6 +351,8 @@ namespace void CLAHE_Impl::apply(cv::InputArray _src, cv::OutputArray _dst) { + CV_INSTRUMENT_REGION() + CV_Assert( _src.type() == CV_8UC1 || _src.type() == CV_16UC1 ); #ifdef HAVE_OPENCL diff --git a/modules/imgproc/src/color.cpp b/modules/imgproc/src/color.cpp index b08c608220..6d0d0f8fad 100644 --- a/modules/imgproc/src/color.cpp +++ b/modules/imgproc/src/color.cpp @@ -226,6 +226,8 @@ public: virtual void operator()(const Range& range) const { + CV_INSTRUMENT_REGION_IPP(); + const void *yS = src_data + src_step * range.start; void *yD = dst_data + dst_step * range.start; if( !cvt(yS, static_cast(src_step), yD, static_cast(dst_step), width, range.end - range.start) ) @@ -278,19 +280,19 @@ bool CvtColorIPPLoopCopy(const uchar * src_data, size_t src_step, int src_type, static IppStatus CV_STDCALL ippiSwapChannels_8u_C3C4Rf(const Ipp8u* pSrc, int srcStep, Ipp8u* pDst, int dstStep, IppiSize roiSize, const int *dstOrder) { - return ippiSwapChannels_8u_C3C4R(pSrc, srcStep, pDst, dstStep, roiSize, dstOrder, MAX_IPP8u); + return CV_INSTRUMENT_FUN_IPP(ippiSwapChannels_8u_C3C4R, pSrc, srcStep, pDst, dstStep, roiSize, dstOrder, MAX_IPP8u); } static IppStatus CV_STDCALL ippiSwapChannels_16u_C3C4Rf(const Ipp16u* pSrc, int srcStep, Ipp16u* pDst, int dstStep, IppiSize roiSize, const int *dstOrder) { - return ippiSwapChannels_16u_C3C4R(pSrc, srcStep, pDst, dstStep, roiSize, dstOrder, MAX_IPP16u); + return CV_INSTRUMENT_FUN_IPP(ippiSwapChannels_16u_C3C4R, pSrc, srcStep, pDst, dstStep, roiSize, dstOrder, MAX_IPP16u); } static IppStatus CV_STDCALL ippiSwapChannels_32f_C3C4Rf(const Ipp32f* pSrc, int srcStep, Ipp32f* pDst, int dstStep, IppiSize roiSize, const int *dstOrder) { - return ippiSwapChannels_32f_C3C4R(pSrc, srcStep, pDst, dstStep, roiSize, dstOrder, MAX_IPP32f); + return CV_INSTRUMENT_FUN_IPP(ippiSwapChannels_32f_C3C4R, pSrc, srcStep, pDst, dstStep, roiSize, dstOrder, MAX_IPP32f); } static ippiReorderFunc ippiSwapChannelsC3C4RTab[] = @@ -393,7 +395,7 @@ static ippiGeneralFunc ippiHLS2RGBTab[] = 0, (ippiGeneralFunc)ippiHLSToRGB_32f_C3R, 0, 0 }; -#if !defined(HAVE_IPP_ICV_ONLY) && IPP_DISABLE_BLOCK +#if IPP_DISABLE_BLOCK static ippiGeneralFunc ippiRGBToLUVTab[] = { (ippiGeneralFunc)ippiRGBToLUV_8u_C3R, 0, (ippiGeneralFunc)ippiRGBToLUV_16u_C3R, 0, @@ -409,18 +411,18 @@ static ippiGeneralFunc ippiLUVToRGBTab[] = struct IPPGeneralFunctor { - IPPGeneralFunctor(ippiGeneralFunc _func) : func(_func){} + IPPGeneralFunctor(ippiGeneralFunc _func) : ippiColorConvertGeneral(_func){} bool operator()(const void *src, int srcStep, void *dst, int dstStep, int cols, int rows) const { - return func ? func(src, srcStep, dst, dstStep, ippiSize(cols, rows)) >= 0 : false; + return ippiColorConvertGeneral ? CV_INSTRUMENT_FUN_IPP(ippiColorConvertGeneral, src, srcStep, dst, dstStep, ippiSize(cols, rows)) >= 0 : false; } private: - ippiGeneralFunc func; + ippiGeneralFunc ippiColorConvertGeneral; }; struct IPPReorderFunctor { - IPPReorderFunctor(ippiReorderFunc _func, int _order0, int _order1, int _order2) : func(_func) + IPPReorderFunctor(ippiReorderFunc _func, int _order0, int _order1, int _order2) : ippiColorConvertReorder(_func) { order[0] = _order0; order[1] = _order1; @@ -429,17 +431,17 @@ struct IPPReorderFunctor } bool operator()(const void *src, int srcStep, void *dst, int dstStep, int cols, int rows) const { - return func ? func(src, srcStep, dst, dstStep, ippiSize(cols, rows), order) >= 0 : false; + return ippiColorConvertReorder ? CV_INSTRUMENT_FUN_IPP(ippiColorConvertReorder, src, srcStep, dst, dstStep, ippiSize(cols, rows), order) >= 0 : false; } private: - ippiReorderFunc func; + ippiReorderFunc ippiColorConvertReorder; int order[4]; }; struct IPPColor2GrayFunctor { IPPColor2GrayFunctor(ippiColor2GrayFunc _func) : - func(_func) + ippiColorToGray(_func) { coeffs[0] = 0.114f; coeffs[1] = 0.587f; @@ -447,61 +449,61 @@ struct IPPColor2GrayFunctor } bool operator()(const void *src, int srcStep, void *dst, int dstStep, int cols, int rows) const { - return func ? func(src, srcStep, dst, dstStep, ippiSize(cols, rows), coeffs) >= 0 : false; + return ippiColorToGray ? CV_INSTRUMENT_FUN_IPP(ippiColorToGray, src, srcStep, dst, dstStep, ippiSize(cols, rows), coeffs) >= 0 : false; } private: - ippiColor2GrayFunc func; + ippiColor2GrayFunc ippiColorToGray; Ipp32f coeffs[3]; }; struct IPPGray2BGRFunctor { IPPGray2BGRFunctor(ippiGeneralFunc _func) : - func(_func) + ippiGrayToBGR(_func) { } bool operator()(const void *src, int srcStep, void *dst, int dstStep, int cols, int rows) const { - if (func == 0) + if (ippiGrayToBGR == 0) return false; const void* srcarray[3] = { src, src, src }; - return func(srcarray, srcStep, dst, dstStep, ippiSize(cols, rows)) >= 0; + return CV_INSTRUMENT_FUN_IPP(ippiGrayToBGR, srcarray, srcStep, dst, dstStep, ippiSize(cols, rows)) >= 0; } private: - ippiGeneralFunc func; + ippiGeneralFunc ippiGrayToBGR; }; struct IPPGray2BGRAFunctor { IPPGray2BGRAFunctor(ippiGeneralFunc _func1, ippiReorderFunc _func2, int _depth) : - func1(_func1), func2(_func2), depth(_depth) + ippiColorConvertGeneral(_func1), ippiColorConvertReorder(_func2), depth(_depth) { } bool operator()(const void *src, int srcStep, void *dst, int dstStep, int cols, int rows) const { - if (func1 == 0 || func2 == 0) + if (ippiColorConvertGeneral == 0 || ippiColorConvertReorder == 0) return false; const void* srcarray[3] = { src, src, src }; Mat temp(rows, cols, CV_MAKETYPE(depth, 3)); - if(func1(srcarray, srcStep, temp.ptr(), (int)temp.step[0], ippiSize(cols, rows)) < 0) + if(CV_INSTRUMENT_FUN_IPP(ippiColorConvertGeneral, srcarray, srcStep, temp.ptr(), (int)temp.step[0], ippiSize(cols, rows)) < 0) return false; int order[4] = {0, 1, 2, 3}; - return func2(temp.ptr(), (int)temp.step[0], dst, dstStep, ippiSize(cols, rows), order) >= 0; + return CV_INSTRUMENT_FUN_IPP(ippiColorConvertReorder, temp.ptr(), (int)temp.step[0], dst, dstStep, ippiSize(cols, rows), order) >= 0; } private: - ippiGeneralFunc func1; - ippiReorderFunc func2; + ippiGeneralFunc ippiColorConvertGeneral; + ippiReorderFunc ippiColorConvertReorder; int depth; }; struct IPPReorderGeneralFunctor { IPPReorderGeneralFunctor(ippiReorderFunc _func1, ippiGeneralFunc _func2, int _order0, int _order1, int _order2, int _depth) : - func1(_func1), func2(_func2), depth(_depth) + ippiColorConvertReorder(_func1), ippiColorConvertGeneral(_func2), depth(_depth) { order[0] = _order0; order[1] = _order1; @@ -510,18 +512,18 @@ struct IPPReorderGeneralFunctor } bool operator()(const void *src, int srcStep, void *dst, int dstStep, int cols, int rows) const { - if (func1 == 0 || func2 == 0) + if (ippiColorConvertReorder == 0 || ippiColorConvertGeneral == 0) return false; Mat temp; temp.create(rows, cols, CV_MAKETYPE(depth, 3)); - if(func1(src, srcStep, temp.ptr(), (int)temp.step[0], ippiSize(cols, rows), order) < 0) + if(CV_INSTRUMENT_FUN_IPP(ippiColorConvertReorder, src, srcStep, temp.ptr(), (int)temp.step[0], ippiSize(cols, rows), order) < 0) return false; - return func2(temp.ptr(), (int)temp.step[0], dst, dstStep, ippiSize(cols, rows)) >= 0; + return CV_INSTRUMENT_FUN_IPP(ippiColorConvertGeneral, temp.ptr(), (int)temp.step[0], dst, dstStep, ippiSize(cols, rows)) >= 0; } private: - ippiReorderFunc func1; - ippiGeneralFunc func2; + ippiReorderFunc ippiColorConvertReorder; + ippiGeneralFunc ippiColorConvertGeneral; int order[4]; int depth; }; @@ -529,7 +531,7 @@ private: struct IPPGeneralReorderFunctor { IPPGeneralReorderFunctor(ippiGeneralFunc _func1, ippiReorderFunc _func2, int _order0, int _order1, int _order2, int _depth) : - func1(_func1), func2(_func2), depth(_depth) + ippiColorConvertGeneral(_func1), ippiColorConvertReorder(_func2), depth(_depth) { order[0] = _order0; order[1] = _order1; @@ -538,18 +540,18 @@ struct IPPGeneralReorderFunctor } bool operator()(const void *src, int srcStep, void *dst, int dstStep, int cols, int rows) const { - if (func1 == 0 || func2 == 0) + if (ippiColorConvertGeneral == 0 || ippiColorConvertReorder == 0) return false; Mat temp; temp.create(rows, cols, CV_MAKETYPE(depth, 3)); - if(func1(src, srcStep, temp.ptr(), (int)temp.step[0], ippiSize(cols, rows)) < 0) + if(CV_INSTRUMENT_FUN_IPP(ippiColorConvertGeneral, src, srcStep, temp.ptr(), (int)temp.step[0], ippiSize(cols, rows)) < 0) return false; - return func2(temp.ptr(), (int)temp.step[0], dst, dstStep, ippiSize(cols, rows), order) >= 0; + return CV_INSTRUMENT_FUN_IPP(ippiColorConvertReorder, temp.ptr(), (int)temp.step[0], dst, dstStep, ippiSize(cols, rows), order) >= 0; } private: - ippiGeneralFunc func1; - ippiReorderFunc func2; + ippiGeneralFunc ippiColorConvertGeneral; + ippiReorderFunc ippiColorConvertReorder; int order[4]; int depth; }; @@ -1492,36 +1494,47 @@ struct RGB2Gray if( blueIdx == 0 ) std::swap(coeffs[0], coeffs[2]); - v_cb = _mm_set1_epi16((short)coeffs[0]); - v_cg = _mm_set1_epi16((short)coeffs[1]); - v_cr = _mm_set1_epi16((short)coeffs[2]); v_delta = _mm_set1_epi32(1 << (yuv_shift - 1)); + v_zero = _mm_setzero_si128(); haveSIMD = checkHardwareSupport(CV_CPU_SSE4_1); } // 16s x 8 - void process(__m128i v_b, __m128i v_g, __m128i v_r, + void process(__m128i* v_rgb, __m128i* v_coeffs, __m128i & v_gray) const { - __m128i v_mullo_r = _mm_mullo_epi16(v_r, v_cr); - __m128i v_mullo_g = _mm_mullo_epi16(v_g, v_cg); - __m128i v_mullo_b = _mm_mullo_epi16(v_b, v_cb); - __m128i v_mulhi_r = _mm_mulhi_epu16(v_r, v_cr); - __m128i v_mulhi_g = _mm_mulhi_epu16(v_g, v_cg); - __m128i v_mulhi_b = _mm_mulhi_epu16(v_b, v_cb); + __m128i v_rgb_hi[4]; + v_rgb_hi[0] = _mm_cmplt_epi16(v_rgb[0], v_zero); + v_rgb_hi[1] = _mm_cmplt_epi16(v_rgb[1], v_zero); + v_rgb_hi[2] = _mm_cmplt_epi16(v_rgb[2], v_zero); + v_rgb_hi[3] = _mm_cmplt_epi16(v_rgb[3], v_zero); - __m128i v_gray0 = _mm_add_epi32(_mm_unpacklo_epi16(v_mullo_r, v_mulhi_r), - _mm_unpacklo_epi16(v_mullo_g, v_mulhi_g)); - v_gray0 = _mm_add_epi32(_mm_unpacklo_epi16(v_mullo_b, v_mulhi_b), v_gray0); - v_gray0 = _mm_srli_epi32(_mm_add_epi32(v_gray0, v_delta), yuv_shift); + v_rgb_hi[0] = _mm_and_si128(v_rgb_hi[0], v_coeffs[1]); + v_rgb_hi[1] = _mm_and_si128(v_rgb_hi[1], v_coeffs[1]); + v_rgb_hi[2] = _mm_and_si128(v_rgb_hi[2], v_coeffs[1]); + v_rgb_hi[3] = _mm_and_si128(v_rgb_hi[3], v_coeffs[1]); - __m128i v_gray1 = _mm_add_epi32(_mm_unpackhi_epi16(v_mullo_r, v_mulhi_r), - _mm_unpackhi_epi16(v_mullo_g, v_mulhi_g)); - v_gray1 = _mm_add_epi32(_mm_unpackhi_epi16(v_mullo_b, v_mulhi_b), v_gray1); - v_gray1 = _mm_srli_epi32(_mm_add_epi32(v_gray1, v_delta), yuv_shift); + v_rgb_hi[0] = _mm_hadd_epi16(v_rgb_hi[0], v_rgb_hi[1]); + v_rgb_hi[2] = _mm_hadd_epi16(v_rgb_hi[2], v_rgb_hi[3]); + v_rgb_hi[0] = _mm_hadd_epi16(v_rgb_hi[0], v_rgb_hi[2]); - v_gray = _mm_packus_epi32(v_gray0, v_gray1); + v_rgb[0] = _mm_madd_epi16(v_rgb[0], v_coeffs[0]); + v_rgb[1] = _mm_madd_epi16(v_rgb[1], v_coeffs[0]); + v_rgb[2] = _mm_madd_epi16(v_rgb[2], v_coeffs[0]); + v_rgb[3] = _mm_madd_epi16(v_rgb[3], v_coeffs[0]); + + v_rgb[0] = _mm_hadd_epi32(v_rgb[0], v_rgb[1]); + v_rgb[2] = _mm_hadd_epi32(v_rgb[2], v_rgb[3]); + + v_rgb[0] = _mm_add_epi32(v_rgb[0], v_delta); + v_rgb[2] = _mm_add_epi32(v_rgb[2], v_delta); + + v_rgb[0] = _mm_srai_epi32(v_rgb[0], yuv_shift); + v_rgb[2] = _mm_srai_epi32(v_rgb[2], yuv_shift); + + v_gray = _mm_packs_epi32(v_rgb[0], v_rgb[2]); + v_gray = _mm_add_epi16(v_gray, v_rgb_hi[0]); } void operator()(const ushort* src, ushort* dst, int n) const @@ -1530,54 +1543,49 @@ struct RGB2Gray if (scn == 3 && haveSIMD) { - for ( ; i <= n - 16; i += 16, src += scn * 16) + __m128i v_coeffs[2]; + v_coeffs[0] = _mm_set_epi16(0, (short)coeffs[2], (short)coeffs[1], (short)coeffs[0], (short)coeffs[2], (short)coeffs[1], (short)coeffs[0], 0); + v_coeffs[1] = _mm_slli_epi16(v_coeffs[0], 2); + + for ( ; i <= n - 8; i += 8, src += scn * 8) { - __m128i v_r0 = _mm_loadu_si128((__m128i const *)(src)); - __m128i v_r1 = _mm_loadu_si128((__m128i const *)(src + 8)); - __m128i v_g0 = _mm_loadu_si128((__m128i const *)(src + 16)); - __m128i v_g1 = _mm_loadu_si128((__m128i const *)(src + 24)); - __m128i v_b0 = _mm_loadu_si128((__m128i const *)(src + 32)); - __m128i v_b1 = _mm_loadu_si128((__m128i const *)(src + 40)); + __m128i v_src[3]; + v_src[0] = _mm_loadu_si128((__m128i const *)(src)); + v_src[1] = _mm_loadu_si128((__m128i const *)(src + 8)); + v_src[2] = _mm_loadu_si128((__m128i const *)(src + 16)); - _mm_deinterleave_epi16(v_r0, v_r1, v_g0, v_g1, v_b0, v_b1); + __m128i v_rgb[4]; + v_rgb[0] = _mm_slli_si128(v_src[0], 2); + v_rgb[1] = _mm_alignr_epi8(v_src[1], v_src[0], 10); + v_rgb[2] = _mm_alignr_epi8(v_src[2], v_src[1], 6); + v_rgb[3] = _mm_srli_si128(v_src[2], 2); - __m128i v_gray0; - process(v_r0, v_g0, v_b0, - v_gray0); + __m128i v_gray; + process(v_rgb, v_coeffs, + v_gray); - __m128i v_gray1; - process(v_r1, v_g1, v_b1, - v_gray1); - - _mm_storeu_si128((__m128i *)(dst + i), v_gray0); - _mm_storeu_si128((__m128i *)(dst + i + 8), v_gray1); + _mm_storeu_si128((__m128i *)(dst + i), v_gray); } } else if (scn == 4 && haveSIMD) { - for ( ; i <= n - 16; i += 16, src += scn * 16) + __m128i v_coeffs[2]; + v_coeffs[0] = _mm_set_epi16(0, (short)coeffs[2], (short)coeffs[1], (short)coeffs[0], 0, (short)coeffs[2], (short)coeffs[1], (short)coeffs[0]); + v_coeffs[1] = _mm_slli_epi16(v_coeffs[0], 2); + + for ( ; i <= n - 8; i += 8, src += scn * 8) { - __m128i v_r0 = _mm_loadu_si128((__m128i const *)(src)); - __m128i v_r1 = _mm_loadu_si128((__m128i const *)(src + 8)); - __m128i v_g0 = _mm_loadu_si128((__m128i const *)(src + 16)); - __m128i v_g1 = _mm_loadu_si128((__m128i const *)(src + 24)); - __m128i v_b0 = _mm_loadu_si128((__m128i const *)(src + 32)); - __m128i v_b1 = _mm_loadu_si128((__m128i const *)(src + 40)); - __m128i v_a0 = _mm_loadu_si128((__m128i const *)(src + 48)); - __m128i v_a1 = _mm_loadu_si128((__m128i const *)(src + 56)); + __m128i v_rgb[4]; + v_rgb[0] = _mm_loadu_si128((__m128i const *)(src)); + v_rgb[1] = _mm_loadu_si128((__m128i const *)(src + 8)); + v_rgb[2] = _mm_loadu_si128((__m128i const *)(src + 16)); + v_rgb[3] = _mm_loadu_si128((__m128i const *)(src + 24)); - _mm_deinterleave_epi16(v_r0, v_r1, v_g0, v_g1, v_b0, v_b1, v_a0, v_a1); + __m128i v_gray; + process(v_rgb, v_coeffs, + v_gray); - __m128i v_gray0; - process(v_r0, v_g0, v_b0, - v_gray0); - - __m128i v_gray1; - process(v_r1, v_g1, v_b1, - v_gray1); - - _mm_storeu_si128((__m128i *)(dst + i), v_gray0); - _mm_storeu_si128((__m128i *)(dst + i + 8), v_gray1); + _mm_storeu_si128((__m128i *)(dst + i), v_gray); } } @@ -1586,8 +1594,8 @@ struct RGB2Gray } int srccn, coeffs[3]; - __m128i v_cb, v_cg, v_cr; __m128i v_delta; + __m128i v_zero; bool haveSIMD; }; @@ -2174,54 +2182,60 @@ struct RGB2YCrCb_i if (blueIdx==0) std::swap(coeffs[0], coeffs[2]); - v_c0 = _mm_set1_epi32(coeffs[0]); - v_c1 = _mm_set1_epi32(coeffs[1]); - v_c2 = _mm_set1_epi32(coeffs[2]); - v_c3 = _mm_set1_epi32(coeffs[3]); - v_c4 = _mm_set1_epi32(coeffs[4]); - v_delta2 = _mm_set1_epi32(1 << (yuv_shift - 1)); - v_delta = _mm_set1_epi32(ColorChannel::half()*(1 << yuv_shift)); - v_delta = _mm_add_epi32(v_delta, v_delta2); - v_zero = _mm_setzero_si128(); - + short delta = 1 << (yuv_shift - 1); + v_delta_16 = _mm_set1_epi16(delta); + v_delta_32 = _mm_set1_epi32(delta); + short delta2 = 1 + ColorChannel::half() * 2; + v_coeff = _mm_set_epi16(delta2, (short)coeffs[4], delta2, (short)coeffs[3], delta2, (short)coeffs[4], delta2, (short)coeffs[3]); + v_shuffle2 = _mm_set_epi8(0x0, 0x0, 0x0, 0x0, 0xf, 0xe, 0xc, 0xb, 0xa, 0x8, 0x7, 0x6, 0x4, 0x3, 0x2, 0x0); haveSIMD = checkHardwareSupport(CV_CPU_SSE4_1); } // 16u x 8 - void process(__m128i v_r, __m128i v_g, __m128i v_b, - __m128i & v_y, __m128i & v_cr, __m128i & v_cb) const + void process(__m128i* v_rgb, __m128i & v_crgb, + __m128i* v_rb, uchar * dst) const { - __m128i v_r_p = _mm_unpacklo_epi16(v_r, v_zero); - __m128i v_g_p = _mm_unpacklo_epi16(v_g, v_zero); - __m128i v_b_p = _mm_unpacklo_epi16(v_b, v_zero); + v_rgb[0] = _mm_madd_epi16(v_rgb[0], v_crgb); + v_rgb[1] = _mm_madd_epi16(v_rgb[1], v_crgb); + v_rgb[2] = _mm_madd_epi16(v_rgb[2], v_crgb); + v_rgb[3] = _mm_madd_epi16(v_rgb[3], v_crgb); + v_rgb[0] = _mm_hadd_epi32(v_rgb[0], v_rgb[1]); + v_rgb[2] = _mm_hadd_epi32(v_rgb[2], v_rgb[3]); + v_rgb[0] = _mm_add_epi32(v_rgb[0], v_delta_32); + v_rgb[2] = _mm_add_epi32(v_rgb[2], v_delta_32); + v_rgb[0] = _mm_srai_epi32(v_rgb[0], yuv_shift); + v_rgb[2] = _mm_srai_epi32(v_rgb[2], yuv_shift); + __m128i v_y = _mm_packs_epi32(v_rgb[0], v_rgb[2]); - __m128i v_y0 = _mm_add_epi32(_mm_mullo_epi32(v_r_p, v_c0), - _mm_add_epi32(_mm_mullo_epi32(v_g_p, v_c1), - _mm_mullo_epi32(v_b_p, v_c2))); - v_y0 = _mm_srli_epi32(_mm_add_epi32(v_delta2, v_y0), yuv_shift); + v_rb[0] = _mm_cvtepu8_epi16(v_rb[0]); + v_rb[1] = _mm_cvtepu8_epi16(v_rb[1]); + v_rb[0] = _mm_sub_epi16(v_rb[0], _mm_unpacklo_epi16(v_y, v_y)); + v_rb[1] = _mm_sub_epi16(v_rb[1], _mm_unpackhi_epi16(v_y, v_y)); + v_rgb[0] = _mm_unpacklo_epi16(v_rb[0], v_delta_16); + v_rgb[1] = _mm_unpackhi_epi16(v_rb[0], v_delta_16); + v_rgb[2] = _mm_unpacklo_epi16(v_rb[1], v_delta_16); + v_rgb[3] = _mm_unpackhi_epi16(v_rb[1], v_delta_16); + v_rgb[0] = _mm_madd_epi16(v_rgb[0], v_coeff); + v_rgb[1] = _mm_madd_epi16(v_rgb[1], v_coeff); + v_rgb[2] = _mm_madd_epi16(v_rgb[2], v_coeff); + v_rgb[3] = _mm_madd_epi16(v_rgb[3], v_coeff); + v_rgb[0] = _mm_srai_epi32(v_rgb[0], yuv_shift); + v_rgb[1] = _mm_srai_epi32(v_rgb[1], yuv_shift); + v_rgb[2] = _mm_srai_epi32(v_rgb[2], yuv_shift); + v_rgb[3] = _mm_srai_epi32(v_rgb[3], yuv_shift); + v_rgb[0] = _mm_packs_epi32(v_rgb[0], v_rgb[1]); + v_rgb[2] = _mm_packs_epi32(v_rgb[2], v_rgb[3]); + v_rgb[0] = _mm_packus_epi16(v_rgb[0], v_rgb[2]); - __m128i v_cr0 = _mm_mullo_epi32(_mm_sub_epi32(blueIdx == 2 ? v_r_p : v_b_p, v_y0), v_c3); - __m128i v_cb0 = _mm_mullo_epi32(_mm_sub_epi32(blueIdx == 0 ? v_r_p : v_b_p, v_y0), v_c4); - v_cr0 = _mm_srai_epi32(_mm_add_epi32(v_delta, v_cr0), yuv_shift); - v_cb0 = _mm_srai_epi32(_mm_add_epi32(v_delta, v_cb0), yuv_shift); + v_rb[0] = _mm_unpacklo_epi16(v_y, v_rgb[0]); + v_rb[1] = _mm_unpackhi_epi16(v_y, v_rgb[0]); - v_r_p = _mm_unpackhi_epi16(v_r, v_zero); - v_g_p = _mm_unpackhi_epi16(v_g, v_zero); - v_b_p = _mm_unpackhi_epi16(v_b, v_zero); + v_rb[0] = _mm_shuffle_epi8(v_rb[0], v_shuffle2); + v_rb[1] = _mm_shuffle_epi8(v_rb[1], v_shuffle2); + v_rb[1] = _mm_alignr_epi8(v_rb[1], _mm_slli_si128(v_rb[0], 4), 12); - __m128i v_y1 = _mm_add_epi32(_mm_mullo_epi32(v_r_p, v_c0), - _mm_add_epi32(_mm_mullo_epi32(v_g_p, v_c1), - _mm_mullo_epi32(v_b_p, v_c2))); - v_y1 = _mm_srli_epi32(_mm_add_epi32(v_delta2, v_y1), yuv_shift); - - __m128i v_cr1 = _mm_mullo_epi32(_mm_sub_epi32(blueIdx == 2 ? v_r_p : v_b_p, v_y1), v_c3); - __m128i v_cb1 = _mm_mullo_epi32(_mm_sub_epi32(blueIdx == 0 ? v_r_p : v_b_p, v_y1), v_c4); - v_cr1 = _mm_srai_epi32(_mm_add_epi32(v_delta, v_cr1), yuv_shift); - v_cb1 = _mm_srai_epi32(_mm_add_epi32(v_delta, v_cb1), yuv_shift); - - v_y = _mm_packs_epi32(v_y0, v_y1); - v_cr = _mm_packs_epi32(v_cr0, v_cr1); - v_cb = _mm_packs_epi32(v_cb0, v_cb1); + _mm_storel_epi64((__m128i *)(dst), v_rb[0]); + _mm_storeu_si128((__m128i *)(dst + 8), v_rb[1]); } void operator()(const uchar * src, uchar * dst, int n) const @@ -2233,63 +2247,67 @@ struct RGB2YCrCb_i if (haveSIMD) { - for ( ; i <= n - 96; i += 96, src += scn * 32) + __m128i v_shuffle; + __m128i v_crgb; + if (scn == 4) { - __m128i v_r0 = _mm_loadu_si128((__m128i const *)(src)); - __m128i v_r1 = _mm_loadu_si128((__m128i const *)(src + 16)); - __m128i v_g0 = _mm_loadu_si128((__m128i const *)(src + 32)); - __m128i v_g1 = _mm_loadu_si128((__m128i const *)(src + 48)); - __m128i v_b0 = _mm_loadu_si128((__m128i const *)(src + 64)); - __m128i v_b1 = _mm_loadu_si128((__m128i const *)(src + 80)); - - if (scn == 4) + if (bidx == 0) { - __m128i v_a0 = _mm_loadu_si128((__m128i const *)(src + 96)); - __m128i v_a1 = _mm_loadu_si128((__m128i const *)(src + 112)); - _mm_deinterleave_epi8(v_r0, v_r1, v_g0, v_g1, - v_b0, v_b1, v_a0, v_a1); + v_shuffle = _mm_set_epi8(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc, 0xe, 0x8, 0xa, 0x4, 0x6, 0x0, 0x2); } else - _mm_deinterleave_epi8(v_r0, v_r1, v_g0, v_g1, v_b0, v_b1); + { + v_shuffle = _mm_set_epi8(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe, 0xc, 0xa, 0x8, 0x6, 0x4, 0x2, 0x0); + } + v_crgb = _mm_set_epi16(0, (short)C2, (short)C1, (short)C0, 0, (short)C2, (short)C1, (short)C0); + for ( ; i <= n - 24; i += 24, src += scn * 8) + { + __m128i v_src[2]; + v_src[0] = _mm_loadu_si128((__m128i const *)(src)); + v_src[1] = _mm_loadu_si128((__m128i const *)(src + 16)); - __m128i v_y0 = v_zero, v_cr0 = v_zero, v_cb0 = v_zero; - process(_mm_unpacklo_epi8(v_r0, v_zero), - _mm_unpacklo_epi8(v_g0, v_zero), - _mm_unpacklo_epi8(v_b0, v_zero), - v_y0, v_cr0, v_cb0); + __m128i v_rgb[4]; + v_rgb[0] = _mm_cvtepu8_epi16(v_src[0]); + v_rgb[1] = _mm_cvtepu8_epi16(_mm_srli_si128(v_src[0], 8)); + v_rgb[2] = _mm_cvtepu8_epi16(v_src[1]); + v_rgb[3] = _mm_cvtepu8_epi16(_mm_srli_si128(v_src[1], 8)); - __m128i v_y1 = v_zero, v_cr1 = v_zero, v_cb1 = v_zero; - process(_mm_unpackhi_epi8(v_r0, v_zero), - _mm_unpackhi_epi8(v_g0, v_zero), - _mm_unpackhi_epi8(v_b0, v_zero), - v_y1, v_cr1, v_cb1); + __m128i v_rb[2]; + v_rb[0] = _mm_shuffle_epi8(v_src[0], v_shuffle); + v_rb[1] = _mm_shuffle_epi8(v_src[1], v_shuffle); - __m128i v_y_0 = _mm_packus_epi16(v_y0, v_y1); - __m128i v_cr_0 = _mm_packus_epi16(v_cr0, v_cr1); - __m128i v_cb_0 = _mm_packus_epi16(v_cb0, v_cb1); + process(v_rgb, v_crgb, v_rb, dst + i); + } + } + else + { + if (bidx == 0) + { + v_shuffle = _mm_set_epi8(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9, 0xb, 0x6, 0x8, 0x3, 0x5, 0x0, 0x2); + } + else + { + v_shuffle = _mm_set_epi8(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xb, 0x9, 0x8, 0x6, 0x5, 0x3, 0x2, 0x0); + } + v_crgb = _mm_set_epi16(0, (short)C2, (short)C1, (short)C0, (short)C2, (short)C1, (short)C0, 0); + for ( ; i <= n - 24; i += 24, src += scn * 8) + { + __m128i v_src[2]; + v_src[0] = _mm_loadu_si128((__m128i const *)(src)); + v_src[1] = _mm_loadl_epi64((__m128i const *)(src + 16)); - process(_mm_unpacklo_epi8(v_r1, v_zero), - _mm_unpacklo_epi8(v_g1, v_zero), - _mm_unpacklo_epi8(v_b1, v_zero), - v_y0, v_cr0, v_cb0); + __m128i v_rgb[4]; + v_rgb[0] = _mm_cvtepu8_epi16(_mm_slli_si128(v_src[0], 1)); + v_rgb[1] = _mm_cvtepu8_epi16(_mm_srli_si128(v_src[0], 5)); + v_rgb[2] = _mm_cvtepu8_epi16(_mm_alignr_epi8(v_src[1], v_src[0], 11)); + v_rgb[3] = _mm_cvtepu8_epi16(_mm_srli_si128(v_src[1], 1)); - process(_mm_unpackhi_epi8(v_r1, v_zero), - _mm_unpackhi_epi8(v_g1, v_zero), - _mm_unpackhi_epi8(v_b1, v_zero), - v_y1, v_cr1, v_cb1); + __m128i v_rb[2]; + v_rb[0] = _mm_shuffle_epi8(v_src[0], v_shuffle); + v_rb[1] = _mm_shuffle_epi8(_mm_alignr_epi8(v_src[1], v_src[0], 12), v_shuffle); - __m128i v_y_1 = _mm_packus_epi16(v_y0, v_y1); - __m128i v_cr_1 = _mm_packus_epi16(v_cr0, v_cr1); - __m128i v_cb_1 = _mm_packus_epi16(v_cb0, v_cb1); - - _mm_interleave_epi8(v_y_0, v_y_1, v_cr_0, v_cr_1, v_cb_0, v_cb_1); - - _mm_storeu_si128((__m128i *)(dst + i), v_y_0); - _mm_storeu_si128((__m128i *)(dst + i + 16), v_y_1); - _mm_storeu_si128((__m128i *)(dst + i + 32), v_cr_0); - _mm_storeu_si128((__m128i *)(dst + i + 48), v_cr_1); - _mm_storeu_si128((__m128i *)(dst + i + 64), v_cb_0); - _mm_storeu_si128((__m128i *)(dst + i + 80), v_cb_1); + process(v_rgb, v_crgb, v_rb, dst + i); + } } } @@ -2304,10 +2322,10 @@ struct RGB2YCrCb_i } } + __m128i v_delta_16, v_delta_32; + __m128i v_coeff; + __m128i v_shuffle2; int srccn, blueIdx, coeffs[5]; - __m128i v_c0, v_c1, v_c2; - __m128i v_c3, v_c4, v_delta, v_delta2; - __m128i v_zero; bool haveSIMD; }; @@ -2977,6 +2995,72 @@ struct YCrCb2RGB_i haveSIMD = checkHardwareSupport(CV_CPU_SSE2); } +#if CV_SSE4_1 + // 16s x 8 + void process(__m128i* v_src, __m128i* v_shuffle, + __m128i* v_coeffs) const + { + __m128i v_ycrcb[3]; + v_ycrcb[0] = _mm_shuffle_epi8(v_src[0], v_shuffle[0]); + v_ycrcb[1] = _mm_shuffle_epi8(_mm_alignr_epi8(v_src[1], v_src[0], 8), v_shuffle[0]); + v_ycrcb[2] = _mm_shuffle_epi8(v_src[1], v_shuffle[0]); + + __m128i v_y[3]; + v_y[1] = _mm_shuffle_epi8(v_src[0], v_shuffle[1]); + v_y[2] = _mm_srli_si128(_mm_shuffle_epi8(_mm_alignr_epi8(v_src[1], v_src[0], 15), v_shuffle[1]), 1); + v_y[0] = _mm_unpacklo_epi8(v_y[1], v_zero); + v_y[1] = _mm_unpackhi_epi8(v_y[1], v_zero); + v_y[2] = _mm_unpacklo_epi8(v_y[2], v_zero); + + __m128i v_rgb[6]; + v_rgb[0] = _mm_unpacklo_epi8(v_ycrcb[0], v_zero); + v_rgb[1] = _mm_unpackhi_epi8(v_ycrcb[0], v_zero); + v_rgb[2] = _mm_unpacklo_epi8(v_ycrcb[1], v_zero); + v_rgb[3] = _mm_unpackhi_epi8(v_ycrcb[1], v_zero); + v_rgb[4] = _mm_unpacklo_epi8(v_ycrcb[2], v_zero); + v_rgb[5] = _mm_unpackhi_epi8(v_ycrcb[2], v_zero); + + v_rgb[0] = _mm_sub_epi16(v_rgb[0], v_delta); + v_rgb[1] = _mm_sub_epi16(v_rgb[1], v_delta); + v_rgb[2] = _mm_sub_epi16(v_rgb[2], v_delta); + v_rgb[3] = _mm_sub_epi16(v_rgb[3], v_delta); + v_rgb[4] = _mm_sub_epi16(v_rgb[4], v_delta); + v_rgb[5] = _mm_sub_epi16(v_rgb[5], v_delta); + + v_rgb[0] = _mm_madd_epi16(v_rgb[0], v_coeffs[0]); + v_rgb[1] = _mm_madd_epi16(v_rgb[1], v_coeffs[1]); + v_rgb[2] = _mm_madd_epi16(v_rgb[2], v_coeffs[2]); + v_rgb[3] = _mm_madd_epi16(v_rgb[3], v_coeffs[0]); + v_rgb[4] = _mm_madd_epi16(v_rgb[4], v_coeffs[1]); + v_rgb[5] = _mm_madd_epi16(v_rgb[5], v_coeffs[2]); + + v_rgb[0] = _mm_add_epi32(v_rgb[0], v_delta2); + v_rgb[1] = _mm_add_epi32(v_rgb[1], v_delta2); + v_rgb[2] = _mm_add_epi32(v_rgb[2], v_delta2); + v_rgb[3] = _mm_add_epi32(v_rgb[3], v_delta2); + v_rgb[4] = _mm_add_epi32(v_rgb[4], v_delta2); + v_rgb[5] = _mm_add_epi32(v_rgb[5], v_delta2); + + v_rgb[0] = _mm_srai_epi32(v_rgb[0], yuv_shift); + v_rgb[1] = _mm_srai_epi32(v_rgb[1], yuv_shift); + v_rgb[2] = _mm_srai_epi32(v_rgb[2], yuv_shift); + v_rgb[3] = _mm_srai_epi32(v_rgb[3], yuv_shift); + v_rgb[4] = _mm_srai_epi32(v_rgb[4], yuv_shift); + v_rgb[5] = _mm_srai_epi32(v_rgb[5], yuv_shift); + + v_rgb[0] = _mm_packs_epi32(v_rgb[0], v_rgb[1]); + v_rgb[2] = _mm_packs_epi32(v_rgb[2], v_rgb[3]); + v_rgb[4] = _mm_packs_epi32(v_rgb[4], v_rgb[5]); + + v_rgb[0] = _mm_add_epi16(v_rgb[0], v_y[0]); + v_rgb[2] = _mm_add_epi16(v_rgb[2], v_y[1]); + v_rgb[4] = _mm_add_epi16(v_rgb[4], v_y[2]); + + v_src[0] = _mm_packus_epi16(v_rgb[0], v_rgb[2]); + v_src[1] = _mm_packus_epi16(v_rgb[4], v_rgb[4]); + } +#endif // CV_SSE4_1 + // 16s x 8 void process(__m128i v_y, __m128i v_cr, __m128i v_cb, __m128i & v_r, __m128i & v_g, __m128i & v_b) const @@ -3030,6 +3114,91 @@ struct YCrCb2RGB_i int C0 = coeffs[0], C1 = coeffs[1], C2 = coeffs[2], C3 = coeffs[3]; n *= 3; +#if CV_SSE4_1 + if (checkHardwareSupport(CV_CPU_SSE4_1) && useSSE) + { + __m128i v_shuffle[2]; + v_shuffle[0] = _mm_set_epi8(0x8, 0x7, 0x7, 0x6, 0x6, 0x5, 0x5, 0x4, 0x4, 0x3, 0x3, 0x2, 0x2, 0x1, 0x1, 0x0); + v_shuffle[1] = _mm_set_epi8(0xf, 0xc, 0xc, 0xc, 0x9, 0x9, 0x9, 0x6, 0x6, 0x6, 0x3, 0x3, 0x3, 0x0, 0x0, 0x0); + __m128i v_coeffs[3]; + v_coeffs[0] = _mm_set_epi16((short)C0, 0, 0, (short)C3, (short)C2, (short)C1, (short)C0, 0); + v_coeffs[1] = _mm_set_epi16((short)C2, (short)C1, (short)C0, 0, 0, (short)C3, (short)C2, (short)C1); + v_coeffs[2] = _mm_set_epi16(0, (short)C3, (short)C2, (short)C1, (short)C0, 0, 0, (short)C3); + + if (dcn == 3) + { + if (bidx == 0) + { + __m128i v_shuffle_dst = _mm_set_epi8(0xf, 0xc, 0xd, 0xe, 0x9, 0xa, 0xb, 0x6, 0x7, 0x8, 0x3, 0x4, 0x5, 0x0, 0x1, 0x2); + for ( ; i <= n - 24; i += 24, dst += dcn * 8) + { + __m128i v_src[2]; + v_src[0] = _mm_loadu_si128((__m128i const *)(src + i)); + v_src[1] = _mm_loadl_epi64((__m128i const *)(src + i + 16)); + + process(v_src, v_shuffle, v_coeffs); + + __m128i v_dst[2]; + v_dst[0] = _mm_shuffle_epi8(v_src[0], v_shuffle_dst); + v_dst[1] = _mm_shuffle_epi8(_mm_alignr_epi8(v_src[1], v_src[0], 15), v_shuffle_dst); + + _mm_storeu_si128((__m128i *)(dst), _mm_alignr_epi8(v_dst[1], _mm_slli_si128(v_dst[0], 1), 1)); + _mm_storel_epi64((__m128i *)(dst + 16), _mm_srli_si128(v_dst[1], 1)); + } + } + else + { + for ( ; i <= n - 24; i += 24, dst += dcn * 8) + { + __m128i v_src[2]; + v_src[0] = _mm_loadu_si128((__m128i const *)(src + i)); + v_src[1] = _mm_loadl_epi64((__m128i const *)(src + i + 16)); + + process(v_src, v_shuffle, v_coeffs); + + _mm_storeu_si128((__m128i *)(dst), v_src[0]); + _mm_storel_epi64((__m128i *)(dst + 16), v_src[1]); + } + } + } + else + { + if (bidx == 0) + { + __m128i v_shuffle_dst = _mm_set_epi8(0x0, 0xa, 0xb, 0xc, 0x0, 0x7, 0x8, 0x9, 0x0, 0x4, 0x5, 0x6, 0x0, 0x1, 0x2, 0x3); + + for ( ; i <= n - 24; i += 24, dst += dcn * 8) + { + __m128i v_src[2]; + v_src[0] = _mm_loadu_si128((__m128i const *)(src + i)); + v_src[1] = _mm_loadl_epi64((__m128i const *)(src + i + 16)); + + process(v_src, v_shuffle, v_coeffs); + + _mm_storeu_si128((__m128i *)(dst), _mm_shuffle_epi8(_mm_alignr_epi8(v_src[0], v_alpha, 15), v_shuffle_dst)); + _mm_storeu_si128((__m128i *)(dst + 16), _mm_shuffle_epi8(_mm_alignr_epi8(_mm_alignr_epi8(v_src[1], v_src[0], 12), v_alpha, 15), v_shuffle_dst)); + } + } + else + { + __m128i v_shuffle_dst = _mm_set_epi8(0x0, 0xc, 0xb, 0xa, 0x0, 0x9, 0x8, 0x7, 0x0, 0x6, 0x5, 0x4, 0x0, 0x3, 0x2, 0x1); + + for ( ; i <= n - 24; i += 24, dst += dcn * 8) + { + __m128i v_src[2]; + v_src[0] = _mm_loadu_si128((__m128i const *)(src + i)); + v_src[1] = _mm_loadl_epi64((__m128i const *)(src + i + 16)); + + process(v_src, v_shuffle, v_coeffs); + + _mm_storeu_si128((__m128i *)(dst), _mm_shuffle_epi8(_mm_alignr_epi8(v_src[0], v_alpha, 15), v_shuffle_dst)); + _mm_storeu_si128((__m128i *)(dst + 16), _mm_shuffle_epi8(_mm_alignr_epi8(_mm_alignr_epi8(v_src[1], v_src[0], 12), v_alpha, 15), v_shuffle_dst)); + } + } + } + } + else +#endif // CV_SSE4_1 if (haveSIMD && useSSE) { for ( ; i <= n - 96; i += 96, dst += dcn * 32) @@ -4325,7 +4494,6 @@ struct HSV2RGB_b v_scale = vdupq_n_f32(255.f); v_alpha = vdup_n_u8(ColorChannel::max()); #elif CV_SSE2 - v_scale_inv = _mm_set1_ps(1.f/255.f); v_scale = _mm_set1_ps(255.0f); v_zero = _mm_setzero_si128(); haveSIMD = checkHardwareSupport(CV_CPU_SSE2); @@ -4333,8 +4501,8 @@ struct HSV2RGB_b } #if CV_SSE2 - // 16s x 8 void process(__m128i v_r, __m128i v_g, __m128i v_b, + const __m128& v_coeffs_, float * buf) const { __m128 v_r0 = _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_r, v_zero)); @@ -4345,13 +4513,20 @@ struct HSV2RGB_b __m128 v_g1 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_g, v_zero)); __m128 v_b1 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_b, v_zero)); - v_g0 = _mm_mul_ps(v_g0, v_scale_inv); - v_b0 = _mm_mul_ps(v_b0, v_scale_inv); + __m128 v_coeffs = v_coeffs_; - v_g1 = _mm_mul_ps(v_g1, v_scale_inv); - v_b1 = _mm_mul_ps(v_b1, v_scale_inv); + v_r0 = _mm_mul_ps(v_r0, v_coeffs); + v_g1 = _mm_mul_ps(v_g1, v_coeffs); - _mm_interleave_ps(v_r0, v_r1, v_g0, v_g1, v_b0, v_b1); + v_coeffs = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_coeffs), 0x49)); + + v_r1 = _mm_mul_ps(v_r1, v_coeffs); + v_b0 = _mm_mul_ps(v_b0, v_coeffs); + + v_coeffs = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_coeffs), 0x49)); + + v_g0 = _mm_mul_ps(v_g0, v_coeffs); + v_b1 = _mm_mul_ps(v_b1, v_coeffs); _mm_store_ps(buf, v_r0); _mm_store_ps(buf + 4, v_r1); @@ -4367,6 +4542,9 @@ struct HSV2RGB_b int i, j, dcn = dstcn; uchar alpha = ColorChannel::max(); float CV_DECL_ALIGNED(16) buf[3*BLOCK_SIZE]; + #if CV_SSE2 + __m128 v_coeffs = _mm_set_ps(1.f, 1.f/255.f, 1.f/255.f, 1.f); + #endif for( i = 0; i < n; i += BLOCK_SIZE, src += BLOCK_SIZE*3 ) { @@ -4395,36 +4573,16 @@ struct HSV2RGB_b #elif CV_SSE2 if (haveSIMD) { - for ( ; j <= (dn - 32) * 3; j += 96) + for ( ; j <= (dn - 8) * 3; j += 24) { - __m128i v_r0 = _mm_loadu_si128((__m128i const *)(src + j)); - __m128i v_r1 = _mm_loadu_si128((__m128i const *)(src + j + 16)); - __m128i v_g0 = _mm_loadu_si128((__m128i const *)(src + j + 32)); - __m128i v_g1 = _mm_loadu_si128((__m128i const *)(src + j + 48)); - __m128i v_b0 = _mm_loadu_si128((__m128i const *)(src + j + 64)); - __m128i v_b1 = _mm_loadu_si128((__m128i const *)(src + j + 80)); + __m128i v_src0 = _mm_loadu_si128((__m128i const *)(src + j)); + __m128i v_src1 = _mm_loadl_epi64((__m128i const *)(src + j + 16)); - _mm_deinterleave_epi8(v_r0, v_r1, v_g0, v_g1, v_b0, v_b1); - - process(_mm_unpacklo_epi8(v_r0, v_zero), - _mm_unpacklo_epi8(v_g0, v_zero), - _mm_unpacklo_epi8(v_b0, v_zero), + process(_mm_unpacklo_epi8(v_src0, v_zero), + _mm_unpackhi_epi8(v_src0, v_zero), + _mm_unpacklo_epi8(v_src1, v_zero), + v_coeffs, buf + j); - - process(_mm_unpackhi_epi8(v_r0, v_zero), - _mm_unpackhi_epi8(v_g0, v_zero), - _mm_unpackhi_epi8(v_b0, v_zero), - buf + j + 24); - - process(_mm_unpacklo_epi8(v_r1, v_zero), - _mm_unpacklo_epi8(v_g1, v_zero), - _mm_unpacklo_epi8(v_b1, v_zero), - buf + j + 48); - - process(_mm_unpackhi_epi8(v_r1, v_zero), - _mm_unpackhi_epi8(v_g1, v_zero), - _mm_unpackhi_epi8(v_b1, v_zero), - buf + j + 72); } } #endif @@ -4508,7 +4666,7 @@ struct HSV2RGB_b float32x4_t v_scale, v_scale_inv; uint8x8_t v_alpha; #elif CV_SSE2 - __m128 v_scale_inv, v_scale; + __m128 v_scale; __m128i v_zero; bool haveSIMD; #endif @@ -4584,7 +4742,6 @@ struct RGB2HLS_b v_alpha = vdup_n_u8(ColorChannel::max()); #elif CV_SSE2 v_scale_inv = _mm_set1_ps(1.f/255.f); - v_scale = _mm_set1_ps(255.f); v_zero = _mm_setzero_si128(); haveSIMD = checkHardwareSupport(CV_CPU_SSE2); #endif @@ -4592,25 +4749,25 @@ struct RGB2HLS_b #if CV_SSE2 void process(const float * buf, - __m128i & v_h, __m128i & v_l, __m128i & v_s) const + __m128 & v_coeffs, uchar * dst) const { - __m128 v_h0f = _mm_load_ps(buf); - __m128 v_h1f = _mm_load_ps(buf + 4); - __m128 v_l0f = _mm_load_ps(buf + 8); - __m128 v_l1f = _mm_load_ps(buf + 12); - __m128 v_s0f = _mm_load_ps(buf + 16); - __m128 v_s1f = _mm_load_ps(buf + 20); + __m128 v_l0f = _mm_load_ps(buf); + __m128 v_l1f = _mm_load_ps(buf + 4); + __m128 v_u0f = _mm_load_ps(buf + 8); + __m128 v_u1f = _mm_load_ps(buf + 12); - _mm_deinterleave_ps(v_h0f, v_h1f, v_l0f, v_l1f, v_s0f, v_s1f); + v_l0f = _mm_mul_ps(v_l0f, v_coeffs); + v_u1f = _mm_mul_ps(v_u1f, v_coeffs); + v_coeffs = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_coeffs), 0x92)); + v_u0f = _mm_mul_ps(v_u0f, v_coeffs); + v_coeffs = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_coeffs), 0x92)); + v_l1f = _mm_mul_ps(v_l1f, v_coeffs); - v_l0f = _mm_mul_ps(v_l0f, v_scale); - v_l1f = _mm_mul_ps(v_l1f, v_scale); - v_s0f = _mm_mul_ps(v_s0f, v_scale); - v_s1f = _mm_mul_ps(v_s1f, v_scale); + __m128i v_l = _mm_packs_epi32(_mm_cvtps_epi32(v_l0f), _mm_cvtps_epi32(v_l1f)); + __m128i v_u = _mm_packs_epi32(_mm_cvtps_epi32(v_u0f), _mm_cvtps_epi32(v_u1f)); + __m128i v_l0 = _mm_packus_epi16(v_l, v_u); - v_h = _mm_packs_epi32(_mm_cvtps_epi32(v_h0f), _mm_cvtps_epi32(v_h1f)); - v_l = _mm_packs_epi32(_mm_cvtps_epi32(v_l0f), _mm_cvtps_epi32(v_l1f)); - v_s = _mm_packs_epi32(_mm_cvtps_epi32(v_s0f), _mm_cvtps_epi32(v_s1f)); + _mm_storeu_si128((__m128i *)(dst), v_l0); } #endif @@ -4618,6 +4775,9 @@ struct RGB2HLS_b { int i, j, scn = srccn; float CV_DECL_ALIGNED(16) buf[3*BLOCK_SIZE]; + #if CV_SSE2 + __m128 v_coeffs = _mm_set_ps(1.f, 255.f, 255.f, 1.f); + #endif for( i = 0; i < n; i += BLOCK_SIZE, dst += BLOCK_SIZE*3 ) { @@ -4702,38 +4862,16 @@ struct RGB2HLS_b #elif CV_SSE2 if (haveSIMD) { - for ( ; j <= (dn - 32) * 3; j += 96) + for ( ; j <= (dn - 16) * 3; j += 48) { - __m128i v_h_0, v_l_0, v_s_0; process(buf + j, - v_h_0, v_l_0, v_s_0); + v_coeffs, dst + j); - __m128i v_h_1, v_l_1, v_s_1; - process(buf + j + 24, - v_h_1, v_l_1, v_s_1); + process(buf + j + 16, + v_coeffs, dst + j + 16); - __m128i v_h0 = _mm_packus_epi16(v_h_0, v_h_1); - __m128i v_l0 = _mm_packus_epi16(v_l_0, v_l_1); - __m128i v_s0 = _mm_packus_epi16(v_s_0, v_s_1); - - process(buf + j + 48, - v_h_0, v_l_0, v_s_0); - - process(buf + j + 72, - v_h_1, v_l_1, v_s_1); - - __m128i v_h1 = _mm_packus_epi16(v_h_0, v_h_1); - __m128i v_l1 = _mm_packus_epi16(v_l_0, v_l_1); - __m128i v_s1 = _mm_packus_epi16(v_s_0, v_s_1); - - _mm_interleave_epi8(v_h0, v_h1, v_l0, v_l1, v_s0, v_s1); - - _mm_storeu_si128((__m128i *)(dst + j), v_h0); - _mm_storeu_si128((__m128i *)(dst + j + 16), v_h1); - _mm_storeu_si128((__m128i *)(dst + j + 32), v_l0); - _mm_storeu_si128((__m128i *)(dst + j + 48), v_l1); - _mm_storeu_si128((__m128i *)(dst + j + 64), v_s0); - _mm_storeu_si128((__m128i *)(dst + j + 80), v_s1); + process(buf + j + 32, + v_coeffs, dst + j + 32); } } #endif @@ -4752,7 +4890,7 @@ struct RGB2HLS_b float32x4_t v_scale, v_scale_inv; uint8x8_t v_alpha; #elif CV_SSE2 - __m128 v_scale, v_scale_inv; + __m128 v_scale_inv; __m128i v_zero; bool haveSIMD; #endif @@ -4835,7 +4973,6 @@ struct HLS2RGB_b v_scale = vdupq_n_f32(255.f); v_alpha = vdup_n_u8(ColorChannel::max()); #elif CV_SSE2 - v_scale_inv = _mm_set1_ps(1.f/255.f); v_scale = _mm_set1_ps(255.f); v_zero = _mm_setzero_si128(); haveSIMD = checkHardwareSupport(CV_CPU_SSE2); @@ -4843,8 +4980,8 @@ struct HLS2RGB_b } #if CV_SSE2 - // 16s x 8 void process(__m128i v_r, __m128i v_g, __m128i v_b, + const __m128& v_coeffs_, float * buf) const { __m128 v_r0 = _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_r, v_zero)); @@ -4855,13 +4992,20 @@ struct HLS2RGB_b __m128 v_g1 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_g, v_zero)); __m128 v_b1 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_b, v_zero)); - v_g0 = _mm_mul_ps(v_g0, v_scale_inv); - v_b0 = _mm_mul_ps(v_b0, v_scale_inv); + __m128 v_coeffs = v_coeffs_; - v_g1 = _mm_mul_ps(v_g1, v_scale_inv); - v_b1 = _mm_mul_ps(v_b1, v_scale_inv); + v_r0 = _mm_mul_ps(v_r0, v_coeffs); + v_g1 = _mm_mul_ps(v_g1, v_coeffs); - _mm_interleave_ps(v_r0, v_r1, v_g0, v_g1, v_b0, v_b1); + v_coeffs = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_coeffs), 0x49)); + + v_r1 = _mm_mul_ps(v_r1, v_coeffs); + v_b0 = _mm_mul_ps(v_b0, v_coeffs); + + v_coeffs = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_coeffs), 0x49)); + + v_g0 = _mm_mul_ps(v_g0, v_coeffs); + v_b1 = _mm_mul_ps(v_b1, v_coeffs); _mm_store_ps(buf, v_r0); _mm_store_ps(buf + 4, v_r1); @@ -4877,6 +5021,9 @@ struct HLS2RGB_b int i, j, dcn = dstcn; uchar alpha = ColorChannel::max(); float CV_DECL_ALIGNED(16) buf[3*BLOCK_SIZE]; + #if CV_SSE2 + __m128 v_coeffs = _mm_set_ps(1.f, 1.f/255.f, 1.f/255.f, 1.f); + #endif for( i = 0; i < n; i += BLOCK_SIZE, src += BLOCK_SIZE*3 ) { @@ -4905,36 +5052,16 @@ struct HLS2RGB_b #elif CV_SSE2 if (haveSIMD) { - for ( ; j <= (dn - 32) * 3; j += 96) + for ( ; j <= (dn - 8) * 3; j += 24) { - __m128i v_r0 = _mm_loadu_si128((__m128i const *)(src + j)); - __m128i v_r1 = _mm_loadu_si128((__m128i const *)(src + j + 16)); - __m128i v_g0 = _mm_loadu_si128((__m128i const *)(src + j + 32)); - __m128i v_g1 = _mm_loadu_si128((__m128i const *)(src + j + 48)); - __m128i v_b0 = _mm_loadu_si128((__m128i const *)(src + j + 64)); - __m128i v_b1 = _mm_loadu_si128((__m128i const *)(src + j + 80)); + __m128i v_src0 = _mm_loadu_si128((__m128i const *)(src + j)); + __m128i v_src1 = _mm_loadl_epi64((__m128i const *)(src + j + 16)); - _mm_deinterleave_epi8(v_r0, v_r1, v_g0, v_g1, v_b0, v_b1); - - process(_mm_unpacklo_epi8(v_r0, v_zero), - _mm_unpacklo_epi8(v_g0, v_zero), - _mm_unpacklo_epi8(v_b0, v_zero), + process(_mm_unpacklo_epi8(v_src0, v_zero), + _mm_unpackhi_epi8(v_src0, v_zero), + _mm_unpacklo_epi8(v_src1, v_zero), + v_coeffs, buf + j); - - process(_mm_unpackhi_epi8(v_r0, v_zero), - _mm_unpackhi_epi8(v_g0, v_zero), - _mm_unpackhi_epi8(v_b0, v_zero), - buf + j + 24); - - process(_mm_unpacklo_epi8(v_r1, v_zero), - _mm_unpacklo_epi8(v_g1, v_zero), - _mm_unpacklo_epi8(v_b1, v_zero), - buf + j + 48); - - process(_mm_unpackhi_epi8(v_r1, v_zero), - _mm_unpackhi_epi8(v_g1, v_zero), - _mm_unpackhi_epi8(v_b1, v_zero), - buf + j + 72); } } #endif @@ -5017,7 +5144,7 @@ struct HLS2RGB_b float32x4_t v_scale, v_scale_inv; uint8x8_t v_alpha; #elif CV_SSE2 - __m128 v_scale, v_scale_inv; + __m128 v_scale; __m128i v_zero; bool haveSIMD; #endif @@ -5336,9 +5463,7 @@ struct Lab2RGB_b v_alpha = vdup_n_u8(ColorChannel::max()); v_128 = vdupq_n_f32(128.0f); #elif CV_SSE2 - v_scale_inv = _mm_set1_ps(100.f/255.f); v_scale = _mm_set1_ps(255.f); - v_128 = _mm_set1_ps(128.0f); v_zero = _mm_setzero_si128(); haveSIMD = checkHardwareSupport(CV_CPU_SSE2); #endif @@ -5347,6 +5472,7 @@ struct Lab2RGB_b #if CV_SSE2 // 16s x 8 void process(__m128i v_r, __m128i v_g, __m128i v_b, + const __m128& v_coeffs_, const __m128& v_res_, float * buf) const { __m128 v_r0 = _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_r, v_zero)); @@ -5357,15 +5483,23 @@ struct Lab2RGB_b __m128 v_g1 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_g, v_zero)); __m128 v_b1 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_b, v_zero)); - v_r0 = _mm_mul_ps(v_r0, v_scale_inv); - v_r1 = _mm_mul_ps(v_r1, v_scale_inv); + __m128 v_coeffs = v_coeffs_; + __m128 v_res = v_res_; - v_g0 = _mm_sub_ps(v_g0, v_128); - v_g1 = _mm_sub_ps(v_g1, v_128); - v_b0 = _mm_sub_ps(v_b0, v_128); - v_b1 = _mm_sub_ps(v_b1, v_128); + v_r0 = _mm_sub_ps(_mm_mul_ps(v_r0, v_coeffs), v_res); + v_g1 = _mm_sub_ps(_mm_mul_ps(v_g1, v_coeffs), v_res); - _mm_interleave_ps(v_r0, v_r1, v_g0, v_g1, v_b0, v_b1); + v_coeffs = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_coeffs), 0x49)); + v_res = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_res), 0x49)); + + v_r1 = _mm_sub_ps(_mm_mul_ps(v_r1, v_coeffs), v_res); + v_b0 = _mm_sub_ps(_mm_mul_ps(v_b0, v_coeffs), v_res); + + v_coeffs = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_coeffs), 0x49)); + v_res = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_res), 0x49)); + + v_g0 = _mm_sub_ps(_mm_mul_ps(v_g0, v_coeffs), v_res); + v_b1 = _mm_sub_ps(_mm_mul_ps(v_b1, v_coeffs), v_res); _mm_store_ps(buf, v_r0); _mm_store_ps(buf + 4, v_r1); @@ -5381,6 +5515,10 @@ struct Lab2RGB_b int i, j, dcn = dstcn; uchar alpha = ColorChannel::max(); float CV_DECL_ALIGNED(16) buf[3*BLOCK_SIZE]; + #if CV_SSE2 + __m128 v_coeffs = _mm_set_ps(100.f/255.f, 1.f, 1.f, 100.f/255.f); + __m128 v_res = _mm_set_ps(0.f, 128.f, 128.f, 0.f); + #endif for( i = 0; i < n; i += BLOCK_SIZE, src += BLOCK_SIZE*3 ) { @@ -5409,36 +5547,16 @@ struct Lab2RGB_b #elif CV_SSE2 if (haveSIMD) { - for ( ; j <= (dn - 32) * 3; j += 96) + for ( ; j <= (dn - 8) * 3; j += 24) { - __m128i v_r0 = _mm_loadu_si128((__m128i const *)(src + j)); - __m128i v_r1 = _mm_loadu_si128((__m128i const *)(src + j + 16)); - __m128i v_g0 = _mm_loadu_si128((__m128i const *)(src + j + 32)); - __m128i v_g1 = _mm_loadu_si128((__m128i const *)(src + j + 48)); - __m128i v_b0 = _mm_loadu_si128((__m128i const *)(src + j + 64)); - __m128i v_b1 = _mm_loadu_si128((__m128i const *)(src + j + 80)); + __m128i v_src0 = _mm_loadu_si128((__m128i const *)(src + j)); + __m128i v_src1 = _mm_loadl_epi64((__m128i const *)(src + j + 16)); - _mm_deinterleave_epi8(v_r0, v_r1, v_g0, v_g1, v_b0, v_b1); - - process(_mm_unpacklo_epi8(v_r0, v_zero), - _mm_unpacklo_epi8(v_g0, v_zero), - _mm_unpacklo_epi8(v_b0, v_zero), + process(_mm_unpacklo_epi8(v_src0, v_zero), + _mm_unpackhi_epi8(v_src0, v_zero), + _mm_unpacklo_epi8(v_src1, v_zero), + v_coeffs, v_res, buf + j); - - process(_mm_unpackhi_epi8(v_r0, v_zero), - _mm_unpackhi_epi8(v_g0, v_zero), - _mm_unpackhi_epi8(v_b0, v_zero), - buf + j + 24); - - process(_mm_unpacklo_epi8(v_r1, v_zero), - _mm_unpacklo_epi8(v_g1, v_zero), - _mm_unpacklo_epi8(v_b1, v_zero), - buf + j + 48); - - process(_mm_unpackhi_epi8(v_r1, v_zero), - _mm_unpackhi_epi8(v_g1, v_zero), - _mm_unpackhi_epi8(v_b1, v_zero), - buf + j + 72); } } #endif @@ -5523,7 +5641,7 @@ struct Lab2RGB_b float32x4_t v_scale, v_scale_inv, v_128; uint8x8_t v_alpha; #elif CV_SSE2 - __m128 v_scale, v_scale_inv, v_128; + __m128 v_scale; __m128i v_zero; bool haveSIMD; #endif @@ -5703,38 +5821,33 @@ struct RGB2Luv_b #elif CV_SSE2 v_zero = _mm_setzero_si128(); v_scale_inv = _mm_set1_ps(1.f/255.f); - v_scale = _mm_set1_ps(2.55f); - v_coeff1 = _mm_set1_ps(0.72033898305084743f); - v_coeff2 = _mm_set1_ps(96.525423728813564f); - v_coeff3 = _mm_set1_ps(0.9732824427480916f); - v_coeff4 = _mm_set1_ps(136.259541984732824f); haveSIMD = checkHardwareSupport(CV_CPU_SSE2); #endif } #if CV_SSE2 void process(const float * buf, - __m128i & v_l, __m128i & v_u, __m128i & v_v) const + __m128 & v_coeffs, __m128 & v_res, uchar * dst) const { __m128 v_l0f = _mm_load_ps(buf); __m128 v_l1f = _mm_load_ps(buf + 4); __m128 v_u0f = _mm_load_ps(buf + 8); __m128 v_u1f = _mm_load_ps(buf + 12); - __m128 v_v0f = _mm_load_ps(buf + 16); - __m128 v_v1f = _mm_load_ps(buf + 20); - _mm_deinterleave_ps(v_l0f, v_l1f, v_u0f, v_u1f, v_v0f, v_v1f); + v_l0f = _mm_add_ps(_mm_mul_ps(v_l0f, v_coeffs), v_res); + v_u1f = _mm_add_ps(_mm_mul_ps(v_u1f, v_coeffs), v_res); + v_coeffs = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_coeffs), 0x92)); + v_res = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_res), 0x92)); + v_u0f = _mm_add_ps(_mm_mul_ps(v_u0f, v_coeffs), v_res); + v_coeffs = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_coeffs), 0x92)); + v_res = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_res), 0x92)); + v_l1f = _mm_add_ps(_mm_mul_ps(v_l1f, v_coeffs), v_res); - v_l0f = _mm_mul_ps(v_l0f, v_scale); - v_l1f = _mm_mul_ps(v_l1f, v_scale); - v_u0f = _mm_add_ps(_mm_mul_ps(v_u0f, v_coeff1), v_coeff2); - v_u1f = _mm_add_ps(_mm_mul_ps(v_u1f, v_coeff1), v_coeff2); - v_v0f = _mm_add_ps(_mm_mul_ps(v_v0f, v_coeff3), v_coeff4); - v_v1f = _mm_add_ps(_mm_mul_ps(v_v1f, v_coeff3), v_coeff4); + __m128i v_l = _mm_packs_epi32(_mm_cvtps_epi32(v_l0f), _mm_cvtps_epi32(v_l1f)); + __m128i v_u = _mm_packs_epi32(_mm_cvtps_epi32(v_u0f), _mm_cvtps_epi32(v_u1f)); + __m128i v_l0 = _mm_packus_epi16(v_l, v_u); - v_l = _mm_packs_epi32(_mm_cvtps_epi32(v_l0f), _mm_cvtps_epi32(v_l1f)); - v_u = _mm_packs_epi32(_mm_cvtps_epi32(v_u0f), _mm_cvtps_epi32(v_u1f)); - v_v = _mm_packs_epi32(_mm_cvtps_epi32(v_v0f), _mm_cvtps_epi32(v_v1f)); + _mm_storeu_si128((__m128i *)(dst), v_l0); } #endif @@ -5743,6 +5856,11 @@ struct RGB2Luv_b int i, j, scn = srccn; float CV_DECL_ALIGNED(16) buf[3*BLOCK_SIZE]; + #if CV_SSE2 + __m128 v_coeffs = _mm_set_ps(2.55f, 0.9732824427480916f, 0.72033898305084743f, 2.55f); + __m128 v_res = _mm_set_ps(0.f, 136.259541984732824f, 96.525423728813564f, 0.f); + #endif + for( i = 0; i < n; i += BLOCK_SIZE, dst += BLOCK_SIZE*3 ) { int dn = std::min(n - i, (int)BLOCK_SIZE); @@ -5827,38 +5945,16 @@ struct RGB2Luv_b #elif CV_SSE2 if (haveSIMD) { - for ( ; j <= (dn - 32) * 3; j += 96) + for ( ; j <= (dn - 16) * 3; j += 48) { - __m128i v_l_0, v_u_0, v_v_0; process(buf + j, - v_l_0, v_u_0, v_v_0); + v_coeffs, v_res, dst + j); - __m128i v_l_1, v_u_1, v_v_1; - process(buf + j + 24, - v_l_1, v_u_1, v_v_1); + process(buf + j + 16, + v_coeffs, v_res, dst + j + 16); - __m128i v_l0 = _mm_packus_epi16(v_l_0, v_l_1); - __m128i v_u0 = _mm_packus_epi16(v_u_0, v_u_1); - __m128i v_v0 = _mm_packus_epi16(v_v_0, v_v_1); - - process(buf + j + 48, - v_l_0, v_u_0, v_v_0); - - process(buf + j + 72, - v_l_1, v_u_1, v_v_1); - - __m128i v_l1 = _mm_packus_epi16(v_l_0, v_l_1); - __m128i v_u1 = _mm_packus_epi16(v_u_0, v_u_1); - __m128i v_v1 = _mm_packus_epi16(v_v_0, v_v_1); - - _mm_interleave_epi8(v_l0, v_l1, v_u0, v_u1, v_v0, v_v1); - - _mm_storeu_si128((__m128i *)(dst + j), v_l0); - _mm_storeu_si128((__m128i *)(dst + j + 16), v_l1); - _mm_storeu_si128((__m128i *)(dst + j + 32), v_u0); - _mm_storeu_si128((__m128i *)(dst + j + 48), v_u1); - _mm_storeu_si128((__m128i *)(dst + j + 64), v_v0); - _mm_storeu_si128((__m128i *)(dst + j + 80), v_v1); + process(buf + j + 32, + v_coeffs, v_res, dst + j + 32); } } #endif @@ -5879,7 +5975,7 @@ struct RGB2Luv_b float32x4_t v_scale, v_scale_inv, v_coeff1, v_coeff2, v_coeff3, v_coeff4; uint8x8_t v_alpha; #elif CV_SSE2 - __m128 v_scale, v_scale_inv, v_coeff1, v_coeff2, v_coeff3, v_coeff4; + __m128 v_scale_inv; __m128i v_zero; bool haveSIMD; #endif @@ -5903,11 +5999,6 @@ struct Luv2RGB_b v_scale = vdupq_n_f32(255.f); v_alpha = vdup_n_u8(ColorChannel::max()); #elif CV_SSE2 - v_scale_inv = _mm_set1_ps(100.f/255.f); - v_coeff1 = _mm_set1_ps(1.388235294117647f); - v_coeff2 = _mm_set1_ps(1.027450980392157f); - v_134 = _mm_set1_ps(134.f); - v_140 = _mm_set1_ps(140.f); v_scale = _mm_set1_ps(255.f); v_zero = _mm_setzero_si128(); haveSIMD = checkHardwareSupport(CV_CPU_SSE2); @@ -5917,6 +6008,7 @@ struct Luv2RGB_b #if CV_SSE2 // 16s x 8 void process(__m128i v_l, __m128i v_u, __m128i v_v, + const __m128& v_coeffs_, const __m128& v_res_, float * buf) const { __m128 v_l0 = _mm_cvtepi32_ps(_mm_unpacklo_epi16(v_l, v_zero)); @@ -5927,15 +6019,29 @@ struct Luv2RGB_b __m128 v_u1 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_u, v_zero)); __m128 v_v1 = _mm_cvtepi32_ps(_mm_unpackhi_epi16(v_v, v_zero)); - v_l0 = _mm_mul_ps(v_l0, v_scale_inv); - v_l1 = _mm_mul_ps(v_l1, v_scale_inv); + __m128 v_coeffs = v_coeffs_; + __m128 v_res = v_res_; - v_u0 = _mm_sub_ps(_mm_mul_ps(v_u0, v_coeff1), v_134); - v_u1 = _mm_sub_ps(_mm_mul_ps(v_u1, v_coeff1), v_134); - v_v0 = _mm_sub_ps(_mm_mul_ps(v_v0, v_coeff2), v_140); - v_v1 = _mm_sub_ps(_mm_mul_ps(v_v1, v_coeff2), v_140); + v_l0 = _mm_mul_ps(v_l0, v_coeffs); + v_u1 = _mm_mul_ps(v_u1, v_coeffs); + v_l0 = _mm_sub_ps(v_l0, v_res); + v_u1 = _mm_sub_ps(v_u1, v_res); - _mm_interleave_ps(v_l0, v_l1, v_u0, v_u1, v_v0, v_v1); + v_coeffs = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_coeffs), 0x49)); + v_res = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_res), 0x49)); + + v_l1 = _mm_mul_ps(v_l1, v_coeffs); + v_v0 = _mm_mul_ps(v_v0, v_coeffs); + v_l1 = _mm_sub_ps(v_l1, v_res); + v_v0 = _mm_sub_ps(v_v0, v_res); + + v_coeffs = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_coeffs), 0x49)); + v_res = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v_res), 0x49)); + + v_u0 = _mm_mul_ps(v_u0, v_coeffs); + v_v1 = _mm_mul_ps(v_v1, v_coeffs); + v_u0 = _mm_sub_ps(v_u0, v_res); + v_v1 = _mm_sub_ps(v_v1, v_res); _mm_store_ps(buf, v_l0); _mm_store_ps(buf + 4, v_l1); @@ -5952,6 +6058,11 @@ struct Luv2RGB_b uchar alpha = ColorChannel::max(); float CV_DECL_ALIGNED(16) buf[3*BLOCK_SIZE]; + #if CV_SSE2 + __m128 v_coeffs = _mm_set_ps(100.f/255.f, 1.027450980392157f, 1.388235294117647f, 100.f/255.f); + __m128 v_res = _mm_set_ps(0.f, 140.f, 134.f, 0.f); + #endif + for( i = 0; i < n; i += BLOCK_SIZE, src += BLOCK_SIZE*3 ) { int dn = std::min(n - i, (int)BLOCK_SIZE); @@ -5979,36 +6090,16 @@ struct Luv2RGB_b #elif CV_SSE2 if (haveSIMD) { - for ( ; j <= (dn - 32) * 3; j += 96) + for ( ; j <= (dn - 8) * 3; j += 24) { - __m128i v_r0 = _mm_loadu_si128((__m128i const *)(src + j)); - __m128i v_r1 = _mm_loadu_si128((__m128i const *)(src + j + 16)); - __m128i v_g0 = _mm_loadu_si128((__m128i const *)(src + j + 32)); - __m128i v_g1 = _mm_loadu_si128((__m128i const *)(src + j + 48)); - __m128i v_b0 = _mm_loadu_si128((__m128i const *)(src + j + 64)); - __m128i v_b1 = _mm_loadu_si128((__m128i const *)(src + j + 80)); + __m128i v_src0 = _mm_loadu_si128((__m128i const *)(src + j)); + __m128i v_src1 = _mm_loadl_epi64((__m128i const *)(src + j + 16)); - _mm_deinterleave_epi8(v_r0, v_r1, v_g0, v_g1, v_b0, v_b1); - - process(_mm_unpacklo_epi8(v_r0, v_zero), - _mm_unpacklo_epi8(v_g0, v_zero), - _mm_unpacklo_epi8(v_b0, v_zero), + process(_mm_unpacklo_epi8(v_src0, v_zero), + _mm_unpackhi_epi8(v_src0, v_zero), + _mm_unpacklo_epi8(v_src1, v_zero), + v_coeffs, v_res, buf + j); - - process(_mm_unpackhi_epi8(v_r0, v_zero), - _mm_unpackhi_epi8(v_g0, v_zero), - _mm_unpackhi_epi8(v_b0, v_zero), - buf + j + 24); - - process(_mm_unpacklo_epi8(v_r1, v_zero), - _mm_unpacklo_epi8(v_g1, v_zero), - _mm_unpacklo_epi8(v_b1, v_zero), - buf + j + 48); - - process(_mm_unpackhi_epi8(v_r1, v_zero), - _mm_unpackhi_epi8(v_g1, v_zero), - _mm_unpackhi_epi8(v_b1, v_zero), - buf + j + 72); } } #endif @@ -6092,7 +6183,7 @@ struct Luv2RGB_b float32x4_t v_scale, v_scale_inv, v_coeff1, v_coeff2, v_134, v_140; uint8x8_t v_alpha; #elif CV_SSE2 - __m128 v_scale, v_scale_inv, v_coeff1, v_coeff2, v_134, v_140; + __m128 v_scale; __m128i v_zero; bool haveSIMD; #endif @@ -7376,6 +7467,8 @@ void cvtBGRtoBGR(const uchar * src_data, size_t src_step, int width, int height, int depth, int scn, int dcn, bool swapBlue) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtBGRtoBGR, cv_hal_cvtBGRtoBGR, src_data, src_step, dst_data, dst_step, width, height, depth, scn, dcn, swapBlue); #if defined(HAVE_IPP) && IPP_VERSION_X100 >= 700 @@ -7437,6 +7530,8 @@ void cvtBGRtoBGR5x5(const uchar * src_data, size_t src_step, int width, int height, int scn, bool swapBlue, int greenBits) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtBGRtoBGR5x5, cv_hal_cvtBGRtoBGR5x5, src_data, src_step, dst_data, dst_step, width, height, scn, swapBlue, greenBits); #if defined(HAVE_IPP) && IPP_DISABLE_BLOCK // breaks OCL accuracy tests @@ -7483,6 +7578,8 @@ void cvtBGR5x5toBGR(const uchar * src_data, size_t src_step, int width, int height, int dcn, bool swapBlue, int greenBits) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtBGR5x5toBGR, cv_hal_cvtBGR5x5toBGR, src_data, src_step, dst_data, dst_step, width, height, dcn, swapBlue, greenBits); #if defined(HAVE_IPP) && IPP_VERSION_X100 < 900 @@ -7529,6 +7626,8 @@ void cvtBGRtoGray(const uchar * src_data, size_t src_step, int width, int height, int depth, int scn, bool swapBlue) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtBGRtoGray, cv_hal_cvtBGRtoGray, src_data, src_step, dst_data, dst_step, width, height, depth, scn, swapBlue); #if defined(HAVE_IPP) && IPP_VERSION_X100 >= 700 @@ -7576,6 +7675,8 @@ void cvtGraytoBGR(const uchar * src_data, size_t src_step, int width, int height, int depth, int dcn) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtGraytoBGR, cv_hal_cvtGraytoBGR, src_data, src_step, dst_data, dst_step, width, height, depth, dcn); #if defined(HAVE_IPP) && IPP_VERSION_X100 >= 700 @@ -7610,6 +7711,8 @@ void cvtBGR5x5toGray(const uchar * src_data, size_t src_step, int width, int height, int greenBits) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtBGR5x5toGray, cv_hal_cvtBGR5x5toGray, src_data, src_step, dst_data, dst_step, width, height, greenBits); CvtColorLoop(src_data, src_step, dst_data, dst_step, width, height, RGB5x52Gray(greenBits)); } @@ -7620,6 +7723,8 @@ void cvtGraytoBGR5x5(const uchar * src_data, size_t src_step, int width, int height, int greenBits) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtGraytoBGR5x5, cv_hal_cvtGraytoBGR5x5, src_data, src_step, dst_data, dst_step, width, height, greenBits); CvtColorLoop(src_data, src_step, dst_data, dst_step, width, height, Gray2RGB5x5(greenBits)); } @@ -7630,6 +7735,8 @@ void cvtBGRtoYUV(const uchar * src_data, size_t src_step, int width, int height, int depth, int scn, bool swapBlue, bool isCbCr) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtBGRtoYUV, cv_hal_cvtBGRtoYUV, src_data, src_step, dst_data, dst_step, width, height, depth, scn, swapBlue, isCbCr); #if defined(HAVE_IPP) && IPP_DISABLE_BLOCK @@ -7683,6 +7790,8 @@ void cvtYUVtoBGR(const uchar * src_data, size_t src_step, int width, int height, int depth, int dcn, bool swapBlue, bool isCbCr) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtYUVtoBGR, cv_hal_cvtYUVtoBGR, src_data, src_step, dst_data, dst_step, width, height, depth, dcn, swapBlue, isCbCr); @@ -7737,6 +7846,8 @@ void cvtBGRtoXYZ(const uchar * src_data, size_t src_step, int width, int height, int depth, int scn, bool swapBlue) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtBGRtoXYZ, cv_hal_cvtBGRtoXYZ, src_data, src_step, dst_data, dst_step, width, height, depth, scn, swapBlue); #if defined(HAVE_IPP) && IPP_VERSION_X100 >= 700 @@ -7783,6 +7894,8 @@ void cvtXYZtoBGR(const uchar * src_data, size_t src_step, int width, int height, int depth, int dcn, bool swapBlue) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtXYZtoBGR, cv_hal_cvtXYZtoBGR, src_data, src_step, dst_data, dst_step, width, height, depth, dcn, swapBlue); #if defined(HAVE_IPP) && IPP_VERSION_X100 >= 700 @@ -7830,6 +7943,8 @@ void cvtBGRtoHSV(const uchar * src_data, size_t src_step, int width, int height, int depth, int scn, bool swapBlue, bool isFullRange, bool isHSV) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtBGRtoHSV, cv_hal_cvtBGRtoHSV, src_data, src_step, dst_data, dst_step, width, height, depth, scn, swapBlue, isFullRange, isHSV); #if defined(HAVE_IPP) && IPP_VERSION_X100 >= 700 @@ -7915,6 +8030,8 @@ void cvtHSVtoBGR(const uchar * src_data, size_t src_step, int width, int height, int depth, int dcn, bool swapBlue, bool isFullRange, bool isHSV) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtHSVtoBGR, cv_hal_cvtHSVtoBGR, src_data, src_step, dst_data, dst_step, width, height, depth, dcn, swapBlue, isFullRange, isHSV); #if defined(HAVE_IPP) && IPP_VERSION_X100 >= 700 @@ -8004,6 +8121,8 @@ void cvtBGRtoLab(const uchar * src_data, size_t src_step, int width, int height, int depth, int scn, bool swapBlue, bool isLab, bool srgb) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtBGRtoLab, cv_hal_cvtBGRtoLab, src_data, src_step, dst_data, dst_step, width, height, depth, scn, swapBlue, isLab, srgb); #if defined(HAVE_IPP) && IPP_DISABLE_BLOCK @@ -8099,6 +8218,8 @@ void cvtLabtoBGR(const uchar * src_data, size_t src_step, int width, int height, int depth, int dcn, bool swapBlue, bool isLab, bool srgb) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtLabtoBGR, cv_hal_cvtLabtoBGR, src_data, src_step, dst_data, dst_step, width, height, depth, dcn, swapBlue, isLab, srgb); #if defined(HAVE_IPP) && IPP_DISABLE_BLOCK @@ -8192,6 +8313,8 @@ void cvtTwoPlaneYUVtoBGR(const uchar * src_data, size_t src_step, int dst_width, int dst_height, int dcn, bool swapBlue, int uIdx) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtTwoPlaneYUVtoBGR, cv_hal_cvtTwoPlaneYUVtoBGR, src_data, src_step, dst_data, dst_step, dst_width, dst_height, dcn, swapBlue, uIdx); int blueIdx = swapBlue ? 2 : 0; const uchar* uv = src_data + src_step * static_cast(dst_height); @@ -8214,6 +8337,8 @@ void cvtThreePlaneYUVtoBGR(const uchar * src_data, size_t src_step, int dst_width, int dst_height, int dcn, bool swapBlue, int uIdx) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtThreePlaneYUVtoBGR, cv_hal_cvtThreePlaneYUVtoBGR, src_data, src_step, dst_data, dst_step, dst_width, dst_height, dcn, swapBlue, uIdx); const uchar* u = src_data + src_step * static_cast(dst_height); const uchar* v = src_data + src_step * static_cast(dst_height + dst_height/4) + (dst_width/2) * ((dst_height % 4)/2); @@ -8239,6 +8364,8 @@ void cvtBGRtoThreePlaneYUV(const uchar * src_data, size_t src_step, int width, int height, int scn, bool swapBlue, int uIdx) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtBGRtoThreePlaneYUV, cv_hal_cvtBGRtoThreePlaneYUV, src_data, src_step, dst_data, dst_step, width, height, scn, swapBlue, uIdx); int blueIdx = swapBlue ? 2 : 0; switch(blueIdx + uIdx*10) @@ -8256,6 +8383,8 @@ void cvtOnePlaneYUVtoBGR(const uchar * src_data, size_t src_step, int width, int height, int dcn, bool swapBlue, int uIdx, int ycn) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtOnePlaneYUVtoBGR, cv_hal_cvtOnePlaneYUVtoBGR, src_data, src_step, dst_data, dst_step, width, height, dcn, swapBlue, uIdx, ycn); int blueIdx = swapBlue ? 2 : 0; switch(dcn*1000 + blueIdx*100 + uIdx*10 + ycn) @@ -8280,6 +8409,8 @@ void cvtRGBAtoMultipliedRGBA(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtRGBAtoMultipliedRGBA, cv_hal_cvtRGBAtoMultipliedRGBA, src_data, src_step, dst_data, dst_step, width, height); #ifdef HAVE_IPP @@ -8298,6 +8429,8 @@ void cvtMultipliedRGBAtoRGBA(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height) { + CV_INSTRUMENT_REGION() + CALL_HAL(cvtMultipliedRGBAtoRGBA, cv_hal_cvtMultipliedRGBAtoRGBA, src_data, src_step, dst_data, dst_step, width, height); CvtColorLoop(src_data, src_step, dst_data, dst_step, width, height, mRGBA2RGBA()); } @@ -8388,6 +8521,8 @@ inline bool isFullRange(int code) void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) { + CV_INSTRUMENT_REGION() + int stype = _src.type(); int scn = CV_MAT_CN(stype), depth = CV_MAT_DEPTH(stype), uidx, gbits, ycn; @@ -8586,8 +8721,8 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) _dst.create(dstSz, CV_MAKETYPE(depth, dcn)); dst = _dst.getMat(); #ifdef HAVE_IPP - if (ippStsNoErr == ippiCopy_8u_C1R(src.data, (int)src.step, dst.data, (int)dst.step, - ippiSize(dstSz.width, dstSz.height))) + if (CV_INSTRUMENT_FUN_IPP(ippiCopy_8u_C1R, src.data, (int)src.step, dst.data, (int)dst.step, + ippiSize(dstSz.width, dstSz.height)) >= 0) break; #endif src(Range(0, dstSz.height), Range::all()).copyTo(dst); diff --git a/modules/imgproc/src/colormap.cpp b/modules/imgproc/src/colormap.cpp index ec6e005cee..3fc9755403 100644 --- a/modules/imgproc/src/colormap.cpp +++ b/modules/imgproc/src/colormap.cpp @@ -492,6 +492,8 @@ namespace colormap void ColorMap::operator()(InputArray _src, OutputArray _dst) const { + CV_INSTRUMENT_REGION() + if(_lut.total() != 256) CV_Error(Error::StsAssert, "cv::LUT only supports tables of size 256."); Mat src = _src.getMat(); diff --git a/modules/imgproc/src/connectedcomponents.cpp b/modules/imgproc/src/connectedcomponents.cpp index 523eb14c09..bf53704144 100644 --- a/modules/imgproc/src/connectedcomponents.cpp +++ b/modules/imgproc/src/connectedcomponents.cpp @@ -38,6 +38,10 @@ // the use of this software, even if advised of the possibility of such damage. // // 2011 Jason Newton +// 2016 Costantino Grama +// 2016 Federico Bolelli +// 2016 Lorenzo Baraldi +// 2016 Roberto Vezzani //M*/ // #include "precomp.hpp" @@ -188,7 +192,7 @@ namespace cv{ //reference for 8-way: {{-1, -1}, {-1, 0}, {-1, 1}, {0, -1}};//a, b, c, d neighborhoods const int G8[4][2] = {{1, -1}, {1, 0}, {1, 1}, {0, -1}};//a, b, c, d neighborhoods template - struct LabelingImpl{ + struct LabelingWu{ LabelT operator()(const cv::Mat &I, cv::Mat &L, int connectivity, StatsOp &sop){ CV_Assert(L.rows == I.rows); CV_Assert(L.cols == I.cols); @@ -329,33 +333,1366 @@ namespace cv{ fastFree(P); return nLabels; - }//End function LabelingImpl operator() + }//End function LabelingWu operator() + };//End struct LabelingWu - };//End struct LabelingImpl + // Based on “Optimized Block-based Connected Components Labeling with Decision Trees”, Costantino Grana et al + // Only for 8-connectivity + template + struct LabelingGrana{ + LabelT operator()(const cv::Mat &img, cv::Mat &imgLabels, int connectivity, StatsOp &sop){ + CV_Assert(img.rows == imgLabels.rows); + CV_Assert(img.cols == imgLabels.cols); + CV_Assert(connectivity == 8 || connectivity == 4); + + const int h = img.rows; + const int w = img.cols; + + //A quick and dirty upper bound for the maximimum number of labels. + const size_t Plength = img.rows*img.cols / 4; + LabelT *P = (LabelT *)fastMalloc(sizeof(LabelT)* Plength); + P[0] = 0; + LabelT lunique = 1; + + // First scan + for (int r = 0; r(r); + const PixelT* const img_row_prev = (PixelT *)(((char *)img_row) - img.step.p[0]); + const PixelT* const img_row_prev_prev = (PixelT *)(((char *)img_row_prev) - img.step.p[0]); + const PixelT* const img_row_fol = (PixelT *)(((char *)img_row) + img.step.p[0]); + LabelT* const imgLabels_row = imgLabels.ptr(r); + LabelT* const imgLabels_row_prev_prev = (LabelT *)(((char *)imgLabels_row) - imgLabels.step.p[0] - imgLabels.step.p[0]); + for (int c = 0; c < w; c += 2) { + + // We work with 2x2 blocks + // +-+-+-+ + // |P|Q|R| + // +-+-+-+ + // |S|X| + // +-+-+ + + // The pixels are named as follows + // +---+---+---+ + // |a b|c d|e f| + // |g h|i j|k l| + // +---+---+---+ + // |m n|o p| + // |q r|s t| + // +---+---+ + + // Pixels a, f, l, q are not needed, since we need to understand the + // the connectivity between these blocks and those pixels only metter + // when considering the outer connectivities + + // A bunch of defines used to check if the pixels are foreground, + // without going outside the image limits. + #define condition_b c-1>=0 && r-2>=0 && img_row_prev_prev[c-1]>0 + #define condition_c r-2>=0 && img_row_prev_prev[c]>0 + #define condition_d c+1=0 && img_row_prev_prev[c+1]>0 + #define condition_e c+2=0 && img_row_prev_prev[c+2]>0 + + #define condition_g c-2>=0 && r-1>=0 && img_row_prev[c-2]>0 + #define condition_h c-1>=0 && r-1>=0 && img_row_prev[c-1]>0 + #define condition_i r-1>=0 && img_row_prev[c]>0 + #define condition_j c+1=0 && img_row_prev[c+1]>0 + #define condition_k c+2=0 && img_row_prev[c+2]>0 + + #define condition_m c-2>=0 && img_row[c-2]>0 + #define condition_n c-1>=0 && img_row[c-1]>0 + #define condition_o img_row[c]>0 + #define condition_p c+10 + + #define condition_r c-1>=0 && r+10 + #define condition_s r+10 + #define condition_t c+10 + + // This is a decision tree which allows to choose which action to + // perform, checking as few conditions as possible. + // Actions: the blocks label are provisionally stored in the top left + // pixel of the block in the labels image + + if (condition_o) { + if (condition_n) { + if (condition_j) { + if (condition_i) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_c) { + if (condition_h) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_g) { + if (condition_b) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + } + else { + if (condition_p) { + if (condition_k) { + if (condition_d) { + if (condition_i) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_c) { + if (condition_h) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_g) { + if (condition_b) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + } + else { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + } + } + else { + if (condition_r) { + if (condition_j) { + if (condition_m) { + if (condition_h) { + if (condition_i) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_c) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + } + else { + if (condition_g) { + if (condition_b) { + if (condition_i) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_c) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + } + else { + if (condition_i) { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + else { + if (condition_h) { + if (condition_c) { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + else { + //Action_14: Merge labels of block P, Q and S + imgLabels_row[c] = set_union(P, set_union(P, imgLabels_row_prev_prev[c - 2], imgLabels_row_prev_prev[c]), imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + } + } + else { + if (condition_p) { + if (condition_k) { + if (condition_m) { + if (condition_h) { + if (condition_d) { + if (condition_i) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_c) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + else { + if (condition_d) { + if (condition_g) { + if (condition_b) { + if (condition_i) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_c) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + else { + if (condition_i) { + if (condition_g) { + if (condition_b) { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + else { + //Action_16: labels of block Q, R and S + imgLabels_row[c] = set_union(P, set_union(P, imgLabels_row_prev_prev[c], imgLabels_row_prev_prev[c + 2]), imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_16: labels of block Q, R and S + imgLabels_row[c] = set_union(P, set_union(P, imgLabels_row_prev_prev[c], imgLabels_row_prev_prev[c + 2]), imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + } + } + else { + if (condition_i) { + if (condition_d) { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + else { + //Action_16: labels of block Q, R and S + imgLabels_row[c] = set_union(P, set_union(P, imgLabels_row_prev_prev[c], imgLabels_row_prev_prev[c + 2]), imgLabels_row[c - 2]); + continue; + } + } + else { + if (condition_h) { + if (condition_d) { + if (condition_c) { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + else { + //Action_15: Merge labels of block P, R and S + imgLabels_row[c] = set_union(P, set_union(P, imgLabels_row_prev_prev[c - 2], imgLabels_row_prev_prev[c + 2]), imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_15: Merge labels of block P, R and S + imgLabels_row[c] = set_union(P, set_union(P, imgLabels_row_prev_prev[c - 2], imgLabels_row_prev_prev[c + 2]), imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + } + } + else { + if (condition_h) { + if (condition_m) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + // ACTION_9 Merge labels of block P and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c - 2], imgLabels_row[c - 2]); + continue; + } + } + else { + if (condition_i) { + if (condition_m) { + if (condition_g) { + if (condition_b) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + } + } + } + else { + if (condition_h) { + if (condition_m) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + // ACTION_9 Merge labels of block P and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c - 2], imgLabels_row[c - 2]); + continue; + } + } + else { + if (condition_i) { + if (condition_m) { + if (condition_g) { + if (condition_b) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + } + } + } + } + else { + if (condition_j) { + if (condition_i) { + //Action_4: Assign label of block Q + imgLabels_row[c] = imgLabels_row_prev_prev[c]; + continue; + } + else { + if (condition_h) { + if (condition_c) { + //Action_4: Assign label of block Q + imgLabels_row[c] = imgLabels_row_prev_prev[c]; + continue; + } + else { + //Action_7: Merge labels of block P and Q + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c - 2], imgLabels_row_prev_prev[c]); + continue; + } + } + else { + //Action_4: Assign label of block Q + imgLabels_row[c] = imgLabels_row_prev_prev[c]; + continue; + } + } + } + else { + if (condition_p) { + if (condition_k) { + if (condition_i) { + if (condition_d) { + //Action_5: Assign label of block R + imgLabels_row[c] = imgLabels_row_prev_prev[c + 2]; + continue; + } + else { + // ACTION_10 Merge labels of block Q and R + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row_prev_prev[c + 2]); + continue; + } + } + else { + if (condition_h) { + if (condition_d) { + if (condition_c) { + //Action_5: Assign label of block R + imgLabels_row[c] = imgLabels_row_prev_prev[c + 2]; + continue; + } + else { + //Action_8: Merge labels of block P and R + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c - 2], imgLabels_row_prev_prev[c + 2]); + continue; + } + } + else { + //Action_8: Merge labels of block P and R + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c - 2], imgLabels_row_prev_prev[c + 2]); + continue; + } + } + else { + //Action_5: Assign label of block R + imgLabels_row[c] = imgLabels_row_prev_prev[c + 2]; + continue; + } + } + } + else { + if (condition_i) { + //Action_4: Assign label of block Q + imgLabels_row[c] = imgLabels_row_prev_prev[c]; + continue; + } + else { + if (condition_h) { + //Action_3: Assign label of block P + imgLabels_row[c] = imgLabels_row_prev_prev[c - 2]; + continue; + } + else { + //Action_2: New label (the block has foreground pixels and is not connected to anything else) + imgLabels_row[c] = lunique; + P[lunique] = lunique; + lunique = lunique + 1; + continue; + } + } + } + } + else { + if (condition_i) { + //Action_4: Assign label of block Q + imgLabels_row[c] = imgLabels_row_prev_prev[c]; + continue; + } + else { + if (condition_h) { + //Action_3: Assign label of block P + imgLabels_row[c] = imgLabels_row_prev_prev[c - 2]; + continue; + } + else { + //Action_2: New label (the block has foreground pixels and is not connected to anything else) + imgLabels_row[c] = lunique; + P[lunique] = lunique; + lunique = lunique + 1; + continue; + } + } + } + } + } + } + } + else { + if (condition_s) { + if (condition_p) { + if (condition_n) { + if (condition_j) { + if (condition_i) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_c) { + if (condition_h) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_g) { + if (condition_b) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + } + else { + if (condition_k) { + if (condition_d) { + if (condition_i) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_c) { + if (condition_h) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_g) { + if (condition_b) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + } + } + else { + if (condition_r) { + if (condition_j) { + if (condition_m) { + if (condition_h) { + if (condition_i) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_c) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + } + else { + if (condition_g) { + if (condition_b) { + if (condition_i) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_c) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + else { + if (condition_k) { + if (condition_d) { + if (condition_m) { + if (condition_h) { + if (condition_i) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_c) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + } + else { + if (condition_g) { + if (condition_b) { + if (condition_i) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_c) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + else { + if (condition_i) { + if (condition_m) { + if (condition_h) { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + else { + if (condition_g) { + if (condition_b) { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + else { + //Action_16: labels of block Q, R and S + imgLabels_row[c] = set_union(P, set_union(P, imgLabels_row_prev_prev[c], imgLabels_row_prev_prev[c + 2]), imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_16: labels of block Q, R and S + imgLabels_row[c] = set_union(P, set_union(P, imgLabels_row_prev_prev[c], imgLabels_row_prev_prev[c + 2]), imgLabels_row[c - 2]); + continue; + } + } + } + else { + //Action_16: labels of block Q, R and S + imgLabels_row[c] = set_union(P, set_union(P, imgLabels_row_prev_prev[c], imgLabels_row_prev_prev[c + 2]), imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_12: Merge labels of block R and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c + 2], imgLabels_row[c - 2]); + continue; + } + } + } + else { + if (condition_i) { + if (condition_m) { + if (condition_h) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_g) { + if (condition_b) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + } + else { + //Action_11: Merge labels of block Q and S + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row[c - 2]); + continue; + } + } + else { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + } + } + } + else { + if (condition_j) { + //Action_4: Assign label of block Q + imgLabels_row[c] = imgLabels_row_prev_prev[c]; + continue; + } + else { + if (condition_k) { + if (condition_i) { + if (condition_d) { + //Action_5: Assign label of block R + imgLabels_row[c] = imgLabels_row_prev_prev[c + 2]; + continue; + } + else { + // ACTION_10 Merge labels of block Q and R + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row_prev_prev[c + 2]); + continue; + } + } + else { + //Action_5: Assign label of block R + imgLabels_row[c] = imgLabels_row_prev_prev[c + 2]; + continue; + } + } + else { + if (condition_i) { + //Action_4: Assign label of block Q + imgLabels_row[c] = imgLabels_row_prev_prev[c]; + continue; + } + else { + //Action_2: New label (the block has foreground pixels and is not connected to anything else) + imgLabels_row[c] = lunique; + P[lunique] = lunique; + lunique = lunique + 1; + continue; + } + } + } + } + } + } + else { + if (condition_r) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + if (condition_n) { + //Action_6: Assign label of block S + imgLabels_row[c] = imgLabels_row[c - 2]; + continue; + } + else { + //Action_2: New label (the block has foreground pixels and is not connected to anything else) + imgLabels_row[c] = lunique; + P[lunique] = lunique; + lunique = lunique + 1; + continue; + } + } + } + } + else { + if (condition_p) { + if (condition_j) { + //Action_4: Assign label of block Q + imgLabels_row[c] = imgLabels_row_prev_prev[c]; + continue; + } + else { + if (condition_k) { + if (condition_i) { + if (condition_d) { + //Action_5: Assign label of block R + imgLabels_row[c] = imgLabels_row_prev_prev[c + 2]; + continue; + } + else { + // ACTION_10 Merge labels of block Q and R + imgLabels_row[c] = set_union(P, imgLabels_row_prev_prev[c], imgLabels_row_prev_prev[c + 2]); + continue; + } + } + else { + //Action_5: Assign label of block R + imgLabels_row[c] = imgLabels_row_prev_prev[c + 2]; + continue; + } + } + else { + if (condition_i) { + //Action_4: Assign label of block Q + imgLabels_row[c] = imgLabels_row_prev_prev[c]; + continue; + } + else { + //Action_2: New label (the block has foreground pixels and is not connected to anything else) + imgLabels_row[c] = lunique; + P[lunique] = lunique; + lunique = lunique + 1; + continue; + } + } + } + } + else { + if (condition_t) { + //Action_2: New label (the block has foreground pixels and is not connected to anything else) + imgLabels_row[c] = lunique; + P[lunique] = lunique; + lunique = lunique + 1; + continue; + } + else { + // Action_1: No action (the block has no foreground pixels) + imgLabels_row[c] = 0; + continue; + } + } + } + } + } + } + + // Second scan + analysis + LabelT nLabels = flattenL(P, lunique); + sop.init(nLabels); + + if (imgLabels.rows & 1){ + if (imgLabels.cols & 1){ + //Case 1: both rows and cols odd + for (int r = 0; r(r); + const PixelT* const img_row_fol = (PixelT *)(((char *)img_row) + img.step.p[0]); + LabelT* const imgLabels_row = imgLabels.ptr(r); + LabelT* const imgLabels_row_fol = (LabelT *)(((char *)imgLabels_row) + imgLabels.step.p[0]); + + for (int c = 0; c0) { + iLabel = P[iLabel]; + if (img_row[c] > 0){ + imgLabels_row[c] = iLabel; + sop(r, c, iLabel); + } + else{ + imgLabels_row[c] = 0; + sop(r, c, 0); + } + if (c + 1 0){ + imgLabels_row[c + 1] = iLabel; + sop(r, c + 1, iLabel); + } + else{ + imgLabels_row[c + 1] = 0; + sop(r, c + 1, 0); + } + if (r + 1 0){ + imgLabels_row_fol[c] = iLabel; + sop(r + 1, c, iLabel); + } else{ + imgLabels_row_fol[c] = 0; + sop(r + 1, c, 0); + } + if (img_row_fol[c + 1]>0){ + imgLabels_row_fol[c + 1] = iLabel; + sop(r + 1, c + 1, iLabel); + } else{ + imgLabels_row_fol[c + 1] = 0; + sop(r + 1, c + 1, 0); + } + } + } + else if (r + 10){ + imgLabels_row_fol[c] = iLabel; + sop(r + 1, c, iLabel); + }else{ + imgLabels_row_fol[c] = 0; + sop(r + 1, c, 0); + } + } + } + else { + imgLabels_row[c] = 0; + sop(r, c, 0); + if (c + 1(r); + const PixelT* const img_row_fol = (PixelT *)(((char *)img_row) + img.step.p[0]); + LabelT* const imgLabels_row = imgLabels.ptr(r); + LabelT* const imgLabels_row_fol = (LabelT *)(((char *)imgLabels_row) + imgLabels.step.p[0]); + + for (int c = 0; c0) { + iLabel = P[iLabel]; + if (img_row[c]>0){ + imgLabels_row[c] = iLabel; + sop(r, c, iLabel); + } else{ + imgLabels_row[c] = 0; + sop(r, c, 0); + } + if (img_row[c + 1]>0){ + imgLabels_row[c + 1] = iLabel; + sop(r, c + 1, iLabel); + }else{ + imgLabels_row[c + 1] = 0; + sop(r, c + 1, 0); + } + if (r + 10){ + imgLabels_row_fol[c] = iLabel; + sop(r + 1, c, iLabel); + }else{ + imgLabels_row_fol[c] = 0; + sop(r + 1, c, 0); + } + if (img_row_fol[c + 1]>0){ + imgLabels_row_fol[c + 1] = iLabel; + sop(r + 1, c + 1, iLabel); + }else{ + imgLabels_row_fol[c + 1] = 0; + sop(r + 1, c + 1, 0); + } + } + } + else { + imgLabels_row[c] = 0; + imgLabels_row[c + 1] = 0; + sop(r, c, 0); + sop(r, c + 1, 0); + if (r + 1(r); + const PixelT* const img_row_fol = (PixelT *)(((char *)img_row) + img.step.p[0]); + LabelT* const imgLabels_row = imgLabels.ptr(r); + LabelT* const imgLabels_row_fol = (LabelT *)(((char *)imgLabels_row) + imgLabels.step.p[0]); + + for (int c = 0; c0) { + iLabel = P[iLabel]; + if (img_row[c]>0){ + imgLabels_row[c] = iLabel; + sop(r, c, iLabel); + }else{ + imgLabels_row[c] = 0; + sop(r, c, 0); + } + if (img_row_fol[c]>0){ + imgLabels_row_fol[c] = iLabel; + sop(r + 1, c, iLabel); + }else{ + imgLabels_row_fol[c] = 0; + sop(r + 1, c, 0); + } + if (c + 10){ + imgLabels_row[c + 1] = iLabel; + sop(r, c + 1, iLabel); + }else{ + imgLabels_row[c + 1] = 0; + sop(r, c + 1, 0); + } + if (img_row_fol[c + 1]>0){ + imgLabels_row_fol[c + 1] = iLabel; + sop(r + 1, c + 1, iLabel); + }else{ + imgLabels_row_fol[c + 1] = 0; + sop(r + 1, c + 1, 0); + } + } + } + else{ + imgLabels_row[c] = 0; + imgLabels_row_fol[c] = 0; + sop(r, c, 0); + sop(r + 1, c, 0); + if (c + 1(r); + const PixelT* const img_row_fol = (PixelT *)(((char *)img_row) + img.step.p[0]); + LabelT* const imgLabels_row = imgLabels.ptr(r); + LabelT* const imgLabels_row_fol = (LabelT *)(((char *)imgLabels_row) + imgLabels.step.p[0]); + + for (int c = 0; c0) { + iLabel = P[iLabel]; + if (img_row[c] > 0){ + imgLabels_row[c] = iLabel; + sop(r, c, iLabel); + }else{ + imgLabels_row[c] = 0; + sop(r, c, 0); + } + if (img_row[c + 1] > 0){ + imgLabels_row[c + 1] = iLabel; + sop(r, c + 1, iLabel); + }else{ + imgLabels_row[c + 1] = 0; + sop(r, c + 1, 0); + } + if (img_row_fol[c] > 0){ + imgLabels_row_fol[c] = iLabel; + sop(r + 1, c, iLabel); + }else{ + imgLabels_row_fol[c] = 0; + sop(r + 1, c, 0); + } + if (img_row_fol[c + 1] > 0){ + imgLabels_row_fol[c + 1] = iLabel; + sop(r + 1, c + 1, iLabel); + }else{ + imgLabels_row_fol[c + 1] = 0; + sop(r + 1, c + 1, 0); + } + } + else { + imgLabels_row[c] = 0; + imgLabels_row[c + 1] = 0; + imgLabels_row_fol[c] = 0; + imgLabels_row_fol[c + 1] = 0; + sop(r, c, 0); + sop(r, c + 1, 0); + sop(r + 1, c, 0); + sop(r + 1, c + 1, 0); + } + } + } + }//END case 4 + } + + sop.finish(); + fastFree(P); + + return nLabels; + + } //End function LabelingGrana operator() + }; //End struct LabelingGrana }//end namespace connectedcomponents //L's type must have an appropriate depth for the number of pixels in I template static -int connectedComponents_sub1(const cv::Mat &I, cv::Mat &L, int connectivity, StatsOp &sop){ +int connectedComponents_sub1(const cv::Mat &I, cv::Mat &L, int connectivity, int ccltype, StatsOp &sop){ CV_Assert(L.channels() == 1 && I.channels() == 1); CV_Assert(connectivity == 8 || connectivity == 4); + CV_Assert(ccltype == CCL_GRANA || ccltype == CCL_WU || ccltype == CCL_DEFAULT); int lDepth = L.depth(); int iDepth = I.depth(); - using connectedcomponents::LabelingImpl; - //warn if L's depth is not sufficient? CV_Assert(iDepth == CV_8U || iDepth == CV_8S); - if(lDepth == CV_8U){ - return (int) LabelingImpl()(I, L, connectivity, sop); - }else if(lDepth == CV_16U){ - return (int) LabelingImpl()(I, L, connectivity, sop); - }else if(lDepth == CV_32S){ - //note that signed types don't really make sense here and not being able to use unsigned matters for scientific projects - //OpenCV: how should we proceed? .at typechecks in debug mode - return (int) LabelingImpl()(I, L, connectivity, sop); + if (ccltype == CCL_WU || connectivity == 4){ + // Wu algorithm is used + using connectedcomponents::LabelingWu; + //warn if L's depth is not sufficient? + if (lDepth == CV_8U){ + return (int)LabelingWu()(I, L, connectivity, sop); + } + else if (lDepth == CV_16U){ + return (int)LabelingWu()(I, L, connectivity, sop); + } + else if (lDepth == CV_32S){ + //note that signed types don't really make sense here and not being able to use unsigned matters for scientific projects + //OpenCV: how should we proceed? .at typechecks in debug mode + return (int)LabelingWu()(I, L, connectivity, sop); + } + }else if ((ccltype == CCL_GRANA || ccltype == CCL_DEFAULT) && connectivity == 8){ + // Grana algorithm is used + using connectedcomponents::LabelingGrana; + //warn if L's depth is not sufficient? + if (lDepth == CV_8U){ + return (int)LabelingGrana()(I, L, connectivity, sop); + } + else if (lDepth == CV_16U){ + return (int)LabelingGrana()(I, L, connectivity, sop); + } + else if (lDepth == CV_32S){ + //note that signed types don't really make sense here and not being able to use unsigned matters for scientific projects + //OpenCV: how should we proceed? .at typechecks in debug mode + return (int)LabelingGrana()(I, L, connectivity, sop); + } } CV_Error(CV_StsUnsupportedFormat, "unsupported label/image type"); @@ -364,33 +1701,49 @@ int connectedComponents_sub1(const cv::Mat &I, cv::Mat &L, int connectivity, Sta } +// Simple wrapper to ensure binary and source compatibility (ABI) int cv::connectedComponents(InputArray _img, OutputArray _labels, int connectivity, int ltype){ + return cv::connectedComponents(_img, _labels, connectivity, ltype, CCL_DEFAULT); +} + +int cv::connectedComponents(InputArray _img, OutputArray _labels, int connectivity, int ltype, int ccltype){ const cv::Mat img = _img.getMat(); _labels.create(img.size(), CV_MAT_DEPTH(ltype)); cv::Mat labels = _labels.getMat(); connectedcomponents::NoOp sop; - if(ltype == CV_16U){ - return connectedComponents_sub1(img, labels, connectivity, sop); - }else if(ltype == CV_32S){ - return connectedComponents_sub1(img, labels, connectivity, sop); - }else{ + if (ltype == CV_16U){ + return connectedComponents_sub1(img, labels, connectivity, ccltype, sop); + } + else if (ltype == CV_32S){ + return connectedComponents_sub1(img, labels, connectivity, ccltype, sop); + } + else{ CV_Error(CV_StsUnsupportedFormat, "the type of labels must be 16u or 32s"); return 0; } } +// Simple wrapper to ensure binary and source compatibility (ABI) int cv::connectedComponentsWithStats(InputArray _img, OutputArray _labels, OutputArray statsv, OutputArray centroids, int connectivity, int ltype) +{ + return cv::connectedComponentsWithStats(_img, _labels, statsv, centroids, connectivity, ltype, CCL_DEFAULT); +} + +int cv::connectedComponentsWithStats(InputArray _img, OutputArray _labels, OutputArray statsv, + OutputArray centroids, int connectivity, int ltype, int ccltype) { const cv::Mat img = _img.getMat(); _labels.create(img.size(), CV_MAT_DEPTH(ltype)); cv::Mat labels = _labels.getMat(); connectedcomponents::CCStatsOp sop(statsv, centroids); - if(ltype == CV_16U){ - return connectedComponents_sub1(img, labels, connectivity, sop); - }else if(ltype == CV_32S){ - return connectedComponents_sub1(img, labels, connectivity, sop); - }else{ + if (ltype == CV_16U){ + return connectedComponents_sub1(img, labels, connectivity, ccltype, sop); + } + else if (ltype == CV_32S){ + return connectedComponents_sub1(img, labels, connectivity, ccltype, sop); + } + else{ CV_Error(CV_StsUnsupportedFormat, "the type of labels must be 16u or 32s"); return 0; } diff --git a/modules/imgproc/src/contours.cpp b/modules/imgproc/src/contours.cpp index 4cb3f55c41..5f08be5fe5 100644 --- a/modules/imgproc/src/contours.cpp +++ b/modules/imgproc/src/contours.cpp @@ -1704,6 +1704,8 @@ cvFindContours( void* img, CvMemStorage* storage, void cv::findContours( InputOutputArray _image, OutputArrayOfArrays _contours, OutputArray _hierarchy, int mode, int method, Point offset ) { + CV_INSTRUMENT_REGION() + // Sanity check: output must be of type vector> CV_Assert((_contours.kind() == _InputArray::STD_VECTOR_VECTOR || _contours.kind() == _InputArray::STD_VECTOR_MAT || _contours.kind() == _InputArray::STD_VECTOR_UMAT)); @@ -1757,6 +1759,8 @@ void cv::findContours( InputOutputArray _image, OutputArrayOfArrays _contours, void cv::findContours( InputOutputArray _image, OutputArrayOfArrays _contours, int mode, int method, Point offset) { + CV_INSTRUMENT_REGION() + findContours(_image, _contours, noArray(), mode, method, offset); } diff --git a/modules/imgproc/src/convhull.cpp b/modules/imgproc/src/convhull.cpp index b870ee4217..f7e7c2291d 100644 --- a/modules/imgproc/src/convhull.cpp +++ b/modules/imgproc/src/convhull.cpp @@ -128,6 +128,8 @@ struct CHullCmpPoints void convexHull( InputArray _points, OutputArray _hull, bool clockwise, bool returnPoints ) { + CV_INSTRUMENT_REGION() + Mat points = _points.getMat(); int i, total = points.checkVector(2), depth = points.depth(), nout = 0; int miny_ind = 0, maxy_ind = 0; @@ -264,6 +266,8 @@ void convexHull( InputArray _points, OutputArray _hull, bool clockwise, bool ret void convexityDefects( InputArray _points, InputArray _hull, OutputArray _defects ) { + CV_INSTRUMENT_REGION() + Mat points = _points.getMat(); int i, j = 0, npoints = points.checkVector(2, CV_32S); CV_Assert( npoints >= 0 ); diff --git a/modules/imgproc/src/corner.cpp b/modules/imgproc/src/corner.cpp index 946625eb0b..7f3bad5012 100644 --- a/modules/imgproc/src/corner.cpp +++ b/modules/imgproc/src/corner.cpp @@ -528,6 +528,8 @@ namespace cv { static bool ipp_cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, int ksize, int borderType ) { + CV_INSTRUMENT_REGION_IPP() + #if IPP_VERSION_X100 >= 800 Mat src = _src.getMat(); _dst.create( src.size(), CV_32FC1 ); @@ -552,23 +554,23 @@ static bool ipp_cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockS (kerSize == 3 || kerSize == 5) && (blockSize == 3 || blockSize == 5)) { ippiMinEigenValGetBufferSize getBufferSizeFunc = 0; - ippiMinEigenVal minEigenValFunc = 0; + ippiMinEigenVal ippiMinEigenVal_C1R = 0; float norm_coef = 0.f; if (src.type() == CV_8UC1) { getBufferSizeFunc = (ippiMinEigenValGetBufferSize) ippiMinEigenValGetBufferSize_8u32f_C1R; - minEigenValFunc = (ippiMinEigenVal) ippiMinEigenVal_8u32f_C1R; + ippiMinEigenVal_C1R = (ippiMinEigenVal) ippiMinEigenVal_8u32f_C1R; norm_coef = 1.f / 255.f; } else if (src.type() == CV_32FC1) { getBufferSizeFunc = (ippiMinEigenValGetBufferSize) ippiMinEigenValGetBufferSize_32f_C1R; - minEigenValFunc = (ippiMinEigenVal) ippiMinEigenVal_32f_C1R; + ippiMinEigenVal_C1R = (ippiMinEigenVal) ippiMinEigenVal_32f_C1R; norm_coef = 255.f; } norm_coef = kerType == ippKernelSobel ? norm_coef : norm_coef / 2.45f; - if (getBufferSizeFunc && minEigenValFunc) + if (getBufferSizeFunc && ippiMinEigenVal_C1R) { int bufferSize; IppiSize srcRoi = { src.cols, src.rows }; @@ -576,9 +578,9 @@ static bool ipp_cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockS if (ok >= 0) { AutoBuffer buffer(bufferSize); - ok = minEigenValFunc(src.ptr(), (int) src.step, dst.ptr(), (int) dst.step, srcRoi, kerType, kerSize, blockSize, buffer); + ok = CV_INSTRUMENT_FUN_IPP(ippiMinEigenVal_C1R, src.ptr(), (int) src.step, dst.ptr(), (int) dst.step, srcRoi, kerType, kerSize, blockSize, buffer); CV_SUPPRESS_DEPRECATED_START - if (ok >= 0) ok = ippiMulC_32f_C1IR(norm_coef, dst.ptr(), (int) dst.step, srcRoi); + if (ok >= 0) ok = CV_INSTRUMENT_FUN_IPP(ippiMulC_32f_C1IR, norm_coef, dst.ptr(), (int) dst.step, srcRoi); CV_SUPPRESS_DEPRECATED_END if (ok >= 0) { @@ -599,6 +601,8 @@ static bool ipp_cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockS void cv::cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, int ksize, int borderType ) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(), ocl_cornerMinEigenValVecs(_src, _dst, blockSize, ksize, 0.0, borderType, MINEIGENVAL)) @@ -609,7 +613,7 @@ void cv::cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, in #endif CV_IPP_RUN(((borderTypeNI == BORDER_REPLICATE && (!_src.isSubmatrix() || isolated)) && (kerSize == 3 || kerSize == 5) && (blockSize == 3 || blockSize == 5)) && IPP_VERSION_X100 >= 800, - ipp_cornerMinEigenVal( _src, _dst, blockSize, ksize, borderType )); + ipp_cornerMinEigenVal( _src, _dst, blockSize, ksize, borderType )); Mat src = _src.getMat(); @@ -625,6 +629,8 @@ namespace cv { static bool ipp_cornerHarris( InputArray _src, OutputArray _dst, int blockSize, int ksize, double k, int borderType ) { + CV_INSTRUMENT_REGION_IPP() + #if IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK Mat src = _src.getMat(); _dst.create( src.size(), CV_32FC1 ); @@ -658,11 +664,11 @@ static bool ipp_cornerHarris( InputArray _src, OutputArray _dst, int blockSize, IppStatus status = (IppStatus)-1; if (depth == CV_8U) - status = ippiHarrisCorner_8u32f_C1R((const Ipp8u *)src.data, (int)src.step, (Ipp32f *)dst.data, (int)dst.step, roisize, - filterType, masksize, blockSize, (Ipp32f)k, (Ipp32f)scale, borderTypeIpp, 0, buffer); + status = CV_INSTRUMENT_FUN_IPP(ippiHarrisCorner_8u32f_C1R,((const Ipp8u *)src.data, (int)src.step, (Ipp32f *)dst.data, (int)dst.step, roisize, + filterType, masksize, blockSize, (Ipp32f)k, (Ipp32f)scale, borderTypeIpp, 0, buffer)); else if (depth == CV_32F) - status = ippiHarrisCorner_32f_C1R((const Ipp32f *)src.data, (int)src.step, (Ipp32f *)dst.data, (int)dst.step, roisize, - filterType, masksize, blockSize, (Ipp32f)k, (Ipp32f)scale, borderTypeIpp, 0, buffer); + status = CV_INSTRUMENT_FUN_IPP(ippiHarrisCorner_32f_C1R,((const Ipp32f *)src.data, (int)src.step, (Ipp32f *)dst.data, (int)dst.step, roisize, + filterType, masksize, blockSize, (Ipp32f)k, (Ipp32f)scale, borderTypeIpp, 0, buffer)); ippsFree(buffer); if (status >= 0) @@ -683,6 +689,8 @@ static bool ipp_cornerHarris( InputArray _src, OutputArray _dst, int blockSize, void cv::cornerHarris( InputArray _src, OutputArray _dst, int blockSize, int ksize, double k, int borderType ) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(), ocl_cornerMinEigenValVecs(_src, _dst, blockSize, ksize, k, borderType, HARRIS)) @@ -706,6 +714,8 @@ void cv::cornerHarris( InputArray _src, OutputArray _dst, int blockSize, int ksi void cv::cornerEigenValsAndVecs( InputArray _src, OutputArray _dst, int blockSize, int ksize, int borderType ) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); Size dsz = _dst.size(); int dtype = _dst.type(); @@ -719,6 +729,8 @@ void cv::cornerEigenValsAndVecs( InputArray _src, OutputArray _dst, int blockSiz void cv::preCornerDetect( InputArray _src, OutputArray _dst, int ksize, int borderType ) { + CV_INSTRUMENT_REGION() + int type = _src.type(); CV_Assert( type == CV_8UC1 || type == CV_32FC1 ); diff --git a/modules/imgproc/src/cornersubpix.cpp b/modules/imgproc/src/cornersubpix.cpp index 1909bbcbb1..1bd30d24c9 100644 --- a/modules/imgproc/src/cornersubpix.cpp +++ b/modules/imgproc/src/cornersubpix.cpp @@ -44,6 +44,8 @@ void cv::cornerSubPix( InputArray _image, InputOutputArray _corners, Size win, Size zeroZone, TermCriteria criteria ) { + CV_INSTRUMENT_REGION() + const int MAX_ITERS = 100; int win_w = win.width * 2 + 1, win_h = win.height * 2 + 1; int i, j, k; diff --git a/modules/imgproc/src/demosaicing.cpp b/modules/imgproc/src/demosaicing.cpp index cec450dc71..296ace8a25 100644 --- a/modules/imgproc/src/demosaicing.cpp +++ b/modules/imgproc/src/demosaicing.cpp @@ -1615,6 +1615,8 @@ static void Bayer2RGB_EdgeAware_T(const Mat& src, Mat& dst, int code) void cv::demosaicing(InputArray _src, OutputArray _dst, int code, int dcn) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(), dst; Size sz = src.size(); int scn = src.channels(), depth = src.depth(); diff --git a/modules/imgproc/src/deriv.cpp b/modules/imgproc/src/deriv.cpp index e660d2e3b0..0dce2fd9e7 100644 --- a/modules/imgproc/src/deriv.cpp +++ b/modules/imgproc/src/deriv.cpp @@ -184,6 +184,8 @@ namespace cv { static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx, int dy, double scale, double delta, int borderType) { + CV_INSTRUMENT_REGION_IPP() + #if IPP_VERSION_X100 >= 810 if ((0 > dx) || (0 > dy) || (1 != dx + dy)) return false; @@ -230,7 +232,7 @@ static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx pBuffer = ippsMalloc_8u(bufferSize); if (NULL == pBuffer) return false; - sts = ippiFilterScharrHorizMaskBorder_8u16s_C1R(src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer); + sts = CV_INSTRUMENT_FUN_IPP(ippiFilterScharrHorizMaskBorder_8u16s_C1R, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer); } else { @@ -239,7 +241,7 @@ static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx pBuffer = ippsMalloc_8u(bufferSize); if (NULL == pBuffer) return false; - sts = ippiFilterScharrVertMaskBorder_8u16s_C1R(src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer); + sts = CV_INSTRUMENT_FUN_IPP(ippiFilterScharrVertMaskBorder_8u16s_C1R, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer); } ippsFree(pBuffer); } @@ -253,7 +255,7 @@ static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx pBuffer = ippsMalloc_8u(bufferSize); if (NULL == pBuffer) return false; - sts = ippiFilterScharrHorizMaskBorder_16s_C1R(src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer); + sts = CV_INSTRUMENT_FUN_IPP(ippiFilterScharrHorizMaskBorder_16s_C1R, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer); } else { @@ -262,7 +264,7 @@ static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx pBuffer = ippsMalloc_8u(bufferSize); if (NULL == pBuffer) return false; - sts = ippiFilterScharrVertMaskBorder_16s_C1R(src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer); + sts = CV_INSTRUMENT_FUN_IPP(ippiFilterScharrVertMaskBorder_16s_C1R, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer); } ippsFree(pBuffer); } @@ -276,7 +278,7 @@ static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx pBuffer = ippsMalloc_8u(bufferSize); if (NULL == pBuffer) return false; - sts = ippiFilterScharrHorizMaskBorder_32f_C1R(src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer); + sts = CV_INSTRUMENT_FUN_IPP(ippiFilterScharrHorizMaskBorder_32f_C1R, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer); } else { @@ -285,14 +287,14 @@ static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx pBuffer = ippsMalloc_8u(bufferSize); if (NULL == pBuffer) return false; - sts = ippiFilterScharrVertMaskBorder_32f_C1R(src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer); + sts = CV_INSTRUMENT_FUN_IPP(ippiFilterScharrVertMaskBorder_32f_C1R, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roiSize, ippMskSize3x3, ippiBorderType, 0, pBuffer); } ippsFree(pBuffer); if (sts < 0) return false;; if (FLT_EPSILON < fabs(scale - 1.0)) - sts = ippiMulC_32f_C1R(dst.ptr(), (int)dst.step, (Ipp32f)scale, dst.ptr(), (int)dst.step, roiSize); + sts = CV_INSTRUMENT_FUN_IPP(ippiMulC_32f_C1R, dst.ptr(), (int)dst.step, (Ipp32f)scale, dst.ptr(), (int)dst.step, roiSize); } return (0 <= sts); #else @@ -303,7 +305,9 @@ static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx, int dy, int ksize, double scale, double delta, int borderType) { - if ((borderType != BORDER_REPLICATE) || ((3 != ksize) && (5 != ksize))) + CV_INSTRUMENT_REGION_IPP() + + if (((borderType & ~BORDER_ISOLATED) != BORDER_REPLICATE) || ((3 != ksize) && (5 != ksize))) return false; if (fabs(delta) > FLT_EPSILON) return false; @@ -313,6 +317,10 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx, int bufSize = 0; cv::AutoBuffer buffer; Mat src = _src.getMat(), dst = _dst.getMat(); + + if ((borderType & BORDER_ISOLATED) == 0 && src.isSubmatrix()) + return false; + if ( ddepth < 0 ) ddepth = src.depth(); @@ -333,7 +341,7 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx, buffer.allocate(bufSize); #endif - if (0 > ippiFilterSobelNegVertBorder_8u16s_C1R(src.ptr(), (int)src.step, + if (0 > CV_INSTRUMENT_FUN_IPP(ippiFilterSobelNegVertBorder_8u16s_C1R, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roi, kernel, ippBorderRepl, 0, (Ipp8u*)(char*)buffer)) return false; @@ -352,14 +360,13 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx, buffer.allocate(bufSize); #endif - if (0 > ippiFilterSobelHorizBorder_8u16s_C1R(src.ptr(), (int)src.step, + if (0 > CV_INSTRUMENT_FUN_IPP(ippiFilterSobelHorizBorder_8u16s_C1R, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roi, kernel, ippBorderRepl, 0, (Ipp8u*)(char*)buffer)) return false; return true; } -#if !defined(HAVE_IPP_ICV_ONLY) if ((dx == 2) && (dy == 0)) { #if IPP_VERSION_X100 >= 900 @@ -372,7 +379,7 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx, buffer.allocate(bufSize); #endif - if (0 > ippiFilterSobelVertSecondBorder_8u16s_C1R(src.ptr(), (int)src.step, + if (0 > CV_INSTRUMENT_FUN_IPP(ippiFilterSobelVertSecondBorder_8u16s_C1R, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roi, kernel, ippBorderRepl, 0, (Ipp8u*)(char*)buffer)) return false; @@ -391,13 +398,12 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx, buffer.allocate(bufSize); #endif - if (0 > ippiFilterSobelHorizSecondBorder_8u16s_C1R(src.ptr(), (int)src.step, + if (0 > CV_INSTRUMENT_FUN_IPP(ippiFilterSobelHorizSecondBorder_8u16s_C1R, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roi, kernel, ippBorderRepl, 0, (Ipp8u*)(char*)buffer)) return false; return true; } -#endif } if (src.type() == CV_32F && dst.type() == CV_32F) @@ -445,7 +451,7 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx, return true; } #endif -#if !defined(HAVE_IPP_ICV_ONLY) + if((dx == 2) && (dy == 0)) { #if IPP_VERSION_X100 >= 900 @@ -458,12 +464,12 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx, buffer.allocate(bufSize); #endif - if (0 > ippiFilterSobelVertSecondBorder_32f_C1R(src.ptr(), (int)src.step, + if (0 > CV_INSTRUMENT_FUN_IPP(ippiFilterSobelVertSecondBorder_32f_C1R, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roi, kernel, ippBorderRepl, 0, (Ipp8u*)(char*)buffer)) return false; if(scale != 1) - ippiMulC_32f_C1R(dst.ptr(), (int)dst.step, (Ipp32f)scale, dst.ptr(), (int)dst.step, ippiSize(dst.cols*dst.channels(), dst.rows)); + CV_INSTRUMENT_FUN_IPP(ippiMulC_32f_C1R, dst.ptr(), (int)dst.step, (Ipp32f)scale, dst.ptr(), (int)dst.step, ippiSize(dst.cols*dst.channels(), dst.rows)); return true; } @@ -479,22 +485,23 @@ static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx, buffer.allocate(bufSize); #endif - if (0 > ippiFilterSobelHorizSecondBorder_32f_C1R(src.ptr(), (int)src.step, + if (0 > CV_INSTRUMENT_FUN_IPP(ippiFilterSobelHorizSecondBorder_32f_C1R, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roi, kernel, ippBorderRepl, 0, (Ipp8u*)(char*)buffer)) return false; if(scale != 1) - ippiMulC_32f_C1R(dst.ptr(), (int)dst.step, (Ipp32f)scale, dst.ptr(), (int)dst.step, ippiSize(dst.cols*dst.channels(), dst.rows)); + CV_INSTRUMENT_FUN_IPP(ippiMulC_32f_C1R, dst.ptr(), (int)dst.step, (Ipp32f)scale, dst.ptr(), (int)dst.step, ippiSize(dst.cols*dst.channels(), dst.rows)); return true; } -#endif } return false; } static bool ipp_sobel(InputArray _src, OutputArray _dst, int ddepth, int dx, int dy, int ksize, double scale, double delta, int borderType) { + CV_INSTRUMENT_REGION_IPP() + if (ksize < 0) { if (IPPDerivScharr(_src, _dst, ddepth, dx, dy, scale, delta, borderType)) @@ -513,6 +520,8 @@ static bool ipp_sobel(InputArray _src, OutputArray _dst, int ddepth, int dx, int void cv::Sobel( InputArray _src, OutputArray _dst, int ddepth, int dx, int dy, int ksize, double scale, double delta, int borderType ) { + CV_INSTRUMENT_REGION() + int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), cn = CV_MAT_CN(stype); if (ddepth < 0) ddepth = sdepth; @@ -552,6 +561,8 @@ void cv::Sobel( InputArray _src, OutputArray _dst, int ddepth, int dx, int dy, void cv::Scharr( InputArray _src, OutputArray _dst, int ddepth, int dx, int dy, double scale, double delta, int borderType ) { + CV_INSTRUMENT_REGION() + int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), cn = CV_MAT_CN(stype); if (ddepth < 0) ddepth = sdepth; @@ -736,6 +747,8 @@ namespace cv static bool ipp_Laplacian(InputArray _src, OutputArray _dst, int ddepth, int ksize, double scale, double delta, int borderType) { + CV_INSTRUMENT_REGION_IPP() + int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), cn = CV_MAT_CN(stype); if (ddepth < 0) ddepth = sdepth; @@ -761,7 +774,7 @@ static bool ipp_Laplacian(InputArray _src, OutputArray _dst, int ddepth, int ksi if (borderTypeIpp >= 0 && ippiFilterLaplacianGetBufferSize_##ippfavor##_C1R(roisize, masksize, &bufsize) >= 0) \ { \ Ipp8u * buffer = ippsMalloc_8u(bufsize); \ - status = ippiFilterLaplacianBorder_##ippfavor##_C1R(src.ptr(), (int)src.step, dst.ptr(), \ + status = CV_INSTRUMENT_FUN_IPP(ippiFilterLaplacianBorder_##ippfavor##_C1R, src.ptr(), (int)src.step, dst.ptr(), \ (int)dst.step, roisize, masksize, borderTypeIpp, 0, buffer); \ ippsFree(buffer); \ } \ @@ -773,18 +786,18 @@ static bool ipp_Laplacian(InputArray _src, OutputArray _dst, int ddepth, int ksi IPP_FILTER_LAPLACIAN(Ipp8u, Ipp16s, 8u16s); if (needScale && status >= 0) - status = ippiMulC_16s_C1IRSfs((Ipp16s)iscale, dst.ptr(), (int)dst.step, roisize, 0); + status = CV_INSTRUMENT_FUN_IPP(ippiMulC_16s_C1IRSfs, (Ipp16s)iscale, dst.ptr(), (int)dst.step, roisize, 0); if (needDelta && status >= 0) - status = ippiAddC_16s_C1IRSfs((Ipp16s)idelta, dst.ptr(), (int)dst.step, roisize, 0); + status = CV_INSTRUMENT_FUN_IPP(ippiAddC_16s_C1IRSfs, (Ipp16s)idelta, dst.ptr(), (int)dst.step, roisize, 0); } else if (sdepth == CV_32F && ddepth == CV_32F) { IPP_FILTER_LAPLACIAN(Ipp32f, Ipp32f, 32f); if (needScale && status >= 0) - status = ippiMulC_32f_C1IR((Ipp32f)scale, dst.ptr(), (int)dst.step, roisize); + status = CV_INSTRUMENT_FUN_IPP(ippiMulC_32f_C1IR, (Ipp32f)scale, dst.ptr(), (int)dst.step, roisize); if (needDelta && status >= 0) - status = ippiAddC_32f_C1IR((Ipp32f)delta, dst.ptr(), (int)dst.step, roisize); + status = CV_INSTRUMENT_FUN_IPP(ippiAddC_32f_C1IR, (Ipp32f)delta, dst.ptr(), (int)dst.step, roisize); } CV_SUPPRESS_DEPRECATED_END @@ -802,6 +815,8 @@ static bool ipp_Laplacian(InputArray _src, OutputArray _dst, int ddepth, int ksi void cv::Laplacian( InputArray _src, OutputArray _dst, int ddepth, int ksize, double scale, double delta, int borderType ) { + CV_INSTRUMENT_REGION() + int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), cn = CV_MAT_CN(stype); if (ddepth < 0) ddepth = sdepth; diff --git a/modules/imgproc/src/distransform.cpp b/modules/imgproc/src/distransform.cpp index cde6ec4eb6..36914d89d8 100644 --- a/modules/imgproc/src/distransform.cpp +++ b/modules/imgproc/src/distransform.cpp @@ -693,7 +693,7 @@ static void distanceTransform_L1_8U(InputArray _src, OutputArray _dst) { IppiSize roi = { src.cols, src.rows }; Ipp32s pMetrics[2] = { 1, 2 }; //L1, 3x3 mask - if (ippiDistanceTransform_3x3_8u_C1R(src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roi, pMetrics)>=0) + if (CV_INSTRUMENT_FUN_IPP(ippiDistanceTransform_3x3_8u_C1R, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roi, pMetrics) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; @@ -710,6 +710,8 @@ static void distanceTransform_L1_8U(InputArray _src, OutputArray _dst) void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labels, int distType, int maskSize, int labelType ) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(), labels; bool need_labels = _labels.needed(); @@ -754,7 +756,7 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe if (status>=0) { pBuffer = (Ipp8u *)ippMalloc( bufSize ); - status = ippiTrueDistanceTransform_8u32f_C1R(src.ptr(),(int)src.step, dst.ptr(), (int)dst.step, roi, pBuffer); + status = CV_INSTRUMENT_FUN_IPP(ippiTrueDistanceTransform_8u32f_C1R, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roi, pBuffer); ippFree( pBuffer ); if (status>=0) { @@ -789,7 +791,7 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe CV_IPP_CHECK() { IppiSize roi = { src.cols, src.rows }; - if (ippiDistanceTransform_3x3_8u32f_C1R(src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roi, _mask)>=0) + if (CV_INSTRUMENT_FUN_IPP(ippiDistanceTransform_3x3_8u32f_C1R, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roi, _mask) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; @@ -806,7 +808,7 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe CV_IPP_CHECK() { IppiSize roi = { src.cols, src.rows }; - if (ippiDistanceTransform_5x5_8u32f_C1R(src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roi, _mask)>=0) + if (CV_INSTRUMENT_FUN_IPP(ippiDistanceTransform_5x5_8u32f_C1R, src.ptr(), (int)src.step, dst.ptr(), (int)dst.step, roi, _mask) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; @@ -825,7 +827,7 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe if( labelType == CV_DIST_LABEL_CCOMP ) { Mat zpix = src == 0; - connectedComponents(zpix, labels, 8, CV_32S); + connectedComponents(zpix, labels, 8, CV_32S, CCL_WU); } else { @@ -848,6 +850,8 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe void cv::distanceTransform( InputArray _src, OutputArray _dst, int distanceType, int maskSize, int dstType) { + CV_INSTRUMENT_REGION() + if (distanceType == CV_DIST_L1 && dstType==CV_8U) distanceTransform_L1_8U(_src, _dst); else diff --git a/modules/imgproc/src/drawing.cpp b/modules/imgproc/src/drawing.cpp index a73a30f9dc..bd3aa903e7 100644 --- a/modules/imgproc/src/drawing.cpp +++ b/modules/imgproc/src/drawing.cpp @@ -79,6 +79,8 @@ FillConvexPoly( Mat& img, const Point* v, int npts, bool clipLine( Size img_size, Point& pt1, Point& pt2 ) { + CV_INSTRUMENT_REGION() + int64 x1, y1, x2, y2; int c1, c2; int64 right = img_size.width-1, bottom = img_size.height-1; @@ -138,6 +140,8 @@ bool clipLine( Size img_size, Point& pt1, Point& pt2 ) bool clipLine( Rect img_rect, Point& pt1, Point& pt2 ) { + CV_INSTRUMENT_REGION() + Point tl = img_rect.tl(); pt1 -= tl; pt2 -= tl; bool inside = clipLine(img_rect.size(), pt1, pt2); @@ -922,6 +926,8 @@ void ellipse2Poly( Point center, Size axes, int angle, int arc_start, int arc_end, int delta, std::vector& pts ) { + CV_INSTRUMENT_REGION() + float alpha, beta; double size_a = axes.width, size_b = axes.height; double cx = center.x, cy = center.y; @@ -1726,6 +1732,8 @@ void drawMarker(Mat& img, Point position, const Scalar& color, int markerType, i void line( InputOutputArray _img, Point pt1, Point pt2, const Scalar& color, int thickness, int line_type, int shift ) { + CV_INSTRUMENT_REGION() + Mat img = _img.getMat(); if( line_type == CV_AA && img.depth() != CV_8U ) @@ -1742,6 +1750,8 @@ void line( InputOutputArray _img, Point pt1, Point pt2, const Scalar& color, void arrowedLine(InputOutputArray img, Point pt1, Point pt2, const Scalar& color, int thickness, int line_type, int shift, double tipLength) { + CV_INSTRUMENT_REGION() + const double tipSize = norm(pt1-pt2)*tipLength; // Factor to normalize the size of the tip depending on the length of the arrow line(img, pt1, pt2, color, thickness, line_type, shift); @@ -1761,6 +1771,8 @@ void rectangle( InputOutputArray _img, Point pt1, Point pt2, const Scalar& color, int thickness, int lineType, int shift ) { + CV_INSTRUMENT_REGION() + Mat img = _img.getMat(); if( lineType == CV_AA && img.depth() != CV_8U ) @@ -1792,6 +1804,8 @@ void rectangle( Mat& img, Rect rec, const Scalar& color, int thickness, int lineType, int shift ) { + CV_INSTRUMENT_REGION() + CV_Assert( 0 <= shift && shift <= XY_SHIFT ); if( rec.area() > 0 ) rectangle( img, rec.tl(), rec.br() - Point(1<= 0); fillConvexPoly(img, points.ptr(), points.rows*points.cols*points.channels()/2, color, lineType, shift); @@ -2261,6 +2291,8 @@ void cv::fillConvexPoly(InputOutputArray _img, InputArray _points, void cv::fillPoly(InputOutputArray _img, InputArrayOfArrays pts, const Scalar& color, int lineType, int shift, Point offset) { + CV_INSTRUMENT_REGION() + Mat img = _img.getMat(); int i, ncontours = (int)pts.total(); if( ncontours == 0 ) @@ -2285,6 +2317,8 @@ void cv::polylines(InputOutputArray _img, InputArrayOfArrays pts, bool isClosed, const Scalar& color, int thickness, int lineType, int shift ) { + CV_INSTRUMENT_REGION() + Mat img = _img.getMat(); bool manyContours = pts.kind() == _InputArray::STD_VECTOR_VECTOR || pts.kind() == _InputArray::STD_VECTOR_MAT; @@ -2347,6 +2381,8 @@ void cv::drawContours( InputOutputArray _image, InputArrayOfArrays _contours, int lineType, InputArray _hierarchy, int maxLevel, Point offset ) { + CV_INSTRUMENT_REGION() + Mat image = _image.getMat(), hierarchy = _hierarchy.getMat(); CvMat _cimage = image; diff --git a/modules/imgproc/src/emd.cpp b/modules/imgproc/src/emd.cpp index 4dddbc6f14..96eda61331 100644 --- a/modules/imgproc/src/emd.cpp +++ b/modules/imgproc/src/emd.cpp @@ -1144,6 +1144,8 @@ float cv::EMD( InputArray _signature1, InputArray _signature2, int distType, InputArray _cost, float* lowerBound, OutputArray _flow ) { + CV_INSTRUMENT_REGION() + Mat signature1 = _signature1.getMat(), signature2 = _signature2.getMat(); Mat cost = _cost.getMat(), flow; diff --git a/modules/imgproc/src/featureselect.cpp b/modules/imgproc/src/featureselect.cpp index 2f5f1631de..3f54bef61e 100644 --- a/modules/imgproc/src/featureselect.cpp +++ b/modules/imgproc/src/featureselect.cpp @@ -269,6 +269,8 @@ void cv::goodFeaturesToTrack( InputArray _image, OutputArray _corners, InputArray _mask, int blockSize, bool useHarrisDetector, double harrisK ) { + CV_INSTRUMENT_REGION() + CV_Assert( qualityLevel > 0 && minDistance >= 0 && maxCorners >= 0 ); CV_Assert( _mask.empty() || (_mask.type() == CV_8UC1 && _mask.sameSize(_image)) ); diff --git a/modules/imgproc/src/filter.cpp b/modules/imgproc/src/filter.cpp index 50b38094a9..68a168f617 100644 --- a/modules/imgproc/src/filter.cpp +++ b/modules/imgproc/src/filter.cpp @@ -379,6 +379,8 @@ int FilterEngine::proceed( const uchar* src, int srcstep, int count, void FilterEngine::apply(const Mat& src, Mat& dst, const Size & wsz, const Point & ofs) { + CV_INSTRUMENT_REGION() + CV_Assert( src.type() == srcType && dst.type() == dstType ); int y = start(src, wsz, ofs); @@ -1411,6 +1413,8 @@ private: mutable int bufsz; int ippiOperator(const uchar* _src, uchar* _dst, int width, int cn) const { + CV_INSTRUMENT_REGION_IPP() + int _ksize = kernel.rows + kernel.cols - 1; if ((1 != cn && 3 != cn) || width < _ksize*8) return 0; @@ -1432,10 +1436,10 @@ private: float borderValue[] = {0.f, 0.f, 0.f}; // here is the trick. IPP needs border type and extrapolates the row. We did it already. // So we pass anchor=0 and ignore the right tail of results since they are incorrect there. - if( (cn == 1 && ippiFilterRowBorderPipeline_32f_C1R(src, step, &dst, roisz, _kx, _ksize, 0, - ippBorderRepl, borderValue[0], bufptr) < 0) || - (cn == 3 && ippiFilterRowBorderPipeline_32f_C3R(src, step, &dst, roisz, _kx, _ksize, 0, - ippBorderRepl, borderValue, bufptr) < 0)) + if( (cn == 1 && CV_INSTRUMENT_FUN_IPP(ippiFilterRowBorderPipeline_32f_C1R,(src, step, &dst, roisz, _kx, _ksize, 0, + ippBorderRepl, borderValue[0], bufptr)) < 0) || + (cn == 3 && CV_INSTRUMENT_FUN_IPP(ippiFilterRowBorderPipeline_32f_C3R,(src, step, &dst, roisz, _kx, _ksize, 0, + ippBorderRepl, borderValue, bufptr)) < 0)) { setIppErrorStatus(); return 0; @@ -4540,40 +4544,39 @@ struct ReplacementFilter : public hal::Filter2D }; #ifdef HAVE_IPP -#if !HAVE_ICV -typedef IppStatus(CV_STDCALL* ippiFilterBorder)( +typedef IppStatus(CV_STDCALL* IppiFilterBorder)( const void* pSrc, int srcStep, void* pDst, int dstStep, IppiSize dstRoiSize, IppiBorderType border, const void* borderValue, const IppiFilterBorderSpec* pSpec, Ipp8u* pBuffer); -static ippiFilterBorder getIppFunc(int stype) +static IppiFilterBorder getIppFunc(int stype) { switch (stype) { case CV_8UC1: - return reinterpret_cast(ippiFilterBorder_8u_C1R); + return reinterpret_cast(ippiFilterBorder_8u_C1R); case CV_8UC3: - return reinterpret_cast(ippiFilterBorder_8u_C3R); + return reinterpret_cast(ippiFilterBorder_8u_C3R); case CV_8UC4: - return reinterpret_cast(ippiFilterBorder_8u_C4R); + return reinterpret_cast(ippiFilterBorder_8u_C4R); case CV_16UC1: - return reinterpret_cast(ippiFilterBorder_16u_C1R); + return reinterpret_cast(ippiFilterBorder_16u_C1R); case CV_16UC3: - return reinterpret_cast(ippiFilterBorder_16u_C3R); + return reinterpret_cast(ippiFilterBorder_16u_C3R); case CV_16UC4: - return reinterpret_cast(ippiFilterBorder_16u_C4R); + return reinterpret_cast(ippiFilterBorder_16u_C4R); case CV_16SC1: - return reinterpret_cast(ippiFilterBorder_16s_C1R); + return reinterpret_cast(ippiFilterBorder_16s_C1R); case CV_16SC3: - return reinterpret_cast(ippiFilterBorder_16s_C3R); + return reinterpret_cast(ippiFilterBorder_16s_C3R); case CV_16SC4: - return reinterpret_cast(ippiFilterBorder_16s_C4R); + return reinterpret_cast(ippiFilterBorder_16s_C4R); case CV_32FC1: - return reinterpret_cast(ippiFilterBorder_32f_C1R); + return reinterpret_cast(ippiFilterBorder_32f_C1R); case CV_32FC3: - return reinterpret_cast(ippiFilterBorder_32f_C3R); + return reinterpret_cast(ippiFilterBorder_32f_C3R); case CV_32FC4: - return reinterpret_cast(ippiFilterBorder_32f_C4R); + return reinterpret_cast(ippiFilterBorder_32f_C4R); default: return 0; } @@ -4690,19 +4693,20 @@ struct IppFilter : public hal::Filter2D void apply(uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, int, int, int, int) { + CV_INSTRUMENT_REGION_IPP() + if (dst_data == src_data) CV_Error(Error::StsBadArg, "Inplace IPP Filter2D is not supported"); - ippiFilterBorder ippFunc = getIppFunc(src_type); + IppiFilterBorder ippiFilterBorder = getIppFunc(src_type); IppiSize dstRoiSize = { width, height }; kernel_type borderValue[4] = { 0, 0, 0, 0 }; - IppStatus status = ippFunc(src_data, (int)src_step, dst_data, (int)dst_step, dstRoiSize, ippBorderType, borderValue, spec, buffer); + IppStatus status = CV_INSTRUMENT_FUN_IPP(ippiFilterBorder, src_data, (int)src_step, dst_data, (int)dst_step, dstRoiSize, ippBorderType, borderValue, spec, buffer); if (status >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); } } }; #endif -#endif struct DftFilter : public hal::Filter2D { @@ -4819,13 +4823,13 @@ struct ReplacementSepFilter : public hal::SepFilter2D bool isInitialized; ReplacementSepFilter() : ctx(0), isInitialized(false) {} bool init(int stype, int dtype, int ktype, - uchar * kernelx_data, size_t kernelx_step, int kernelx_width, int kernelx_height, - uchar * kernely_data, size_t kernely_step, int kernely_width, int kernely_height, + uchar * kernelx_data, int kernelx_len, + uchar * kernely_data, int kernely_len, int anchor_x, int anchor_y, double delta, int borderType) { int res = cv_hal_sepFilterInit(&ctx, stype, dtype, ktype, - kernelx_data, kernelx_step, kernelx_width, kernelx_height, - kernely_data, kernely_step, kernely_width, kernely_height, + kernelx_data, kernelx_len, + kernely_data, kernely_len, anchor_x, anchor_y, delta, borderType); isInitialized = (res == CV_HAL_ERROR_OK); return isInitialized; @@ -4858,14 +4862,14 @@ struct OcvSepFilter : public hal::SepFilter2D int src_type; int dst_type; bool init(int stype, int dtype, int ktype, - uchar * kernelx_data, size_t kernelx_step, int kernelx_width, int kernelx_height, - uchar * kernely_data, size_t kernely_step, int kernely_width, int kernely_height, + uchar * kernelx_data, int kernelx_len, + uchar * kernely_data, int kernely_len, int anchor_x, int anchor_y, double delta, int borderType) { src_type = stype; dst_type = dtype; - Mat kernelX(Size(kernelx_width, kernelx_height), ktype, kernelx_data, kernelx_step); - Mat kernelY(Size(kernely_width, kernely_height), ktype, kernely_data, kernely_step); + Mat kernelX(Size(kernelx_len, 1), ktype, kernelx_data); + Mat kernelY(Size(kernely_len, 1), ktype, kernely_data); f = createSeparableLinearFilter( stype, dtype, kernelX, kernelY, Point(anchor_x, anchor_y), @@ -4907,7 +4911,6 @@ Ptr Filter2D::create(uchar* kernel_data, size_t kernel_step, int } #ifdef HAVE_IPP -#if !HAVE_ICV if (kernel_type == CV_32FC1) { IppFilter* impl = new IppFilter(); if (impl->init(kernel_data, kernel_step, kernel_type, kernel_width, kernel_height, @@ -4929,7 +4932,6 @@ Ptr Filter2D::create(uchar* kernel_data, size_t kernel_step, int } delete impl; } -#endif #endif if (DftFilter::isAppropriate(stype, dtype, kernel_width, kernel_height)) @@ -4956,15 +4958,15 @@ Ptr Filter2D::create(uchar* kernel_data, size_t kernel_step, int //--------------------------------------------------------------- Ptr SepFilter2D::create(int stype, int dtype, int ktype, - uchar * kernelx_data, size_t kernelx_step, int kernelx_width, int kernelx_height, - uchar * kernely_data, size_t kernely_step, int kernely_width, int kernely_height, + uchar * kernelx_data, int kernelx_len, + uchar * kernely_data, int kernely_len, int anchor_x, int anchor_y, double delta, int borderType) { { ReplacementSepFilter * impl = new ReplacementSepFilter(); if (impl->init(stype, dtype, ktype, - kernelx_data, kernelx_step, kernelx_width, kernelx_height, - kernely_data, kernely_step, kernely_width, kernely_height, + kernelx_data, kernelx_len, + kernely_data, kernely_len, anchor_x, anchor_y, delta, borderType)) { return Ptr(impl); @@ -4974,8 +4976,8 @@ Ptr SepFilter2D::create(int stype, int dtype, int ktype, { OcvSepFilter * impl = new OcvSepFilter(); impl->init(stype, dtype, ktype, - kernelx_data, kernelx_step, kernelx_width, kernelx_height, - kernely_data, kernely_step, kernely_width, kernely_height, + kernelx_data, kernelx_len, + kernely_data, kernely_len, anchor_x, anchor_y, delta, borderType); return Ptr(impl); } @@ -4992,6 +4994,8 @@ void cv::filter2D( InputArray _src, OutputArray _dst, int ddepth, InputArray _kernel, Point anchor0, double delta, int borderType ) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(_dst.isUMat() && _src.dims() <= 2, ocl_filter2D(_src, _dst, ddepth, _kernel, anchor0, delta, borderType)) @@ -5019,7 +5023,9 @@ void cv::sepFilter2D( InputArray _src, OutputArray _dst, int ddepth, InputArray _kernelX, InputArray _kernelY, Point anchor, double delta, int borderType ) { - CV_OCL_RUN(_dst.isUMat() && _src.dims() <= 2, + CV_INSTRUMENT_REGION() + + CV_OCL_RUN(_dst.isUMat() && _src.dims() <= 2 && (size_t)_src.rows() > _kernelY.total() && (size_t)_src.cols() > _kernelX.total(), ocl_sepFilter2D(_src, _dst, ddepth, _kernelX, _kernelY, anchor, delta, borderType)) Mat src = _src.getMat(), kernelX = _kernelX.getMat(), kernelY = _kernelY.getMat(); @@ -5035,11 +5041,15 @@ void cv::sepFilter2D( InputArray _src, OutputArray _dst, int ddepth, if( (borderType & BORDER_ISOLATED) == 0 ) src.locateROI( wsz, ofs ); - CV_Assert(kernelX.type() == kernelY.type()); + CV_Assert( kernelX.type() == kernelY.type() && + (kernelX.cols == 1 || kernelX.rows == 1) && + (kernelY.cols == 1 || kernelY.rows == 1) ); + Mat contKernelX = kernelX.isContinuous() ? kernelX : kernelX.clone(); + Mat contKernelY = kernelY.isContinuous() ? kernelY : kernelY.clone(); Ptr c = hal::SepFilter2D::create(src.type(), dst.type(), kernelX.type(), - kernelX.data, kernelX.step, kernelX.cols, kernelX.rows, - kernelY.data, kernelY.step, kernelY.cols, kernelY.rows, + contKernelX.data, kernelX.cols + kernelX.rows - 1, + contKernelY.data, kernelY.cols + kernelY.rows - 1, anchor.x, anchor.y, delta, borderType & ~BORDER_ISOLATED); c->apply(src.data, src.step, dst.data, dst.step, dst.cols, dst.rows, wsz.width, wsz.height, ofs.x, ofs.y); } diff --git a/modules/imgproc/src/floodfill.cpp b/modules/imgproc/src/floodfill.cpp index 6d8491a2a6..a818539a86 100644 --- a/modules/imgproc/src/floodfill.cpp +++ b/modules/imgproc/src/floodfill.cpp @@ -459,6 +459,8 @@ int cv::floodFill( InputOutputArray _image, InputOutputArray _mask, Point seedPoint, Scalar newVal, Rect* rect, Scalar loDiff, Scalar upDiff, int flags ) { + CV_INSTRUMENT_REGION() + ConnectedComp comp; std::vector buffer; @@ -629,6 +631,8 @@ int cv::floodFill( InputOutputArray _image, Point seedPoint, Scalar newVal, Rect* rect, Scalar loDiff, Scalar upDiff, int flags ) { + CV_INSTRUMENT_REGION() + return floodFill(_image, Mat(), seedPoint, newVal, rect, loDiff, upDiff, flags); } diff --git a/modules/imgproc/src/generalized_hough.cpp b/modules/imgproc/src/generalized_hough.cpp index a261d644b8..2d0b5bf530 100644 --- a/modules/imgproc/src/generalized_hough.cpp +++ b/modules/imgproc/src/generalized_hough.cpp @@ -415,6 +415,8 @@ namespace void GeneralizedHoughBallardImpl::calcHist() { + CV_INSTRUMENT_REGION() + CV_Assert( imageEdges_.type() == CV_8UC1 ); CV_Assert( imageDx_.type() == CV_32FC1 && imageDx_.size() == imageSize_); CV_Assert( imageDy_.type() == imageDx_.type() && imageDy_.size() == imageSize_); diff --git a/modules/imgproc/src/geometry.cpp b/modules/imgproc/src/geometry.cpp index 2d95853c8a..0377ba3b6b 100644 --- a/modules/imgproc/src/geometry.cpp +++ b/modules/imgproc/src/geometry.cpp @@ -94,6 +94,8 @@ cvBoxPoints( CvBox2D box, CvPoint2D32f pt[4] ) double cv::pointPolygonTest( InputArray _contour, Point2f pt, bool measureDist ) { + CV_INSTRUMENT_REGION() + double result = 0; Mat contour = _contour.getMat(); int i, total = contour.checkVector(2), counter = 0; @@ -504,6 +506,8 @@ static int intersectConvexConvex_( const Point2f* P, int n, const Point2f* Q, in float cv::intersectConvexConvex( InputArray _p1, InputArray _p2, OutputArray _p12, bool handleNested ) { + CV_INSTRUMENT_REGION() + Mat p1 = _p1.getMat(), p2 = _p2.getMat(); CV_Assert( p1.depth() == CV_32S || p1.depth() == CV_32F ); CV_Assert( p2.depth() == CV_32S || p2.depth() == CV_32F ); diff --git a/modules/imgproc/src/grabcut.cpp b/modules/imgproc/src/grabcut.cpp index ca3a89faf0..ca9b05c787 100644 --- a/modules/imgproc/src/grabcut.cpp +++ b/modules/imgproc/src/grabcut.cpp @@ -529,6 +529,8 @@ void cv::grabCut( InputArray _img, InputOutputArray _mask, Rect rect, InputOutputArray _bgdModel, InputOutputArray _fgdModel, int iterCount, int mode ) { + CV_INSTRUMENT_REGION() + Mat img = _img.getMat(); Mat& mask = _mask.getMatRef(); Mat& bgdModel = _bgdModel.getMatRef(); diff --git a/modules/imgproc/src/hal_replacement.hpp b/modules/imgproc/src/hal_replacement.hpp index ecc11fb0b4..3196cd88eb 100644 --- a/modules/imgproc/src/hal_replacement.hpp +++ b/modules/imgproc/src/hal_replacement.hpp @@ -140,20 +140,16 @@ inline int hal_ni_filterFree(cvhalFilter2D *context) { return CV_HAL_ERROR_NOT_I @param dst_type destination image type @param kernel_type kernels type @param kernelx_data pointer to x-kernel data - @param kernelx_step x-kernel step - @param kernelx_width x-kernel width - @param kernelx_height x-kernel height + @param kernelx_length x-kernel vector length @param kernely_data pointer to y-kernel data - @param kernely_step y-kernel step - @param kernely_width y-kernel width - @param kernely_height y-kernel height + @param kernely_length y-kernel vector length @param anchor_x relative X position of center point within the kernel @param anchor_y relative Y position of center point within the kernel @param delta added to pixel values @param borderType border processing mode (CV_HAL_BORDER_REFLECT, ...) @sa cv::sepFilter2D, cv::hal::SepFilter2D */ -inline int hal_ni_sepFilterInit(cvhalFilter2D **context, int src_type, int dst_type, int kernel_type, uchar *kernelx_data, size_t kernelx_step, int kernelx_width, int kernelx_height, uchar *kernely_data, size_t kernely_step, int kernely_width, int kernely_height, int anchor_x, int anchor_y, double delta, int borderType) { return CV_HAL_ERROR_NOT_IMPLEMENTED; } +inline int hal_ni_sepFilterInit(cvhalFilter2D **context, int src_type, int dst_type, int kernel_type, uchar *kernelx_data, int kernelx_length, uchar *kernely_data, int kernely_length, int anchor_x, int anchor_y, double delta, int borderType) { return CV_HAL_ERROR_NOT_IMPLEMENTED; } /** @brief hal_sepFilter @param context pointer to user-defined context @@ -267,7 +263,7 @@ inline int hal_ni_resize(int src_type, const uchar *src_data, size_t src_step, i @param dst_step destination image step @param dst_width destination image width @param dst_height destination image height - @param M 3x2 matrix with transform coefficients + @param M 2x3 matrix with transform coefficients @param interpolation interpolation mode (CV_HAL_INTER_NEAREST, ...) @param borderType border processing mode (CV_HAL_BORDER_REFLECT, ...) @param borderValue values to use for CV_HAL_BORDER_CONSTANT mode diff --git a/modules/imgproc/src/histogram.cpp b/modules/imgproc/src/histogram.cpp index 640f07e95f..9b3b1b19a8 100644 --- a/modules/imgproc/src/histogram.cpp +++ b/modules/imgproc/src/histogram.cpp @@ -1188,6 +1188,8 @@ public: virtual void operator() (const Range & range) const { + CV_INSTRUMENT_REGION_IPP() + Ipp32s levelNum = histSize + 1; Mat phist(hist->size(), hist->type(), Scalar::all(0)); #if IPP_VERSION_X100 >= 900 @@ -1226,7 +1228,7 @@ public: return; } - IppStatus status = ippiHistogram_8u_C1R(src->ptr(range.start), (int)src->step, ippiSize(src->cols, range.end - range.start), + IppStatus status = CV_INSTRUMENT_FUN_IPP(ippiHistogram_8u_C1R, src->ptr(range.start), (int)src->step, ippiSize(src->cols, range.end - range.start), phist.ptr(), pSpec, pBuffer); if(pSpec) ippFree(pSpec); @@ -1269,6 +1271,8 @@ static bool ipp_calchist(const Mat* images, int nimages, const int* channels, InputArray _mask, OutputArray _hist, int dims, const int* histSize, const float** ranges, bool uniform, bool accumulate ) { + CV_INSTRUMENT_REGION_IPP() + Mat mask = _mask.getMat(); CV_Assert(dims > 0 && histSize); @@ -1311,6 +1315,7 @@ void cv::calcHist( const Mat* images, int nimages, const int* channels, InputArray _mask, OutputArray _hist, int dims, const int* histSize, const float** ranges, bool uniform, bool accumulate ) { + CV_INSTRUMENT_REGION() CV_IPP_RUN(nimages == 1 && images[0].type() == CV_8UC1 && dims == 1 && channels && channels[0] == 0 && _mask.getMat().empty() && images[0].dims <= 2 && @@ -1602,6 +1607,8 @@ void cv::calcHist( const Mat* images, int nimages, const int* channels, InputArray _mask, SparseMat& hist, int dims, const int* histSize, const float** ranges, bool uniform, bool accumulate ) { + CV_INSTRUMENT_REGION() + Mat mask = _mask.getMat(); calcHist( images, nimages, channels, mask, hist, dims, histSize, ranges, uniform, accumulate, false ); @@ -1614,6 +1621,8 @@ void cv::calcHist( InputArrayOfArrays images, const std::vector& channels, const std::vector& ranges, bool accumulate ) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(images.total() == 1 && channels.size() == 1 && images.channels(0) == 1 && channels[0] == 0 && images.isUMatVector() && mask.empty() && !accumulate && histSize.size() == 1 && histSize[0] == BINS && ranges.size() == 2 && @@ -1941,6 +1950,8 @@ void cv::calcBackProject( const Mat* images, int nimages, const int* channels, InputArray _hist, OutputArray _backProject, const float** ranges, double scale, bool uniform ) { + CV_INSTRUMENT_REGION() + Mat hist = _hist.getMat(); std::vector ptrs; std::vector deltas; @@ -2104,6 +2115,8 @@ void cv::calcBackProject( const Mat* images, int nimages, const int* channels, const SparseMat& hist, OutputArray _backProject, const float** ranges, double scale, bool uniform ) { + CV_INSTRUMENT_REGION() + std::vector ptrs; std::vector deltas; std::vector uniranges; @@ -2283,6 +2296,8 @@ void cv::calcBackProject( InputArrayOfArrays images, const std::vector& cha const std::vector& ranges, double scale ) { + CV_INSTRUMENT_REGION() + #ifdef HAVE_OPENCL Size histSize = hist.size(); bool _1D = histSize.height == 1 || histSize.width == 1; @@ -2335,6 +2350,8 @@ void cv::calcBackProject( InputArrayOfArrays images, const std::vector& cha double cv::compareHist( InputArray _H1, InputArray _H2, int method ) { + CV_INSTRUMENT_REGION() + Mat H1 = _H1.getMat(), H2 = _H2.getMat(); const Mat* arrays[] = {&H1, &H2, 0}; Mat planes[2]; @@ -2541,6 +2558,8 @@ double cv::compareHist( InputArray _H1, InputArray _H2, int method ) double cv::compareHist( const SparseMat& H1, const SparseMat& H2, int method ) { + CV_INSTRUMENT_REGION() + double result = 0; int i, dims = H1.dims(); @@ -3685,6 +3704,8 @@ static bool ocl_equalizeHist(InputArray _src, OutputArray _dst) void cv::equalizeHist( InputArray _src, OutputArray _dst ) { + CV_INSTRUMENT_REGION() + CV_Assert( _src.type() == CV_8UC1 ); if (_src.empty()) diff --git a/modules/imgproc/src/hough.cpp b/modules/imgproc/src/hough.cpp index e77544e902..13c11dbee3 100644 --- a/modules/imgproc/src/hough.cpp +++ b/modules/imgproc/src/hough.cpp @@ -96,7 +96,7 @@ HoughLinesStandard( const Mat& img, float rho, float theta, int numangle = cvRound((max_theta - min_theta) / theta); int numrho = cvRound(((width + height) * 2 + 1) / rho); -#if defined HAVE_IPP && !defined(HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK +#if defined HAVE_IPP && IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK CV_IPP_CHECK() { IppiSize srcSize = { width, height }; @@ -109,7 +109,7 @@ HoughLinesStandard( const Mat& img, float rho, float theta, lines.resize(ipp_linesMax); IppStatus ok = ippiHoughLineGetSize_8u_C1R(srcSize, delta, ipp_linesMax, &bufferSize); Ipp8u* buffer = ippsMalloc_8u(bufferSize); - if (ok >= 0) ok = ippiHoughLine_Region_8u32f_C1R(image, step, srcSize, (IppPointPolar*) &lines[0], dstRoi, ipp_linesMax, &linesCount, delta, threshold, buffer); + if (ok >= 0) {ok = CV_INSTRUMENT_FUN_IPP(ippiHoughLine_Region_8u32f_C1R,(image, step, srcSize, (IppPointPolar*) &lines[0], dstRoi, ipp_linesMax, &linesCount, delta, threshold, buffer))}; ippsFree(buffer); if (ok >= 0) { @@ -429,7 +429,7 @@ HoughLinesProbabilistic( Mat& image, int numangle = cvRound(CV_PI / theta); int numrho = cvRound(((width + height) * 2 + 1) / rho); -#if defined HAVE_IPP && !defined(HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK +#if defined HAVE_IPP && IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK CV_IPP_CHECK() { IppiSize srcSize = { width, height }; @@ -443,7 +443,7 @@ HoughLinesProbabilistic( Mat& image, Ipp8u* buffer = ippsMalloc_8u(bufferSize); pSpec = (IppiHoughProbSpec*) malloc(specSize); if (ok >= 0) ok = ippiHoughProbLineInit_8u32f_C1R(srcSize, delta, ippAlgHintNone, pSpec); - if (ok >= 0) ok = ippiHoughProbLine_8u32f_C1R(image.data, image.step, srcSize, threshold, lineLength, lineGap, (IppiPoint*) &lines[0], ipp_linesMax, &linesCount, buffer, pSpec); + if (ok >= 0) {ok = CV_INSTRUMENT_FUN_IPP(ippiHoughProbLine_8u32f_C1R,(image.data, image.step, srcSize, threshold, lineLength, lineGap, (IppiPoint*) &lines[0], ipp_linesMax, &linesCount, buffer, pSpec))}; free(pSpec); ippsFree(buffer); @@ -850,6 +850,8 @@ void cv::HoughLines( InputArray _image, OutputArray _lines, double rho, double theta, int threshold, double srn, double stn, double min_theta, double max_theta ) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(srn == 0 && stn == 0 && _image.isUMat() && _lines.isUMat(), ocl_HoughLines(_image, _lines, rho, theta, threshold, min_theta, max_theta)); @@ -869,6 +871,8 @@ void cv::HoughLinesP(InputArray _image, OutputArray _lines, double rho, double theta, int threshold, double minLineLength, double maxGap ) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(_image.isUMat() && _lines.isUMat(), ocl_HoughLinesP(_image, _lines, rho, theta, threshold, minLineLength, maxGap)); @@ -1322,6 +1326,8 @@ void cv::HoughCircles( InputArray _image, OutputArray _circles, double param1, double param2, int minRadius, int maxRadius ) { + CV_INSTRUMENT_REGION() + Ptr storage(cvCreateMemStorage(STORAGE_SIZE)); Mat image = _image.getMat(); CvMat c_image = image; diff --git a/modules/imgproc/src/imgwarp.cpp b/modules/imgproc/src/imgwarp.cpp index ff96c2fe1e..08424363f4 100644 --- a/modules/imgproc/src/imgwarp.cpp +++ b/modules/imgproc/src/imgwarp.cpp @@ -69,6 +69,8 @@ namespace cv template bool IPPSetSimple(cv::Scalar value, void *dataPointer, int step, IppiSize &size, ippiSetFunc func) { + CV_INSTRUMENT_REGION_IPP() + Type values[channels]; for( int i = 0; i < channels; i++ ) values[i] = saturate_cast(value[i]); @@ -77,16 +79,18 @@ namespace cv static bool IPPSet(const cv::Scalar &value, void *dataPointer, int step, IppiSize &size, int channels, int depth) { + CV_INSTRUMENT_REGION_IPP() + if( channels == 1 ) { switch( depth ) { case CV_8U: - return ippiSet_8u_C1R(saturate_cast(value[0]), (Ipp8u *)dataPointer, step, size) >= 0; + return CV_INSTRUMENT_FUN_IPP(ippiSet_8u_C1R,(saturate_cast(value[0]), (Ipp8u *)dataPointer, step, size)) >= 0; case CV_16U: - return ippiSet_16u_C1R(saturate_cast(value[0]), (Ipp16u *)dataPointer, step, size) >= 0; + return CV_INSTRUMENT_FUN_IPP(ippiSet_16u_C1R,(saturate_cast(value[0]), (Ipp16u *)dataPointer, step, size)) >= 0; case CV_32F: - return ippiSet_32f_C1R(saturate_cast(value[0]), (Ipp32f *)dataPointer, step, size) >= 0; + return CV_INSTRUMENT_FUN_IPP(ippiSet_32f_C1R,(saturate_cast(value[0]), (Ipp32f *)dataPointer, step, size)) >= 0; } } else @@ -2712,7 +2716,7 @@ static int computeResizeAreaTab( int ssize, int dsize, int cn, double scale, Dec #define CHECK_IPP_STATUS(STATUS) if (STATUS < 0) { *ok = false; return; } #define SET_IPP_RESIZE_LINEAR_FUNC_PTR(TYPE, CN) \ - func = (ippiResizeFunc)ippiResizeLinear_##TYPE##_##CN##R; \ + ippiResize = (ippiResizeFunc)ippiResizeLinear_##TYPE##_##CN##R; \ CHECK_IPP_STATUS(ippiResizeGetSize_##TYPE(srcSize, dstSize, (IppiInterpolationType)mode, 0, &specSize, &initSize));\ specBuf.allocate(specSize);\ pSpec = (uchar*)specBuf;\ @@ -2720,7 +2724,7 @@ static int computeResizeAreaTab( int ssize, int dsize, int cn, double scale, Dec #define SET_IPP_RESIZE_LINEAR_FUNC_64_PTR(TYPE, CN) \ if (mode == (int)ippCubic) { *ok = false; return; } \ - func = (ippiResizeFunc)ippiResizeLinear_##TYPE##_##CN##R; \ + ippiResize = (ippiResizeFunc)ippiResizeLinear_##TYPE##_##CN##R; \ CHECK_IPP_STATUS(ippiResizeGetSize_##TYPE(srcSize, dstSize, (IppiInterpolationType)mode, 0, &specSize, &initSize));\ specBuf.allocate(specSize);\ pSpec = (uchar*)specBuf;\ @@ -2729,7 +2733,7 @@ static int computeResizeAreaTab( int ssize, int dsize, int cn, double scale, Dec getSrcOffsetFunc = (ippiResizeGetSrcOffset) ippiResizeGetSrcOffset_##TYPE; #define SET_IPP_RESIZE_CUBIC_FUNC_PTR(TYPE, CN) \ - func = (ippiResizeFunc)ippiResizeCubic_##TYPE##_##CN##R; \ + ippiResize = (ippiResizeFunc)ippiResizeCubic_##TYPE##_##CN##R; \ CHECK_IPP_STATUS(ippiResizeGetSize_##TYPE(srcSize, dstSize, (IppiInterpolationType)mode, 0, &specSize, &initSize));\ specBuf.allocate(specSize);\ pSpec = (uchar*)specBuf;\ @@ -2752,7 +2756,7 @@ public: IPPresizeInvoker(const Mat & _src, Mat & _dst, double _inv_scale_x, double _inv_scale_y, int _mode, bool *_ok) : ParallelLoopBody(), src(_src), dst(_dst), inv_scale_x(_inv_scale_x), inv_scale_y(_inv_scale_y), pSpec(NULL), mode(_mode), - func(NULL), getBufferSizeFunc(NULL), getSrcOffsetFunc(NULL), ok(_ok) + ippiResize(NULL), getBufferSizeFunc(NULL), getSrcOffsetFunc(NULL), ok(_ok) { *ok = true; IppiSize srcSize, dstSize; @@ -2791,6 +2795,8 @@ public: virtual void operator() (const Range& range) const { + CV_INSTRUMENT_REGION_IPP() + if (*ok == false) return; @@ -2812,7 +2818,7 @@ public: AutoBuffer buf(bufsize + 64); uchar* bufptr = alignPtr((uchar*)buf, 32); - if( func( pSrc, (int)src.step[0], pDst, (int)dst.step[0], dstOffset, dstSize, ippBorderRepl, 0, pSpec, bufptr ) < 0 ) + if( CV_INSTRUMENT_FUN_IPP(ippiResize, pSrc, (int)src.step[0], pDst, (int)dst.step[0], dstOffset, dstSize, ippBorderRepl, 0, pSpec, bufptr) < 0 ) *ok = false; else { @@ -2827,7 +2833,7 @@ private: void *pSpec; AutoBuffer specBuf; int mode; - ippiResizeFunc func; + ippiResizeFunc ippiResize; ippiResizeGetBufferSize getBufferSizeFunc; ippiResizeGetSrcOffset getSrcOffsetFunc; bool *ok; @@ -3095,6 +3101,8 @@ static bool ocl_resize( InputArray _src, OutputArray _dst, Size dsize, static bool ipp_resize_mt(Mat & src, Mat & dst, double inv_scale_x, double inv_scale_y, int interpolation) { + CV_INSTRUMENT_REGION_IPP() + int mode = -1; if (interpolation == INTER_LINEAR && src.rows >= 2 && src.cols >= 2) mode = ippLinear; @@ -3123,6 +3131,8 @@ void resize(int src_type, uchar * dst_data, size_t dst_step, int dst_width, int dst_height, double inv_scale_x, double inv_scale_y, int interpolation) { + CV_INSTRUMENT_REGION() + CV_Assert((dst_width * dst_height > 0) || (inv_scale_x > 0 && inv_scale_y > 0)); if (inv_scale_x < DBL_EPSILON || inv_scale_y < DBL_EPSILON) { @@ -3475,6 +3485,8 @@ void resize(int src_type, void cv::resize( InputArray _src, OutputArray _dst, Size dsize, double inv_scale_x, double inv_scale_y, int interpolation ) { + CV_INSTRUMENT_REGION() + Size ssize = _src.size(); CV_Assert( ssize.width > 0 && ssize.height > 0 ); @@ -4740,7 +4752,7 @@ static bool ocl_logPolar(InputArray _src, OutputArray _dst, } #endif -#if defined HAVE_IPP && !defined HAVE_IPP_ICV_ONLY && IPP_DISABLE_BLOCK +#if defined HAVE_IPP && IPP_DISABLE_BLOCK typedef IppStatus (CV_STDCALL * ippiRemap)(const void * pSrc, IppiSize srcSize, int srcStep, IppiRect srcRoi, const Ipp32f* pxMap, int xMapStep, const Ipp32f* pyMap, int yMapStep, @@ -4760,6 +4772,8 @@ public: virtual void operator() (const Range & range) const { + CV_INSTRUMENT_REGION_IPP() + IppiRect srcRoiRect = { 0, 0, src.cols, src.rows }; Mat dstRoi = dst.rowRange(range); IppiSize dstRoiSize = ippiSize(dstRoi.size()); @@ -4772,9 +4786,9 @@ public: return; } - if (ippFunc(src.ptr(), ippiSize(src.size()), (int)src.step, srcRoiRect, + if (CV_INSTRUMENT_FUN_PTR_CALL_IPP(ippFunc,(src.ptr(), ippiSize(src.size()), (int)src.step, srcRoiRect, map1.ptr(), (int)map1.step, map2.ptr(), (int)map2.step, - dstRoi.ptr(), (int)dstRoi.step, dstRoiSize, ippInterpolation) < 0) + dstRoi.ptr(), (int)dstRoi.step, dstRoiSize, ippInterpolation)) < 0) *ok = false; else { @@ -4798,6 +4812,8 @@ void cv::remap( InputArray _src, OutputArray _dst, InputArray _map1, InputArray _map2, int interpolation, int borderType, const Scalar& borderValue ) { + CV_INSTRUMENT_REGION() + static RemapNNFunc nn_tab[] = { remapNearest, remapNearest, remapNearest, remapNearest, @@ -4848,7 +4864,7 @@ void cv::remap( InputArray _src, OutputArray _dst, int type = src.type(), depth = CV_MAT_DEPTH(type); -#if defined HAVE_IPP && !defined HAVE_IPP_ICV_ONLY && IPP_DISABLE_BLOCK +#if defined HAVE_IPP && IPP_DISABLE_BLOCK CV_IPP_CHECK() { if ((interpolation == INTER_LINEAR || interpolation == INTER_CUBIC || interpolation == INTER_NEAREST) && @@ -4940,6 +4956,8 @@ void cv::convertMaps( InputArray _map1, InputArray _map2, OutputArray _dstmap1, OutputArray _dstmap2, int dstm1type, bool nninterpolate ) { + CV_INSTRUMENT_REGION() + Mat map1 = _map1.getMat(), map2 = _map2.getMat(), dstmap1, dstmap2; Size size = map1.size(); const Mat *m1 = &map1, *m2 = &map2; @@ -5589,6 +5607,8 @@ public: virtual void operator() (const Range& range) const { + CV_INSTRUMENT_REGION_IPP() + IppiSize srcsize = { src.cols, src.rows }; IppiRect srcroi = { 0, 0, src.cols, src.rows }; IppiRect dstroi = { 0, range.start, dst.cols, range.end - range.start }; @@ -5605,8 +5625,8 @@ public: } // Aug 2013: problem in IPP 7.1, 8.0 : sometimes function return ippStsCoeffErr - IppStatus status = func( src.ptr(), srcsize, (int)src.step[0], srcroi, dst.ptr(), - (int)dst.step[0], dstroi, coeffs, mode ); + IppStatus status = CV_INSTRUMENT_FUN_PTR_CALL_IPP(func,( src.ptr(), srcsize, (int)src.step[0], srcroi, dst.ptr(), + (int)dst.step[0], dstroi, coeffs, mode )); if( status < 0) *ok = false; else @@ -5768,6 +5788,8 @@ void cv::warpAffine( InputArray _src, OutputArray _dst, InputArray _M0, Size dsize, int flags, int borderType, const Scalar& borderValue ) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(), ocl_warpTransform(_src, _dst, _M0, dsize, flags, borderType, borderValue, OCL_OP_AFFINE)) @@ -6230,6 +6252,8 @@ public: virtual void operator() (const Range& range) const { + CV_INSTRUMENT_REGION_IPP() + IppiSize srcsize = {src.cols, src.rows}; IppiRect srcroi = {0, 0, src.cols, src.rows}; IppiRect dstroi = {0, range.start, dst.cols, range.end - range.start}; @@ -6246,7 +6270,7 @@ public: } } - IppStatus status = func(src.ptr(), srcsize, (int)src.step[0], srcroi, dst.ptr(), (int)dst.step[0], dstroi, coeffs, mode); + IppStatus status = CV_INSTRUMENT_FUN_PTR_CALL_IPP(func,(src.ptr(), srcsize, (int)src.step[0], srcroi, dst.ptr(), (int)dst.step[0], dstroi, coeffs, mode)); if (status != ippStsNoErr) *ok = false; else @@ -6290,6 +6314,8 @@ void warpPerspectve(int src_type, void cv::warpPerspective( InputArray _src, OutputArray _dst, InputArray _M0, Size dsize, int flags, int borderType, const Scalar& borderValue ) { + CV_INSTRUMENT_REGION() + CV_Assert( _src.total() > 0 ); CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(), @@ -6381,6 +6407,8 @@ void cv::warpPerspective( InputArray _src, OutputArray _dst, InputArray _M0, cv::Mat cv::getRotationMatrix2D( Point2f center, double angle, double scale ) { + CV_INSTRUMENT_REGION() + angle *= CV_PI/180; double alpha = cos(angle)*scale; double beta = sin(angle)*scale; @@ -6424,6 +6452,8 @@ cv::Mat cv::getRotationMatrix2D( Point2f center, double angle, double scale ) */ cv::Mat cv::getPerspectiveTransform( const Point2f src[], const Point2f dst[] ) { + CV_INSTRUMENT_REGION() + Mat M(3, 3, CV_64F), X(8, 1, CV_64F, M.ptr()); double a[8][8], b[8]; Mat A(8, 8, CV_64F, a), B(8, 1, CV_64F, b); @@ -6778,6 +6808,8 @@ cvLogPolar( const CvArr* srcarr, CvArr* dstarr, void cv::logPolar( InputArray _src, OutputArray _dst, Point2f center, double M, int flags ) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(_src.isUMat() && _dst.isUMat(), ocl_logPolar(_src, _dst, center, M, flags)); Mat src_with_border; // don't scope this variable (it holds image data) @@ -6987,6 +7019,8 @@ void cvLinearPolar( const CvArr* srcarr, CvArr* dstarr, void cv::linearPolar( InputArray _src, OutputArray _dst, Point2f center, double maxRadius, int flags ) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(_src.isUMat() && _dst.isUMat(), ocl_linearPolar(_src, _dst, center, maxRadius, flags)); Mat src_with_border; // don't scope this variable (it holds image data) diff --git a/modules/imgproc/src/intersection.cpp b/modules/imgproc/src/intersection.cpp index dfebd260e7..5da743a0f9 100644 --- a/modules/imgproc/src/intersection.cpp +++ b/modules/imgproc/src/intersection.cpp @@ -49,6 +49,8 @@ namespace cv int rotatedRectangleIntersection( const RotatedRect& rect1, const RotatedRect& rect2, OutputArray intersectingRegion ) { + CV_INSTRUMENT_REGION() + const float samePointEps = 0.00001f; // used to test if two points are the same Point2f vec1[4], vec2[4]; diff --git a/modules/imgproc/src/linefit.cpp b/modules/imgproc/src/linefit.cpp index dc71d888ae..c073e26cb0 100644 --- a/modules/imgproc/src/linefit.cpp +++ b/modules/imgproc/src/linefit.cpp @@ -594,6 +594,8 @@ static void fitLine3D( Point3f * points, int count, int dist, void cv::fitLine( InputArray _points, OutputArray _line, int distType, double param, double reps, double aeps ) { + CV_INSTRUMENT_REGION() + Mat points = _points.getMat(); float linebuf[6]={0.f}; diff --git a/modules/imgproc/src/lsd.cpp b/modules/imgproc/src/lsd.cpp index cda073a61e..8791f0aad8 100644 --- a/modules/imgproc/src/lsd.cpp +++ b/modules/imgproc/src/lsd.cpp @@ -412,6 +412,8 @@ LineSegmentDetectorImpl::LineSegmentDetectorImpl(int _refine, double _scale, dou void LineSegmentDetectorImpl::detect(InputArray _image, OutputArray _lines, OutputArray _width, OutputArray _prec, OutputArray _nfa) { + CV_INSTRUMENT_REGION() + Mat_ img = _image.getMat(); CV_Assert(!img.empty() && img.channels() == 1); @@ -1154,6 +1156,8 @@ inline bool LineSegmentDetectorImpl::isAligned(const int& address, const double& void LineSegmentDetectorImpl::drawSegments(InputOutputArray _image, InputArray lines) { + CV_INSTRUMENT_REGION() + CV_Assert(!_image.empty() && (_image.channels() == 1 || _image.channels() == 3)); Mat gray; @@ -1191,6 +1195,8 @@ void LineSegmentDetectorImpl::drawSegments(InputOutputArray _image, InputArray l int LineSegmentDetectorImpl::compareSegments(const Size& size, InputArray lines1, InputArray lines2, InputOutputArray _image) { + CV_INSTRUMENT_REGION() + Size sz = size; if (_image.needed() && _image.size() != size) sz = _image.size(); CV_Assert(sz.area()); diff --git a/modules/imgproc/src/matchcontours.cpp b/modules/imgproc/src/matchcontours.cpp index 1ac6c16627..1a371677bf 100644 --- a/modules/imgproc/src/matchcontours.cpp +++ b/modules/imgproc/src/matchcontours.cpp @@ -43,6 +43,8 @@ double cv::matchShapes(InputArray contour1, InputArray contour2, int method, double) { + CV_INSTRUMENT_REGION() + double ma[7], mb[7]; int i, sma, smb; double eps = 1.e-5; diff --git a/modules/imgproc/src/moments.cpp b/modules/imgproc/src/moments.cpp index 11acc377b0..d445ed270d 100644 --- a/modules/imgproc/src/moments.cpp +++ b/modules/imgproc/src/moments.cpp @@ -227,16 +227,15 @@ struct MomentsInTile_SIMD if( useSIMD ) { - __m128i qx_init = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7); __m128i dx = _mm_set1_epi16(8); - __m128i z = _mm_setzero_si128(), qx0 = z, qx1 = z, qx2 = z, qx3 = z, qx = qx_init; + __m128i z = _mm_setzero_si128(), qx0 = z, qx1 = z, qx2 = z, qx3 = z, qx = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7); for( ; x <= len - 8; x += 8 ) { __m128i p = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i*)(ptr + x)), z); __m128i sx = _mm_mullo_epi16(qx, qx); - qx0 = _mm_add_epi32(qx0, _mm_sad_epu8(p, z)); + qx0 = _mm_add_epi16(qx0, p); qx1 = _mm_add_epi32(qx1, _mm_madd_epi16(p, qx)); qx2 = _mm_add_epi32(qx2, _mm_madd_epi16(p, sx)); qx3 = _mm_add_epi32(qx3, _mm_madd_epi16( _mm_mullo_epi16(p, qx), sx)); @@ -244,14 +243,21 @@ struct MomentsInTile_SIMD qx = _mm_add_epi16(qx, dx); } - _mm_store_si128((__m128i*)buf, qx0); - x0 = buf[0] + buf[1] + buf[2] + buf[3]; - _mm_store_si128((__m128i*)buf, qx1); - x1 = buf[0] + buf[1] + buf[2] + buf[3]; - _mm_store_si128((__m128i*)buf, qx2); - x2 = buf[0] + buf[1] + buf[2] + buf[3]; - _mm_store_si128((__m128i*)buf, qx3); - x3 = buf[0] + buf[1] + buf[2] + buf[3]; + __m128i qx01_lo = _mm_unpacklo_epi32(qx0, qx1); + __m128i qx23_lo = _mm_unpacklo_epi32(qx2, qx3); + __m128i qx01_hi = _mm_unpackhi_epi32(qx0, qx1); + __m128i qx23_hi = _mm_unpackhi_epi32(qx2, qx3); + qx01_lo = _mm_add_epi32(qx01_lo, qx01_hi); + qx23_lo = _mm_add_epi32(qx23_lo, qx23_hi); + __m128i qx0123_lo = _mm_unpacklo_epi64(qx01_lo, qx23_lo); + __m128i qx0123_hi = _mm_unpackhi_epi64(qx01_lo, qx23_lo); + qx0123_lo = _mm_add_epi32(qx0123_lo, qx0123_hi); + _mm_store_si128((__m128i*)buf, qx0123_lo); + + x0 = (buf[0] & 0xffff) + (buf[0] >> 16); + x1 = buf[1]; + x2 = buf[2]; + x3 = buf[3]; } return x; @@ -560,6 +566,8 @@ static bool ocl_moments( InputArray _src, Moments& m, bool binary) cv::Moments cv::moments( InputArray _src, bool binary ) { + CV_INSTRUMENT_REGION() + const int TILE_SIZE = 32; MomentsInTileFunc func = 0; uchar nzbuf[TILE_SIZE*TILE_SIZE]; @@ -603,7 +611,7 @@ cv::Moments cv::moments( InputArray _src, bool binary ) if (ippFunc) { - if (ippFunc(mat.data, (int)mat.step, roi, moment) >= 0) + if (CV_INSTRUMENT_FUN_IPP(ippFunc,(mat.data, (int)mat.step, roi, moment)) >= 0) { IppiPoint point = { 0, 0 }; ippiGetSpatialMoment_64f(moment, 0, 0, 0, point, &m.m00); @@ -734,6 +742,8 @@ cv::Moments cv::moments( InputArray _src, bool binary ) void cv::HuMoments( const Moments& m, double hu[7] ) { + CV_INSTRUMENT_REGION() + double t0 = m.nu30 + m.nu12; double t1 = m.nu21 + m.nu03; @@ -761,6 +771,8 @@ void cv::HuMoments( const Moments& m, double hu[7] ) void cv::HuMoments( const Moments& m, OutputArray _hu ) { + CV_INSTRUMENT_REGION() + _hu.create(7, 1, CV_64F); Mat hu = _hu.getMat(); CV_Assert( hu.isContinuous() ); diff --git a/modules/imgproc/src/morph.cpp b/modules/imgproc/src/morph.cpp index 3b799803c3..a0103b3143 100644 --- a/modules/imgproc/src/morph.cpp +++ b/modules/imgproc/src/morph.cpp @@ -1145,10 +1145,10 @@ struct IppMorphTrait\ IppStatus morphInit(IppiSize roiSize, const Ipp8u* pMask, IppiSize maskSize, IppiMorphState* pMorphSpec, Ipp8u* pBuffer) {return ippiMorphologyBorderInit_##flavor(roiSize, pMask, maskSize, pMorphSpec, pBuffer);}\ IppStatus filterGetMinSize(IppiSize dstRoiSize, IppiSize maskSize, IppDataType dataType, int numChannels, int* pBufferSize) {return ippiFilterMinBorderGetBufferSize(dstRoiSize, maskSize, dataType, numChannels, pBufferSize);}\ IppStatus filterGetMaxSize(IppiSize dstRoiSize, IppiSize maskSize, IppDataType dataType, int numChannels, int* pBufferSize) {return ippiFilterMaxBorderGetBufferSize(dstRoiSize, maskSize, dataType, numChannels, pBufferSize);}\ - IppStatus filterMinBorder(const ipp_data_type* pSrc, int srcStep, ipp_data_type* pDst, int dstStep, IppiSize dstRoiSize, IppiSize maskSize, IppiPoint, Ipp8u* pBuffer) { ipp_data_type zerodef; return ippiFilterMinBorder_##flavor(pSrc, srcStep, pDst, dstStep, dstRoiSize, maskSize, ippBorderRepl, zero, pBuffer); }\ - IppStatus filterMaxBorder(const ipp_data_type* pSrc, int srcStep, ipp_data_type* pDst, int dstStep, IppiSize dstRoiSize, IppiSize maskSize, IppiPoint, Ipp8u* pBuffer) { ipp_data_type zerodef; return ippiFilterMaxBorder_##flavor(pSrc, srcStep, pDst, dstStep, dstRoiSize, maskSize, ippBorderRepl, zero, pBuffer); }\ - IppStatus morphDilate(const ipp_data_type* pSrc, int srcStep, ipp_data_type* pDst, int dstStep, IppiSize roiSize, const IppiMorphState* pMorphSpec, Ipp8u* pBuffer) { ipp_data_type zerodef; return ippiDilateBorder_##flavor(pSrc, srcStep, pDst, dstStep, roiSize, ippBorderRepl, zero, pMorphSpec, pBuffer); }\ - IppStatus morphErode(const ipp_data_type* pSrc, int srcStep, ipp_data_type* pDst, int dstStep, IppiSize roiSize, const IppiMorphState* pMorphSpec, Ipp8u* pBuffer) { ipp_data_type zerodef; return ippiErodeBorder_##flavor(pSrc, srcStep, pDst, dstStep, roiSize, ippBorderRepl, zero, pMorphSpec, pBuffer); }\ + IppStatus filterMinBorder(const ipp_data_type* pSrc, int srcStep, ipp_data_type* pDst, int dstStep, IppiSize dstRoiSize, IppiSize maskSize, IppiPoint, Ipp8u* pBuffer) { ipp_data_type zerodef; return CV_INSTRUMENT_FUN_IPP(ippiFilterMinBorder_##flavor, pSrc, srcStep, pDst, dstStep, dstRoiSize, maskSize, ippBorderRepl, zero, pBuffer); }\ + IppStatus filterMaxBorder(const ipp_data_type* pSrc, int srcStep, ipp_data_type* pDst, int dstStep, IppiSize dstRoiSize, IppiSize maskSize, IppiPoint, Ipp8u* pBuffer) { ipp_data_type zerodef; return CV_INSTRUMENT_FUN_IPP(ippiFilterMaxBorder_##flavor, pSrc, srcStep, pDst, dstStep, dstRoiSize, maskSize, ippBorderRepl, zero, pBuffer); }\ + IppStatus morphDilate(const ipp_data_type* pSrc, int srcStep, ipp_data_type* pDst, int dstStep, IppiSize roiSize, const IppiMorphState* pMorphSpec, Ipp8u* pBuffer) { ipp_data_type zerodef; return CV_INSTRUMENT_FUN_IPP(ippiDilateBorder_##flavor, pSrc, srcStep, pDst, dstStep, roiSize, ippBorderRepl, zero, pMorphSpec, pBuffer); }\ + IppStatus morphErode(const ipp_data_type* pSrc, int srcStep, ipp_data_type* pDst, int dstStep, IppiSize roiSize, const IppiMorphState* pMorphSpec, Ipp8u* pBuffer) { ipp_data_type zerodef; return CV_INSTRUMENT_FUN_IPP(ippiErodeBorder_##flavor, pSrc, srcStep, pDst, dstStep, roiSize, ippBorderRepl, zero, pMorphSpec, pBuffer); }\ }; #else @@ -1333,6 +1333,8 @@ struct IppMorphImpl : public IppMorphBaseImpl int roi_width, int roi_height, int roi_x, int roi_y, int roi_width2, int roi_height2, int roi_x2, int roi_y2) { + CV_INSTRUMENT_REGION_IPP() + CV_UNUSED(roi_width); CV_UNUSED(roi_height); CV_UNUSED(roi_x); CV_UNUSED(roi_y); CV_UNUSED(roi_width2); CV_UNUSED(roi_height2); CV_UNUSED(roi_x2); CV_UNUSED(roi_y2); if (src_data == dst_data) @@ -1873,6 +1875,8 @@ void cv::erode( InputArray src, OutputArray dst, InputArray kernel, Point anchor, int iterations, int borderType, const Scalar& borderValue ) { + CV_INSTRUMENT_REGION() + morphOp( MORPH_ERODE, src, dst, kernel, anchor, iterations, borderType, borderValue ); } @@ -1881,6 +1885,8 @@ void cv::dilate( InputArray src, OutputArray dst, InputArray kernel, Point anchor, int iterations, int borderType, const Scalar& borderValue ) { + CV_INSTRUMENT_REGION() + morphOp( MORPH_DILATE, src, dst, kernel, anchor, iterations, borderType, borderValue ); } @@ -1952,6 +1958,8 @@ void cv::morphologyEx( InputArray _src, OutputArray _dst, int op, InputArray _kernel, Point anchor, int iterations, int borderType, const Scalar& borderValue ) { + CV_INSTRUMENT_REGION() + Mat kernel = _kernel.getMat(); if (kernel.empty()) { diff --git a/modules/imgproc/src/opencl/canny.cl b/modules/imgproc/src/opencl/canny.cl index 584cf9e90b..138850424b 100644 --- a/modules/imgproc/src/opencl/canny.cl +++ b/modules/imgproc/src/opencl/canny.cl @@ -260,7 +260,7 @@ __kernel void stage1_with_sobel(__global const uchar *src, int src_step, int src #ifdef L2GRAD #define dist(x, y) ((int)(x) * (x) + (int)(y) * (y)) #else -#define dist(x, y) (abs(x) + abs(y)) +#define dist(x, y) (abs((int)(x)) + abs((int)(y))) #endif __constant int prev[4][2] = { diff --git a/modules/imgproc/src/phasecorr.cpp b/modules/imgproc/src/phasecorr.cpp index e6416ead59..1770f7aab8 100644 --- a/modules/imgproc/src/phasecorr.cpp +++ b/modules/imgproc/src/phasecorr.cpp @@ -490,6 +490,8 @@ static Point2d weightedCentroid(InputArray _src, cv::Point peakLocation, cv::Siz cv::Point2d cv::phaseCorrelate(InputArray _src1, InputArray _src2, InputArray _window, double* response) { + CV_INSTRUMENT_REGION() + Mat src1 = _src1.getMat(); Mat src2 = _src2.getMat(); Mat window = _window.getMat(); @@ -571,6 +573,8 @@ cv::Point2d cv::phaseCorrelate(InputArray _src1, InputArray _src2, InputArray _w void cv::createHanningWindow(OutputArray _dst, cv::Size winSize, int type) { + CV_INSTRUMENT_REGION() + CV_Assert( type == CV_32FC1 || type == CV_64FC1 ); _dst.create(winSize, type); diff --git a/modules/imgproc/src/pyramids.cpp b/modules/imgproc/src/pyramids.cpp index f7ff60d532..7d1cb67b05 100644 --- a/modules/imgproc/src/pyramids.cpp +++ b/modules/imgproc/src/pyramids.cpp @@ -1187,6 +1187,8 @@ namespace cv { static bool ipp_pyrdown( InputArray _src, OutputArray _dst, const Size& _dsz, int borderType ) { + CV_INSTRUMENT_REGION_IPP() + #if IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK Size dsz = _dsz.area() == 0 ? Size((_src.cols() + 1)/2, (_src.rows() + 1)/2) : _dsz; bool isolated = (borderType & BORDER_ISOLATED) != 0; @@ -1245,6 +1247,8 @@ static bool ipp_pyrdown( InputArray _src, OutputArray _dst, const Size& _dsz, in void cv::pyrDown( InputArray _src, OutputArray _dst, const Size& _dsz, int borderType ) { + CV_INSTRUMENT_REGION() + CV_Assert(borderType != BORDER_CONSTANT); CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(), @@ -1292,6 +1296,8 @@ namespace cv { static bool ipp_pyrup( InputArray _src, OutputArray _dst, const Size& _dsz, int borderType ) { + CV_INSTRUMENT_REGION_IPP() + #if IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK Size sz = _src.dims() <= 2 ? _src.size() : Size(); Size dsz = _dsz.area() == 0 ? Size(_src.cols()*2, _src.rows()*2) : _dsz; @@ -1348,6 +1354,8 @@ static bool ipp_pyrup( InputArray _src, OutputArray _dst, const Size& _dsz, int void cv::pyrUp( InputArray _src, OutputArray _dst, const Size& _dsz, int borderType ) { + CV_INSTRUMENT_REGION() + CV_Assert(borderType == BORDER_DEFAULT); CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(), @@ -1396,6 +1404,8 @@ namespace cv { static bool ipp_buildpyramid( InputArray _src, OutputArrayOfArrays _dst, int maxlevel, int borderType ) { + CV_INSTRUMENT_REGION_IPP() + #if IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK Mat src = _src.getMat(); _dst.create( maxlevel + 1, 1, 0 ); @@ -1506,6 +1516,8 @@ static bool ipp_buildpyramid( InputArray _src, OutputArrayOfArrays _dst, int max void cv::buildPyramid( InputArray _src, OutputArrayOfArrays _dst, int maxlevel, int borderType ) { + CV_INSTRUMENT_REGION() + CV_Assert(borderType != BORDER_CONSTANT); if (_src.dims() <= 2 && _dst.isUMatVector()) diff --git a/modules/imgproc/src/rotcalipers.cpp b/modules/imgproc/src/rotcalipers.cpp index c80636bdc6..d19addd0d7 100644 --- a/modules/imgproc/src/rotcalipers.cpp +++ b/modules/imgproc/src/rotcalipers.cpp @@ -346,6 +346,8 @@ static void rotatingCalipers( const Point2f* points, int n, int mode, float* out cv::RotatedRect cv::minAreaRect( InputArray _points ) { + CV_INSTRUMENT_REGION() + Mat hull; Point2f out[3]; RotatedRect box; @@ -404,6 +406,8 @@ cvMinAreaRect2( const CvArr* array, CvMemStorage* /*storage*/ ) void cv::boxPoints(cv::RotatedRect box, OutputArray _pts) { + CV_INSTRUMENT_REGION() + _pts.create(4, 2, CV_32F); Mat pts = _pts.getMat(); box.points(pts.ptr()); diff --git a/modules/imgproc/src/samplers.cpp b/modules/imgproc/src/samplers.cpp index c89bd32e0b..df9a2ef1de 100644 --- a/modules/imgproc/src/samplers.cpp +++ b/modules/imgproc/src/samplers.cpp @@ -365,6 +365,8 @@ getQuadrangleSubPix_8u32f_CnR( const uchar* src, size_t src_step, Size src_size, void cv::getRectSubPix( InputArray _image, Size patchSize, Point2f center, OutputArray _patch, int patchType ) { + CV_INSTRUMENT_REGION() + Mat image = _image.getMat(); int depth = image.depth(), cn = image.channels(); int ddepth = patchType < 0 ? depth : CV_MAT_DEPTH(patchType); @@ -387,15 +389,15 @@ void cv::getRectSubPix( InputArray _image, Size patchSize, Point2f center, IppiPoint_32f icenter = {center.x, center.y}; IppiSize src_size={image.cols, image.rows}, win_size={patch.cols, patch.rows}; int srctype = image.type(); - ippiGetRectSubPixFunc ippfunc = + ippiGetRectSubPixFunc ippiCopySubpixIntersect = srctype == CV_8UC1 && ddepth == CV_8U ? (ippiGetRectSubPixFunc)ippiCopySubpixIntersect_8u_C1R : srctype == CV_8UC1 && ddepth == CV_32F ? (ippiGetRectSubPixFunc)ippiCopySubpixIntersect_8u32f_C1R : srctype == CV_32FC1 && ddepth == CV_32F ? (ippiGetRectSubPixFunc)ippiCopySubpixIntersect_32f_C1R : 0; - if( ippfunc) + if( ippiCopySubpixIntersect) { - if (ippfunc(image.ptr(), (int)image.step, src_size, patch.ptr(), - (int)patch.step, win_size, icenter, &minpt, &maxpt) >= 0 ) + if (CV_INSTRUMENT_FUN_IPP(ippiCopySubpixIntersect, image.ptr(), (int)image.step, src_size, patch.ptr(), + (int)patch.step, win_size, icenter, &minpt, &maxpt) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; diff --git a/modules/imgproc/src/segmentation.cpp b/modules/imgproc/src/segmentation.cpp index 124aecdb2e..b803770f12 100644 --- a/modules/imgproc/src/segmentation.cpp +++ b/modules/imgproc/src/segmentation.cpp @@ -87,6 +87,8 @@ allocWSNodes( std::vector& storage ) void cv::watershed( InputArray _src, InputOutputArray _markers ) { + CV_INSTRUMENT_REGION() + // Labels for pixels const int IN_QUEUE = -2; // Pixel visited const int WSHED = -1; // Pixel belongs to watershed @@ -332,6 +334,8 @@ void cv::pyrMeanShiftFiltering( InputArray _src, OutputArray _dst, double sp0, double sr, int max_level, TermCriteria termcrit ) { + CV_INSTRUMENT_REGION() + Mat src0 = _src.getMat(); if( src0.empty() ) diff --git a/modules/imgproc/src/shapedescr.cpp b/modules/imgproc/src/shapedescr.cpp index 294f4fa492..56186bb404 100644 --- a/modules/imgproc/src/shapedescr.cpp +++ b/modules/imgproc/src/shapedescr.cpp @@ -206,6 +206,8 @@ static void findMinEnclosingCircle(const PT *pts, int count, Point2f ¢er, fl // see Welzl, Emo. Smallest enclosing disks (balls and ellipsoids). Springer Berlin Heidelberg, 1991. void cv::minEnclosingCircle( InputArray _points, Point2f& _center, float& _radius ) { + CV_INSTRUMENT_REGION() + Mat points = _points.getMat(); int count = points.checkVector(2); int depth = points.depth(); @@ -275,6 +277,8 @@ void cv::minEnclosingCircle( InputArray _points, Point2f& _center, float& _radiu // calculates length of a curve (e.g. contour perimeter) double cv::arcLength( InputArray _curve, bool is_closed ) { + CV_INSTRUMENT_REGION() + Mat curve = _curve.getMat(); int count = curve.checkVector(2); int depth = curve.depth(); @@ -308,6 +312,8 @@ double cv::arcLength( InputArray _curve, bool is_closed ) // area of a whole sequence double cv::contourArea( InputArray _contour, bool oriented ) { + CV_INSTRUMENT_REGION() + Mat contour = _contour.getMat(); int npoints = contour.checkVector(2); int depth = contour.depth(); @@ -339,6 +345,8 @@ double cv::contourArea( InputArray _contour, bool oriented ) cv::RotatedRect cv::fitEllipse( InputArray _points ) { + CV_INSTRUMENT_REGION() + Mat points = _points.getMat(); int i, n = points.checkVector(2); int depth = points.depth(); @@ -668,6 +676,8 @@ static Rect maskBoundingRect( const Mat& img ) cv::Rect cv::boundingRect(InputArray array) { + CV_INSTRUMENT_REGION() + Mat m = array.getMat(); return m.depth() <= CV_8U ? maskBoundingRect(m) : pointSetBoundingRect(m); } diff --git a/modules/imgproc/src/smooth.cpp b/modules/imgproc/src/smooth.cpp index b5a037ec2d..7772fc763a 100644 --- a/modules/imgproc/src/smooth.cpp +++ b/modules/imgproc/src/smooth.cpp @@ -86,18 +86,93 @@ struct RowSum : int i = 0, k, ksz_cn = ksize*cn; width = (width - 1)*cn; - for( k = 0; k < cn; k++, S++, D++ ) + if( ksize == 3 ) { - ST s = 0; - for( i = 0; i < ksz_cn; i += cn ) - s += S[i]; - D[0] = s; - for( i = 0; i < width; i += cn ) + for( i = 0; i < width + cn; i++ ) { - s += S[i + ksz_cn] - S[i]; - D[i+cn] = s; + D[i] = (ST)(S[i] + S[i+cn] + S[i+cn*2]); } } + else if( ksize == 5 ) + { + for( i = 0; i < width + cn; i++ ) + { + D[i] = (ST)(S[i] + S[i+cn] + S[i+cn*2] + S[i + cn*3] + S[i + cn*4]); + } + } + else if( cn == 1 ) + { + ST s = 0; + for( i = 0; i < ksz_cn; i++ ) + s += S[i]; + D[0] = s; + for( i = 0; i < width; i++ ) + { + s += S[i + ksz_cn] - S[i]; + D[i+1] = s; + } + } + else if( cn == 3 ) + { + ST s0 = 0, s1 = 0, s2 = 0; + for( i = 0; i < ksz_cn; i += 3 ) + { + s0 += S[i]; + s1 += S[i+1]; + s2 += S[i+2]; + } + D[0] = s0; + D[1] = s1; + D[2] = s2; + for( i = 0; i < width; i += 3 ) + { + s0 += S[i + ksz_cn] - S[i]; + s1 += S[i + ksz_cn + 1] - S[i + 1]; + s2 += S[i + ksz_cn + 2] - S[i + 2]; + D[i+3] = s0; + D[i+4] = s1; + D[i+5] = s2; + } + } + else if( cn == 4 ) + { + ST s0 = 0, s1 = 0, s2 = 0, s3 = 0; + for( i = 0; i < ksz_cn; i += 4 ) + { + s0 += S[i]; + s1 += S[i+1]; + s2 += S[i+2]; + s3 += S[i+3]; + } + D[0] = s0; + D[1] = s1; + D[2] = s2; + D[3] = s3; + for( i = 0; i < width; i += 4 ) + { + s0 += S[i + ksz_cn] - S[i]; + s1 += S[i + ksz_cn + 1] - S[i + 1]; + s2 += S[i + ksz_cn + 2] - S[i + 2]; + s3 += S[i + ksz_cn + 3] - S[i + 3]; + D[i+4] = s0; + D[i+5] = s1; + D[i+6] = s2; + D[i+7] = s3; + } + } + else + for( k = 0; k < cn; k++, S++, D++ ) + { + ST s = 0; + for( i = 0; i < ksz_cn; i += cn ) + s += S[i]; + D[0] = s; + for( i = 0; i < width; i += cn ) + { + s += S[i + ksz_cn] - S[i]; + D[i+cn] = s; + } + } } }; @@ -138,13 +213,8 @@ struct ColumnSum : for( ; sumCount < ksize - 1; sumCount++, src++ ) { const ST* Sp = (const ST*)src[0]; - for( i = 0; i <= width - 2; i += 2 ) - { - ST s0 = SUM[i] + Sp[i], s1 = SUM[i+1] + Sp[i+1]; - SUM[i] = s0; SUM[i+1] = s1; - } - for( ; i < width; i++ ) + for( i = 0; i < width; i++ ) SUM[i] += Sp[i]; } } @@ -391,6 +461,151 @@ struct ColumnSum : std::vector sum; }; + +template<> +struct ColumnSum : +public BaseColumnFilter +{ + ColumnSum( int _ksize, int _anchor, double _scale ) : + BaseColumnFilter() + { + ksize = _ksize; + anchor = _anchor; + scale = _scale; + sumCount = 0; + divDelta = 0; + divScale = 1; + if( scale != 1 ) + { + int d = cvRound(1./scale); + double scalef = (1 << 16)/d; + divScale = cvFloor(scalef); + scalef -= divScale; + divDelta = d/2; + if( scalef < 0.5 ) + divDelta++; + else + divScale++; + } + } + + virtual void reset() { sumCount = 0; } + + virtual void operator()(const uchar** src, uchar* dst, int dststep, int count, int width) + { + int i, ds = divScale, dd = divDelta; + ushort* SUM; + bool haveScale = scale != 1; + +#if CV_SSE2 + bool haveSSE2 = checkHardwareSupport(CV_CPU_SSE2); +#elif CV_NEON + bool haveNEON = checkHardwareSupport(CV_CPU_NEON); +#endif + + if( width != (int)sum.size() ) + { + sum.resize(width); + sumCount = 0; + } + + SUM = &sum[0]; + if( sumCount == 0 ) + { + memset((void*)SUM, 0, width*sizeof(SUM[0])); + for( ; sumCount < ksize - 1; sumCount++, src++ ) + { + const ushort* Sp = (const ushort*)src[0]; + i = 0; +#if CV_SSE2 + if(haveSSE2) + { + for( ; i <= width-8; i+=8 ) + { + __m128i _sum = _mm_loadu_si128((const __m128i*)(SUM+i)); + __m128i _sp = _mm_loadu_si128((const __m128i*)(Sp+i)); + _mm_storeu_si128((__m128i*)(SUM+i),_mm_add_epi16(_sum, _sp)); + } + } +#elif CV_NEON + if(haveNEON) + { + for( ; i <= width - 8; i+=8 ) + vst1q_u16(SUM + i, vaddq_u16(vld1q_u16(SUM + i), vld1q_u16(Sp + i))); + } +#endif + for( ; i < width; i++ ) + SUM[i] += Sp[i]; + } + } + else + { + CV_Assert( sumCount == ksize-1 ); + src += ksize-1; + } + + for( ; count--; src++ ) + { + const ushort* Sp = (const ushort*)src[0]; + const ushort* Sm = (const ushort*)src[1-ksize]; + uchar* D = (uchar*)dst; + if( haveScale ) + { + i = 0; + #if CV_SSE2 + if(haveSSE2) + { + __m128i ds8 = _mm_set1_epi16((short)ds); + __m128i dd8 = _mm_set1_epi16((short)dd); + + for( ; i <= width-16; i+=16 ) + { + __m128i _sm0 = _mm_loadu_si128((const __m128i*)(Sm+i)); + __m128i _sm1 = _mm_loadu_si128((const __m128i*)(Sm+i+8)); + + __m128i _s0 = _mm_add_epi16(_mm_loadu_si128((const __m128i*)(SUM+i)), + _mm_loadu_si128((const __m128i*)(Sp+i))); + __m128i _s1 = _mm_add_epi16(_mm_loadu_si128((const __m128i*)(SUM+i+8)), + _mm_loadu_si128((const __m128i*)(Sp+i+8))); + __m128i _s2 = _mm_mulhi_epu16(_mm_adds_epu16(_s0, dd8), ds8); + __m128i _s3 = _mm_mulhi_epu16(_mm_adds_epu16(_s1, dd8), ds8); + _s0 = _mm_sub_epi16(_s0, _sm0); + _s1 = _mm_sub_epi16(_s1, _sm1); + _mm_storeu_si128((__m128i*)(D+i), _mm_packus_epi16(_s2, _s3)); + _mm_storeu_si128((__m128i*)(SUM+i), _s0); + _mm_storeu_si128((__m128i*)(SUM+i+8), _s1); + } + } + #endif + for( ; i < width; i++ ) + { + int s0 = SUM[i] + Sp[i]; + D[i] = (uchar)((s0 + dd)*ds >> 16); + SUM[i] = (ushort)(s0 - Sm[i]); + } + } + else + { + i = 0; + for( ; i < width; i++ ) + { + int s0 = SUM[i] + Sp[i]; + D[i] = saturate_cast(s0); + SUM[i] = (ushort)(s0 - Sm[i]); + } + } + dst += dststep; + } + } + + double scale; + int sumCount; + int divDelta; + int divScale; + std::vector sum; +}; + + template<> struct ColumnSum : public BaseColumnFilter @@ -1276,6 +1491,8 @@ cv::Ptr cv::getRowSumFilter(int srcType, int sumType, int ksi if( sdepth == CV_8U && ddepth == CV_32S ) return makePtr >(ksize, anchor); + if( sdepth == CV_8U && ddepth == CV_16U ) + return makePtr >(ksize, anchor); if( sdepth == CV_8U && ddepth == CV_64F ) return makePtr >(ksize, anchor); if( sdepth == CV_16U && ddepth == CV_32S ) @@ -1312,6 +1529,8 @@ cv::Ptr cv::getColumnSumFilter(int sumType, int dstType, i if( ddepth == CV_8U && sdepth == CV_32S ) return makePtr >(ksize, anchor, scale); + if( ddepth == CV_8U && sdepth == CV_16U ) + return makePtr >(ksize, anchor, scale); if( ddepth == CV_8U && sdepth == CV_64F ) return makePtr >(ksize, anchor, scale); if( ddepth == CV_16U && sdepth == CV_32S ) @@ -1346,7 +1565,10 @@ cv::Ptr cv::createBoxFilter( int srcType, int dstType, Size ks { int sdepth = CV_MAT_DEPTH(srcType); int cn = CV_MAT_CN(srcType), sumType = CV_64F; - if( sdepth <= CV_32S && (!normalize || + if( sdepth == CV_8U && CV_MAT_DEPTH(dstType) == CV_8U && + ksize.width*ksize.height <= 256 ) + sumType = CV_16U; + else if( sdepth <= CV_32S && (!normalize || ksize.width*ksize.height <= (sdepth == CV_8U ? (1<<23) : sdepth == CV_16U ? (1 << 15) : (1 << 16))) ) sumType = CV_32S; @@ -1360,13 +1582,16 @@ cv::Ptr cv::createBoxFilter( int srcType, int dstType, Size ks srcType, dstType, sumType, borderType ); } -#if defined(HAVE_IPP) +// TODO: IPP performance regression +#if defined(HAVE_IPP) && IPP_DISABLE_BLOCK namespace cv { static bool ipp_boxfilter( InputArray _src, OutputArray _dst, int ddepth, Size ksize, Point anchor, bool normalize, int borderType ) { + CV_INSTRUMENT_REGION_IPP() + int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), cn = CV_MAT_CN(stype); if( ddepth < 0 ) ddepth = sdepth; @@ -1405,7 +1630,7 @@ static bool ipp_boxfilter( InputArray _src, OutputArray _dst, int ddepth, Ipp8u * buffer = ippsMalloc_8u(bufSize); \ ippType borderValue[4] = { 0, 0, 0, 0 }; \ ippBorderType = ippBorderType == BORDER_CONSTANT ? ippBorderConst : ippBorderRepl; \ - IppStatus status = ippiFilterBoxBorder_##flavor(src.ptr(), (int)src.step, dst.ptr(), \ + IppStatus status = CV_INSTRUMENT_FUN_IPP(ippiFilterBoxBorder_##flavor, src.ptr(), (int)src.step, dst.ptr(), \ (int)dst.step, roiSize, maskSize, \ (IppiBorderType)ippBorderType, borderValue, buffer); \ ippsFree(buffer); \ @@ -1459,6 +1684,8 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth, Size ksize, Point anchor, bool normalize, int borderType ) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(_dst.isUMat(), ocl_boxFilter(_src, _dst, ddepth, ksize, anchor, borderType, normalize)) Mat src = _src.getMat(); @@ -1479,9 +1706,8 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth, return; #endif -#ifdef HAVE_IPP +#if defined HAVE_IPP && IPP_DISABLE_BLOCK int ippBorderType = borderType & ~BORDER_ISOLATED; -#endif Point ocvAnchor, ippAnchor; ocvAnchor.x = anchor.x < 0 ? ksize.width / 2 : anchor.x; ocvAnchor.y = anchor.y < 0 ? ksize.height / 2 : anchor.y; @@ -1492,7 +1718,7 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth, ippBorderType == BORDER_CONSTANT) && ocvAnchor == ippAnchor && _dst.cols() != ksize.width && _dst.rows() != ksize.height), ipp_boxfilter( _src, _dst, ddepth, ksize, anchor, normalize, borderType)); - +#endif Ptr f = createBoxFilter( src.type(), dst.type(), ksize, anchor, normalize, borderType ); @@ -1507,6 +1733,8 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth, void cv::blur( InputArray src, OutputArray dst, Size ksize, Point anchor, int borderType ) { + CV_INSTRUMENT_REGION() + boxFilter( src, dst, -1, ksize, anchor, true, borderType ); } @@ -1589,6 +1817,8 @@ void cv::sqrBoxFilter( InputArray _src, OutputArray _dst, int ddepth, Size ksize, Point anchor, bool normalize, int borderType ) { + CV_INSTRUMENT_REGION() + int srcType = _src.type(), sdepth = CV_MAT_DEPTH(srcType), cn = CV_MAT_CN(srcType); Size size = _src.size(); @@ -1733,7 +1963,12 @@ static bool ipp_GaussianBlur( InputArray _src, OutputArray _dst, Size ksize, double sigma1, double sigma2, int borderType ) { + CV_INSTRUMENT_REGION_IPP() + #if IPP_VERSION_X100 >= 810 + if ((borderType & BORDER_ISOLATED) == 0 && _src.isSubmatrix()) + return false; + int type = _src.type(); Size size = _src.size(); @@ -1768,19 +2003,18 @@ static bool ipp_GaussianBlur( InputArray _src, OutputArray _dst, Size ksize, #define IPP_FILTER_GAUSS_C1(ippfavor) \ { \ Ipp##ippfavor borderValues = 0; \ - status = ippiFilterGaussianBorder_##ippfavor##_C1R(src.ptr(), (int)src.step, \ + status = CV_INSTRUMENT_FUN_IPP(ippiFilterGaussianBorder_##ippfavor##_C1R, src.ptr(), (int)src.step, \ dst.ptr(), (int)dst.step, roiSize, borderValues, spec, buffer); \ } #define IPP_FILTER_GAUSS_CN(ippfavor, ippcn) \ { \ Ipp##ippfavor borderValues[] = { 0, 0, 0 }; \ - status = ippiFilterGaussianBorder_##ippfavor##_C##ippcn##R(src.ptr(), (int)src.step, \ + status = CV_INSTRUMENT_FUN_IPP(ippiFilterGaussianBorder_##ippfavor##_C##ippcn##R, src.ptr(), (int)src.step, \ dst.ptr(), (int)dst.step, roiSize, borderValues, spec, buffer); \ } IppStatus status = ippStsErr; -#if !HAVE_ICV #if IPP_VERSION_X100 > 900 // Buffer overflow may happen in IPP 9.0.0 and less if (type == CV_8UC1) IPP_FILTER_GAUSS_C1(8u) @@ -1798,9 +2032,7 @@ static bool ipp_GaussianBlur( InputArray _src, OutputArray _dst, Size ksize, IPP_FILTER_GAUSS_CN(16s, 3) else if (type == CV_32FC3) IPP_FILTER_GAUSS_CN(32f, 3) - else -#endif - if (type == CV_32FC1) + else if (type == CV_32FC1) IPP_FILTER_GAUSS_C1(32f) if(status >= 0) @@ -1825,6 +2057,8 @@ void cv::GaussianBlur( InputArray _src, OutputArray _dst, Size ksize, double sigma1, double sigma2, int borderType ) { + CV_INSTRUMENT_REGION() + int type = _src.type(); Size size = _src.size(); _dst.create( size, type ); @@ -1850,7 +2084,7 @@ void cv::GaussianBlur( InputArray _src, OutputArray _dst, Size ksize, return; #endif - CV_IPP_RUN(true, ipp_GaussianBlur( _src, _dst, ksize, sigma1, sigma2, borderType)); + CV_IPP_RUN(!(ocl::useOpenCL() && _dst.isUMat()), ipp_GaussianBlur( _src, _dst, ksize, sigma1, sigma2, borderType)); Mat kx, ky; createGaussianKernels(kx, ky, type, ksize, sigma1, sigma2); @@ -2768,6 +3002,8 @@ namespace cv { static bool ipp_medianFilter( InputArray _src0, OutputArray _dst, int ksize ) { + CV_INSTRUMENT_REGION_IPP() + #if IPP_VERSION_X100 >= 810 Mat src0 = _src0.getMat(); _dst.create( src0.size(), src0.type() ); @@ -2780,7 +3016,7 @@ static bool ipp_medianFilter( InputArray _src0, OutputArray _dst, int ksize ) ippDataType, CV_MAT_CN(type), &bufSize) >= 0) \ { \ Ipp8u * buffer = ippsMalloc_8u(bufSize); \ - IppStatus status = ippiFilterMedianBorder_##flavor(src.ptr(), (int)src.step, \ + IppStatus status = CV_INSTRUMENT_FUN_IPP(ippiFilterMedianBorder_##flavor, src.ptr(), (int)src.step, \ dst.ptr(), (int)dst.step, dstRoiSize, maskSize, \ ippBorderRepl, (ippType)0, buffer); \ ippsFree(buffer); \ @@ -2824,6 +3060,8 @@ static bool ipp_medianFilter( InputArray _src0, OutputArray _dst, int ksize ) void cv::medianBlur( InputArray _src0, OutputArray _dst, int ksize ) { + CV_INSTRUMENT_REGION() + CV_Assert( (ksize % 2 == 1) && (_src0.dims() <= 2 )); if( ksize <= 1 ) @@ -3057,7 +3295,7 @@ private: float *space_weight, *color_weight; }; -#if defined (HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) && IPP_DISABLE_BLOCK +#if defined (HAVE_IPP) && IPP_DISABLE_BLOCK class IPPBilateralFilter_8u_Invoker : public ParallelLoopBody { @@ -3070,6 +3308,8 @@ public: virtual void operator() (const Range& range) const { + CV_INSTRUMENT_REGION_IPP() + int d = radius * 2 + 1; IppiSize kernel = {d, d}; IppiSize roi={dst.cols, range.end - range.start}; @@ -3665,6 +3905,8 @@ void cv::bilateralFilter( InputArray _src, OutputArray _dst, int d, double sigmaColor, double sigmaSpace, int borderType ) { + CV_INSTRUMENT_REGION() + _dst.create( _src.size(), _src.type() ); CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(), diff --git a/modules/imgproc/src/spatialgradient.cpp b/modules/imgproc/src/spatialgradient.cpp index 411c29947f..ecf52f9ce1 100644 --- a/modules/imgproc/src/spatialgradient.cpp +++ b/modules/imgproc/src/spatialgradient.cpp @@ -78,6 +78,7 @@ static inline void spatialGradientKernel( T& vx, T& vy, void spatialGradient( InputArray _src, OutputArray _dx, OutputArray _dy, int ksize, int borderType ) { + CV_INSTRUMENT_REGION() // Prepare InputArray src Mat src = _src.getMat(); diff --git a/modules/imgproc/src/subdivision2d.cpp b/modules/imgproc/src/subdivision2d.cpp index d849d2aa10..5917dbd51f 100644 --- a/modules/imgproc/src/subdivision2d.cpp +++ b/modules/imgproc/src/subdivision2d.cpp @@ -275,6 +275,8 @@ void Subdiv2D::deletePoint(int vidx) int Subdiv2D::locate(Point2f pt, int& _edge, int& _vertex) { + CV_INSTRUMENT_REGION() + int vertex = 0; int i, maxEdges = (int)(qedges.size() * 4); @@ -409,6 +411,8 @@ isPtInCircle3( Point2f pt, Point2f a, Point2f b, Point2f c) int Subdiv2D::insert(Point2f pt) { + CV_INSTRUMENT_REGION() + int curr_point = 0, curr_edge = 0, deleted_edge = 0; int location = locate( pt, curr_edge, curr_point ); @@ -479,12 +483,16 @@ int Subdiv2D::insert(Point2f pt) void Subdiv2D::insert(const std::vector& ptvec) { + CV_INSTRUMENT_REGION() + for( size_t i = 0; i < ptvec.size(); i++ ) insert(ptvec[i]); } void Subdiv2D::initDelaunay( Rect rect ) { + CV_INSTRUMENT_REGION() + float big_coord = 3.f * MAX( rect.width, rect.height ); float rx = (float)rect.x; float ry = (float)rect.y; @@ -644,6 +652,8 @@ isRightOf2( const Point2f& pt, const Point2f& org, const Point2f& diff ) int Subdiv2D::findNearest(Point2f pt, Point2f* nearestPt) { + CV_INSTRUMENT_REGION() + if( !validGeometry ) calcVoronoi(); diff --git a/modules/imgproc/src/sumpixels.cpp b/modules/imgproc/src/sumpixels.cpp index 7771d2cab4..d998a7ab05 100755 --- a/modules/imgproc/src/sumpixels.cpp +++ b/modules/imgproc/src/sumpixels.cpp @@ -425,7 +425,9 @@ namespace cv { static bool ipp_integral(InputArray _src, OutputArray _sum, OutputArray _sqsum, OutputArray _tilted, int sdepth, int sqdepth) { -#if !defined(HAVE_IPP_ICV_ONLY) && (IPP_VERSION_X100 != 900) // Disabled on ICV due invalid results + CV_INSTRUMENT_REGION_IPP() + +#if IPP_VERSION_X100 != 900 // Disabled on ICV due invalid results int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type); if( sdepth <= 0 ) sdepth = depth == CV_8U ? CV_32S : CV_64F; @@ -452,22 +454,22 @@ static bool ipp_integral(InputArray _src, OutputArray _sum, OutputArray _sqsum, { if( _sqsum.needed() ) { - status = ippiSqrIntegral_8u32f64f_C1R( (const Ipp8u*)src.data, (int)src.step, (Ipp32f*)sum.data, (int)sum.step, (Ipp64f*)sqsum.data, (int)sqsum.step, srcRoiSize, 0, 0 ); + status = CV_INSTRUMENT_FUN_IPP(ippiSqrIntegral_8u32f64f_C1R, (const Ipp8u*)src.data, (int)src.step, (Ipp32f*)sum.data, (int)sum.step, (Ipp64f*)sqsum.data, (int)sqsum.step, srcRoiSize, 0, 0); } else { - status = ippiIntegral_8u32f_C1R( (const Ipp8u*)src.data, (int)src.step, (Ipp32f*)sum.data, (int)sum.step, srcRoiSize, 0 ); + status = CV_INSTRUMENT_FUN_IPP(ippiIntegral_8u32f_C1R, (const Ipp8u*)src.data, (int)src.step, (Ipp32f*)sum.data, (int)sum.step, srcRoiSize, 0); } } else if( sdepth == CV_32S ) { if( _sqsum.needed() ) { - status = ippiSqrIntegral_8u32s64f_C1R( (const Ipp8u*)src.data, (int)src.step, (Ipp32s*)sum.data, (int)sum.step, (Ipp64f*)sqsum.data, (int)sqsum.step, srcRoiSize, 0, 0 ); + status = CV_INSTRUMENT_FUN_IPP(ippiSqrIntegral_8u32s64f_C1R, (const Ipp8u*)src.data, (int)src.step, (Ipp32s*)sum.data, (int)sum.step, (Ipp64f*)sqsum.data, (int)sqsum.step, srcRoiSize, 0, 0); } else { - status = ippiIntegral_8u32s_C1R( (const Ipp8u*)src.data, (int)src.step, (Ipp32s*)sum.data, (int)sum.step, srcRoiSize, 0 ); + status = CV_INSTRUMENT_FUN_IPP(ippiIntegral_8u32s_C1R, (const Ipp8u*)src.data, (int)src.step, (Ipp32s*)sum.data, (int)sum.step, srcRoiSize, 0); } } if (0 <= status) @@ -486,6 +488,8 @@ static bool ipp_integral(InputArray _src, OutputArray _sum, OutputArray _sqsum, void cv::integral( InputArray _src, OutputArray _sum, OutputArray _sqsum, OutputArray _tilted, int sdepth, int sqdepth ) { + CV_INSTRUMENT_REGION() + int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type); if( sdepth <= 0 ) sdepth = depth == CV_8U ? CV_32S : CV_64F; @@ -559,11 +563,15 @@ void cv::integral( InputArray _src, OutputArray _sum, OutputArray _sqsum, Output void cv::integral( InputArray src, OutputArray sum, int sdepth ) { + CV_INSTRUMENT_REGION() + integral( src, sum, noArray(), noArray(), sdepth ); } void cv::integral( InputArray src, OutputArray sum, OutputArray sqsum, int sdepth, int sqdepth ) { + CV_INSTRUMENT_REGION() + integral( src, sum, sqsum, noArray(), sdepth, sqdepth ); } diff --git a/modules/imgproc/src/templmatch.cpp b/modules/imgproc/src/templmatch.cpp index 019c41f33b..5bae692dc7 100644 --- a/modules/imgproc/src/templmatch.cpp +++ b/modules/imgproc/src/templmatch.cpp @@ -566,6 +566,8 @@ typedef IppStatus (CV_STDCALL * ippimatchTemplate)(const void*, int, IppiSize, c static bool ipp_crossCorr(const Mat& src, const Mat& tpl, Mat& dst) { + CV_INSTRUMENT_REGION_IPP() + IppStatus status; IppiSize srcRoiSize = {src.cols,src.rows}; @@ -576,11 +578,11 @@ static bool ipp_crossCorr(const Mat& src, const Mat& tpl, Mat& dst) int depth = src.depth(); - ippimatchTemplate ippFunc = + ippimatchTemplate ippiCrossCorrNorm = depth==CV_8U ? (ippimatchTemplate)ippiCrossCorrNorm_8u32f_C1R: depth==CV_32F? (ippimatchTemplate)ippiCrossCorrNorm_32f_C1R: 0; - if (ippFunc==0) + if (ippiCrossCorrNorm==0) return false; IppEnum funCfg = (IppEnum)(ippAlgAuto | ippiNormNone | ippiROIValid); @@ -591,7 +593,7 @@ static bool ipp_crossCorr(const Mat& src, const Mat& tpl, Mat& dst) pBuffer = ippsMalloc_8u( bufSize ); - status = ippFunc(src.ptr(), (int)src.step, srcRoiSize, tpl.ptr(), (int)tpl.step, tplRoiSize, dst.ptr(), (int)dst.step, funCfg, pBuffer); + status = CV_INSTRUMENT_FUN_IPP(ippiCrossCorrNorm, src.ptr(), (int)src.step, srcRoiSize, tpl.ptr(), (int)tpl.step, tplRoiSize, dst.ptr(), (int)dst.step, funCfg, pBuffer); ippsFree( pBuffer ); return status >= 0; @@ -599,6 +601,8 @@ static bool ipp_crossCorr(const Mat& src, const Mat& tpl, Mat& dst) static bool ipp_sqrDistance(const Mat& src, const Mat& tpl, Mat& dst) { + CV_INSTRUMENT_REGION_IPP() + IppStatus status; IppiSize srcRoiSize = {src.cols,src.rows}; @@ -609,11 +613,11 @@ static bool ipp_sqrDistance(const Mat& src, const Mat& tpl, Mat& dst) int depth = src.depth(); - ippimatchTemplate ippFunc = + ippimatchTemplate ippiSqrDistanceNorm = depth==CV_8U ? (ippimatchTemplate)ippiSqrDistanceNorm_8u32f_C1R: depth==CV_32F? (ippimatchTemplate)ippiSqrDistanceNorm_32f_C1R: 0; - if (ippFunc==0) + if (ippiSqrDistanceNorm==0) return false; IppEnum funCfg = (IppEnum)(ippAlgAuto | ippiNormNone | ippiROIValid); @@ -624,7 +628,7 @@ static bool ipp_sqrDistance(const Mat& src, const Mat& tpl, Mat& dst) pBuffer = ippsMalloc_8u( bufSize ); - status = ippFunc(src.ptr(), (int)src.step, srcRoiSize, tpl.ptr(), (int)tpl.step, tplRoiSize, dst.ptr(), (int)dst.step, funCfg, pBuffer); + status = CV_INSTRUMENT_FUN_IPP(ippiSqrDistanceNorm, src.ptr(), (int)src.step, srcRoiSize, tpl.ptr(), (int)tpl.step, tplRoiSize, dst.ptr(), (int)dst.step, funCfg, pBuffer); ippsFree( pBuffer ); return status >= 0; @@ -1041,6 +1045,8 @@ namespace cv { static bool ipp_matchTemplate( Mat& img, Mat& templ, Mat& result, int method, int cn ) { + CV_INSTRUMENT_REGION_IPP() + bool useIppMT = (templ.rows < img.rows/2 && templ.cols < img.cols/2); if(cn == 1 && useIppMT) @@ -1069,6 +1075,8 @@ static bool ipp_matchTemplate( Mat& img, Mat& templ, Mat& result, int method, in void cv::matchTemplate( InputArray _img, InputArray _templ, OutputArray _result, int method, InputArray _mask ) { + CV_INSTRUMENT_REGION() + if (!_mask.empty()) { cv::matchTemplateMask(_img, _templ, _result, method, _mask); diff --git a/modules/imgproc/src/thresh.cpp b/modules/imgproc/src/thresh.cpp index 804e7616c7..e88d06a6c7 100644 --- a/modules/imgproc/src/thresh.cpp +++ b/modules/imgproc/src/thresh.cpp @@ -91,14 +91,12 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type ) switch( type ) { case THRESH_TRUNC: -#ifndef HAVE_IPP_ICV_ONLY - if (_src.data == _dst.data && ippiThreshold_GT_8u_C1IR(_dst.ptr(), (int)dst_step, sz, thresh) >= 0) + if (_src.data == _dst.data && CV_INSTRUMENT_FUN_IPP(ippiThreshold_GT_8u_C1IR, _dst.ptr(), (int)dst_step, sz, thresh) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; } -#endif - if (ippiThreshold_GT_8u_C1R(_src.ptr(), (int)src_step, _dst.ptr(), (int)dst_step, sz, thresh) >= 0) + if (CV_INSTRUMENT_FUN_IPP(ippiThreshold_GT_8u_C1R, _src.ptr(), (int)src_step, _dst.ptr(), (int)dst_step, sz, thresh) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; @@ -106,14 +104,12 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type ) setIppErrorStatus(); break; case THRESH_TOZERO: -#ifndef HAVE_IPP_ICV_ONLY - if (_src.data == _dst.data && ippiThreshold_LTVal_8u_C1IR(_dst.ptr(), (int)dst_step, sz, thresh+1, 0) >= 0) + if (_src.data == _dst.data && CV_INSTRUMENT_FUN_IPP(ippiThreshold_LTVal_8u_C1IR, _dst.ptr(), (int)dst_step, sz, thresh+1, 0) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; } -#endif - if (ippiThreshold_LTVal_8u_C1R(_src.ptr(), (int)src_step, _dst.ptr(), (int)dst_step, sz, thresh+1, 0) >= 0) + if (CV_INSTRUMENT_FUN_IPP(ippiThreshold_LTVal_8u_C1R, _src.ptr(), (int)src_step, _dst.ptr(), (int)dst_step, sz, thresh + 1, 0) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; @@ -121,14 +117,12 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type ) setIppErrorStatus(); break; case THRESH_TOZERO_INV: -#ifndef HAVE_IPP_ICV_ONLY - if (_src.data == _dst.data && ippiThreshold_GTVal_8u_C1IR(_dst.ptr(), (int)dst_step, sz, thresh, 0) >= 0) + if (_src.data == _dst.data && CV_INSTRUMENT_FUN_IPP(ippiThreshold_GTVal_8u_C1IR, _dst.ptr(), (int)dst_step, sz, thresh, 0) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; } -#endif - if (ippiThreshold_GTVal_8u_C1R(_src.ptr(), (int)src_step, _dst.ptr(), (int)dst_step, sz, thresh, 0) >= 0) + if (CV_INSTRUMENT_FUN_IPP(ippiThreshold_GTVal_8u_C1R, _src.ptr(), (int)src_step, _dst.ptr(), (int)dst_step, sz, thresh, 0) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; @@ -434,14 +428,12 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type ) switch( type ) { case THRESH_TRUNC: -#ifndef HAVE_IPP_ICV_ONLY - if (_src.data == _dst.data && ippiThreshold_GT_16s_C1IR(dst, (int)dst_step*sizeof(dst[0]), sz, thresh) >= 0) + if (_src.data == _dst.data && CV_INSTRUMENT_FUN_IPP(ippiThreshold_GT_16s_C1IR, dst, (int)dst_step*sizeof(dst[0]), sz, thresh) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; } -#endif - if (ippiThreshold_GT_16s_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh) >= 0) + if (CV_INSTRUMENT_FUN_IPP(ippiThreshold_GT_16s_C1R, src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; @@ -449,14 +441,12 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type ) setIppErrorStatus(); break; case THRESH_TOZERO: -#ifndef HAVE_IPP_ICV_ONLY - if (_src.data == _dst.data && ippiThreshold_LTVal_16s_C1IR(dst, (int)dst_step*sizeof(dst[0]), sz, thresh + 1, 0) >= 0) + if (_src.data == _dst.data && CV_INSTRUMENT_FUN_IPP(ippiThreshold_LTVal_16s_C1IR, dst, (int)dst_step*sizeof(dst[0]), sz, thresh + 1, 0) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; } -#endif - if (ippiThreshold_LTVal_16s_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh+1, 0) >= 0) + if (CV_INSTRUMENT_FUN_IPP(ippiThreshold_LTVal_16s_C1R, src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh + 1, 0) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; @@ -464,14 +454,12 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type ) setIppErrorStatus(); break; case THRESH_TOZERO_INV: -#ifndef HAVE_IPP_ICV_ONLY - if (_src.data == _dst.data && ippiThreshold_GTVal_16s_C1IR(dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0) >= 0) + if (_src.data == _dst.data && CV_INSTRUMENT_FUN_IPP(ippiThreshold_GTVal_16s_C1IR, dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; } -#endif - if (ippiThreshold_GTVal_16s_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0) >= 0) + if (CV_INSTRUMENT_FUN_IPP(ippiThreshold_GTVal_16s_C1R, src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0) >= 0) { CV_IMPL_ADD(CV_IMPL_IPP); return; @@ -701,7 +689,7 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type ) switch( type ) { case THRESH_TRUNC: - if (0 <= ippiThreshold_GT_32f_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh)) + if (0 <= CV_INSTRUMENT_FUN_IPP(ippiThreshold_GT_32f_C1R, src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh)) { CV_IMPL_ADD(CV_IMPL_IPP); return; @@ -709,7 +697,7 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type ) setIppErrorStatus(); break; case THRESH_TOZERO: - if (0 <= ippiThreshold_LTVal_32f_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh+FLT_EPSILON, 0)) + if (0 <= CV_INSTRUMENT_FUN_IPP(ippiThreshold_LTVal_32f_C1R, src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh + FLT_EPSILON, 0)) { CV_IMPL_ADD(CV_IMPL_IPP); return; @@ -717,7 +705,7 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type ) setIppErrorStatus(); break; case THRESH_TOZERO_INV: - if (0 <= ippiThreshold_GTVal_32f_C1R(src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0)) + if (0 <= CV_INSTRUMENT_FUN_IPP(ippiThreshold_GTVal_32f_C1R, src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0)) { CV_IMPL_ADD(CV_IMPL_IPP); return; @@ -1188,11 +1176,13 @@ thresh_64f(const Mat& _src, Mat& _dst, double thresh, double maxval, int type) #ifdef HAVE_IPP static bool ipp_getThreshVal_Otsu_8u( const unsigned char* _src, int step, Size size, unsigned char &thresh) { -#if IPP_VERSION_X100 >= 810 && !HAVE_ICV + CV_INSTRUMENT_REGION_IPP() + +#if IPP_VERSION_X100 >= 810 int ippStatus = -1; IppiSize srcSize = { size.width, size.height }; CV_SUPPRESS_DEPRECATED_START - ippStatus = ippiComputeThreshold_Otsu_8u_C1R(_src, step, srcSize, &thresh); + ippStatus = CV_INSTRUMENT_FUN_IPP(ippiComputeThreshold_Otsu_8u_C1R, _src, step, srcSize, &thresh); CV_SUPPRESS_DEPRECATED_END if(ippStatus >= 0) @@ -1218,7 +1208,7 @@ getThreshVal_Otsu_8u( const Mat& _src ) #ifdef HAVE_IPP unsigned char thresh; - CV_IPP_RUN(IPP_VERSION_X100 >= 810 && !HAVE_ICV, ipp_getThreshVal_Otsu_8u(_src.ptr(), step, size, thresh), thresh); + CV_IPP_RUN(IPP_VERSION_X100 >= 810, ipp_getThreshVal_Otsu_8u(_src.ptr(), step, size, thresh), thresh); #endif const int N = 256; @@ -1476,6 +1466,8 @@ static bool ocl_threshold( InputArray _src, OutputArray _dst, double & thresh, d double cv::threshold( InputArray _src, OutputArray _dst, double thresh, double maxval, int type ) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN_(_src.dims() <= 2 && _dst.isUMat(), ocl_threshold(_src, _dst, thresh, maxval, type), thresh) @@ -1569,6 +1561,8 @@ double cv::threshold( InputArray _src, OutputArray _dst, double thresh, double m void cv::adaptiveThreshold( InputArray _src, OutputArray _dst, double maxValue, int method, int type, int blockSize, double delta ) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); CV_Assert( src.type() == CV_8UC1 ); CV_Assert( blockSize % 2 == 1 && blockSize > 1 ); diff --git a/modules/imgproc/src/undistort.cpp b/modules/imgproc/src/undistort.cpp index 5e6cf05de4..198b0cbf9b 100644 --- a/modules/imgproc/src/undistort.cpp +++ b/modules/imgproc/src/undistort.cpp @@ -182,6 +182,8 @@ void cv::initUndistortRectifyMap( InputArray _cameraMatrix, InputArray _distCoef void cv::undistort( InputArray _src, OutputArray _dst, InputArray _cameraMatrix, InputArray _distCoeffs, InputArray _newCameraMatrix ) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(), cameraMatrix = _cameraMatrix.getMat(); Mat distCoeffs = _distCoeffs.getMat(), newCameraMatrix = _newCameraMatrix.getMat(); diff --git a/modules/imgproc/test/ocl/test_canny.cpp b/modules/imgproc/test/ocl/test_canny.cpp index f9c724b049..ca436a4f67 100644 --- a/modules/imgproc/test/ocl/test_canny.cpp +++ b/modules/imgproc/test/ocl/test_canny.cpp @@ -99,11 +99,7 @@ OCL_TEST_P(Canny, Accuracy) generateTestData(); const double low_thresh = 50.0, high_thresh = 100.0; - double eps = 1e-2; -#ifdef ANDROID - if (cv::ocl::Device::getDefault().isNVidia()) - eps = 12e-3; -#endif + double eps = 12e-3; OCL_OFF(cv::Canny(src_roi, dst_roi, low_thresh, high_thresh, aperture_size, useL2gradient)); OCL_ON(cv::Canny(usrc_roi, udst_roi, low_thresh, high_thresh, aperture_size, useL2gradient)); @@ -117,11 +113,7 @@ OCL_TEST_P(Canny, AccuracyCustomGradient) generateTestData(); const double low_thresh = 50.0, high_thresh = 100.0; - double eps = 1e-2; -#ifdef ANDROID - if (cv::ocl::Device::getDefault().isNVidia()) - eps = 12e-3; -#endif + double eps = 12e-3; OCL_OFF(cv::Canny(src_roi, dst_roi, low_thresh, high_thresh, aperture_size, useL2gradient)); OCL_ON( diff --git a/modules/imgproc/test/ocl/test_color.cpp b/modules/imgproc/test/ocl/test_color.cpp index 160c035345..c0218cca3f 100644 --- a/modules/imgproc/test/ocl/test_color.cpp +++ b/modules/imgproc/test/ocl/test_color.cpp @@ -98,7 +98,29 @@ PARAM_TEST_CASE(CvtColor, MatDepth, bool) OCL_OFF(cv::cvtColor(src_roi, dst_roi, code, channelsOut)); OCL_ON(cv::cvtColor(usrc_roi, udst_roi, code, channelsOut)); - Near(threshold); + int h_limit = 256; + switch (code) + { + case COLOR_RGB2HLS: case COLOR_BGR2HLS: + h_limit = 180; + case COLOR_RGB2HLS_FULL: case COLOR_BGR2HLS_FULL: + { + ASSERT_EQ(dst_roi.type(), udst_roi.type()); + ASSERT_EQ(dst_roi.size(), udst_roi.size()); + Mat gold, actual; + dst_roi.convertTo(gold, CV_32FC3); + udst_roi.getMat(ACCESS_READ).convertTo(actual, CV_32FC3); + Mat absdiff1, absdiff2, absdiff3; + cv::absdiff(gold, actual, absdiff1); + cv::absdiff(gold, actual + h_limit, absdiff2); + cv::absdiff(gold, actual - h_limit, absdiff3); + Mat diff = cv::min(cv::min(absdiff1, absdiff2), absdiff3); + EXPECT_LE(cvtest::norm(diff, NORM_INF), threshold); + break; + } + default: + Near(threshold); + } } } }; diff --git a/modules/imgproc/test/ocl/test_filters.cpp b/modules/imgproc/test/ocl/test_filters.cpp index 0c4564e5ac..f92cc785a1 100644 --- a/modules/imgproc/test/ocl/test_filters.cpp +++ b/modules/imgproc/test/ocl/test_filters.cpp @@ -225,7 +225,7 @@ OCL_TEST_P(GaussianBlurTest, Mat) OCL_OFF(cv::GaussianBlur(src_roi, dst_roi, Size(ksize, ksize), sigma1, sigma2, borderType)); OCL_ON(cv::GaussianBlur(usrc_roi, udst_roi, Size(ksize, ksize), sigma1, sigma2, borderType)); - Near(CV_MAT_DEPTH(type) >= CV_32F ? 7e-5 : 1, false); + Near(CV_MAT_DEPTH(type) >= CV_32F ? 1e-3 : 4, CV_MAT_DEPTH(type) >= CV_32F); } } diff --git a/modules/imgproc/test/test_connectedcomponents.cpp b/modules/imgproc/test/test_connectedcomponents.cpp index dd4d8339a0..d1c7b6a5fe 100644 --- a/modules/imgproc/test/test_connectedcomponents.cpp +++ b/modules/imgproc/test/test_connectedcomponents.cpp @@ -42,6 +42,7 @@ #include "test_precomp.hpp" #include +#include using namespace cv; using namespace std; @@ -58,49 +59,81 @@ protected: CV_ConnectedComponentsTest::CV_ConnectedComponentsTest() {} CV_ConnectedComponentsTest::~CV_ConnectedComponentsTest() {} +// This function force a row major order for the labels +void normalizeLabels(Mat1i& imgLabels, int iNumLabels) { + vector vecNewLabels(iNumLabels + 1, 0); + int iMaxNewLabel = 0; + + for (int r = 0; r0) { + if (vecNewLabels[iCurLabel] == 0) { + vecNewLabels[iCurLabel] = ++iMaxNewLabel; + } + imgLabels(r, c) = vecNewLabels[iCurLabel]; + } + } + } +} + + void CV_ConnectedComponentsTest::run( int /* start_from */) { + + int ccltype[] = { cv::CCL_WU, cv::CCL_DEFAULT, cv::CCL_GRANA }; + string exp_path = string(ts->get_data_path()) + "connectedcomponents/ccomp_exp.png"; Mat exp = imread(exp_path, 0); Mat orig = imread(string(ts->get_data_path()) + "connectedcomponents/concentric_circles.png", 0); if (orig.empty()) { - ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_TEST_DATA ); + ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA); return; } Mat bw = orig > 128; - Mat labelImage; - int nLabels = connectedComponents(bw, labelImage, 8, CV_32S); - for(int r = 0; r < labelImage.rows; ++r){ - for(int c = 0; c < labelImage.cols; ++c){ - int l = labelImage.at(r, c); - bool pass = l >= 0 && l <= nLabels; - if(!pass){ - ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_OUTPUT ); - return; + for (uint cclt = 0; cclt < sizeof(ccltype)/sizeof(int); ++cclt) + { + + Mat1i labelImage; + int nLabels = connectedComponents(bw, labelImage, 8, CV_32S, ccltype[cclt]); + + normalizeLabels(labelImage, nLabels); + + // Validate test results + for (int r = 0; r < labelImage.rows; ++r){ + for (int c = 0; c < labelImage.cols; ++c){ + int l = labelImage.at(r, c); + bool pass = l >= 0 && l <= nLabels; + if (!pass){ + ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_OUTPUT); + return; + } } } + + if (exp.empty() || orig.size() != exp.size()) + { + imwrite(exp_path, labelImage); + exp = labelImage; + } + + if (0 != cvtest::norm(labelImage > 0, exp > 0, NORM_INF)) + { + ts->set_failed_test_info(cvtest::TS::FAIL_MISMATCH); + return; + } + if (nLabels != cvtest::norm(labelImage, NORM_INF) + 1) + { + ts->set_failed_test_info(cvtest::TS::FAIL_MISMATCH); + return; + } + } - if( exp.empty() || orig.size() != exp.size() ) - { - imwrite(exp_path, labelImage); - exp = labelImage; - } - - if (0 != cvtest::norm(labelImage > 0, exp > 0, NORM_INF)) - { - ts->set_failed_test_info( cvtest::TS::FAIL_MISMATCH ); - return; - } - if (nLabels != cvtest::norm(labelImage, NORM_INF)+1) - { - ts->set_failed_test_info( cvtest::TS::FAIL_MISMATCH ); - return; - } ts->set_failed_test_info(cvtest::TS::OK); } diff --git a/modules/imgproc/test/test_filter.cpp b/modules/imgproc/test/test_filter.cpp index 5994b1b11b..886c5ab90a 100644 --- a/modules/imgproc/test/test_filter.cpp +++ b/modules/imgproc/test/test_filter.cpp @@ -2015,3 +2015,53 @@ TEST(Imgproc_Morphology, iterated) ASSERT_EQ(0.0, norm(dst0, dst2, NORM_INF)); } } + +TEST(Imgproc_Sobel, borderTypes) +{ + int kernelSize = 3; + + /// ksize > src_roi.size() + Mat src = (Mat_(3, 3) << 1, 2, 3, 4, 5, 6, 7, 8, 9), dst, expected_dst; + Mat src_roi = src(Rect(1, 1, 1, 1)); + src_roi.setTo(cv::Scalar::all(0)); + + // should work like !BORDER_ISOLATED, so the function MUST read values in full matrix + Sobel(src_roi, dst, CV_16S, 1, 0, kernelSize, 1, 0, BORDER_REPLICATE); + EXPECT_EQ(8, dst.at(0, 0)); + Sobel(src_roi, dst, CV_16S, 1, 0, kernelSize, 1, 0, BORDER_REFLECT); + EXPECT_EQ(8, dst.at(0, 0)); + + // should work like BORDER_ISOLATED + Sobel(src_roi, dst, CV_16S, 1, 0, kernelSize, 1, 0, BORDER_REPLICATE | BORDER_ISOLATED); + EXPECT_EQ(0, dst.at(0, 0)); + Sobel(src_roi, dst, CV_16S, 1, 0, kernelSize, 1, 0, BORDER_REFLECT | BORDER_ISOLATED); + EXPECT_EQ(0, dst.at(0, 0)); + + /// ksize <= src_roi.size() + src = Mat(5, 5, CV_8UC1, cv::Scalar(5)); + src_roi = src(Rect(1, 1, 3, 3)); + src_roi.setTo(0); + + // should work like !BORDER_ISOLATED, so the function MUST read values in full matrix + expected_dst = + (Mat_(3, 3) << -15, 0, 15, -20, 0, 20, -15, 0, 15); + Sobel(src_roi, dst, CV_16S, 1, 0, kernelSize, 1, 0, BORDER_REPLICATE); + EXPECT_EQ(expected_dst.type(), dst.type()); + EXPECT_EQ(expected_dst.size(), dst.size()); + EXPECT_DOUBLE_EQ(0.0, cvtest::norm(expected_dst, dst, NORM_INF)); + Sobel(src_roi, dst, CV_16S, 1, 0, kernelSize, 1, 0, BORDER_REFLECT); + EXPECT_EQ(expected_dst.type(), dst.type()); + EXPECT_EQ(expected_dst.size(), dst.size()); + EXPECT_DOUBLE_EQ(0.0, cvtest::norm(expected_dst, dst, NORM_INF)); + + // should work like !BORDER_ISOLATED, so the function MUST read values in full matrix + expected_dst = Mat::zeros(3, 3, CV_16SC1); + Sobel(src_roi, dst, CV_16S, 1, 0, kernelSize, 1, 0, BORDER_REPLICATE | BORDER_ISOLATED); + EXPECT_EQ(expected_dst.type(), dst.type()); + EXPECT_EQ(expected_dst.size(), dst.size()); + EXPECT_DOUBLE_EQ(0.0, cvtest::norm(expected_dst, dst, NORM_INF)); + Sobel(src_roi, dst, CV_16S, 1, 0, kernelSize, 1, 0, BORDER_REFLECT | BORDER_ISOLATED); + EXPECT_EQ(expected_dst.type(), dst.type()); + EXPECT_EQ(expected_dst.size(), dst.size()); + EXPECT_DOUBLE_EQ(0.0, cvtest::norm(expected_dst, dst, NORM_INF)); +} diff --git a/modules/imgproc/test/test_houghLines.cpp b/modules/imgproc/test/test_houghLines.cpp index a508841714..93a1202ee1 100644 --- a/modules/imgproc/test/test_houghLines.cpp +++ b/modules/imgproc/test/test_houghLines.cpp @@ -189,7 +189,7 @@ void BaseHoughLineTest::run_test(int type) else if (type == PROBABILISTIC) count = countMatIntersection(exp_lines, lines, 1e-4f, 0.f); -#if defined HAVE_IPP && !defined(HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK +#if defined HAVE_IPP && IPP_VERSION_X100 >= 810 && IPP_DISABLE_BLOCK EXPECT_GE( count, (int) (exp_lines.total() * 0.8) ); #else EXPECT_EQ( count, (int) exp_lines.total()); diff --git a/modules/ml/include/opencv2/ml.hpp b/modules/ml/include/opencv2/ml.hpp index d016810874..ea9c89e4e6 100644 --- a/modules/ml/include/opencv2/ml.hpp +++ b/modules/ml/include/opencv2/ml.hpp @@ -190,6 +190,7 @@ public: CV_WRAP virtual Mat getTestSampleWeights() const = 0; CV_WRAP virtual Mat getVarIdx() const = 0; CV_WRAP virtual Mat getVarType() const = 0; + CV_WRAP Mat getVarSymbolFlags() const; CV_WRAP virtual int getResponseType() const = 0; CV_WRAP virtual Mat getTrainSampleIdx() const = 0; CV_WRAP virtual Mat getTestSampleIdx() const = 0; @@ -227,6 +228,9 @@ public: /** @brief Returns matrix of test samples */ CV_WRAP Mat getTestSamples() const; + /** @brief Returns vector of symbolic names captured in loadFromCSV() */ + CV_WRAP void getNames(std::vector& names) const; + CV_WRAP static Mat getSubVector(const Mat& vec, const Mat& idx); /** @brief Reads the dataset from a .csv file and returns the ready-to-use training data. diff --git a/modules/ml/misc/python/pyopencv_ml.hpp b/modules/ml/misc/python/pyopencv_ml.hpp new file mode 100644 index 0000000000..6a86c46c2e --- /dev/null +++ b/modules/ml/misc/python/pyopencv_ml.hpp @@ -0,0 +1,22 @@ +template<> +bool pyopencv_to(PyObject *obj, CvTermCriteria& dst, const char *name) +{ + (void)name; + if(!obj) + return true; + return PyArg_ParseTuple(obj, "iid", &dst.type, &dst.max_iter, &dst.epsilon) > 0; +} + +template<> +bool pyopencv_to(PyObject* obj, CvSlice& r, const char* name) +{ + (void)name; + if(!obj || obj == Py_None) + return true; + if(PyObject_Size(obj) == 0) + { + r = CV_WHOLE_SEQ; + return true; + } + return PyArg_ParseTuple(obj, "ii", &r.start_index, &r.end_index) > 0; +} \ No newline at end of file diff --git a/modules/ml/src/data.cpp b/modules/ml/src/data.cpp index 465163c927..5e1b6d2340 100644 --- a/modules/ml/src/data.cpp +++ b/modules/ml/src/data.cpp @@ -220,6 +220,7 @@ public: samples.release(); missing.release(); varType.release(); + varSymbolFlags.release(); responses.release(); sampleIdx.release(); trainSampleIdx.release(); @@ -522,6 +523,7 @@ public: std::vector allresponses; std::vector rowvals; std::vector vtypes, rowtypes; + std::vector vsymbolflags; bool haveMissed = false; char* buf = &_buf[0]; @@ -583,6 +585,9 @@ public: } else vtypes = rowtypes; + vsymbolflags.resize(nvars); + for( i = 0; i < nvars; i++ ) + vsymbolflags[i] = (uchar)(rowtypes[i] == VAR_CATEGORICAL); ridx0 = ridx0 >= 0 ? ridx0 : ridx0 == -1 ? nvars - 1 : -1; ridx1 = ridx1 >= 0 ? ridx1 : ridx0 >= 0 ? ridx0+1 : -1; @@ -598,6 +603,11 @@ public: { CV_Assert( (!varTypesSet && vtypes[i] == rowtypes[i]) || (varTypesSet && (vtypes[i] == rowtypes[i] || rowtypes[i] == VAR_ORDERED)) ); + uchar sflag = (uchar)(rowtypes[i] == VAR_CATEGORICAL); + if( vsymbolflags[i] == VAR_MISSED ) + vsymbolflags[i] = sflag; + else + CV_Assert(vsymbolflags[i] == sflag || rowtypes[i] == VAR_MISSED); } if( ridx0 >= 0 ) @@ -657,7 +667,10 @@ public: } bool ok = !samples.empty(); if(ok) + { std::swap(tempNameMap, nameMap); + Mat(vsymbolflags).copyTo(varSymbolFlags); + } return ok; } @@ -976,13 +989,38 @@ public: FILE* file; int layout; - Mat samples, missing, varType, varIdx, responses, missingSubst; + Mat samples, missing, varType, varIdx, varSymbolFlags, responses, missingSubst; Mat sampleIdx, trainSampleIdx, testSampleIdx; Mat sampleWeights, catMap, catOfs; Mat normCatResponses, classLabels, classCounters; MapType nameMap; }; +void TrainData::getNames(std::vector& names) const +{ + const TrainDataImpl* impl = dynamic_cast(this); + CV_Assert(impl != 0); + size_t n = impl->nameMap.size(); + TrainDataImpl::MapType::const_iterator it = impl->nameMap.begin(), + it_end = impl->nameMap.end(); + names.resize(n+1); + names[0] = "?"; + for( ; it != it_end; ++it ) + { + String s = it->first; + int label = it->second; + CV_Assert( label > 0 && label <= (int)n ); + names[label] = s; + } +} + +Mat TrainData::getVarSymbolFlags() const +{ + const TrainDataImpl* impl = dynamic_cast(this); + CV_Assert(impl != 0); + return impl->varSymbolFlags; +} + Ptr TrainData::loadFromCSV(const String& filename, int headerLines, int responseStartIdx, diff --git a/modules/ml/src/inner_functions.cpp b/modules/ml/src/inner_functions.cpp index b39d403434..20abf7b052 100644 --- a/modules/ml/src/inner_functions.cpp +++ b/modules/ml/src/inner_functions.cpp @@ -116,35 +116,12 @@ static void Cholesky( const Mat& A, Mat& S ) { CV_Assert(A.type() == CV_32F); - int dim = A.rows; - S.create(dim, dim, CV_32F); - - int i, j, k; - - for( i = 0; i < dim; i++ ) - { - for( j = 0; j < i; j++ ) - S.at(i,j) = 0.f; - - float sum = 0.f; - for( k = 0; k < i; k++ ) - { - float val = S.at(k,i); - sum += val*val; - } - - S.at(i,i) = std::sqrt(std::max(A.at(i,i) - sum, 0.f)); - float ival = 1.f/S.at(i, i); - - for( j = i + 1; j < dim; j++ ) - { - sum = 0; - for( k = 0; k < i; k++ ) - sum += S.at(k, i) * S.at(k, j); - - S.at(i, j) = (A.at(i, j) - sum)*ival; - } - } + S = A.clone(); + cv::Cholesky ((float*)S.ptr(),S.step, S.rows,NULL, 0, 0); + S = S.t(); + for (int i=1;i(i,j)=0; } /* Generates from multivariate normal distribution, where - is an diff --git a/modules/ml/test/test_save_load.cpp b/modules/ml/test/test_save_load.cpp index d127471cc9..b97c8c3ab3 100644 --- a/modules/ml/test/test_save_load.cpp +++ b/modules/ml/test/test_save_load.cpp @@ -64,12 +64,12 @@ int CV_SLMLTest::run_test_case( int testCaseIdx ) if( code == cvtest::TS::OK ) { get_test_error( testCaseIdx, &test_resps1 ); - fname1 = tempfile(".yml.gz"); - save( fname1.c_str() ); + fname1 = tempfile(".json.gz"); + save( (fname1 + "?base64").c_str() ); load( fname1.c_str() ); get_test_error( testCaseIdx, &test_resps2 ); - fname2 = tempfile(".yml.gz"); - save( fname2.c_str() ); + fname2 = tempfile(".json.gz"); + save( (fname2 + "?base64").c_str() ); } else ts->printf( cvtest::TS::LOG, "model can not be trained" ); @@ -279,8 +279,8 @@ TEST(DISABLED_ML_SVM, linear_save_load) svm1 = Algorithm::load("SVM45_X_38-1.xml"); svm2 = Algorithm::load("SVM45_X_38-2.xml"); - string tname = tempfile("a.xml"); - svm2->save(tname); + string tname = tempfile("a.json"); + svm2->save(tname + "?base64"); svm3 = Algorithm::load(tname); ASSERT_EQ(svm1->getVarCount(), svm2->getVarCount()); diff --git a/modules/objdetect/include/opencv2/objdetect.hpp b/modules/objdetect/include/opencv2/objdetect.hpp index 87d7ec3ac5..b92467db2c 100644 --- a/modules/objdetect/include/opencv2/objdetect.hpp +++ b/modules/objdetect/include/opencv2/objdetect.hpp @@ -124,7 +124,7 @@ public: SimilarRects(double _eps) : eps(_eps) {} inline bool operator()(const Rect& r1, const Rect& r2) const { - double delta = eps*(std::min(r1.width, r2.width) + std::min(r1.height, r2.height))*0.5; + double delta = eps * ((std::min)(r1.width, r2.width) + (std::min)(r1.height, r2.height)) * 0.5; return std::abs(r1.x - r2.x) <= delta && std::abs(r1.y - r2.y) <= delta && std::abs(r1.x + r1.width - r2.x - r2.width) <= delta && diff --git a/modules/objdetect/src/cascadedetect.cpp b/modules/objdetect/src/cascadedetect.cpp index e206992574..9eef693d70 100644 --- a/modules/objdetect/src/cascadedetect.cpp +++ b/modules/objdetect/src/cascadedetect.cpp @@ -59,6 +59,8 @@ template void copyVectorToUMat(const std::vector<_Tp>& v, UMat& um void groupRectangles(std::vector& rectList, int groupThreshold, double eps, std::vector* weights, std::vector* levelWeights) { + CV_INSTRUMENT_REGION() + if( groupThreshold <= 0 || rectList.empty() ) { if( weights ) @@ -359,23 +361,31 @@ static void groupRectangles_meanshift(std::vector& rectList, double detect void groupRectangles(std::vector& rectList, int groupThreshold, double eps) { + CV_INSTRUMENT_REGION() + groupRectangles(rectList, groupThreshold, eps, 0, 0); } void groupRectangles(std::vector& rectList, std::vector& weights, int groupThreshold, double eps) { + CV_INSTRUMENT_REGION() + groupRectangles(rectList, groupThreshold, eps, &weights, 0); } //used for cascade detection algorithm for ROC-curve calculating void groupRectangles(std::vector& rectList, std::vector& rejectLevels, std::vector& levelWeights, int groupThreshold, double eps) { + CV_INSTRUMENT_REGION() + groupRectangles(rectList, groupThreshold, eps, &rejectLevels, &levelWeights); } //can be used for HOG detection algorithm only void groupRectangles_meanshift(std::vector& rectList, std::vector& foundWeights, std::vector& foundScales, double detectThreshold, Size winDetSize) { + CV_INSTRUMENT_REGION() + groupRectangles_meanshift(rectList, detectThreshold, &foundWeights, foundScales, winDetSize); } @@ -1217,6 +1227,8 @@ void CascadeClassifierImpl::detectMultiScaleNoGrouping( InputArray _image, std:: double scaleFactor, Size minObjectSize, Size maxObjectSize, bool outputRejectLevels ) { + CV_INSTRUMENT_REGION() + Size imgsz = _image.size(); Mat grayImage; @@ -1320,6 +1332,8 @@ void CascadeClassifierImpl::detectMultiScale( InputArray _image, std::vector 1 && _image.depth() == CV_8U ); if( empty() ) @@ -1352,6 +1366,8 @@ void CascadeClassifierImpl::detectMultiScale( InputArray _image, std::vector fakeLevels; std::vector fakeWeights; detectMultiScale( _image, objects, fakeLevels, fakeWeights, scaleFactor, @@ -1363,6 +1379,8 @@ void CascadeClassifierImpl::detectMultiScale( InputArray _image, std::vector 1 && image.depth() == CV_8U ); @@ -1636,6 +1654,8 @@ void CascadeClassifier::detectMultiScale( InputArray image, Size minSize, Size maxSize ) { + CV_INSTRUMENT_REGION() + CV_Assert(!empty()); cc->detectMultiScale(image, objects, scaleFactor, minNeighbors, flags, minSize, maxSize); clipObjects(image.size(), objects, 0, 0); @@ -1648,6 +1668,8 @@ void CascadeClassifier::detectMultiScale( InputArray image, int minNeighbors, int flags, Size minSize, Size maxSize ) { + CV_INSTRUMENT_REGION() + CV_Assert(!empty()); cc->detectMultiScale(image, objects, numDetections, scaleFactor, minNeighbors, flags, minSize, maxSize); @@ -1663,6 +1685,8 @@ void CascadeClassifier::detectMultiScale( InputArray image, Size minSize, Size maxSize, bool outputRejectLevels ) { + CV_INSTRUMENT_REGION() + CV_Assert(!empty()); cc->detectMultiScale(image, objects, rejectLevels, levelWeights, scaleFactor, minNeighbors, flags, diff --git a/modules/objdetect/src/detection_based_tracker.cpp b/modules/objdetect/src/detection_based_tracker.cpp index 040784bc23..8c236c7594 100644 --- a/modules/objdetect/src/detection_based_tracker.cpp +++ b/modules/objdetect/src/detection_based_tracker.cpp @@ -618,6 +618,8 @@ cv::DetectionBasedTracker::~DetectionBasedTracker() void DetectionBasedTracker::process(const Mat& imageGray) { + CV_INSTRUMENT_REGION() + CV_Assert(imageGray.type()==CV_8UC1); if ( separateDetectionWork && !separateDetectionWork->isWorking() ) { diff --git a/modules/objdetect/src/haar.cpp b/modules/objdetect/src/haar.cpp index 66ea517c3e..51843fa488 100644 --- a/modules/objdetect/src/haar.cpp +++ b/modules/objdetect/src/haar.cpp @@ -1275,6 +1275,8 @@ CV_IMPL int cvRunHaarClassifierCascade( const CvHaarClassifierCascade* _cascade, CvPoint pt, int start_stage ) { + CV_INSTRUMENT_REGION() + double stage_sum; return cvRunHaarClassifierCascadeSum(_cascade, pt, stage_sum, start_stage); } @@ -1308,6 +1310,8 @@ public: void operator()( const Range& range ) const { + CV_INSTRUMENT_REGION() + Size winSize0 = cascade->orig_window_size; Size winSize(cvRound(winSize0.width*factor), cvRound(winSize0.height*factor)); int y1 = range.start*stripSize, y2 = std::min(range.end*stripSize, sum1.rows - 1 - winSize0.height); @@ -1322,10 +1326,10 @@ public: if(CV_IPP_CHECK_COND && cascade->hid_cascade->ipp_stages ) { IppiRect iequRect = {equRect.x, equRect.y, equRect.width, equRect.height}; - ippiRectStdDev_32f_C1R(sum1.ptr(y1), (int)sum1.step, + CV_INSTRUMENT_FUN_IPP(ippiRectStdDev_32f_C1R, sum1.ptr(y1), (int)sum1.step, sqsum1.ptr(y1), (int)sqsum1.step, norm1->ptr(y1), (int)norm1->step, - ippiSize(ssz.width, ssz.height), iequRect ); + ippiSize(ssz.width, ssz.height), iequRect); int positive = (ssz.width/ystep)*((ssz.height + ystep-1)/ystep); @@ -1344,7 +1348,7 @@ public: for( int j = 0; j < cascade->count; j++ ) { - if( ippiApplyHaarClassifier_32f_C1R( + if (CV_INSTRUMENT_FUN_IPP(ippiApplyHaarClassifier_32f_C1R, sum1.ptr(y1), (int)sum1.step, norm1->ptr(y1), (int)norm1->step, mask1->ptr(y1), (int)mask1->step, @@ -1441,6 +1445,8 @@ public: void operator()( const Range& range ) const { + CV_INSTRUMENT_REGION() + int iy, startY = range.start, endY = range.end; const int *p0 = p[0], *p1 = p[1], *p2 = p[2], *p3 = p[3]; const int *pq0 = pq[0], *pq1 = pq[1], *pq2 = pq[2], *pq3 = pq[3]; @@ -1500,6 +1506,8 @@ cvHaarDetectObjectsForROC( const CvArr* _img, double scaleFactor, int minNeighbors, int flags, CvSize minSize, CvSize maxSize, bool outputRejectLevels ) { + CV_INSTRUMENT_REGION() + const double GROUP_EPS = 0.2; CvMat stub, *img = (CvMat*)_img; cv::Ptr temp, sum, tilted, sqsum, normImg, sumcanny, imgSmall; diff --git a/modules/objdetect/src/hog.cpp b/modules/objdetect/src/hog.cpp index 1055525a82..84baed6ef8 100644 --- a/modules/objdetect/src/hog.cpp +++ b/modules/objdetect/src/hog.cpp @@ -236,6 +236,8 @@ inline float32x4_t vsetq_f32(float f0, float f1, float f2, float f3) void HOGDescriptor::computeGradient(const Mat& img, Mat& grad, Mat& qangle, Size paddingTL, Size paddingBR) const { + CV_INSTRUMENT_REGION() + CV_Assert( img.type() == CV_8U || img.type() == CV_8UC3 ); Size gradsize(img.cols + paddingTL.width + paddingBR.width, @@ -1582,6 +1584,8 @@ static bool ocl_compute(InputArray _img, Size win_stride, std::vector& _d void HOGDescriptor::compute(InputArray _img, std::vector& descriptors, Size winStride, Size padding, const std::vector& locations) const { + CV_INSTRUMENT_REGION() + if( winStride == Size() ) winStride = cellSize; Size cacheStride(gcd(winStride.width, blockStride.width), @@ -1647,6 +1651,8 @@ void HOGDescriptor::detect(const Mat& img, std::vector& hits, std::vector& weights, double hitThreshold, Size winStride, Size padding, const std::vector& locations) const { + CV_INSTRUMENT_REGION() + hits.clear(); weights.clear(); if( svmDetector.empty() ) @@ -1758,6 +1764,8 @@ void HOGDescriptor::detect(const Mat& img, void HOGDescriptor::detect(const Mat& img, std::vector& hits, double hitThreshold, Size winStride, Size padding, const std::vector& locations) const { + CV_INSTRUMENT_REGION() + std::vector weightsV; detect(img, hits, weightsV, hitThreshold, winStride, padding, locations); } @@ -2040,6 +2048,8 @@ void HOGDescriptor::detectMultiScale( double hitThreshold, Size winStride, Size padding, double scale0, double finalThreshold, bool useMeanshiftGrouping) const { + CV_INSTRUMENT_REGION() + double scale = 1.; int levels = 0; @@ -2093,6 +2103,8 @@ void HOGDescriptor::detectMultiScale(InputArray img, std::vector& foundLoc double hitThreshold, Size winStride, Size padding, double scale0, double finalThreshold, bool useMeanshiftGrouping) const { + CV_INSTRUMENT_REGION() + std::vector foundWeights; detectMultiScale(img, foundLocations, foundWeights, hitThreshold, winStride, padding, scale0, finalThreshold, useMeanshiftGrouping); @@ -3489,6 +3501,8 @@ public: void operator()( const Range& range ) const { + CV_INSTRUMENT_REGION() + int i, i1 = range.start, i2 = range.end; Size maxSz(cvCeil(img.cols/(*locations)[0].scale), cvCeil(img.rows/(*locations)[0].scale)); @@ -3531,6 +3545,8 @@ void HOGDescriptor::detectROI(const cv::Mat& img, const std::vector & CV_OUT std::vector& foundLocations, CV_OUT std::vector& confidences, double hitThreshold, cv::Size winStride, cv::Size padding) const { + CV_INSTRUMENT_REGION() + foundLocations.clear(); confidences.clear(); @@ -3641,6 +3657,8 @@ void HOGDescriptor::detectMultiScaleROI(const cv::Mat& img, CV_OUT std::vector& foundLocations, std::vector& locations, double hitThreshold, int groupThreshold) const { + CV_INSTRUMENT_REGION() + std::vector allCandidates; Mutex mtx; @@ -3747,6 +3765,8 @@ void HOGDescriptor::readALTModel(String modelfile) void HOGDescriptor::groupRectangles(std::vector& rectList, std::vector& weights, int groupThreshold, double eps) const { + CV_INSTRUMENT_REGION() + if( groupThreshold <= 0 || rectList.empty() ) { return; diff --git a/modules/photo/src/align.cpp b/modules/photo/src/align.cpp index 4fda881c29..02087117e1 100644 --- a/modules/photo/src/align.cpp +++ b/modules/photo/src/align.cpp @@ -61,11 +61,15 @@ public: void process(InputArrayOfArrays src, std::vector& dst, InputArray, InputArray) { + CV_INSTRUMENT_REGION() + process(src, dst); } void process(InputArrayOfArrays _src, std::vector& dst) { + CV_INSTRUMENT_REGION() + std::vector src; _src.getMatVector(src); @@ -114,6 +118,8 @@ public: Point calculateShift(InputArray _img0, InputArray _img1) { + CV_INSTRUMENT_REGION() + Mat img0 = _img0.getMat(); Mat img1 = _img1.getMat(); CV_Assert(img0.channels() == 1 && img0.type() == img1.type()); @@ -160,6 +166,8 @@ public: void shiftMat(InputArray _src, OutputArray _dst, const Point shift) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); _dst.create(src.size(), src.type()); Mat dst = _dst.getMat(); @@ -203,6 +211,8 @@ public: void computeBitmaps(InputArray _img, OutputArray _tb, OutputArray _eb) { + CV_INSTRUMENT_REGION() + Mat img = _img.getMat(); _tb.create(img.size(), CV_8U); _eb.create(img.size(), CV_8U); diff --git a/modules/photo/src/calibrate.cpp b/modules/photo/src/calibrate.cpp index f945ef1b5b..dd30005f6f 100644 --- a/modules/photo/src/calibrate.cpp +++ b/modules/photo/src/calibrate.cpp @@ -63,6 +63,8 @@ public: void process(InputArrayOfArrays src, OutputArray dst, InputArray _times) { + CV_INSTRUMENT_REGION() + std::vector images; src.getMatVector(images); Mat times = _times.getMat(); @@ -184,6 +186,8 @@ public: void process(InputArrayOfArrays src, OutputArray dst, InputArray _times) { + CV_INSTRUMENT_REGION() + std::vector images; src.getMatVector(images); Mat times = _times.getMat(); diff --git a/modules/photo/src/contrast_preserve.cpp b/modules/photo/src/contrast_preserve.cpp index 55ea32189e..8c6caedbdf 100644 --- a/modules/photo/src/contrast_preserve.cpp +++ b/modules/photo/src/contrast_preserve.cpp @@ -52,6 +52,8 @@ using namespace cv; void cv::decolor(InputArray _src, OutputArray _dst, OutputArray _color_boost) { + CV_INSTRUMENT_REGION() + Mat I = _src.getMat(); _dst.create(I.size(), CV_8UC1); Mat dst = _dst.getMat(); diff --git a/modules/photo/src/denoising.cpp b/modules/photo/src/denoising.cpp index 93d4b4ebbe..ebf345c827 100644 --- a/modules/photo/src/denoising.cpp +++ b/modules/photo/src/denoising.cpp @@ -104,6 +104,8 @@ static void fastNlMeansDenoising_( const Mat& src, Mat& dst, const std::vector(1, h), templateWindowSize, searchWindowSize); } @@ -111,6 +113,8 @@ void cv::fastNlMeansDenoising( InputArray _src, OutputArray _dst, float h, void cv::fastNlMeansDenoising( InputArray _src, OutputArray _dst, const std::vector& h, int templateWindowSize, int searchWindowSize, int normType) { + CV_INSTRUMENT_REGION() + int hn = (int)h.size(), type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type); CV_Assert(hn == 1 || hn == cn); @@ -169,6 +173,8 @@ void cv::fastNlMeansDenoisingColored( InputArray _src, OutputArray _dst, float h, float hForColorComponents, int templateWindowSize, int searchWindowSize) { + CV_INSTRUMENT_REGION() + int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type); Size src_size = _src.size(); if (type != CV_8UC3 && type != CV_8UC4) @@ -308,6 +314,8 @@ void cv::fastNlMeansDenoisingMulti( InputArrayOfArrays _srcImgs, OutputArray _ds int imgToDenoiseIndex, int temporalWindowSize, float h, int templateWindowSize, int searchWindowSize) { + CV_INSTRUMENT_REGION() + fastNlMeansDenoisingMulti(_srcImgs, _dst, imgToDenoiseIndex, temporalWindowSize, std::vector(1, h), templateWindowSize, searchWindowSize); } @@ -317,6 +325,8 @@ void cv::fastNlMeansDenoisingMulti( InputArrayOfArrays _srcImgs, OutputArray _ds const std::vector& h, int templateWindowSize, int searchWindowSize, int normType) { + CV_INSTRUMENT_REGION() + std::vector srcImgs; _srcImgs.getMatVector(srcImgs); @@ -378,6 +388,8 @@ void cv::fastNlMeansDenoisingColoredMulti( InputArrayOfArrays _srcImgs, OutputAr float h, float hForColorComponents, int templateWindowSize, int searchWindowSize) { + CV_INSTRUMENT_REGION() + std::vector srcImgs; _srcImgs.getMatVector(srcImgs); diff --git a/modules/photo/src/inpaint.cpp b/modules/photo/src/inpaint.cpp index f91db5f545..0b96f1c057 100644 --- a/modules/photo/src/inpaint.cpp +++ b/modules/photo/src/inpaint.cpp @@ -810,6 +810,8 @@ cvInpaint( const CvArr* _input_img, const CvArr* _inpaint_mask, CvArr* _output_i void cv::inpaint( InputArray _src, InputArray _mask, OutputArray _dst, double inpaintRange, int flags ) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(), mask = _mask.getMat(); _dst.create( src.size(), src.type() ); CvMat c_src = src, c_mask = mask, c_dst = _dst.getMat(); diff --git a/modules/photo/src/merge.cpp b/modules/photo/src/merge.cpp index 9772212d7b..3e59180904 100644 --- a/modules/photo/src/merge.cpp +++ b/modules/photo/src/merge.cpp @@ -58,6 +58,8 @@ public: void process(InputArrayOfArrays src, OutputArray dst, InputArray _times, InputArray input_response) { + CV_INSTRUMENT_REGION() + std::vector images; src.getMatVector(images); Mat times = _times.getMat(); @@ -122,6 +124,8 @@ public: void process(InputArrayOfArrays src, OutputArray dst, InputArray times) { + CV_INSTRUMENT_REGION() + process(src, dst, times, Mat()); } @@ -148,11 +152,15 @@ public: void process(InputArrayOfArrays src, OutputArrayOfArrays dst, InputArray, InputArray) { + CV_INSTRUMENT_REGION() + process(src, dst); } void process(InputArrayOfArrays src, OutputArray dst) { + CV_INSTRUMENT_REGION() + std::vector images; src.getMatVector(images); checkImageDimensions(images); @@ -302,6 +310,8 @@ public: void process(InputArrayOfArrays src, OutputArray dst, InputArray _times, InputArray input_response) { + CV_INSTRUMENT_REGION() + std::vector images; src.getMatVector(images); Mat times = _times.getMat(); @@ -339,6 +349,8 @@ public: void process(InputArrayOfArrays src, OutputArray dst, InputArray times) { + CV_INSTRUMENT_REGION() + process(src, dst, times, Mat()); } diff --git a/modules/photo/src/npr.cpp b/modules/photo/src/npr.cpp index 761f3c73cb..e800ce9a9a 100644 --- a/modules/photo/src/npr.cpp +++ b/modules/photo/src/npr.cpp @@ -51,6 +51,8 @@ using namespace cv; void cv::edgePreservingFilter(InputArray _src, OutputArray _dst, int flags, float sigma_s, float sigma_r) { + CV_INSTRUMENT_REGION() + Mat I = _src.getMat(); _dst.create(I.size(), CV_8UC3); Mat dst = _dst.getMat(); @@ -73,6 +75,8 @@ void cv::edgePreservingFilter(InputArray _src, OutputArray _dst, int flags, floa void cv::detailEnhance(InputArray _src, OutputArray _dst, float sigma_s, float sigma_r) { + CV_INSTRUMENT_REGION() + Mat I = _src.getMat(); _dst.create(I.size(), CV_8UC3); Mat dst = _dst.getMat(); @@ -118,6 +122,8 @@ void cv::detailEnhance(InputArray _src, OutputArray _dst, float sigma_s, float s void cv::pencilSketch(InputArray _src, OutputArray _dst1, OutputArray _dst2, float sigma_s, float sigma_r, float shade_factor) { + CV_INSTRUMENT_REGION() + Mat I = _src.getMat(); _dst1.create(I.size(), CV_8UC1); Mat dst1 = _dst1.getMat(); @@ -142,6 +148,8 @@ void cv::pencilSketch(InputArray _src, OutputArray _dst1, OutputArray _dst2, flo void cv::stylization(InputArray _src, OutputArray _dst, float sigma_s, float sigma_r) { + CV_INSTRUMENT_REGION() + Mat I = _src.getMat(); _dst.create(I.size(), CV_8UC3); Mat dst = _dst.getMat(); diff --git a/modules/photo/src/seamless_cloning.cpp b/modules/photo/src/seamless_cloning.cpp index 2564145e58..ed02f8cf92 100644 --- a/modules/photo/src/seamless_cloning.cpp +++ b/modules/photo/src/seamless_cloning.cpp @@ -49,6 +49,8 @@ using namespace cv; void cv::seamlessClone(InputArray _src, InputArray _dst, InputArray _mask, Point p, OutputArray _blend, int flags) { + CV_INSTRUMENT_REGION() + const Mat src = _src.getMat(); const Mat dest = _dst.getMat(); const Mat mask = _mask.getMat(); @@ -116,6 +118,8 @@ void cv::seamlessClone(InputArray _src, InputArray _dst, InputArray _mask, Point void cv::colorChange(InputArray _src, InputArray _mask, OutputArray _dst, float r, float g, float b) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); Mat mask = _mask.getMat(); _dst.create(src.size(), src.type()); @@ -142,6 +146,8 @@ void cv::colorChange(InputArray _src, InputArray _mask, OutputArray _dst, float void cv::illuminationChange(InputArray _src, InputArray _mask, OutputArray _dst, float a, float b) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); Mat mask = _mask.getMat(); @@ -169,6 +175,8 @@ void cv::illuminationChange(InputArray _src, InputArray _mask, OutputArray _dst, void cv::textureFlattening(InputArray _src, InputArray _mask, OutputArray _dst, float low_threshold, float high_threshold, int kernel_size) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); Mat mask = _mask.getMat(); diff --git a/modules/photo/src/seamless_cloning_impl.cpp b/modules/photo/src/seamless_cloning_impl.cpp index fe2751d143..6073a9bc4c 100644 --- a/modules/photo/src/seamless_cloning_impl.cpp +++ b/modules/photo/src/seamless_cloning_impl.cpp @@ -420,6 +420,8 @@ void Cloning::localColorChange(Mat &I, Mat &mask, Mat &wmask, Mat &cloned, float void Cloning::illuminationChange(Mat &I, Mat &mask, Mat &wmask, Mat &cloned, float alpha, float beta) { + CV_INSTRUMENT_REGION() + computeDerivatives(I,mask,wmask); arrayProduct(patchGradientX,binaryMaskFloat, patchGradientX); diff --git a/modules/photo/src/tonemap.cpp b/modules/photo/src/tonemap.cpp index a3a71fe50c..acfca04c9b 100644 --- a/modules/photo/src/tonemap.cpp +++ b/modules/photo/src/tonemap.cpp @@ -62,6 +62,8 @@ public: void process(InputArray _src, OutputArray _dst) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); CV_Assert(!src.empty()); _dst.create(src.size(), CV_32FC3); @@ -118,6 +120,8 @@ public: void process(InputArray _src, OutputArray _dst) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); CV_Assert(!src.empty()); _dst.create(src.size(), CV_32FC3); @@ -203,6 +207,8 @@ public: void process(InputArray _src, OutputArray _dst) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); CV_Assert(!src.empty()); _dst.create(src.size(), CV_32FC3); @@ -288,6 +294,8 @@ public: void process(InputArray _src, OutputArray _dst) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); CV_Assert(!src.empty()); _dst.create(src.size(), CV_32FC3); @@ -383,6 +391,8 @@ public: void process(InputArray _src, OutputArray _dst) { + CV_INSTRUMENT_REGION() + Mat src = _src.getMat(); CV_Assert(!src.empty()); _dst.create(src.size(), CV_32FC3); diff --git a/modules/python/common.cmake b/modules/python/common.cmake index ba65100fb7..ffe709f3dc 100644 --- a/modules/python/common.cmake +++ b/modules/python/common.cmake @@ -24,8 +24,11 @@ foreach(m ${OPENCV_MODULES_BUILD}) endforeach() set(opencv_hdrs "") +set(opencv_userdef_hdrs "") foreach(m ${OPENCV_PYTHON_MODULES}) list(APPEND opencv_hdrs ${OPENCV_MODULE_${m}_HEADERS}) + file(GLOB userdef_hdrs ${OPENCV_MODULE_${m}_LOCATION}/misc/python/pyopencv*.hpp) + list(APPEND opencv_userdef_hdrs ${userdef_hdrs}) endforeach(m) # header blacklist @@ -52,7 +55,13 @@ add_custom_command( DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/headers.txt DEPENDS ${opencv_hdrs}) -ocv_add_library(${the_module} MODULE ${PYTHON_SOURCE_DIR}/src2/cv2.cpp ${cv2_generated_hdrs}) +set(cv2_custom_hdr "${CMAKE_CURRENT_BINARY_DIR}/pyopencv_custom_headers.h") +file(WRITE ${cv2_custom_hdr} "//user-defined headers\n") +foreach(uh ${opencv_userdef_hdrs}) + file(APPEND ${cv2_custom_hdr} "#include \"${uh}\"\n") +endforeach(uh) + +ocv_add_library(${the_module} MODULE ${PYTHON_SOURCE_DIR}/src2/cv2.cpp ${cv2_generated_hdrs} ${opencv_userdef_hdrs} ${cv2_custom_hdr}) if(APPLE) set_target_properties(${the_module} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") diff --git a/modules/python/src2/cv2.cpp b/modules/python/src2/cv2.cpp index 4b07e60fa4..1c189e7b67 100644 --- a/modules/python/src2/cv2.cpp +++ b/modules/python/src2/cv2.cpp @@ -111,19 +111,6 @@ typedef std::vector > vector_vector_Point2f; typedef std::vector > vector_vector_Point3f; typedef std::vector > vector_vector_DMatch; -#ifdef HAVE_OPENCV_FEATURES2D -typedef SimpleBlobDetector::Params SimpleBlobDetector_Params; -#endif - -#ifdef HAVE_OPENCV_FLANN -typedef cvflann::flann_distance_t cvflann_flann_distance_t; -typedef cvflann::flann_algorithm_t cvflann_flann_algorithm_t; -#endif - -#ifdef HAVE_OPENCV_STITCHING -typedef Stitcher::Status Status; -#endif - static PyObject* failmsgp(const char *fmt, ...) { char str[1000]; @@ -469,14 +456,6 @@ PyObject* pyopencv_from(const bool& value) return PyBool_FromLong(value); } -#ifdef HAVE_OPENCV_STITCHING -template<> -PyObject* pyopencv_from(const Status& value) -{ - return PyInt_FromLong(value); -} -#endif - template<> bool pyopencv_to(PyObject* obj, bool& value, const char* name) { @@ -512,20 +491,6 @@ PyObject* pyopencv_from(const int& value) return PyInt_FromLong(value); } -#ifdef HAVE_OPENCV_FLANN -template<> -PyObject* pyopencv_from(const cvflann_flann_algorithm_t& value) -{ - return PyInt_FromLong(int(value)); -} - -template<> -PyObject* pyopencv_from(const cvflann_flann_distance_t& value) -{ - return PyInt_FromLong(int(value)); -} -#endif - template<> bool pyopencv_to(PyObject* obj, int& value, const char* name) { @@ -1094,62 +1059,6 @@ PyObject* pyopencv_from(const Moments& m) "nu30", m.nu30, "nu21", m.nu21, "nu12", m.nu12, "nu03", m.nu03); } -#ifdef HAVE_OPENCV_FLANN -template<> -bool pyopencv_to(PyObject *o, cv::flann::IndexParams& p, const char *name) -{ - (void)name; - bool ok = true; - PyObject* key = NULL; - PyObject* item = NULL; - Py_ssize_t pos = 0; - - if(PyDict_Check(o)) { - while(PyDict_Next(o, &pos, &key, &item)) { - if( !PyString_Check(key) ) { - ok = false; - break; - } - - String k = PyString_AsString(key); - if( PyString_Check(item) ) - { - const char* value = PyString_AsString(item); - p.setString(k, value); - } - else if( !!PyBool_Check(item) ) - p.setBool(k, item == Py_True); - else if( PyInt_Check(item) ) - { - int value = (int)PyInt_AsLong(item); - if( strcmp(k.c_str(), "algorithm") == 0 ) - p.setAlgorithm(value); - else - p.setInt(k, value); - } - else if( PyFloat_Check(item) ) - { - double value = PyFloat_AsDouble(item); - p.setDouble(k, value); - } - else - { - ok = false; - break; - } - } - } - - return ok && !PyErr_Occurred(); -} - -template<> -bool pyopencv_to(PyObject* obj, cv::flann::SearchParams & value, const char * name) -{ - return pyopencv_to(obj, value, name); -} -#endif - template bool pyopencv_to(PyObject *o, Ptr& p, const char *name) { @@ -1157,45 +1066,7 @@ bool pyopencv_to(PyObject *o, Ptr& p, const char *name) return pyopencv_to(o, *p, name); } -#ifdef HAVE_OPENCV_FLANN -template<> -bool pyopencv_to(PyObject *o, cvflann::flann_distance_t& dist, const char *name) -{ - int d = (int)dist; - bool ok = pyopencv_to(o, d, name); - dist = (cvflann::flann_distance_t)d; - return ok; -} -#endif - - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// TODO: REMOVE used only by ml wrapper - -template<> -bool pyopencv_to(PyObject *obj, CvTermCriteria& dst, const char *name) -{ - (void)name; - if(!obj) - return true; - return PyArg_ParseTuple(obj, "iid", &dst.type, &dst.max_iter, &dst.epsilon) > 0; -} - -template<> -bool pyopencv_to(PyObject* obj, CvSlice& r, const char* name) -{ - (void)name; - if(!obj || obj == Py_None) - return true; - if(PyObject_Size(obj) == 0) - { - r = CV_WHOLE_SEQ; - return true; - } - return PyArg_ParseTuple(obj, "ii", &r.start_index, &r.end_index) > 0; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// +#include "pyopencv_custom_headers.h" static void OnMouse(int event, int x, int y, int flags, void* param) { diff --git a/modules/python/src2/gen2.py b/modules/python/src2/gen2.py index 0175f1e6db..86cde882b7 100755 --- a/modules/python/src2/gen2.py +++ b/modules/python/src2/gen2.py @@ -30,7 +30,7 @@ gen_template_call_constructor = Template("""self->v.reset(new ${cname}${args})"" gen_template_simple_call_constructor_prelude = Template("""self = PyObject_NEW(pyopencv_${name}_t, &pyopencv_${name}_Type); if(self) """) -gen_template_simple_call_constructor = Template("""self->v = ${cname}${args}""") +gen_template_simple_call_constructor = Template("""new (&(self->v)) ${cname}${args}""") gen_template_parse_args = Template("""const char* keywords[] = { $kw_list, NULL }; if( PyArg_ParseTupleAndKeywords(args, kw, "$fmtspec", (char**)keywords, $parse_arglist)$code_cvt )""") @@ -74,13 +74,14 @@ static PyTypeObject pyopencv_${name}_Type = static void pyopencv_${name}_dealloc(PyObject* self) { + ((pyopencv_${name}_t*)self)->v.${cname}::~${sname}(); PyObject_Del(self); } template<> PyObject* pyopencv_from(const ${cname}& r) { pyopencv_${name}_t *m = PyObject_NEW(pyopencv_${name}_t, &pyopencv_${name}_Type); - m->v = r; + new (&m->v) ${cname}(r); //Copy constructor return (PyObject*)m; } @@ -258,6 +259,7 @@ class ClassInfo(object): def __init__(self, name, decl=None): self.cname = name.replace(".", "::") self.name = self.wname = normalize_class_name(name) + self.sname = name[name.rfind('.') + 1:] self.ismap = False self.issimple = False self.isalgorithm = False @@ -904,7 +906,7 @@ class PythonWrapperGenerator(object): templ = gen_template_simple_type_decl else: templ = gen_template_type_decl - self.code_types.write(templ.substitute(name=name, wname=classinfo.wname, cname=classinfo.cname, + self.code_types.write(templ.substitute(name=name, wname=classinfo.wname, cname=classinfo.cname, sname=classinfo.sname, cname1=("cv::Algorithm" if classinfo.isalgorithm else classinfo.cname))) # register classes in the same order as they have been declared. diff --git a/modules/python/test/test_calibration.py b/modules/python/test/test_calibration.py index 665521862c..584c7e6cbb 100644 --- a/modules/python/test/test_calibration.py +++ b/modules/python/test/test_calibration.py @@ -57,7 +57,7 @@ class calibration_test(NewOpenCVTests): eps = 0.01 normCamEps = 10.0 - normDistEps = 0.001 + normDistEps = 0.05 cameraMatrixTest = [[ 532.80992189, 0., 342.4952186 ], [ 0., 532.93346422, 233.8879292 ], @@ -68,4 +68,4 @@ class calibration_test(NewOpenCVTests): self.assertLess(abs(rms - 0.196334638034), eps) self.assertLess(cv2.norm(camera_matrix - cameraMatrixTest, cv2.NORM_L1), normCamEps) - self.assertLess(cv2.norm(dist_coefs - distCoeffsTest, cv2.NORM_L1), normDistEps) \ No newline at end of file + self.assertLess(cv2.norm(dist_coefs - distCoeffsTest, cv2.NORM_L1), normDistEps) diff --git a/modules/python/test/test_mser.py b/modules/python/test/test_mser.py index 619300b865..f66582ee4b 100644 --- a/modules/python/test/test_mser.py +++ b/modules/python/test/test_mser.py @@ -59,11 +59,11 @@ class mser_test(NewOpenCVTests): if blur: src = cv2.GaussianBlur(src, (5, 5), 1.5, 1.5) minRegs = 7 if use_big_image else 2 - maxRegs = 1000 if use_big_image else 15 + maxRegs = 1000 if use_big_image else 20 if binarize and (thresh == 0 or thresh == 255): minRegs = maxRegs = 0 msers, boxes = mserExtractor.detectRegions(src) nmsers = len(msers) self.assertEqual(nmsers, len(boxes)) self.assertLessEqual(minRegs, nmsers) - self.assertGreaterEqual(maxRegs, nmsers) \ No newline at end of file + self.assertGreaterEqual(maxRegs, nmsers) diff --git a/modules/python/test/test_texture_flow.py b/modules/python/test/test_texture_flow.py index 7dc3b07040..b0f55207c5 100644 --- a/modules/python/test/test_texture_flow.py +++ b/modules/python/test/test_texture_flow.py @@ -21,31 +21,24 @@ class texture_flow_test(NewOpenCVTests): def test_texture_flow(self): - img = self.get_sample('samples/data/pic6.png') + img = self.get_sample('samples/data/chessboard.png') gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) h, w = img.shape[:2] - eigen = cv2.cornerEigenValsAndVecs(gray, 15, 3) + eigen = cv2.cornerEigenValsAndVecs(gray, 5, 3) eigen = eigen.reshape(h, w, 3, 2) # [[e1, e2], v1, v2] flow = eigen[:,:,2] - vis = img.copy() - vis[:] = (192 + np.uint32(vis)) / 2 - d = 80 + d = 300 + eps = d / 30 + points = np.dstack( np.mgrid[d/2:w:d, d/2:h:d] ).reshape(-1, 2) textureVectors = [] - for x, y in np.int32(points): textureVectors.append(np.int32(flow[y, x]*d)) - eps = 0.05 - - testTextureVectors = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], - [-38, 70], [-79, 3], [0, 0], [0, 0], [-39, 69], [-79, -1], - [0, 0], [0, 0], [0, -79], [17, -78], [-48, -63], [65, -46], - [-69, -39], [-48, -63], [-45, 66]] - for i in range(len(textureVectors)): - self.assertLessEqual(cv2.norm(textureVectors[i] - testTextureVectors[i], cv2.NORM_L2), eps) \ No newline at end of file + self.assertTrue(cv2.norm(textureVectors[i], cv2.NORM_L2) < eps + or abs(cv2.norm(textureVectors[i], cv2.NORM_L2) - d) < eps) diff --git a/modules/shape/src/aff_trans.cpp b/modules/shape/src/aff_trans.cpp index 26644eb3a2..bbcd8abfa7 100644 --- a/modules/shape/src/aff_trans.cpp +++ b/modules/shape/src/aff_trans.cpp @@ -102,6 +102,8 @@ protected: void AffineTransformerImpl::warpImage(InputArray transformingImage, OutputArray output, int flags, int borderMode, const Scalar& borderValue) const { + CV_INSTRUMENT_REGION() + CV_Assert(!affineMat.empty()); warpAffine(transformingImage, output, affineMat, transformingImage.getMat().size(), flags, borderMode, borderValue); } @@ -183,6 +185,8 @@ static Mat _localAffineEstimate(const std::vector& shape1, const std::v void AffineTransformerImpl::estimateTransformation(InputArray _pts1, InputArray _pts2, std::vector& _matches) { + CV_INSTRUMENT_REGION() + Mat pts1 = _pts1.getMat(); Mat pts2 = _pts2.getMat(); CV_Assert((pts1.channels()==2) && (pts1.cols>0) && (pts2.channels()==2) && (pts2.cols>0)); @@ -228,6 +232,8 @@ void AffineTransformerImpl::estimateTransformation(InputArray _pts1, InputArray float AffineTransformerImpl::applyTransformation(InputArray inPts, OutputArray outPts) { + CV_INSTRUMENT_REGION() + Mat pts1 = inPts.getMat(); CV_Assert((pts1.channels()==2) && (pts1.cols>0)); diff --git a/modules/shape/src/emdL1.cpp b/modules/shape/src/emdL1.cpp index 75f1b13ad5..7baa97f0b9 100644 --- a/modules/shape/src/emdL1.cpp +++ b/modules/shape/src/emdL1.cpp @@ -787,6 +787,8 @@ float EmdL1::compuTotalFlow() float cv::EMDL1(InputArray _signature1, InputArray _signature2) { + CV_INSTRUMENT_REGION() + Mat signature1 = _signature1.getMat(), signature2 = _signature2.getMat(); EmdL1 emdl1; return emdl1.getEMDL1(signature1, signature2); diff --git a/modules/shape/src/haus_dis.cpp b/modules/shape/src/haus_dis.cpp index dd67a29982..6f372c416d 100644 --- a/modules/shape/src/haus_dis.cpp +++ b/modules/shape/src/haus_dis.cpp @@ -129,6 +129,8 @@ static float _apply(const Mat &set1, const Mat &set2, int distType, double propR float HausdorffDistanceExtractorImpl::computeDistance(InputArray contour1, InputArray contour2) { + CV_INSTRUMENT_REGION() + Mat set1=contour1.getMat(), set2=contour2.getMat(); if (set1.type() != CV_32F) set1.convertTo(set1, CV_32F); diff --git a/modules/shape/src/hist_cost.cpp b/modules/shape/src/hist_cost.cpp index 7df3c4e589..db1d42e562 100644 --- a/modules/shape/src/hist_cost.cpp +++ b/modules/shape/src/hist_cost.cpp @@ -125,6 +125,8 @@ protected: void NormHistogramCostExtractorImpl::buildCostMatrix(InputArray _descriptors1, InputArray _descriptors2, OutputArray _costMatrix) { + CV_INSTRUMENT_REGION() + // size of the costMatrix with dummies // Mat descriptors1=_descriptors1.getMat(); Mat descriptors2=_descriptors2.getMat(); @@ -251,6 +253,8 @@ protected: void EMDHistogramCostExtractorImpl::buildCostMatrix(InputArray _descriptors1, InputArray _descriptors2, OutputArray _costMatrix) { + CV_INSTRUMENT_REGION() + // size of the costMatrix with dummies // Mat descriptors1=_descriptors1.getMat(); Mat descriptors2=_descriptors2.getMat(); @@ -373,6 +377,8 @@ protected: void ChiHistogramCostExtractorImpl::buildCostMatrix(InputArray _descriptors1, InputArray _descriptors2, OutputArray _costMatrix) { + CV_INSTRUMENT_REGION() + // size of the costMatrix with dummies // Mat descriptors1=_descriptors1.getMat(); Mat descriptors2=_descriptors2.getMat(); @@ -490,6 +496,8 @@ protected: void EMDL1HistogramCostExtractorImpl::buildCostMatrix(InputArray _descriptors1, InputArray _descriptors2, OutputArray _costMatrix) { + CV_INSTRUMENT_REGION() + // size of the costMatrix with dummies // Mat descriptors1=_descriptors1.getMat(); Mat descriptors2=_descriptors2.getMat(); diff --git a/modules/shape/src/sc_dis.cpp b/modules/shape/src/sc_dis.cpp index 423ae8e00f..89c6d91255 100644 --- a/modules/shape/src/sc_dis.cpp +++ b/modules/shape/src/sc_dis.cpp @@ -186,6 +186,8 @@ protected: float ShapeContextDistanceExtractorImpl::computeDistance(InputArray contour1, InputArray contour2) { + CV_INSTRUMENT_REGION() + // Checking // Mat sset1=contour1.getMat(), sset2=contour2.getMat(), set1, set2; if (set1.type() != CV_32F) @@ -492,6 +494,8 @@ void SCDMatcher::matchDescriptors(cv::Mat &descriptors1, cv::Mat &descriptors2, void SCDMatcher::buildCostMatrix(const cv::Mat &descriptors1, const cv::Mat &descriptors2, cv::Mat &costMatrix, cv::Ptr &comparer) const { + CV_INSTRUMENT_REGION() + comparer->buildCostMatrix(descriptors1, descriptors2, costMatrix); } @@ -762,7 +766,7 @@ void SCDMatcher::hungarian(cv::Mat &costMatrix, std::vector &outMatc inliers1.reserve(sizeScd1); for (size_t kc = 0; kc &outMatc inliers2.reserve(sizeScd2); for (size_t kc = 0; kc0)); @@ -189,6 +193,8 @@ float ThinPlateSplineShapeTransformerImpl::applyTransformation(InputArray inPts, void ThinPlateSplineShapeTransformerImpl::estimateTransformation(InputArray _pts1, InputArray _pts2, std::vector& _matches ) { + CV_INSTRUMENT_REGION() + Mat pts1 = _pts1.getMat(); Mat pts2 = _pts2.getMat(); CV_Assert((pts1.channels()==2) && (pts1.cols>0) && (pts2.channels()==2) && (pts2.cols>0)); diff --git a/modules/stitching/include/opencv2/stitching/detail/warpers_inl.hpp b/modules/stitching/include/opencv2/stitching/detail/warpers_inl.hpp index 0416ecb5ee..a91dd3f85d 100644 --- a/modules/stitching/include/opencv2/stitching/detail/warpers_inl.hpp +++ b/modules/stitching/include/opencv2/stitching/detail/warpers_inl.hpp @@ -150,10 +150,10 @@ Rect RotationWarperBase

::warpRoi(Size src_size, InputArray K, InputArray R) template void RotationWarperBase

::detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) { - float tl_uf = std::numeric_limits::max(); - float tl_vf = std::numeric_limits::max(); - float br_uf = -std::numeric_limits::max(); - float br_vf = -std::numeric_limits::max(); + float tl_uf = (std::numeric_limits::max)(); + float tl_vf = (std::numeric_limits::max)(); + float br_uf = -(std::numeric_limits::max)(); + float br_vf = -(std::numeric_limits::max)(); float u, v; for (int y = 0; y < src_size.height; ++y) @@ -161,8 +161,8 @@ void RotationWarperBase

::detectResultRoi(Size src_size, Point &dst_tl, Point for (int x = 0; x < src_size.width; ++x) { projector_.mapForward(static_cast(x), static_cast(y), u, v); - tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v); - br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v); + tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v); + br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v); } } @@ -176,31 +176,31 @@ void RotationWarperBase

::detectResultRoi(Size src_size, Point &dst_tl, Point template void RotationWarperBase

::detectResultRoiByBorder(Size src_size, Point &dst_tl, Point &dst_br) { - float tl_uf = std::numeric_limits::max(); - float tl_vf = std::numeric_limits::max(); - float br_uf = -std::numeric_limits::max(); - float br_vf = -std::numeric_limits::max(); + float tl_uf = (std::numeric_limits::max)(); + float tl_vf = (std::numeric_limits::max)(); + float br_uf = -(std::numeric_limits::max)(); + float br_vf = -(std::numeric_limits::max)(); float u, v; for (float x = 0; x < src_size.width; ++x) { projector_.mapForward(static_cast(x), 0, u, v); - tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v); - br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v); + tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v); + br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v); projector_.mapForward(static_cast(x), static_cast(src_size.height - 1), u, v); - tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v); - br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v); + tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v); + br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v); } for (int y = 0; y < src_size.height; ++y) { projector_.mapForward(0, static_cast(y), u, v); - tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v); - br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v); + tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v); + br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v); projector_.mapForward(static_cast(src_size.width - 1), static_cast(y), u, v); - tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v); - br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v); + tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v); + br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v); } dst_tl.x = static_cast(tl_uf); diff --git a/modules/stitching/misc/python/pyopencv_stitching.hpp b/modules/stitching/misc/python/pyopencv_stitching.hpp new file mode 100644 index 0000000000..e5d0cd2481 --- /dev/null +++ b/modules/stitching/misc/python/pyopencv_stitching.hpp @@ -0,0 +1,9 @@ +#ifdef HAVE_OPENCV_STITCHING +typedef Stitcher::Status Status; + +template<> +PyObject* pyopencv_from(const Status& value) +{ + return PyInt_FromLong(value); +} +#endif \ No newline at end of file diff --git a/modules/stitching/src/autocalib.cpp b/modules/stitching/src/autocalib.cpp index 24145242c7..18b6e048d0 100644 --- a/modules/stitching/src/autocalib.cpp +++ b/modules/stitching/src/autocalib.cpp @@ -51,9 +51,6 @@ static inline bool decomposeCholesky(double* A, size_t astep, int m) { if (!hal::Cholesky64f(A, astep, m, 0, 0, 0)) return false; - astep /= sizeof(A[0]); - for (int i = 0; i < m; ++i) - A[i*astep + i] = (double)(1./A[i*astep + i]); return true; } diff --git a/modules/stitching/src/exposure_compensate.cpp b/modules/stitching/src/exposure_compensate.cpp index 1f04fff9f7..6f2562b204 100644 --- a/modules/stitching/src/exposure_compensate.cpp +++ b/modules/stitching/src/exposure_compensate.cpp @@ -147,6 +147,8 @@ void GainCompensator::feed(const std::vector &corners, const std::vector< void GainCompensator::apply(int index, Point /*corner*/, InputOutputArray image, InputArray /*mask*/) { + CV_INSTRUMENT_REGION() + multiply(image, gains_(index, 0), image); } @@ -225,6 +227,8 @@ void BlocksGainCompensator::feed(const std::vector &corners, const std::v void BlocksGainCompensator::apply(int index, Point /*corner*/, InputOutputArray _image, InputArray /*mask*/) { + CV_INSTRUMENT_REGION() + CV_Assert(_image.type() == CV_8UC3); UMat u_gain_map; diff --git a/modules/stitching/src/matchers.cpp b/modules/stitching/src/matchers.cpp index 40988b9888..3cf79822f0 100644 --- a/modules/stitching/src/matchers.cpp +++ b/modules/stitching/src/matchers.cpp @@ -144,6 +144,8 @@ private: void CpuMatcher::match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo& matches_info) { + CV_INSTRUMENT_REGION() + CV_Assert(features1.descriptors.type() == features2.descriptors.type()); CV_Assert(features2.descriptors.depth() == CV_8U || features2.descriptors.depth() == CV_32F); @@ -212,6 +214,8 @@ void CpuMatcher::match(const ImageFeatures &features1, const ImageFeatures &feat #ifdef HAVE_OPENCV_CUDAFEATURES2D void GpuMatcher::match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo& matches_info) { + CV_INSTRUMENT_REGION() + matches_info.matches.clear(); ensureSizeIsEnough(features1.descriptors.size(), features1.descriptors.type(), descriptors1_); @@ -581,6 +585,8 @@ BestOf2NearestMatcher::BestOf2NearestMatcher(bool try_use_gpu, float match_conf, void BestOf2NearestMatcher::match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo &matches_info) { + CV_INSTRUMENT_REGION() + (*impl_)(features1, features2, matches_info); // Check if it makes sense to find homography diff --git a/modules/stitching/src/seam_finders.cpp b/modules/stitching/src/seam_finders.cpp index dbed801d5b..90bf599937 100644 --- a/modules/stitching/src/seam_finders.cpp +++ b/modules/stitching/src/seam_finders.cpp @@ -203,6 +203,8 @@ void DpSeamFinder::process( const Mat &image1, const Mat &image2, Point tl1, Point tl2, Mat &mask1, Mat &mask2) { + CV_INSTRUMENT_REGION() + CV_Assert(image1.size() == mask1.size()); CV_Assert(image2.size() == mask2.size()); @@ -638,7 +640,7 @@ bool DpSeamFinder::getSeamTips(int comp1, int comp2, Point &p1, Point &p2) { double size1 = static_cast(points[i].size()), size2 = static_cast(points[j].size()); double cx1 = cvRound(sum[i].x / size1), cy1 = cvRound(sum[i].y / size1); - double cx2 = cvRound(sum[j].x / size2), cy2 = cvRound(sum[j].y / size1); + double cx2 = cvRound(sum[j].x / size2), cy2 = cvRound(sum[j].y / size2); double dist = (cx1 - cx2) * (cx1 - cx2) + (cy1 - cy2) * (cy1 - cy2); if (dist > maxDist) diff --git a/modules/stitching/src/stitcher.cpp b/modules/stitching/src/stitcher.cpp index 41fe81f5fc..19d3924337 100644 --- a/modules/stitching/src/stitcher.cpp +++ b/modules/stitching/src/stitcher.cpp @@ -56,7 +56,7 @@ Stitcher Stitcher::createDefault(bool try_use_gpu) stitcher.setFeaturesMatcher(makePtr(try_use_gpu)); stitcher.setBundleAdjuster(makePtr()); -#ifdef HAVE_CUDA +#ifdef HAVE_OPENCV_CUDALEGACY if (try_use_gpu && cuda::getCudaEnabledDeviceCount() > 0) { #ifdef HAVE_OPENCV_XFEATURES2D @@ -93,12 +93,16 @@ Stitcher Stitcher::createDefault(bool try_use_gpu) Stitcher::Status Stitcher::estimateTransform(InputArrayOfArrays images) { + CV_INSTRUMENT_REGION() + return estimateTransform(images, std::vector >()); } Stitcher::Status Stitcher::estimateTransform(InputArrayOfArrays images, const std::vector > &rois) { + CV_INSTRUMENT_REGION() + images.getUMatVector(imgs_); rois_ = rois; @@ -117,12 +121,16 @@ Stitcher::Status Stitcher::estimateTransform(InputArrayOfArrays images, const st Stitcher::Status Stitcher::composePanorama(OutputArray pano) { + CV_INSTRUMENT_REGION() + return composePanorama(std::vector(), pano); } Stitcher::Status Stitcher::composePanorama(InputArrayOfArrays images, OutputArray pano) { + CV_INSTRUMENT_REGION() + LOGLN("Warping images (auxiliary)... "); std::vector imgs; @@ -184,7 +192,7 @@ Stitcher::Status Stitcher::composePanorama(InputArrayOfArrays images, OutputArra K(1,1) *= (float)seam_work_aspect_; K(1,2) *= (float)seam_work_aspect_; - corners[i] = w->warp(seam_est_imgs_[i], K, cameras_[i].R, INTER_LINEAR, BORDER_CONSTANT, images_warped[i]); + corners[i] = w->warp(seam_est_imgs_[i], K, cameras_[i].R, INTER_LINEAR, BORDER_REFLECT, images_warped[i]); sizes[i] = images_warped[i].size(); w->warp(masks[i], K, cameras_[i].R, INTER_NEAREST, BORDER_CONSTANT, masks_warped[i]); @@ -290,7 +298,7 @@ Stitcher::Status Stitcher::composePanorama(InputArrayOfArrays images, OutputArra int64 pt = getTickCount(); #endif // Warp the current image - w->warp(img, K, cameras_[img_idx].R, INTER_LINEAR, BORDER_CONSTANT, img_warped); + w->warp(img, K, cameras_[img_idx].R, INTER_LINEAR, BORDER_REFLECT, img_warped); LOGLN(" warp the current image: " << ((getTickCount() - pt) / getTickFrequency()) << " sec"); #if ENABLE_LOG pt = getTickCount(); @@ -365,6 +373,8 @@ Stitcher::Status Stitcher::composePanorama(InputArrayOfArrays images, OutputArra Stitcher::Status Stitcher::stitch(InputArrayOfArrays images, OutputArray pano) { + CV_INSTRUMENT_REGION() + Status status = estimateTransform(images); if (status != OK) return status; @@ -374,6 +384,8 @@ Stitcher::Status Stitcher::stitch(InputArrayOfArrays images, OutputArray pano) Stitcher::Status Stitcher::stitch(InputArrayOfArrays images, const std::vector > &rois, OutputArray pano) { + CV_INSTRUMENT_REGION() + Status status = estimateTransform(images, rois); if (status != OK) return status; @@ -539,6 +551,8 @@ Stitcher::Status Stitcher::estimateCameraParams() Ptr createStitcher(bool try_use_gpu) { + CV_INSTRUMENT_REGION() + Ptr stitcher = makePtr(); stitcher->setRegistrationResol(0.6); stitcher->setSeamEstimationResol(0.1); @@ -549,7 +563,7 @@ Ptr createStitcher(bool try_use_gpu) stitcher->setFeaturesMatcher(makePtr(try_use_gpu)); stitcher->setBundleAdjuster(makePtr()); - #ifdef HAVE_CUDA + #ifdef HAVE_OPENCV_CUDALEGACY if (try_use_gpu && cuda::getCudaEnabledDeviceCount() > 0) { #ifdef HAVE_OPENCV_NONFREE @@ -561,20 +575,20 @@ Ptr createStitcher(bool try_use_gpu) stitcher->setSeamFinder(makePtr()); } else + #endif + { + #ifdef HAVE_OPENCV_NONFREE + stitcher->setFeaturesFinder(makePtr()); + #else + stitcher->setFeaturesFinder(makePtr()); #endif - { - #ifdef HAVE_OPENCV_NONFREE - stitcher->setFeaturesFinder(makePtr()); - #else - stitcher->setFeaturesFinder(makePtr()); - #endif - stitcher->setWarper(makePtr()); - stitcher->setSeamFinder(makePtr(detail::GraphCutSeamFinderBase::COST_COLOR)); - } + stitcher->setWarper(makePtr()); + stitcher->setSeamFinder(makePtr(detail::GraphCutSeamFinderBase::COST_COLOR)); + } - stitcher->setExposureCompensator(makePtr()); - stitcher->setBlender(makePtr(try_use_gpu)); + stitcher->setExposureCompensator(makePtr()); + stitcher->setBlender(makePtr(try_use_gpu)); - return stitcher; + return stitcher; } } // namespace cv diff --git a/modules/stitching/src/timelapsers.cpp b/modules/stitching/src/timelapsers.cpp index bc1d62e1a8..b42e79ae1a 100644 --- a/modules/stitching/src/timelapsers.cpp +++ b/modules/stitching/src/timelapsers.cpp @@ -65,6 +65,8 @@ void Timelapser::initialize(const std::vector &corners, const std::vector void Timelapser::process(InputArray _img, InputArray /*_mask*/, Point tl) { + CV_INSTRUMENT_REGION() + dst_.setTo(Scalar::all(0)); Mat img = _img.getMat(); diff --git a/modules/superres/src/btv_l1.cpp b/modules/superres/src/btv_l1.cpp index d47453f0d0..9c863411e8 100644 --- a/modules/superres/src/btv_l1.cpp +++ b/modules/superres/src/btv_l1.cpp @@ -658,6 +658,8 @@ namespace void BTVL1_Base::process(InputArrayOfArrays _src, OutputArray _dst, InputArrayOfArrays _forwardMotions, InputArrayOfArrays _backwardMotions, int baseIdx) { + CV_INSTRUMENT_REGION() + CV_Assert( scale_ > 1 ); CV_Assert( iterations_ > 0 ); CV_Assert( tau_ > 0.0 ); @@ -954,6 +956,8 @@ namespace void BTVL1::processImpl(Ptr& frameSource, OutputArray _output) { + CV_INSTRUMENT_REGION() + if (outPos_ >= storePos_) { _output.release(); @@ -1003,6 +1007,8 @@ namespace void BTVL1::readNextFrame(Ptr& frameSource) { + CV_INSTRUMENT_REGION() + frameSource->nextFrame(curFrame_); if (curFrame_.empty()) return; @@ -1065,6 +1071,8 @@ namespace void BTVL1::processFrame(int idx) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(isUmat_, ocl_processFrame(idx)) diff --git a/modules/superres/src/input_array_utility.cpp b/modules/superres/src/input_array_utility.cpp index a823e43cda..b3ea4bb914 100644 --- a/modules/superres/src/input_array_utility.cpp +++ b/modules/superres/src/input_array_utility.cpp @@ -235,6 +235,8 @@ namespace Mat cv::superres::convertToType(const Mat& src, int type, Mat& buf0, Mat& buf1) { + CV_INSTRUMENT_REGION() + if (src.type() == type) return src; @@ -260,6 +262,8 @@ Mat cv::superres::convertToType(const Mat& src, int type, Mat& buf0, Mat& buf1) UMat cv::superres::convertToType(const UMat& src, int type, UMat& buf0, UMat& buf1) { + CV_INSTRUMENT_REGION() + if (src.type() == type) return src; diff --git a/modules/superres/src/optical_flow.cpp b/modules/superres/src/optical_flow.cpp index 25a10af3f8..b5d1407eee 100644 --- a/modules/superres/src/optical_flow.cpp +++ b/modules/superres/src/optical_flow.cpp @@ -119,6 +119,8 @@ namespace void CpuOpticalFlow::calc(InputArray _frame0, InputArray _frame1, OutputArray _flow1, OutputArray _flow2) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(_flow1.isUMat() && (_flow2.isUMat() || !_flow2.needed()), ocl_calc(_frame0, _frame1, _flow1, _flow2)) @@ -214,6 +216,8 @@ namespace void Farneback::calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2) { + CV_INSTRUMENT_REGION() + CpuOpticalFlow::calc(frame0, frame1, flow1, flow2); } @@ -358,6 +362,8 @@ namespace void DualTVL1::calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2) { + CV_INSTRUMENT_REGION() + CpuOpticalFlow::calc(frame0, frame1, flow1, flow2); } @@ -434,6 +440,8 @@ namespace void GpuOpticalFlow::calc(InputArray _frame0, InputArray _frame1, OutputArray _flow1, OutputArray _flow2) { + CV_INSTRUMENT_REGION() + GpuMat frame0 = arrGetGpuMat(_frame0, buf_[0]); GpuMat frame1 = arrGetGpuMat(_frame1, buf_[1]); diff --git a/modules/superres/src/super_resolution.cpp b/modules/superres/src/super_resolution.cpp index 3eae5a6fd2..6055920599 100644 --- a/modules/superres/src/super_resolution.cpp +++ b/modules/superres/src/super_resolution.cpp @@ -61,6 +61,8 @@ void cv::superres::SuperResolution::setInput(const Ptr& frameSource void cv::superres::SuperResolution::nextFrame(OutputArray frame) { + CV_INSTRUMENT_REGION() + isUmat_ = frame.isUMat(); if (firstCall_) diff --git a/modules/ts/include/opencv2/ts/ocl_perf.hpp b/modules/ts/include/opencv2/ts/ocl_perf.hpp index c2e860067b..2f2f55ccaf 100644 --- a/modules/ts/include/opencv2/ts/ocl_perf.hpp +++ b/modules/ts/include/opencv2/ts/ocl_perf.hpp @@ -97,13 +97,13 @@ using std::tr1::tuple; // TODO Replace finish call to dstUMat.wait() #define OCL_TEST_CYCLE() \ - for (cvtest::ocl::perf::safeFinish(); startTimer(), next(); cvtest::ocl::perf::safeFinish(), stopTimer()) + for (cvtest::ocl::perf::safeFinish(); next() && startTimer(); cvtest::ocl::perf::safeFinish(), stopTimer()) #define OCL_TEST_CYCLE_N(n) \ - for(declare.iterations(n), cvtest::ocl::perf::safeFinish(); startTimer(), next(); cvtest::ocl::perf::safeFinish(), stopTimer()) + for (declare.iterations(n), cvtest::ocl::perf::safeFinish(); next() && startTimer(); cvtest::ocl::perf::safeFinish(), stopTimer()) #define OCL_TEST_CYCLE_MULTIRUN(runsNum) \ - for (declare.runs(runsNum), cvtest::ocl::perf::safeFinish(); startTimer(), next(); cvtest::ocl::perf::safeFinish(), stopTimer()) \ + for (declare.runs(runsNum), cvtest::ocl::perf::safeFinish(); next() && startTimer(); cvtest::ocl::perf::safeFinish(), stopTimer()) \ for (int r = 0; r < runsNum; cvtest::ocl::perf::safeFinish(), ++r) diff --git a/modules/ts/include/opencv2/ts/ts_perf.hpp b/modules/ts/include/opencv2/ts/ts_perf.hpp index 09998998b5..d1a726a486 100644 --- a/modules/ts/include/opencv2/ts/ts_perf.hpp +++ b/modules/ts/include/opencv2/ts/ts_perf.hpp @@ -354,6 +354,15 @@ typedef struct ImplData } ImplData; #endif +#ifdef ENABLE_INSTRUMENTATION +class InstumentData +{ +public: + static ::cv::String treeToString(); + static void printTree(); +}; +#endif + class CV_EXPORTS TestBase: public ::testing::Test { public: @@ -382,7 +391,7 @@ protected: virtual void SetUp(); virtual void TearDown(); - void startTimer(); + bool startTimer(); // bool is dummy for conditional loop void stopTimer(); bool next(); @@ -406,6 +415,10 @@ protected: #ifdef CV_COLLECT_IMPL_DATA ImplData implConf; #endif +#ifdef ENABLE_INSTRUMENTATION + InstumentData instrConf; +#endif + private: typedef std::vector > SizeVector; typedef std::vector TimeVector; @@ -645,9 +658,9 @@ int main(int argc, char **argv)\ CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\ } -#define TEST_CYCLE_N(n) for(declare.iterations(n); startTimer(), next(); stopTimer()) -#define TEST_CYCLE() for(; startTimer(), next(); stopTimer()) -#define TEST_CYCLE_MULTIRUN(runsNum) for(declare.runs(runsNum); startTimer(), next(); stopTimer()) for(int r = 0; r < runsNum; ++r) +#define TEST_CYCLE_N(n) for(declare.iterations(n); next() && startTimer(); stopTimer()) +#define TEST_CYCLE() for(; next() && startTimer(); stopTimer()) +#define TEST_CYCLE_MULTIRUN(runsNum) for(declare.runs(runsNum); next() && startTimer(); stopTimer()) for(int r = 0; r < runsNum; ++r) namespace perf { diff --git a/modules/ts/src/ts_perf.cpp b/modules/ts/src/ts_perf.cpp index 1a959f176d..8866272667 100644 --- a/modules/ts/src/ts_perf.cpp +++ b/modules/ts/src/ts_perf.cpp @@ -45,6 +45,9 @@ static bool param_verify_sanity; #ifdef CV_COLLECT_IMPL_DATA static bool param_collect_impl; #endif +#ifdef ENABLE_INSTRUMENTATION +static bool param_instrument; +#endif extern bool test_ipp_check; #ifdef HAVE_CUDA @@ -727,7 +730,222 @@ public: } }; +#ifdef ENABLE_INSTRUMENTATION +static void printShift(cv::instr::InstrNode *pNode, cv::instr::InstrNode* pRoot) +{ + // Print empty line for a big tree nodes + if(pNode->m_pParent) + { + int parendIdx = pNode->m_pParent->findChild(pNode); + if(parendIdx > 0 && pNode->m_pParent->m_childs[parendIdx-1]->m_childs.size()) + { + printShift(pNode->m_pParent->m_childs[parendIdx-1]->m_childs[0], pRoot); + printf("\n"); + } + } + // Check if parents have more childs + std::vector cache; + cv::instr::InstrNode *pTmpNode = pNode; + while(pTmpNode->m_pParent && pTmpNode->m_pParent != pRoot) + { + cache.push_back(pTmpNode->m_pParent); + pTmpNode = pTmpNode->m_pParent; + } + for(int i = (int)cache.size()-1; i >= 0; i--) + { + if(cache[i]->m_pParent) + { + if(cache[i]->m_pParent->findChild(cache[i]) == cache[i]->m_pParent->m_childs.size()-1) + printf(" "); + else + printf("| "); + } + } +} + +static double calcLocalWeight(cv::instr::InstrNode *pNode) +{ + if(pNode->m_pParent && pNode->m_pParent->m_pParent) + return ((double)pNode->m_payload.m_ticksTotal*100/pNode->m_pParent->m_payload.m_ticksTotal); + else + return 100; +} + +static double calcGlobalWeight(cv::instr::InstrNode *pNode) +{ + cv::instr::InstrNode* globNode = pNode; + + while(globNode->m_pParent && globNode->m_pParent->m_pParent) + globNode = globNode->m_pParent; + + return ((double)pNode->m_payload.m_ticksTotal*100/(double)globNode->m_payload.m_ticksTotal); +} + +static void printNodeRec(cv::instr::InstrNode *pNode, cv::instr::InstrNode *pRoot) +{ + printf("%s", (pNode->m_payload.m_funName.substr(0, 40) + ((pNode->m_payload.m_funName.size()>40)?"...":"")).c_str()); + + // Write instrumentation flags + if(pNode->m_payload.m_instrType != cv::instr::TYPE_GENERAL || pNode->m_payload.m_implType != cv::instr::IMPL_PLAIN) + { + printf("<"); + if(pNode->m_payload.m_instrType == cv::instr::TYPE_WRAPPER) + printf("W"); + else if(pNode->m_payload.m_instrType == cv::instr::TYPE_FUN) + printf("F"); + else if(pNode->m_payload.m_instrType == cv::instr::TYPE_MARKER) + printf("MARK"); + + if(pNode->m_payload.m_instrType != cv::instr::TYPE_GENERAL && pNode->m_payload.m_implType != cv::instr::IMPL_PLAIN) + printf("_"); + + if(pNode->m_payload.m_implType == cv::instr::IMPL_IPP) + printf("IPP"); + else if(pNode->m_payload.m_implType == cv::instr::IMPL_OPENCL) + printf("OCL"); + + printf(">"); + } + + if(pNode->m_pParent) + { + printf(" - C:%d", pNode->m_payload.m_counter); + printf(" T:%.4fms", pNode->m_payload.getMeanMs()); + if(pNode->m_pParent->m_pParent) + printf(" L:%.0f%% G:%.0f%%", calcLocalWeight(pNode), calcGlobalWeight(pNode)); + } + printf("\n"); + + // Group childes + std::vector groups; + { + bool bFound = false; + for(size_t i = 0; i < pNode->m_childs.size(); i++) + { + bFound = false; + for(size_t j = 0; j < groups.size(); j++) + { + if(groups[j] == pNode->m_childs[i]->m_payload.m_funName) + { + bFound = true; + break; + } + } + if(!bFound) + groups.push_back(pNode->m_childs[i]->m_payload.m_funName); + } + } + + for(size_t g = 0; g < groups.size(); g++) + { + for(size_t i = 0; i < pNode->m_childs.size(); i++) + { + if(pNode->m_childs[i]->m_payload.m_funName == groups[g]) + { + printShift(pNode->m_childs[i], pRoot); + + if(pNode->m_childs.size()-1 == pNode->m_childs[i]->m_pParent->findChild(pNode->m_childs[i])) + printf("\\---"); + else + printf("|---"); + printNodeRec(pNode->m_childs[i], pRoot); + } + } + } +} + +template +std::string to_string_with_precision(const T value, const int p = 3) +{ + std::ostringstream out; + out << std::fixed << std::setprecision(p) << value; + return out.str(); +} + +static cv::String nodeToString(cv::instr::InstrNode *pNode) +{ + cv::String string; + if (pNode->m_payload.m_funName == "ROOT") + string = pNode->m_payload.m_funName; + else + { + string = "#"; + string += std::to_string(pNode->m_payload.m_instrType); + string += pNode->m_payload.m_funName; + string += " - L:"; + string += to_string_with_precision(calcLocalWeight(pNode)); + string += ", G:"; + string += to_string_with_precision(calcGlobalWeight(pNode)); + } + string += "("; + for(size_t i = 0; i < pNode->m_childs.size(); i++) + string += nodeToString(pNode->m_childs[i]); + string += ")"; + + return string; +} + +static uint64 getNodeTimeRec(cv::instr::InstrNode *pNode, cv::instr::TYPE type, cv::instr::IMPL impl) +{ + uint64 ticks = 0; + + if (pNode->m_pParent && (type < 0 || pNode->m_payload.m_instrType == type) && pNode->m_payload.m_implType == impl) + { + ticks = pNode->m_payload.m_ticksTotal; + return ticks; + } + + for(size_t i = 0; i < pNode->m_childs.size(); i++) + ticks += getNodeTimeRec(pNode->m_childs[i], type, impl); + + return ticks; +} + +static uint64 getImplTime(cv::instr::IMPL impl) +{ + uint64 ticks = 0; + cv::instr::InstrNode *pRoot = cv::instr::getTrace(); + + ticks = getNodeTimeRec(pRoot, cv::instr::TYPE_FUN, impl); + + return ticks; +} + +static uint64 getTotalTime() +{ + uint64 ticks = 0; + cv::instr::InstrNode *pRoot = cv::instr::getTrace(); + + for(size_t i = 0; i < pRoot->m_childs.size(); i++) + ticks += pRoot->m_childs[i]->m_payload.m_ticksTotal; + + return ticks; +} + +::cv::String InstumentData::treeToString() +{ + cv::String string = nodeToString(cv::instr::getTrace()); + return string; +} + +void InstumentData::printTree() +{ + if(cv::instr::getTrace()->m_childs.size()) + { + printf("[ TRACE ]\n"); + printNodeRec(cv::instr::getTrace(), cv::instr::getTrace()); +#ifdef HAVE_IPP + printf("\nIPP weight: %.1f%%", ((double)getImplTime(cv::instr::IMPL_IPP)*100/(double)getTotalTime())); +#endif +#ifdef HAVE_OPENCL + printf("\nOPENCL weight: %.1f%%", ((double)getImplTime(cv::instr::IMPL_OPENCL)*100/(double)getTotalTime())); +#endif + printf("\n[/TRACE ]\n"); + fflush(stdout); + } +} +#endif /*****************************************************************************************\ * ::perf::TestBase @@ -774,6 +992,9 @@ void TestBase::Init(const std::vector & availableImpls, #endif #ifdef CV_COLLECT_IMPL_DATA "{ perf_collect_impl |false |collect info about executed implementations}" +#endif +#ifdef ENABLE_INSTRUMENTATION + "{ perf_instrument |false |instrument code to collect implementations trace}" #endif "{ help h |false |print help info}" #ifdef HAVE_CUDA @@ -826,6 +1047,9 @@ void TestBase::Init(const std::vector & availableImpls, #ifdef CV_COLLECT_IMPL_DATA param_collect_impl = args.get("perf_collect_impl"); #endif +#ifdef ENABLE_INSTRUMENTATION + param_instrument = args.get("perf_instrument"); +#endif #ifdef ANDROID param_affinity_mask = args.get("perf_affinity_mask"); log_power_checkpoints = args.has("perf_log_power_checkpoints"); @@ -856,6 +1080,12 @@ void TestBase::Init(const std::vector & availableImpls, else cv::setUseCollection(0); #endif +#ifdef ENABLE_INSTRUMENTATION + if(param_instrument) + cv::instr::setUseInstrumentation(true); + else + cv::instr::setUseInstrumentation(false); +#endif #ifdef HAVE_CUDA @@ -969,13 +1199,13 @@ int64 TestBase::_calibrate() cv::Mat b(2048, 2048, CV_32S, cv::Scalar(2)); declare.time(30); double s = 0; - for(declare.iterations(20); startTimer(), next(); stopTimer()) + for(declare.iterations(20); next() && startTimer(); stopTimer()) s+=a.dot(b); declare.time(s); //self calibration SetUp(); - for(declare.iterations(1000); startTimer(), next(); stopTimer()){} + for(declare.iterations(1000); next() && startTimer(); stopTimer()){} } }; @@ -1242,8 +1472,6 @@ bool TestBase::next() } #endif - if (has_next) - startTimer(); // really we should measure activity from this moment, so reset start time return has_next; } @@ -1281,9 +1509,17 @@ unsigned int TestBase::getTotalOutputSize() const return res; } -void TestBase::startTimer() +bool TestBase::startTimer() { +#ifdef ENABLE_INSTRUMENTATION + if(currentIter == 0) + { + cv::instr::setFlags(cv::instr::getFlags()|cv::instr::FLAGS_MAPPING); // enable mapping for the first run + cv::instr::resetTrace(); + } +#endif lastTime = cv::getTickCount(); + return true; // dummy true for conditional loop } void TestBase::stopTimer() @@ -1297,6 +1533,10 @@ void TestBase::stopTimer() if (lastTime < 0) lastTime = 0; times.push_back(lastTime); lastTime = 0; + +#ifdef ENABLE_INSTRUMENTATION + cv::instr::setFlags(cv::instr::getFlags()&~cv::instr::FLAGS_MAPPING); // disable mapping to decrease overhead for +1 run +#endif } performance_metrics& TestBase::calcMetrics() @@ -1469,6 +1709,16 @@ void TestBase::reportMetrics(bool toJUnitXML) RecordProperty("gstddev", cv::format("%.6f", m.gstddev).c_str()); RecordProperty("mean", cv::format("%.0f", m.mean).c_str()); RecordProperty("stddev", cv::format("%.0f", m.stddev).c_str()); +#ifdef ENABLE_INSTRUMENTATION + if(cv::instr::useInstrumentation()) + { + cv::String tree = InstumentData::treeToString(); + RecordProperty("functions_hierarchy", tree.c_str()); + RecordProperty("total_ipp_weight", cv::format("%.1f", ((double)getImplTime(cv::instr::IMPL_IPP)*100/(double)getTotalTime()))); + RecordProperty("total_opencl_weight", cv::format("%.1f", ((double)getImplTime(cv::instr::IMPL_OPENCL)*100/(double)getTotalTime()))); + cv::instr::resetTrace(); + } +#endif #ifdef CV_COLLECT_IMPL_DATA if(param_collect_impl) { @@ -1639,6 +1889,12 @@ void TestBase::TearDown() fflush(stdout); } #endif + +#ifdef ENABLE_INSTRUMENTATION + if(cv::instr::useInstrumentation()) + InstumentData::printTree(); +#endif + reportMetrics(true); } diff --git a/modules/video/src/bgfg_KNN.cpp b/modules/video/src/bgfg_KNN.cpp index a532204d42..66be34a00f 100755 --- a/modules/video/src/bgfg_KNN.cpp +++ b/modules/video/src/bgfg_KNN.cpp @@ -319,7 +319,7 @@ CV_INLINE void { m_nNextShortUpdate[pixel] = (uchar)( rand() % m_nShortUpdate ); }; -}; +} CV_INLINE int _cvCheckPixelBackgroundNP(long pixel, @@ -436,7 +436,7 @@ CV_INLINE int }; } return 0; -}; +} CV_INLINE void icvUpdatePixelBackgroundNP(const Mat& _src, Mat& _dst, @@ -554,12 +554,14 @@ CV_INLINE void i++; } } -}; +} void BackgroundSubtractorKNNImpl::apply(InputArray _image, OutputArray _fgmask, double learningRate) { + CV_INSTRUMENT_REGION() + Mat image = _image.getMat(); bool needToInitialize = nframes == 0 || learningRate >= 1 || image.size() != frameSize || image.type() != frameType; @@ -598,6 +600,8 @@ void BackgroundSubtractorKNNImpl::apply(InputArray _image, OutputArray _fgmask, void BackgroundSubtractorKNNImpl::getBackgroundImage(OutputArray backgroundImage) const { + CV_INSTRUMENT_REGION() + int nchannels = CV_MAT_CN(frameType); //CV_Assert( nchannels == 3 ); Mat meanBackground(frameSize, CV_8UC3, Scalar::all(0)); diff --git a/modules/video/src/bgfg_gaussmix2.cpp b/modules/video/src/bgfg_gaussmix2.cpp index 2720e50e42..ebe449825c 100644 --- a/modules/video/src/bgfg_gaussmix2.cpp +++ b/modules/video/src/bgfg_gaussmix2.cpp @@ -594,7 +594,7 @@ public: //internal: bool fitsPDF = false;//if it remains zero a new GMM mode will be added - int nmodes = modesUsed[x], nNewModes = nmodes;//current number of modes in GMM + int nmodes = modesUsed[x];//current number of modes in GMM float totalWeight = 0.f; float* mean_m = mean; @@ -700,8 +700,6 @@ public: gmm[mode].weight *= totalWeight; } - nmodes = nNewModes; - //make new mode if needed and exit if( !fitsPDF && alphaT > 0.f ) { @@ -836,6 +834,8 @@ void BackgroundSubtractorMOG2Impl::create_ocl_apply_kernel() void BackgroundSubtractorMOG2Impl::apply(InputArray _image, OutputArray _fgmask, double learningRate) { + CV_INSTRUMENT_REGION() + bool needToInitialize = nframes == 0 || learningRate >= 1 || _image.size() != frameSize || _image.type() != frameType; if( needToInitialize ) @@ -844,7 +844,7 @@ void BackgroundSubtractorMOG2Impl::apply(InputArray _image, OutputArray _fgmask, #ifdef HAVE_OPENCL if (opencl_ON) { - CV_OCL_RUN(opencl_ON, ocl_apply(_image, _fgmask, learningRate)) + CV_OCL_RUN(_image.isUMat(), ocl_apply(_image, _fgmask, learningRate)) opencl_ON = false; initialize(_image.size(), _image.type()); @@ -874,6 +874,8 @@ void BackgroundSubtractorMOG2Impl::apply(InputArray _image, OutputArray _fgmask, template void BackgroundSubtractorMOG2Impl::getBackgroundImage_intern(OutputArray backgroundImage) const { + CV_INSTRUMENT_REGION() + Mat meanBackground(frameSize, frameType, Scalar::all(0)); int firstGaussianIdx = 0; const GMM* gmm = bgmodel.ptr(); diff --git a/modules/video/src/camshift.cpp b/modules/video/src/camshift.cpp index 5449a1b47d..4a7017c82e 100644 --- a/modules/video/src/camshift.cpp +++ b/modules/video/src/camshift.cpp @@ -43,6 +43,8 @@ int cv::meanShift( InputArray _probImage, Rect& window, TermCriteria criteria ) { + CV_INSTRUMENT_REGION() + Size size; int cn; Mat mat; @@ -108,6 +110,8 @@ int cv::meanShift( InputArray _probImage, Rect& window, TermCriteria criteria ) cv::RotatedRect cv::CamShift( InputArray _probImage, Rect& window, TermCriteria criteria ) { + CV_INSTRUMENT_REGION() + const int TOLERANCE = 10; Size size; Mat mat; diff --git a/modules/video/src/kalman.cpp b/modules/video/src/kalman.cpp index 3b86771e87..d0fba8f8fb 100644 --- a/modules/video/src/kalman.cpp +++ b/modules/video/src/kalman.cpp @@ -81,6 +81,8 @@ void KalmanFilter::init(int DP, int MP, int CP, int type) const Mat& KalmanFilter::predict(const Mat& control) { + CV_INSTRUMENT_REGION() + // update the state: x'(k) = A*x(k) statePre = transitionMatrix*statePost; @@ -103,6 +105,8 @@ const Mat& KalmanFilter::predict(const Mat& control) const Mat& KalmanFilter::correct(const Mat& measurement) { + CV_INSTRUMENT_REGION() + // temp2 = H*P'(k) temp2 = measurementMatrix * errorCovPre; diff --git a/modules/video/src/lkpyramid.cpp b/modules/video/src/lkpyramid.cpp index 25614d9ced..b96a43c5f9 100644 --- a/modules/video/src/lkpyramid.cpp +++ b/modules/video/src/lkpyramid.cpp @@ -223,6 +223,8 @@ typedef float itemtype; void cv::detail::LKTrackerInvoker::operator()(const Range& range) const { + CV_INSTRUMENT_REGION() + Point2f halfWin((winSize.width-1)*0.5f, (winSize.height-1)*0.5f); const Mat& I = *prevImg; const Mat& J = *nextImg; @@ -294,7 +296,7 @@ void cv::detail::LKTrackerInvoker::operator()(const Range& range) const #if CV_NEON - int CV_DECL_ALIGNED(16) nA11[] = {0, 0, 0, 0}, nA12[] = {0, 0, 0, 0}, nA22[] = {0, 0, 0, 0}; + float CV_DECL_ALIGNED(16) nA11[] = { 0, 0, 0, 0 }, nA12[] = { 0, 0, 0, 0 }, nA22[] = { 0, 0, 0, 0 }; const int shifter1 = -(W_BITS - 5); //negative so it shifts right const int shifter2 = -(W_BITS); @@ -406,19 +408,19 @@ void cv::detail::LKTrackerInvoker::operator()(const Range& range) const q6 = vaddq_s32(q6, q8); q7 = vmull_s16(d4d5.val[0], d28); - int32x4_t nq0 = vmull_s16(d4d5.val[1], d28); + int32x4_t q14 = vmull_s16(d4d5.val[1], d28); q8 = vmull_s16(d6d7.val[0], d29); int32x4_t q15 = vmull_s16(d6d7.val[1], d29); q7 = vaddq_s32(q7, q8); - nq0 = vaddq_s32(nq0, q15); + q14 = vaddq_s32(q14, q15); q4 = vaddq_s32(q4, q7); - q6 = vaddq_s32(q6, nq0); + q6 = vaddq_s32(q6, q14); - int32x4_t nq1 = vld1q_s32(nA12); - int32x4_t nq2 = vld1q_s32(nA22); - nq0 = vld1q_s32(nA11); + float32x4_t nq0 = vld1q_f32(nA11); + float32x4_t nq1 = vld1q_f32(nA12); + float32x4_t nq2 = vld1q_f32(nA22); q4 = vqrshlq_s32(q4, q12); q6 = vqrshlq_s32(q6, q12); @@ -427,13 +429,13 @@ void cv::detail::LKTrackerInvoker::operator()(const Range& range) const q8 = vmulq_s32(q4, q6); q15 = vmulq_s32(q6, q6); - nq0 = vaddq_s32(nq0, q7); - nq1 = vaddq_s32(nq1, q8); - nq2 = vaddq_s32(nq2, q15); + nq0 = vaddq_f32(nq0, vreinterpretq_f32_s32(q7)); + nq1 = vaddq_f32(nq1, vreinterpretq_f32_s32(q8)); + nq2 = vaddq_f32(nq2, vreinterpretq_f32_s32(q15)); - vst1q_s32(nA11, nq0); - vst1q_s32(nA12, nq1); - vst1q_s32(nA22, nq2); + vst1q_f32(nA11, nq0); + vst1q_f32(nA12, nq1); + vst1q_f32(nA22, nq2); int16x4_t d8 = vmovn_s32(q4); int16x4_t d12 = vmovn_s32(q6); @@ -474,9 +476,9 @@ void cv::detail::LKTrackerInvoker::operator()(const Range& range) const #endif #if CV_NEON - iA11 += (float)(nA11[0] + nA11[1] + nA11[2] + nA11[3]); - iA12 += (float)(nA12[0] + nA12[1] + nA12[2] + nA12[3]); - iA22 += (float)(nA22[0] + nA22[1] + nA22[2] + nA22[3]); + iA11 += nA11[0] + nA11[1] + nA11[2] + nA11[3]; + iA12 += nA12[0] + nA12[1] + nA12[2] + nA12[3]; + iA22 += nA22[0] + nA22[1] + nA22[2] + nA22[3]; #endif A11 = iA11*FLT_SCALE; @@ -530,7 +532,7 @@ void cv::detail::LKTrackerInvoker::operator()(const Range& range) const #endif #if CV_NEON - int CV_DECL_ALIGNED(16) nB1[] = {0,0,0,0}, nB2[] = {0,0,0,0}; + float CV_DECL_ALIGNED(16) nB1[] = { 0,0,0,0 }, nB2[] = { 0,0,0,0 }; const int16x4_t d26_2 = vdup_n_s16((int16_t)iw00); const int16x4_t d27_2 = vdup_n_s16((int16_t)iw01); @@ -567,18 +569,14 @@ void cv::detail::LKTrackerInvoker::operator()(const Range& range) const diff0 = _mm_unpacklo_epi16(diff0, diff0); // It0 It0 It1 It1 ... v00 = _mm_loadu_si128((const __m128i*)(dIptr)); // Ix0 Iy0 Ix1 Iy1 ... v01 = _mm_loadu_si128((const __m128i*)(dIptr + 8)); - v10 = _mm_mullo_epi16(v00, diff0); - v11 = _mm_mulhi_epi16(v00, diff0); - v00 = _mm_unpacklo_epi16(v10, v11); - v10 = _mm_unpackhi_epi16(v10, v11); + v10 = _mm_unpacklo_epi16(v00, v01); + v11 = _mm_unpackhi_epi16(v00, v01); + v00 = _mm_unpacklo_epi16(diff0, diff1); + v01 = _mm_unpackhi_epi16(diff0, diff1); + v00 = _mm_madd_epi16(v00, v10); + v11 = _mm_madd_epi16(v01, v11); qb0 = _mm_add_ps(qb0, _mm_cvtepi32_ps(v00)); - qb1 = _mm_add_ps(qb1, _mm_cvtepi32_ps(v10)); - v10 = _mm_mullo_epi16(v01, diff1); - v11 = _mm_mulhi_epi16(v01, diff1); - v00 = _mm_unpacklo_epi16(v10, v11); - v10 = _mm_unpackhi_epi16(v10, v11); - qb0 = _mm_add_ps(qb0, _mm_cvtepi32_ps(v00)); - qb1 = _mm_add_ps(qb1, _mm_cvtepi32_ps(v10)); + qb1 = _mm_add_ps(qb1, _mm_cvtepi32_ps(v11)); } #endif @@ -625,8 +623,8 @@ void cv::detail::LKTrackerInvoker::operator()(const Range& range) const nq5 = vqrshlq_s32(nq5, q11); int16x8x2_t q0q1 = vld2q_s16(dIptr); - nq11 = vld1q_s32(nB1); - int32x4_t nq15 = vld1q_s32(nB2); + float32x4_t nB1v = vld1q_f32(nB1); + float32x4_t nB2v = vld1q_f32(nB2); nq4 = vsubq_s32(nq4, nq6); nq5 = vsubq_s32(nq5, nq8); @@ -646,11 +644,11 @@ void cv::detail::LKTrackerInvoker::operator()(const Range& range) const nq9 = vaddq_s32(nq9, nq10); nq4 = vaddq_s32(nq4, nq5); - nq11 = vaddq_s32(nq11, nq9); - nq15 = vaddq_s32(nq15, nq4); + nB1v = vaddq_f32(nB1v, vreinterpretq_f32_s32(nq9)); + nB2v = vaddq_f32(nB2v, vreinterpretq_f32_s32(nq4)); - vst1q_s32(nB1, nq11); - vst1q_s32(nB2, nq15); + vst1q_f32(nB1, nB1v); + vst1q_f32(nB2, nB2v); } #endif @@ -744,6 +742,8 @@ void cv::detail::LKTrackerInvoker::operator()(const Range& range) const int cv::buildOpticalFlowPyramid(InputArray _img, OutputArrayOfArrays pyramid, Size winSize, int maxLevel, bool withDerivatives, int pyrBorder, int derivBorder, bool tryReuseInputImage) { + CV_INSTRUMENT_REGION() + Mat img = _img.getMat(); CV_Assert(img.depth() == CV_8U && winSize.width > 2 && winSize.height > 2 ); int pyrstep = withDerivatives ? 2 : 1; @@ -1106,6 +1106,8 @@ void SparsePyrLKOpticalFlowImpl::calc( InputArray _prevImg, InputArray _nextImg, InputArray _prevPts, InputOutputArray _nextPts, OutputArray _status, OutputArray _err) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(ocl::useOpenCL() && (_prevImg.isUMat() || _nextImg.isUMat()) && ocl::Image2D::isFormatSupported(CV_32F, 1, false), @@ -1375,6 +1377,8 @@ getRTMatrix( const Point2f* a, const Point2f* b, cv::Mat cv::estimateRigidTransform( InputArray src1, InputArray src2, bool fullAffine ) { + CV_INSTRUMENT_REGION() + Mat M(2, 3, CV_64F), A = src1.getMat(), B = src2.getMat(); const int COUNT = 15; diff --git a/modules/video/src/optflowgf.cpp b/modules/video/src/optflowgf.cpp index b486edaf84..69a7ea6189 100644 --- a/modules/video/src/optflowgf.cpp +++ b/modules/video/src/optflowgf.cpp @@ -1096,6 +1096,8 @@ private: void FarnebackOpticalFlowImpl::calc(InputArray _prev0, InputArray _next0, InputOutputArray _flow0) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(_flow0.isUMat() && ocl::Image2D::isFormatSupported(CV_32F, 1, false), calc_ocl(_prev0,_next0,_flow0)) @@ -1184,6 +1186,8 @@ void cv::calcOpticalFlowFarneback( InputArray _prev0, InputArray _next0, InputOutputArray _flow0, double pyr_scale, int levels, int winsize, int iterations, int poly_n, double poly_sigma, int flags ) { + CV_INSTRUMENT_REGION() + Ptr optflow; optflow = makePtr(levels,pyr_scale,false,winsize,iterations,poly_n,poly_sigma,flags); optflow->calc(_prev0,_next0,_flow0); diff --git a/modules/video/src/tvl1flow.cpp b/modules/video/src/tvl1flow.cpp index c0299e5c95..03d215d561 100644 --- a/modules/video/src/tvl1flow.cpp +++ b/modules/video/src/tvl1flow.cpp @@ -390,6 +390,8 @@ OpticalFlowDual_TVL1::OpticalFlowDual_TVL1() void OpticalFlowDual_TVL1::calc(InputArray _I0, InputArray _I1, InputOutputArray _flow) { + CV_INSTRUMENT_REGION() + CV_OCL_RUN(_flow.isUMat() && ocl::Image2D::isFormatSupported(CV_32F, 1, false), calc_ocl(_I0, _I1, _flow)) diff --git a/modules/videoio/CMakeLists.txt b/modules/videoio/CMakeLists.txt index 41b0691b75..413b3cdea0 100644 --- a/modules/videoio/CMakeLists.txt +++ b/modules/videoio/CMakeLists.txt @@ -168,8 +168,13 @@ if(HAVE_GIGE_API) endif(HAVE_GIGE_API) if(HAVE_AVFOUNDATION) - list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_avfoundation.mm) - list(APPEND VIDEOIO_LIBRARIES "-framework AVFoundation" "-framework QuartzCore") + if(IOS) + list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_avfoundation.mm) + list(APPEND VIDEOIO_LIBRARIES "-framework AVFoundation" "-framework QuartzCore") + else() + list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_avfoundation_mac.mm) + list(APPEND VIDEOIO_LIBRARIES "-framework Cocoa" "-framework Accelerate" "-framework AVFoundation" "-framework CoreGraphics" "-framework CoreImage" "-framework CoreMedia" "-framework CoreVideo" "-framework QuartzCore") + endif() endif() if(HAVE_QUICKTIME) diff --git a/modules/videoio/doc/pics/videoio_overview.svg b/modules/videoio/doc/pics/videoio_overview.svg new file mode 100644 index 0000000000..f6b376e49c --- /dev/null +++ b/modules/videoio/doc/pics/videoio_overview.svg @@ -0,0 +1,877 @@ + + + + + + + + OpenCV video I/O Structure + + + + + image/svg+xml + + OpenCV video I/O Structure + + + + PkLab.net + + + English + + + OpenCV + Video I/O + + + + + + + + + + + + + + + + + + MEDIA DEVICES + + SYSTEM + + + + + + + USER APPLICATION + + OpenCV Video I/O + + OpenCV Video I/O API Backends + + DShow + + MSMF + + FFMPEG + + V4L + + VFW + + AVF/IOS + + etc... + + OPENNI + + Manufacturer Driver + + C / C++ / JAVA API + + cv::Mat frombuffer + + ManufacturerLibrary + + BackendsLibraries + + O.S.Libraries + + + set / getproperties + grab / writeframe + + Camera + + Video File + + Network Stream + + create / opendevice + + CODECS(fourcc) + + + + VideoCapture + + VideoWriter + Camera + File or URL stream+ fourcc codec + + diff --git a/modules/videoio/doc/videoio_overview.markdown b/modules/videoio/doc/videoio_overview.markdown new file mode 100644 index 0000000000..b96d06089f --- /dev/null +++ b/modules/videoio/doc/videoio_overview.markdown @@ -0,0 +1,94 @@ +Video I/O with OpenCV Overview {#videoio_overview} +=================================== + +### See also: + - @ref videoio "Video I/O Code Reference" + - Tutorials: @ref tutorial_table_of_content_videoio + +General Information +=================== + +The OpenCV @ref videoio module is a set of classes and functions to read and write video or images sequence. + +Basically, the module provides the cv::VideoCapture and cv::VideoWriter classes as 2-layer interface to many video +I/O APIs used as backend. + +![Video I/O with OpenCV](pics/videoio_overview.svg) + +Some backends such as (DSHOW) Direct Show, Video For Windows (VFW), Microsoft Media Foundation (MSMF), +Video 4 Linux (V4L), etc... are interfaces to the video I/O library provided by the operating system. + +Some others backends like OpenNI2 for Kinect, Intel Perceptual Computing SDK, GStreamer, +XIMEA Camera API, etc... are interfaces to proprietary drivers or to external library. + +See the list of supported backends here: cv::VideoCaptureAPIs + +@warning Some backends are experimental use them at your own risk +@note Each backend supports devices properties (cv::VideoCaptureProperties) in a different way or might not support any property at all. + + +Select the backend at runtime +----------------------------- + +OpenCV automatically selects and uses first available backend (`apiPreference=cv::CAP_ANY`). + +As advanced usage you can select the backend to use at runtime. Currently this option is +available only with %VideoCapture. + +For example to grab from default camera using Direct Show as backend + +```cpp +//declare a capture object +cv::VideoCapture cap(0 + cv::CAP_DSHOW); + +//or specify the apiPreference with open +cap.open(0 + cv::CAP_DSHOW); +``` + +If you want to grab from a file using the Direct Show as backend: + +```cpp +//declare a capture object +cv::VideoCapture cap(filename, cv::CAP_DSHOW); + +//or specify the apiPreference with open +cap.open(filename, cv::CAP_DSHOW); +``` + +@sa cv::VideoCapture::open() , cv::VideoCapture::VideoCapture() + +#### Enable backends + +Backends are available only if they have been built with your OpenCV binaries. + +Check in `opencv2/cvconfig.h` to know which APIs are currently available +(e.g. `HAVE_MSMF, HAVE_VFW, HAVE_LIBV4L`, etc...). + +To enable/disable APIs, you have to: + 1. re-configure OpenCV using appropriates CMake switches + (e.g. `-DWITH_MSMF=ON -DWITH_VFW=ON ... `) or checking related switch in cmake-gui + 2. rebuild OpenCV itself + +#### Use 3rd party drivers or cameras + +Many industrial cameras or some video I/O devices don't provide standard driver interfaces +for the operating system. Thus you can't use VideoCapture or VideoWriter with these devices. + +To get access to their devices, manufactures provide their own C++ API and library that you have to +include and link with your OpenCV application. + +Is common case that this libraries read/write images from/to a memory buffer. If it so, it is +possible to make a `Mat` header for memory buffer (user-allocated data) and process it +in-place using OpenCV functions. See cv::Mat::Mat() for more details. + +The FFmpeg library +------------------ + +OpenCV can use the FFmpeg library (http://ffmpeg.org/) as backend to record, convert and stream audio and video. +FFMpeg is a complete, cross-reference solution. If you enable FFmpeg while configuring OpenCV than +CMake will download and install the binaries in `OPENCV_SOURCE_CODE/3rdparty/ffmpeg/`. To use +FFMpeg at runtime, you must deploy the FFMepg binaries with your application. + +@note FFmpeg is licensed under the GNU Lesser General Public License (LGPL) version 2.1 or later. +See `OPENCV_SOURCE_CODE/3rdparty/ffmpeg/readme.txt` and http://ffmpeg.org/legal.html for details and +licensing information diff --git a/modules/videoio/include/opencv2/videoio.hpp b/modules/videoio/include/opencv2/videoio.hpp index c462c67ce5..122f8495d0 100644 --- a/modules/videoio/include/opencv2/videoio.hpp +++ b/modules/videoio/include/opencv2/videoio.hpp @@ -46,11 +46,19 @@ #include "opencv2/core.hpp" /** - @defgroup videoio Media I/O + @defgroup videoio Video I/O + + @brief Read and write video or images sequence with OpenCV + + ### See also: + - @ref videoio_overview + - Tutorials: @ref tutorial_table_of_content_videoio @{ - @defgroup videoio_c C API - @defgroup videoio_ios iOS glue - @defgroup videoio_winrt WinRT glue + @defgroup videoio_flags_base Flags for video I/O + @defgroup videoio_flags_others Additional flags for video I/O API backends + @defgroup videoio_c C API for video I/O + @defgroup videoio_ios iOS glue for video I/O + @defgroup videoio_winrt WinRT glue for video I/O @} */ @@ -65,19 +73,20 @@ namespace cv //! @addtogroup videoio //! @{ -/** @brief Capture API backends. +//! @addtogroup videoio_flags_base +//! @{ + + +/** @brief %VideoCapture API backends identifier. Select preferred API for a capture object. -To be used in the constructor VideoCapture::VideoCapture or VideoCapture::open +To be used in the VideoCapture::VideoCapture() constructor or VideoCapture::open() -@note Backends are available only if they have been built with your OpenCV binaries.
-Check in cvconfig.h to know which APIs are currently available (e.g. HAVE_MSMF, HAVE_VFW, HAVE_LIBV4L). -To enable/disable APIs, you have to: - 1. re-configure OpenCV using the appropriates CMake switches - (e.g. -DWITH_MSMF=ON -DWITH_VFW=ON ... ) or checking related switch in cmake-gui - 2. rebuild OpenCV itself +@note Backends are available only if they have been built with your OpenCV binaries. +See @ref videoio_overview for more information. */ -enum { CAP_ANY = 0, //!< Auto detect +enum VideoCaptureAPIs { + CAP_ANY = 0, //!< Auto detect == 0 CAP_VFW = 200, //!< Video For Windows (platform native) CAP_V4L = 200, //!< V4L/V4L2 capturing support via libv4l CAP_V4L2 = CAP_V4L, //!< Same as CAP_V4L @@ -103,12 +112,15 @@ enum { CAP_ANY = 0, //!< Auto detect CAP_OPENNI2_ASUS = 1610, //!< OpenNI2 (for Asus Xtion and Occipital Structure sensors) CAP_GPHOTO2 = 1700, //!< gPhoto2 connection CAP_GSTREAMER = 1800, //!< GStreamer - CAP_FFMPEG = 1900, //!< FFMPEG + CAP_FFMPEG = 1900, //!< Open and record video file or stream using the FFMPEG library CAP_IMAGES = 2000 //!< OpenCV Image Sequence (e.g. img_%02d.jpg) }; -//! generic properties (based on DC1394 properties) -enum { CAP_PROP_POS_MSEC =0, //!< Current position of the video file in milliseconds. +/** @brief %VideoCapture generic properties identifier. + @sa videoio_flags_others, VideoCapture::get(), VideoCapture::set() +*/ +enum VideoCaptureProperties { + CAP_PROP_POS_MSEC =0, //!< Current position of the video file in milliseconds. CAP_PROP_POS_FRAMES =1, //!< 0-based index of the frame to be decoded/captured next. CAP_PROP_POS_AVI_RATIO =2, //!< Relative position of the video file: 0=start of the film, 1=end of the film. CAP_PROP_FRAME_WIDTH =3, //!< Width of the frames in the video stream. @@ -144,24 +156,42 @@ enum { CAP_PROP_POS_MSEC =0, //!< Current position of the video file in mi CAP_PROP_TILT =34, CAP_PROP_ROLL =35, CAP_PROP_IRIS =36, - CAP_PROP_SETTINGS =37, + CAP_PROP_SETTINGS =37, //! Pop up video/camera filter dialog (note: only supported by DSHOW backend currently. Property value is ignored) CAP_PROP_BUFFERSIZE =38, CAP_PROP_AUTOFOCUS =39 }; -//! @brief Generic camera output modes. -//! @note Currently, these are supported through the libv4l interface only. -enum { CAP_MODE_BGR = 0, //!< BGR24 (default) +/** @brief Generic camera output modes identifier. +@note Currently, these are supported through the libv4l backend only. +*/ +enum VideoCaptureModes { + CAP_MODE_BGR = 0, //!< BGR24 (default) CAP_MODE_RGB = 1, //!< RGB24 CAP_MODE_GRAY = 2, //!< Y8 CAP_MODE_YUYV = 3 //!< YUYV }; +/** @brief %VideoWriter generic properties identifier. + @sa VideoWriter::get(), VideoWriter::set() +*/ +enum VideoWriterProperties { + VIDEOWRITER_PROP_QUALITY = 1, //!< Current quality (0..100%) of the encoded videostream. Can be adjusted dynamically in some codecs. + VIDEOWRITER_PROP_FRAMEBYTES = 2, //!< (Read-only): Size of just encoded video frame. Note that the encoding order may be different from representation order. + VIDEOWRITER_PROP_NSTRIPES = 3 //!< Number of stripes for parallel encoding. -1 for auto detection. +}; -/** @brief DC1394 only +//! @} videoio_flags_base -modes of the controlling registers (can be: auto, manual, auto single push, absolute Latter allowed with any other mode) +//! @addtogroup videoio_flags_others +//! @{ + +/** @name IEEE 1394 drivers + @{ +*/ + +/** @brief Modes of the IEEE 1394 controlling registers +(can be: auto, manual, auto single push, absolute Latter allowed with any other mode) every feature can have only one mode turned on at a time */ enum { CAP_PROP_DC1394_OFF = -4, //!< turn the feature off (not controlled manually nor automatically). @@ -171,6 +201,11 @@ enum { CAP_PROP_DC1394_OFF = -4, //!< turn the feature off (not c CAP_PROP_DC1394_MAX = 31 }; +//! @} IEEE 1394 drivers + +/** @name OpenNI (for Kinect) + @{ +*/ //! OpenNI map generators enum { CAP_OPENNI_DEPTH_GENERATOR = 1 << 31, @@ -179,7 +214,7 @@ enum { CAP_OPENNI_DEPTH_GENERATOR = 1 << 31, CAP_OPENNI_GENERATORS_MASK = CAP_OPENNI_DEPTH_GENERATOR + CAP_OPENNI_IMAGE_GENERATOR + CAP_OPENNI_IR_GENERATOR }; -//! Properties of cameras available through OpenNI interfaces +//! Properties of cameras available through OpenNI backend enum { CAP_PROP_OPENNI_OUTPUT_MODE = 100, CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, //!< In mm CAP_PROP_OPENNI_BASELINE = 102, //!< In mm @@ -229,11 +264,20 @@ enum { CAP_OPENNI_VGA_30HZ = 0, CAP_OPENNI_QVGA_60HZ = 4 }; +//! @} OpenNI + +/** @name GStreamer + @{ +*/ -//! GStreamer enum { CAP_PROP_GSTREAMER_QUEUE_LENGTH = 200 //!< Default is 1 }; +//! @} GStreamer + +/** @name PvAPI, Prosilica GigE SDK + @{ +*/ //! PVAPI enum { CAP_PROP_PVAPI_MULTICASTIP = 300, //!< IP for enable multicast master mode. 0 for disable multicast. @@ -271,7 +315,13 @@ enum { CAP_PVAPI_PIXELFORMAT_MONO8 = 1, //!< Mono8 CAP_PVAPI_PIXELFORMAT_BGRA32 = 8, //!< Bgra32 }; -//! Properties of cameras available through XIMEA SDK interface +//! @} PvAPI + +/** @name XIMEA Camera API + @{ +*/ + +//! Properties of cameras available through XIMEA SDK backend enum { CAP_PROP_XI_DOWNSAMPLING = 400, //!< Change image resolution by binning or skipping. CAP_PROP_XI_DATA_FORMAT = 401, //!< Output data format. CAP_PROP_XI_OFFSET_X = 402, //!< Horizontal offset from the origin to the area of interest (in pixels). @@ -374,8 +424,8 @@ enum { CAP_PROP_XI_DOWNSAMPLING = 400, //!< Chan CAP_PROP_XI_LENS_FOCAL_LENGTH = 516, //!< Lens focal distance in mm. CAP_PROP_XI_LENS_FEATURE_SELECTOR = 517, //!< Selects the current feature which is accessible by XI_PRM_LENS_FEATURE. CAP_PROP_XI_LENS_FEATURE = 518, //!< Allows access to lens feature value currently selected by XI_PRM_LENS_FEATURE_SELECTOR. - CAP_PROP_XI_DEVICE_MODEL_ID = 521, //!< Return device model id. - CAP_PROP_XI_DEVICE_SN = 522, //!< Return device serial number. + CAP_PROP_XI_DEVICE_MODEL_ID = 521, //!< Returns device model id. + CAP_PROP_XI_DEVICE_SN = 522, //!< Returns device serial number. CAP_PROP_XI_IMAGE_DATA_FORMAT_RGB32_ALPHA = 529, //!< The alpha channel of RGB32 output image format. CAP_PROP_XI_IMAGE_PAYLOAD_SIZE = 530, //!< Buffer size in bytes sufficient for output image returned by xiGetImage. CAP_PROP_XI_TRANSPORT_PIXEL_FORMAT = 531, //!< Current format of pixels on transport layer. @@ -386,7 +436,7 @@ enum { CAP_PROP_XI_DOWNSAMPLING = 400, //!< Chan CAP_PROP_XI_COUNTER_SELECTOR = 536, //!< Select counter. CAP_PROP_XI_COUNTER_VALUE = 537, //!< Counter status. CAP_PROP_XI_ACQ_TIMING_MODE = 538, //!< Type of sensor frames timing. - CAP_PROP_XI_AVAILABLE_BANDWIDTH = 539, //!< Calculate and return available interface bandwidth(int Megabits). + CAP_PROP_XI_AVAILABLE_BANDWIDTH = 539, //!< Calculate and returns available interface bandwidth(int Megabits). CAP_PROP_XI_BUFFER_POLICY = 540, //!< Data move policy. CAP_PROP_XI_LUT_EN = 541, //!< Activates LUT. CAP_PROP_XI_LUT_INDEX = 542, //!< Control the index (offset) of the coefficient to access in the LUT. @@ -424,8 +474,14 @@ enum { CAP_PROP_XI_DOWNSAMPLING = 400, //!< Chan CAP_PROP_XI_SENSOR_FEATURE_VALUE = 586, //!< Allows access to sensor feature value currently selected by XI_PRM_SENSOR_FEATURE_SELECTOR. }; +//! @} XIMEA -//! Properties of cameras available through AVFOUNDATION interface +/** @name AVFoundation framework for iOS + OS X Lion will have the same API + @{ +*/ + +//! Properties of cameras available through AVFOUNDATION backend enum { CAP_PROP_IOS_DEVICE_FOCUS = 9001, CAP_PROP_IOS_DEVICE_EXPOSURE = 9002, CAP_PROP_IOS_DEVICE_FLASH = 9003, @@ -433,8 +489,11 @@ enum { CAP_PROP_IOS_DEVICE_FOCUS = 9001, CAP_PROP_IOS_DEVICE_TORCH = 9005 }; +/** @name Smartek Giganetix GigEVisionSDK + @{ +*/ -//! Properties of cameras available through Smartek Giganetix Ethernet Vision interface +//! Properties of cameras available through Smartek Giganetix Ethernet Vision backend /* --- Vladimir Litvinenko (litvinenko.vladimir@gmail.com) --- */ enum { CAP_PROP_GIGA_FRAME_OFFSET_X = 10001, CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002, @@ -444,6 +503,11 @@ enum { CAP_PROP_GIGA_FRAME_OFFSET_X = 10001, CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006 }; +//! @} Smartek + +/** @name Intel Perceptual Computing SDK + @{ +*/ enum { CAP_PROP_INTELPERC_PROFILE_COUNT = 11001, CAP_PROP_INTELPERC_PROFILE_IDX = 11002, CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE = 11003, @@ -453,7 +517,7 @@ enum { CAP_PROP_INTELPERC_PROFILE_COUNT = 11001, CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT = 11007 }; -//! Intel PerC streams +//! Intel Perceptual Streams enum { CAP_INTELPERC_DEPTH_GENERATOR = 1 << 29, CAP_INTELPERC_IMAGE_GENERATOR = 1 << 28, CAP_INTELPERC_GENERATORS_MASK = CAP_INTELPERC_DEPTH_GENERATOR + CAP_INTELPERC_IMAGE_GENERATOR @@ -465,14 +529,15 @@ enum { CAP_INTELPERC_DEPTH_MAP = 0, //!< Each pixel is a 16-bit int CAP_INTELPERC_IMAGE = 3 }; -enum { VIDEOWRITER_PROP_QUALITY = 1, //!< Current quality (0..100%) of the encoded videostream. Can be adjusted dynamically in some codecs. - VIDEOWRITER_PROP_FRAMEBYTES = 2, //!< (Read-only): Size of just encoded video frame. Note that the encoding order may be different from representation order. - VIDEOWRITER_PROP_NSTRIPES = 3 //!< Number of stripes for parallel encoding. -1 for auto detection. - }; +//! @} Intel Perceptual + +/** @name gPhoto2 connection + @{ +*/ /** @brief gPhoto2 properties -if propertyId is less than 0 then work on widget with that __additive inversed__ camera setting ID +If `propertyId` is less than 0 then work on widget with that __additive inversed__ camera setting ID Get IDs by using CAP_PROP_GPHOTO2_WIDGET_ENUMERATE. @see CvCaptureCAM_GPHOTO2 for more info */ @@ -488,112 +553,112 @@ enum { CAP_PROP_GPHOTO2_PREVIEW = 17001, //!< Capture only preview fro CAP_PROP_VIEWFINDER = 17010 //!< Enter liveview mode. }; -//enum { +//! @} gPhoto2 + +//! @} videoio_flags_others + class IVideoCapture; -/** @brief Class for video capturing from video files, image sequences or cameras. The class provides C++ API -for capturing video from cameras or for reading video files and image sequences. Here is how the -class can be used: : -@code - #include "opencv2/opencv.hpp" +/** @brief Class for video capturing from video files, image sequences or cameras. - using namespace cv; +The class provides C++ API for capturing video from cameras or for reading video files and image sequences. - int main(int, char**) - { - VideoCapture cap(0); // open the default camera - if(!cap.isOpened()) // check if we succeeded - return -1; - - Mat edges; - namedWindow("edges",1); - for(;;) - { - Mat frame; - cap >> frame; // get a new frame from camera - cvtColor(frame, edges, COLOR_BGR2GRAY); - GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5); - Canny(edges, edges, 0, 30, 3); - imshow("edges", edges); - if(waitKey(30) >= 0) break; - } - // the camera will be deinitialized automatically in VideoCapture destructor - return 0; - } -@endcode -@note In C API the black-box structure CvCapture is used instead of VideoCapture. +Here is how the class can be used: +@include samples/cpp/videocapture_basic.cpp +@note In @ref videoio_c "C API" the black-box structure `CvCapture` is used instead of %VideoCapture. @note -- A basic sample on using the VideoCapture interface can be found at - opencv_source_code/samples/cpp/starter_video.cpp -- Another basic video processing sample can be found at - opencv_source_code/samples/cpp/video_dmtx.cpp -- (Python) A basic sample on using the VideoCapture interface can be found at - opencv_source_code/samples/python/video.py -- (Python) Another basic video processing sample can be found at - opencv_source_code/samples/python/video_dmtx.py +- (C++) A basic sample on using the %VideoCapture interface can be found at + `OPENCV_SOURCE_CODE/samples/cpp/videocapture_starter.cpp` +- (Python) A basic sample on using the %VideoCapture interface can be found at + `OPENCV_SOURCE_CODE/samples/python/video.py` - (Python) A multi threaded video processing sample can be found at - opencv_source_code/samples/python/video_threaded.py + `OPENCV_SOURCE_CODE/samples/python/video_threaded.py` +- (Python) %VideoCapture sample showcasing some features of the Video4Linux2 backend + `OPENCV_SOURCE_CODE/samples/python/video_v4l2.py` */ class CV_EXPORTS_W VideoCapture { public: - /** @brief - @note In C API, when you finished working with video, release CvCapture structure with + /** @brief Default constructor + @note In @ref videoio_c "C API", when you finished working with video, release CvCapture structure with cvReleaseCapture(), or use Ptr\ that calls cvReleaseCapture() automatically in the destructor. */ CV_WRAP VideoCapture(); /** @overload - @param filename name of the opened video file (eg. video.avi) or image sequence (eg. - img_%02d.jpg, which will read samples like img_00.jpg, img_01.jpg, img_02.jpg, ...) + @brief Open video file or a capturing device or a IP video stream for video capturing + + Same as VideoCapture(const String& filename, int apiPreference) but using default Capture API backends */ CV_WRAP VideoCapture(const String& filename); /** @overload - @param filename name of the opened video file (eg. video.avi) or image sequence (eg. - img_%02d.jpg, which will read samples like img_00.jpg, img_01.jpg, img_02.jpg, ...) + @brief Open video file or a capturing device or a IP video stream for video capturing with API Preference - @param apiPreference preferred Capture API to use. Can be used to enforce a specific reader - implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_IMAGES + @param filename it can be: + - name of video file (eg. `video.avi`) + - or image sequence (eg. `img_%02d.jpg`, which will read samples like `img_00.jpg, img_01.jpg, img_02.jpg, ...`) + - or URL of video stream (eg. `protocol://host:port/script_name?script_params|auth`). + Note that each video stream or IP camera feed has its own URL scheme. Please refer to the + documentation of source stream to know the right URL. + @param apiPreference preferred Capture API backends to use. Can be used to enforce a specific reader + implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_IMAGES or cv::CAP_DSHOW. + @sa The list of supported API backends cv::VideoCaptureAPIs */ CV_WRAP VideoCapture(const String& filename, int apiPreference); /** @overload - @param index = camera_id + domain_offset (CAP_*). id of the video capturing device to open. If there is a single - camera connected, just pass 0. Advanced Usage: to open Camera 1 using the MS Media Foundation API: index = 1 + cv::CAP_MSMF + @brief Open a camera for video capturing + + @param index camera_id + domain_offset (CAP_*) id of the video capturing device to open. To open default camera using default backend just pass 0. + Use a `domain_offset` to enforce a specific reader implementation if multiple are available like cv::CAP_FFMPEG or cv::CAP_IMAGES or cv::CAP_DSHOW. + e.g. to open Camera 1 using the MS Media Foundation API use `index = 1 + cv::CAP_MSMF` + + @sa The list of supported API backends cv::VideoCaptureAPIs */ CV_WRAP VideoCapture(int index); + /** @brief Default destructor + + The method first calls VideoCapture::release to close the already opened file or camera. + */ virtual ~VideoCapture(); - /** @brief Open video file or a capturing device for video capturing + /** @brief Open video file or a capturing device or a IP video stream for video capturing - @param filename name of the opened video file (eg. video.avi) or image sequence (eg. - img_%02d.jpg, which will read samples like img_00.jpg, img_01.jpg, img_02.jpg, ...) + @overload - The methods first call VideoCapture::release to close the already opened file or camera. + Parameters are same as the constructor VideoCapture(const String& filename) + @return `true` if the file has been successfully opened + + The method first calls VideoCapture::release to close the already opened file or camera. */ CV_WRAP virtual bool open(const String& filename); - /** @overload - @param index = camera_id + domain_offset (CAP_*). id of the video capturing device to open. If there is a single - camera connected, just pass 0. Advanced Usage: to open Camera 1 using the MS Media Foundation API: index = 1 + cv::CAP_MSMF + /** @brief Open a camera for video capturing + + @overload + + Parameters are same as the constructor VideoCapture(int index) + @return `true` if the camera has been successfully opened. + + The method first calls VideoCapture::release to close the already opened file or camera. */ CV_WRAP virtual bool open(int index); /** @brief Returns true if video capturing has been initialized already. - If the previous call to VideoCapture constructor or VideoCapture::open succeeded, the method returns + If the previous call to VideoCapture constructor or VideoCapture::open() succeeded, the method returns true. */ CV_WRAP virtual bool isOpened() const; /** @brief Closes video file or capturing device. - The methods are automatically called by subsequent VideoCapture::open and by VideoCapture + The method is automatically called by subsequent VideoCapture::open and by VideoCapture destructor. The C function also deallocates memory and clears \*capture pointer. @@ -602,7 +667,9 @@ public: /** @brief Grabs the next frame from video file or capturing device. - The methods/functions grab the next frame from video file or camera and return true (non-zero) in + @return `true` (non-zero) in the case of success. + + The method/function grabs the next frame from video file or camera and returns true (non-zero) in the case of success. The primary use of the function is in multi-camera environments, especially when the cameras do not @@ -612,34 +679,52 @@ public: from different cameras will be closer in time. Also, when a connected camera is multi-head (for example, a stereo camera or a Kinect device), the - correct way of retrieving data from it is to call VideoCapture::grab first and then call - VideoCapture::retrieve one or more times with different values of the channel parameter. See - + correct way of retrieving data from it is to call VideoCapture::grab() first and then call + VideoCapture::retrieve() one or more times with different values of the channel parameter. + + @ref tutorial_kinect_openni */ CV_WRAP virtual bool grab(); /** @brief Decodes and returns the grabbed video frame. - The methods/functions decode and return the just grabbed frame. If no frames has been grabbed - (camera has been disconnected, or there are no more frames in video file), the methods return false - and the functions return NULL pointer. + @param [out] image the video frame is returned here. If no frames has been grabbed the image will be empty. + @param flag it could be a frame index or a driver specific flag + @return `false` if no frames has been grabbed - @note OpenCV 1.x functions cvRetrieveFrame and cv.RetrieveFrame return image stored inside the video + The method decodes and returns the just grabbed frame. If no frames has been grabbed + (camera has been disconnected, or there are no more frames in video file), the method returns false + and the function returns an empty image (with %cv::Mat, test it with Mat::empty()). + + @sa read() + + @note In @ref videoio_c "C API", functions cvRetrieveFrame() and cv.RetrieveFrame() return image stored inside the video capturing structure. It is not allowed to modify or release the image! You can copy the frame using :ocvcvCloneImage and then do whatever you want with the copy. */ CV_WRAP virtual bool retrieve(OutputArray image, int flag = 0); + + /** @brief Stream operator to read the next video frame. + @sa read() + */ virtual VideoCapture& operator >> (CV_OUT Mat& image); + + /** @overload + @sa read() + */ virtual VideoCapture& operator >> (CV_OUT UMat& image); /** @brief Grabs, decodes and returns the next video frame. - The methods/functions combine VideoCapture::grab and VideoCapture::retrieve in one call. This is the - most convenient method for reading video files or capturing data from decode and return the just - grabbed frame. If no frames has been grabbed (camera has been disconnected, or there are no more - frames in video file), the methods return false and the functions return NULL pointer. + @param [out] image the video frame is returned here. If no frames has been grabbed the image will be empty. + @return `false` if no frames has been grabbed - @note OpenCV 1.x functions cvRetrieveFrame and cv.RetrieveFrame return image stored inside the video + The method/function combines VideoCapture::grab() and VideoCapture::retrieve() in one call. This is the + most convenient method for reading video files or capturing data from decode and returns the just + grabbed frame. If no frames has been grabbed (camera has been disconnected, or there are no more + frames in video file), the method returns false and the function returns empty image (with %cv::Mat, test it with Mat::empty()). + + @note In @ref videoio_c "C API", functions cvRetrieveFrame() and cv.RetrieveFrame() return image stored inside the video capturing structure. It is not allowed to modify or release the image! You can copy the frame using :ocvcvCloneImage and then do whatever you want with the copy. */ @@ -647,70 +732,43 @@ public: /** @brief Sets a property in the VideoCapture. - @param propId Property identifier. It can be one of the following: - - cv::CAP_PROP_POS_MSEC @copydoc cv::CAP_PROP_POS_MSEC - - cv::CAP_PROP_POS_FRAMES @copydoc CAP_PROP_POS_FRAMES - - cv::CAP_PROP_POS_AVI_RATIO @copydoc cv::CAP_PROP_POS_AVI_RATIO - - cv::CAP_PROP_FRAME_WIDTH @copydoc cv::CAP_PROP_FRAME_WIDTH - - cv::CAP_PROP_FRAME_HEIGHT @copydoc cv::CAP_PROP_FRAME_HEIGHT - - cv::CAP_PROP_FPS @copydoc cv::CAP_PROP_FPS - - cv::CAP_PROP_FOURCC @copydoc cv::CAP_PROP_FOURCC - - cv::CAP_PROP_FRAME_COUNT @copydoc cv::CAP_PROP_FRAME_COUNT - - cv::CAP_PROP_FORMAT @copydoc cv::CAP_PROP_FORMAT - - cv::CAP_PROP_MODE @copydoc cv::CAP_PROP_MODE - - cv::CAP_PROP_BRIGHTNESS @copydoc cv::CAP_PROP_BRIGHTNESS - - cv::CAP_PROP_CONTRAST @copydoc cv::CAP_PROP_CONTRAST - - cv::CAP_PROP_SATURATION @copydoc cv::CAP_PROP_SATURATION - - cv::CAP_PROP_HUE @copydoc cv::CAP_PROP_HUE - - cv::CAP_PROP_GAIN @copydoc cv::CAP_PROP_GAIN - - cv::CAP_PROP_EXPOSURE @copydoc cv::CAP_PROP_EXPOSURE - - cv::CAP_PROP_CONVERT_RGB @copydoc cv::CAP_PROP_CONVERT_RGB - - cv::CAP_PROP_WHITE_BALANCE_BLUE_U @copydoc cv::CAP_PROP_WHITE_BALANCE_BLUE_U - - cv::CAP_PROP_WHITE_BALANCE_RED_V @copydoc cv::CAP_PROP_WHITE_BALANCE_RED_V - - cv::CAP_PROP_RECTIFICATION @copydoc cv::CAP_PROP_RECTIFICATION + @param propId Property identifier from cv::VideoCaptureProperties (eg. cv::CAP_PROP_POS_MSEC, cv::CAP_PROP_POS_FRAMES, ...) + or one from @ref videoio_flags_others @param value Value of the property. + @return `true` if the property is supported by backend used by the VideoCapture instance. + @note Even if it returns `true` this doesn't ensure that the property + value has been accepted by the capture device. See note in VideoCapture::get() */ CV_WRAP virtual bool set(int propId, double value); /** @brief Returns the specified VideoCapture property - @param propId Property identifier. It can be one of the following: - - cv::CAP_PROP_POS_MSEC @copydoc cv::CAP_PROP_POS_MSEC - - cv::CAP_PROP_POS_FRAMES @copydoc CAP_PROP_POS_FRAMES - - cv::CAP_PROP_POS_AVI_RATIO @copydoc cv::CAP_PROP_POS_AVI_RATIO - - cv::CAP_PROP_FRAME_WIDTH @copydoc cv::CAP_PROP_FRAME_WIDTH - - cv::CAP_PROP_FRAME_HEIGHT @copydoc cv::CAP_PROP_FRAME_HEIGHT - - cv::CAP_PROP_FPS @copydoc cv::CAP_PROP_FPS - - cv::CAP_PROP_FOURCC @copydoc cv::CAP_PROP_FOURCC - - cv::CAP_PROP_FRAME_COUNT @copydoc cv::CAP_PROP_FRAME_COUNT - - cv::CAP_PROP_FORMAT @copydoc cv::CAP_PROP_FORMAT - - cv::CAP_PROP_MODE @copydoc cv::CAP_PROP_MODE - - cv::CAP_PROP_BRIGHTNESS @copydoc cv::CAP_PROP_BRIGHTNESS - - cv::CAP_PROP_CONTRAST @copydoc cv::CAP_PROP_CONTRAST - - cv::CAP_PROP_SATURATION @copydoc cv::CAP_PROP_SATURATION - - cv::CAP_PROP_HUE @copydoc cv::CAP_PROP_HUE - - cv::CAP_PROP_GAIN @copydoc cv::CAP_PROP_GAIN - - cv::CAP_PROP_EXPOSURE @copydoc cv::CAP_PROP_EXPOSURE - - cv::CAP_PROP_CONVERT_RGB @copydoc cv::CAP_PROP_CONVERT_RGB - - cv::CAP_PROP_WHITE_BALANCE_BLUE_U @copydoc cv::CAP_PROP_WHITE_BALANCE_BLUE_U - - cv::CAP_PROP_WHITE_BALANCE_RED_V @copydoc cv::CAP_PROP_WHITE_BALANCE_RED_V - - cv::CAP_PROP_RECTIFICATION @copydoc cv::CAP_PROP_RECTIFICATION + @param propId Property identifier from cv::VideoCaptureProperties (eg. cv::CAP_PROP_POS_MSEC, cv::CAP_PROP_POS_FRAMES, ...) + or one from @ref videoio_flags_others + @return Value for the specified property. Value 0 is returned when querying a property that is + not supported by the backend used by the VideoCapture instance. - @note When querying a property that is not supported by the backend used by the VideoCapture - class, value 0 is returned. - */ + @note Reading / writing properties involves many layers. Some unexpected result might happens + along this chain. + @code {.txt} + `VideoCapture -> API Backend -> Operating System -> Device Driver -> Device Hardware` + @endcode + The returned value might be different from what really used by the device or it could be encoded + using device dependant rules (eg. steps or percentage). Effective behaviour depends from device + driver and API Backend + + */ CV_WRAP virtual double get(int propId) const; - /** @overload + /** @brief Open video file or a capturing device or a IP video stream for video capturing with API Preference - @param filename name of the opened video file (eg. video.avi) or image sequence (eg. - img_%02d.jpg, which will read samples like img_00.jpg, img_01.jpg, img_02.jpg, ...) + @overload - @param apiPreference preferred Capture API to use. Can be used to enforce a specific reader - implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_IMAGES + Parameters are same as the constructor VideoCapture(const String& filename, int apiPreference) + @return `true` if the file has been successfully opened - The methods first call VideoCapture::release to close the already opened file or camera. - */ + The method first calls VideoCapture::release to close the already opened file or camera. + */ CV_WRAP virtual bool open(const String& filename, int apiPreference); protected: @@ -721,14 +779,21 @@ protected: class IVideoWriter; /** @brief Video writer class. + +The class provides C++ API for writing video files or image sequences. + +Here is how the class can be used: +@include samples/cpp/videowriter_basic.cpp */ class CV_EXPORTS_W VideoWriter { public: - /** @brief VideoWriter constructors + /** @brief Default constructors - The constructors/functions initialize video writers. On Linux FFMPEG is used to write videos; on - Windows FFMPEG or VFW is used; on MacOSX QTKit is used. + The constructors/functions initialize video writers. + - On Linux FFMPEG is used to write videos; + - On Windows FFMPEG or VFW is used; + - On MacOSX QTKit is used. */ CV_WRAP VideoWriter(); @@ -744,16 +809,31 @@ public: @param frameSize Size of the video frames. @param isColor If it is not zero, the encoder will expect and encode color frames, otherwise it will work with grayscale frames (the flag is currently supported on Windows only). + + @b Tips: + - With some backends `fourcc=-1` pops up the codec selection dialog from the system. + - To save image sequence use a proper filename (eg. `img_%02d.jpg`) and `fourcc=0` + OR `fps=0`. Use uncompressed image format (eg. `img_%02d.BMP`) to save raw frames. + - Most codecs are lossy. If you want lossless video file you need to use a lossless codecs + (eg. FFMPEG FFV1, Huffman HFYU, Lagarith LAGS, etc...) + - If FFMPEG is enabled, using `codec=0; fps=0;` you can create an uncompressed (raw) video file. */ CV_WRAP VideoWriter(const String& filename, int fourcc, double fps, Size frameSize, bool isColor = true); + /** @brief Default destructor + + The method first calls VideoWriter::release to close the already opened file. + */ virtual ~VideoWriter(); /** @brief Initializes or reinitializes video writer. The method opens video writer. Parameters are the same as in the constructor VideoWriter::VideoWriter. + @return `true` if video writer has been successfully initialized + + The method first calls VideoWriter::release to close the already opened file. */ CV_WRAP virtual bool open(const String& filename, int fourcc, double fps, Size frameSize, bool isColor = true); @@ -764,44 +844,49 @@ public: /** @brief Closes the video writer. - The methods are automatically called by subsequent VideoWriter::open and by the VideoWriter + The method is automatically called by subsequent VideoWriter::open and by the VideoWriter destructor. */ CV_WRAP virtual void release(); + + /** @brief Stream operator to write the next video frame. + @sa write + */ virtual VideoWriter& operator << (const Mat& image); /** @brief Writes the next video frame @param image The written frame - The functions/methods write the specified image to video file. It must have the same size as has + The function/method writes the specified image to video file. It must have the same size as has been specified when opening the video writer. */ CV_WRAP virtual void write(const Mat& image); /** @brief Sets a property in the VideoWriter. - @param propId Property identifier. It can be one of the following: - - cv::VIDEOWRITER_PROP_QUALITY @copydoc cv::VIDEOWRITER_PROP_QUALITY - - cv::VIDEOWRITER_PROP_NSTRIPES @copydoc cv::VIDEOWRITER_PROP_NSTRIPES + @param propId Property identifier from cv::VideoWriterProperties (eg. cv::VIDEOWRITER_PROP_QUALITY) + or one of @ref videoio_flags_others + @param value Value of the property. + @return `true` if the property is supported by the backend used by the VideoWriter instance. */ CV_WRAP virtual bool set(int propId, double value); /** @brief Returns the specified VideoWriter property - @param propId Property identifier. It can be one of the following: - - cv::VIDEOWRITER_PROP_QUALITY @copydoc cv::VIDEOWRITER_PROP_QUALITY - - cv::VIDEOWRITER_PROP_FRAMEBYTES @copydoc VIDEOWRITER_PROP_FRAMEBYTES - - cv::VIDEOWRITER_PROP_NSTRIPES @copydoc cv::VIDEOWRITER_PROP_NSTRIPES + @param propId Property identifier from cv::VideoWriterProperties (eg. cv::VIDEOWRITER_PROP_QUALITY) + or one of @ref videoio_flags_others - @note When querying a property that is not supported by the backend used by the VideoWriter - class, value 0 is returned. + @return Value for the specified property. Value 0 is returned when querying a property that is + not supported by the backend used by the VideoWriter instance. */ CV_WRAP virtual double get(int propId) const; /** @brief Concatenates 4 chars to a fourcc code + @return a fourcc code + This static method constructs the fourcc code of the codec to be used in the constructor VideoWriter::VideoWriter or VideoWriter::open. */ diff --git a/modules/videoio/include/opencv2/videoio/cap_ios.h b/modules/videoio/include/opencv2/videoio/cap_ios.h index 1a9875b257..c90ad2e73e 100644 --- a/modules/videoio/include/opencv2/videoio/cap_ios.h +++ b/modules/videoio/include/opencv2/videoio/cap_ios.h @@ -41,31 +41,13 @@ @interface CvAbstractCamera : NSObject { - AVCaptureSession* captureSession; - AVCaptureConnection* videoCaptureConnection; - AVCaptureVideoPreviewLayer *captureVideoPreviewLayer; - UIDeviceOrientation currentDeviceOrientation; BOOL cameraAvailable; - BOOL captureSessionLoaded; - BOOL running; - BOOL useAVCaptureVideoPreviewLayer; - - AVCaptureDevicePosition defaultAVCaptureDevicePosition; - AVCaptureVideoOrientation defaultAVCaptureVideoOrientation; - NSString *const defaultAVCaptureSessionPreset; - - int defaultFPS; - - UIView* parentView; - - int imageWidth; - int imageHeight; } -@property (nonatomic, retain) AVCaptureSession* captureSession; -@property (nonatomic, retain) AVCaptureConnection* videoCaptureConnection; +@property (nonatomic, strong) AVCaptureSession* captureSession; +@property (nonatomic, strong) AVCaptureConnection* videoCaptureConnection; @property (nonatomic, readonly) BOOL running; @property (nonatomic, readonly) BOOL captureSessionLoaded; @@ -80,7 +62,7 @@ @property (nonatomic, assign) int imageWidth; @property (nonatomic, assign) int imageHeight; -@property (nonatomic, retain) UIView* parentView; +@property (nonatomic, strong) UIView* parentView; - (void)start; - (void)stop; @@ -121,26 +103,18 @@ dispatch_queue_t videoDataOutputQueue; CALayer *customPreviewLayer; - BOOL grayscaleMode; - - BOOL recordVideo; - BOOL rotateVideo; - AVAssetWriterInput* recordAssetWriterInput; - AVAssetWriterInputPixelBufferAdaptor* recordPixelBufferAdaptor; - AVAssetWriter* recordAssetWriter; - CMTime lastSampleTime; } -@property (nonatomic, assign) id delegate; +@property (nonatomic, weak) id delegate; @property (nonatomic, assign) BOOL grayscaleMode; @property (nonatomic, assign) BOOL recordVideo; @property (nonatomic, assign) BOOL rotateVideo; -@property (nonatomic, retain) AVAssetWriterInput* recordAssetWriterInput; -@property (nonatomic, retain) AVAssetWriterInputPixelBufferAdaptor* recordPixelBufferAdaptor; -@property (nonatomic, retain) AVAssetWriter* recordAssetWriter; +@property (nonatomic, strong) AVAssetWriterInput* recordAssetWriterInput; +@property (nonatomic, strong) AVAssetWriterInputPixelBufferAdaptor* recordPixelBufferAdaptor; +@property (nonatomic, strong) AVAssetWriter* recordAssetWriter; - (void)adjustLayoutToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation; - (void)layoutPreviewLayer; @@ -167,7 +141,7 @@ AVCaptureStillImageOutput *stillImageOutput; } -@property (nonatomic, assign) id delegate; +@property (nonatomic, weak) id delegate; - (void)takePicture; diff --git a/modules/videoio/include/opencv2/videoio/videoio_c.h b/modules/videoio/include/opencv2/videoio/videoio_c.h index e502c7be83..63aef7ddb2 100644 --- a/modules/videoio/include/opencv2/videoio/videoio_c.h +++ b/modules/videoio/include/opencv2/videoio/videoio_c.h @@ -57,13 +57,18 @@ extern "C" { * Working with Video Files and Cameras * \****************************************************************************************/ -/* "black box" capture structure */ +/** @brief "black box" capture structure + +In C++ use cv::VideoCapture +*/ typedef struct CvCapture CvCapture; -/* start capturing frames from video file */ +/** @brief start capturing frames from video file +*/ CVAPI(CvCapture*) cvCreateFileCapture( const char* filename ); -/* start capturing frames from video file. allows specifying a preferred API to use */ +/** @brief start capturing frames from video file. allows specifying a preferred API to use +*/ CVAPI(CvCapture*) cvCreateFileCaptureWithPreference( const char* filename , int apiPreference); enum @@ -120,24 +125,32 @@ enum CV_CAP_IMAGES = 2000 // OpenCV Image Sequence (e.g. img_%02d.jpg) }; -/* start capturing frames from camera: index = camera_index + domain_offset (CV_CAP_*) */ +/** @brief start capturing frames from camera: index = camera_index + domain_offset (CV_CAP_*) +*/ CVAPI(CvCapture*) cvCreateCameraCapture( int index ); -/* grab a frame, return 1 on success, 0 on fail. - this function is thought to be fast */ +/** @brief grab a frame, return 1 on success, 0 on fail. + + this function is thought to be fast +*/ CVAPI(int) cvGrabFrame( CvCapture* capture ); -/* get the frame grabbed with cvGrabFrame(..) +/** @brief get the frame grabbed with cvGrabFrame(..) + This function may apply some frame processing like frame decompression, flipping etc. - !!!DO NOT RELEASE or MODIFY the retrieved frame!!! */ + @warning !!!DO NOT RELEASE or MODIFY the retrieved frame!!! +*/ CVAPI(IplImage*) cvRetrieveFrame( CvCapture* capture, int streamIdx CV_DEFAULT(0) ); -/* Just a combination of cvGrabFrame and cvRetrieveFrame - !!!DO NOT RELEASE or MODIFY the retrieved frame!!! */ +/** @brief Just a combination of cvGrabFrame and cvRetrieveFrame + + @warning !!!DO NOT RELEASE or MODIFY the retrieved frame!!! +*/ CVAPI(IplImage*) cvQueryFrame( CvCapture* capture ); -/* stop capturing/reading and free resources */ +/** @brief stop capturing/reading and free resources +*/ CVAPI(void) cvReleaseCapture( CvCapture** capture ); enum @@ -498,48 +511,71 @@ enum CV_CAP_PROP_VIEWFINDER = 17010 // Enter liveview mode. }; -/* retrieve or set capture properties */ +/** @brief retrieve capture properties +*/ CVAPI(double) cvGetCaptureProperty( CvCapture* capture, int property_id ); +/** @brief set capture properties +*/ CVAPI(int) cvSetCaptureProperty( CvCapture* capture, int property_id, double value ); -// Return the type of the capturer (eg, CV_CAP_V4W, CV_CAP_UNICAP), which is unknown if created with CV_CAP_ANY +/** @brief Return the type of the capturer (eg, ::CV_CAP_VFW, ::CV_CAP_UNICAP) + +It is unknown if created with ::CV_CAP_ANY +*/ CVAPI(int) cvGetCaptureDomain( CvCapture* capture); -/* "black box" video file writer structure */ +/** @brief "black box" video file writer structure + +In C++ use cv::VideoWriter +*/ typedef struct CvVideoWriter CvVideoWriter; +//! Macro to construct the fourcc code of the codec. Same as CV_FOURCC() #define CV_FOURCC_MACRO(c1, c2, c3, c4) (((c1) & 255) + (((c2) & 255) << 8) + (((c3) & 255) << 16) + (((c4) & 255) << 24)) +/** @brief Constructs the fourcc code of the codec function + +Simply call it with 4 chars fourcc code like `CV_FOURCC('I', 'Y', 'U', 'V')` + +List of codes can be obtained at [Video Codecs by FOURCC](http://www.fourcc.org/codecs.php) page. +FFMPEG backend with MP4 container natively uses other values as fourcc code: +see [ObjectType](http://www.mp4ra.org/codecs.html). +*/ CV_INLINE int CV_FOURCC(char c1, char c2, char c3, char c4) { return CV_FOURCC_MACRO(c1, c2, c3, c4); } -#define CV_FOURCC_PROMPT -1 /* Open Codec Selection Dialog (Windows only) */ -#define CV_FOURCC_DEFAULT CV_FOURCC('I', 'Y', 'U', 'V') /* Use default codec for specified filename (Linux only) */ +//! (Windows only) Open Codec Selection Dialog +#define CV_FOURCC_PROMPT -1 +//! (Linux only) Use default codec for specified filename +#define CV_FOURCC_DEFAULT CV_FOURCC('I', 'Y', 'U', 'V') -/* initialize video file writer */ +/** @brief initialize video file writer +*/ CVAPI(CvVideoWriter*) cvCreateVideoWriter( const char* filename, int fourcc, double fps, CvSize frame_size, int is_color CV_DEFAULT(1)); -/* write frame to video file */ +/** @brief write frame to video file +*/ CVAPI(int) cvWriteFrame( CvVideoWriter* writer, const IplImage* image ); -/* close video file writer */ +/** @brief close video file writer +*/ CVAPI(void) cvReleaseVideoWriter( CvVideoWriter** writer ); -/****************************************************************************************\ -* Obsolete functions/synonyms * -\****************************************************************************************/ +// *************************************************************************************** +//! @name Obsolete functions/synonyms +//! @{ +#define cvCaptureFromCAM cvCreateCameraCapture //!< @deprecated use cvCreateCameraCapture() instead +#define cvCaptureFromFile cvCreateFileCapture //!< @deprecated use cvCreateFileCapture() instead +#define cvCaptureFromAVI cvCaptureFromFile //!< @deprecated use cvCreateFileCapture() instead +#define cvCreateAVIWriter cvCreateVideoWriter //!< @deprecated use cvCreateVideoWriter() instead +#define cvWriteToAVI cvWriteFrame //!< @deprecated use cvWriteFrame() instead +//! @} Obsolete... -#define cvCaptureFromFile cvCreateFileCapture -#define cvCaptureFromCAM cvCreateCameraCapture -#define cvCaptureFromAVI cvCaptureFromFile -#define cvCreateAVIWriter cvCreateVideoWriter -#define cvWriteToAVI cvWriteFrame - -/** @} videoio_c */ +//! @} videoio_c #ifdef __cplusplus } diff --git a/modules/videoio/src/cap.cpp b/modules/videoio/src/cap.cpp index 46cbf42733..a774afbaad 100644 --- a/modules/videoio/src/cap.cpp +++ b/modules/videoio/src/cap.cpp @@ -340,6 +340,12 @@ CV_IMPL CvCapture * cvCreateFileCaptureWithPreference (const char * filename, in if (apiPreference) break; #endif +#ifdef HAVE_OPENNI2 + case CV_CAP_OPENNI2: + TRY_OPEN(result, cvCreateFileCapture_OpenNI2 (filename)) + if (apiPreference) break; +#endif + case CV_CAP_IMAGES: TRY_OPEN(result, cvCreateFileCapture_Images (filename)) } @@ -565,6 +571,8 @@ VideoCapture::~VideoCapture() bool VideoCapture::open(const String& filename, int apiPreference) { + CV_INSTRUMENT_REGION() + if (isOpened()) release(); icap = IVideoCapture_create(filename); if (!icap.empty()) @@ -576,11 +584,15 @@ bool VideoCapture::open(const String& filename, int apiPreference) bool VideoCapture::open(const String& filename) { + CV_INSTRUMENT_REGION() + return open(filename, CAP_ANY); } bool VideoCapture::open(int index) { + CV_INSTRUMENT_REGION() + if (isOpened()) release(); icap = IVideoCapture_create(index); if (!icap.empty()) @@ -602,6 +614,8 @@ void VideoCapture::release() bool VideoCapture::grab() { + CV_INSTRUMENT_REGION() + if (!icap.empty()) return icap->grabFrame(); return cvGrabFrame(cap) != 0; @@ -609,6 +623,8 @@ bool VideoCapture::grab() bool VideoCapture::retrieve(OutputArray image, int channel) { + CV_INSTRUMENT_REGION() + if (!icap.empty()) return icap->retrieveFrame(channel, image); @@ -630,6 +646,8 @@ bool VideoCapture::retrieve(OutputArray image, int channel) bool VideoCapture::read(OutputArray image) { + CV_INSTRUMENT_REGION() + if(grab()) retrieve(image); else @@ -667,6 +685,8 @@ VideoCapture& VideoCapture::operator >> (Mat& image) VideoCapture& VideoCapture::operator >> (UMat& image) { + CV_INSTRUMENT_REGION() + read(image); return *this; } @@ -707,6 +727,8 @@ VideoWriter::~VideoWriter() bool VideoWriter::open(const String& filename, int _fourcc, double fps, Size frameSize, bool isColor) { + CV_INSTRUMENT_REGION() + if (isOpened()) release(); iwriter = IVideoWriter_create(filename, _fourcc, fps, frameSize, isColor); if (!iwriter.empty()) @@ -737,6 +759,8 @@ double VideoWriter::get(int propId) const void VideoWriter::write(const Mat& image) { + CV_INSTRUMENT_REGION() + if( iwriter ) iwriter->write(image); else @@ -748,6 +772,8 @@ void VideoWriter::write(const Mat& image) VideoWriter& VideoWriter::operator << (const Mat& image) { + CV_INSTRUMENT_REGION() + write(image); return *this; } diff --git a/modules/videoio/src/cap_avfoundation_mac.mm b/modules/videoio/src/cap_avfoundation_mac.mm new file mode 100644 index 0000000000..8c30506400 --- /dev/null +++ b/modules/videoio/src/cap_avfoundation_mac.mm @@ -0,0 +1,1322 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's 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 name of the copyright holders 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 contributor 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. +// +//M*//////////////////////////////////////////////////////////////////////////////////////// + + +#include "precomp.hpp" +#include "opencv2/imgproc.hpp" +#include +#import + +/********************** Declaration of class headers ************************/ + +/***************************************************************************** + * + * CaptureDelegate Declaration. + * + * CaptureDelegate is notified on a separate thread by the OS whenever there + * is a new frame. When "updateImage" is called from the main thread, it + * copies this new frame into an IplImage, but only if this frame has not + * been copied before. When "getOutput" is called from the main thread, + * it gives the last copied IplImage. + * + *****************************************************************************/ + + +@interface CaptureDelegate : NSObject +{ + NSCondition *mHasNewFrame; + CVPixelBufferRef mGrabbedPixels; + CVImageBufferRef mCurrentImageBuffer; + IplImage *mDeviceImage; + uint8_t *mOutImagedata; + IplImage *mOutImage; + size_t currSize; +} + +- (void)captureOutput:(AVCaptureOutput *)captureOutput +didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer + fromConnection:(AVCaptureConnection *)connection; + +- (BOOL)grabImageUntilDate: (NSDate *)limit; +- (int)updateImage; +- (IplImage*)getOutput; + +@end + +/***************************************************************************** + * + * CvCaptureCAM Declaration. + * + * CvCaptureCAM is the instantiation of a capture source for cameras. + * + *****************************************************************************/ + +class CvCaptureCAM : public CvCapture { +public: + CvCaptureCAM(int cameraNum = -1) ; + ~CvCaptureCAM(); + virtual bool grabFrame(); + virtual IplImage* retrieveFrame(int); + virtual double getProperty(int property_id) const; + virtual bool setProperty(int property_id, double value); + virtual int didStart(); + + +private: + AVCaptureSession *mCaptureSession; + AVCaptureDeviceInput *mCaptureDeviceInput; + AVCaptureVideoDataOutput *mCaptureVideoDataOutput; + AVCaptureDevice *mCaptureDevice; + CaptureDelegate *mCapture; + + int startCaptureDevice(int cameraNum); + void stopCaptureDevice(); + + void setWidthHeight(); + bool grabFrame(double timeOut); + + int camNum; + int width; + int height; + int settingWidth; + int settingHeight; + OSType mInputPixelFormat; + + int started; +}; + + +/***************************************************************************** + * + * CvCaptureFile Declaration. + * + * CvCaptureFile is the instantiation of a capture source for video files. + * + *****************************************************************************/ + +class CvCaptureFile : public CvCapture { +public: + CvCaptureFile(const char* filename) ; + ~CvCaptureFile(); + virtual bool grabFrame(); + virtual IplImage* retrieveFrame(int); + virtual double getProperty(int property_id) const; + virtual bool setProperty(int property_id, double value); + virtual int didStart(); + + +private: + AVAsset *mAsset; + AVAssetTrack *mAssetTrack; + AVAssetReader *mAssetReader; + AVAssetReaderTrackOutput *mTrackOutput; + + CMSampleBufferRef mCurrentSampleBuffer; + CVImageBufferRef mGrabbedPixels; + IplImage *mDeviceImage; + uint8_t *mOutImagedata; + IplImage *mOutImage; + size_t currSize; + int mMode; + int mFormat; + + bool setupReadingAt(CMTime position); + IplImage* retrieveFramePixelBuffer(); + + CMTime mFrameTimestamp; + size_t mFrameNum; + OSType mInputPixelFormat; + + int started; +}; + + +/***************************************************************************** + * + * CvVideoWriter_AVFoundation Declaration. + * + * CvVideoWriter_AVFoundation is the instantiation of a video output class. + * + *****************************************************************************/ + +class CvVideoWriter_AVFoundation : public CvVideoWriter { + public: + CvVideoWriter_AVFoundation(const char* filename, int fourcc, + double fps, CvSize frame_size, + int is_color=1); + ~CvVideoWriter_AVFoundation(); + bool writeFrame(const IplImage* image); + private: + IplImage* argbimage; + + AVAssetWriter *mMovieWriter; + AVAssetWriterInput* mMovieWriterInput; + AVAssetWriterInputPixelBufferAdaptor* mMovieWriterAdaptor; + + NSString* path; + NSString* codec; + NSString* fileType; + double mMovieFPS; + CvSize movieSize; + int movieColor; + unsigned long mFrameNum; +}; + +/****************** Implementation of interface functions ********************/ + + +CvCapture* cvCreateFileCapture_AVFoundation(const char* filename) { + CvCaptureFile *retval = new CvCaptureFile(filename); + + if(retval->didStart()) + return retval; + delete retval; + return NULL; +} + +CvCapture* cvCreateCameraCapture_AVFoundation(int index ) { + CvCapture* retval = new CvCaptureCAM(index); + if (!((CvCaptureCAM *)retval)->didStart()) + cvReleaseCapture(&retval); + return retval; +} + +CvVideoWriter* cvCreateVideoWriter_AVFoundation(const char* filename, int fourcc, + double fps, CvSize frame_size, + int is_color) { + return new CvVideoWriter_AVFoundation(filename, fourcc, fps, frame_size,is_color); +} + +/********************** Implementation of Classes ****************************/ + +/***************************************************************************** + * + * CvCaptureCAM Implementation. + * + * CvCaptureCAM is the instantiation of a capture source for cameras. + * + *****************************************************************************/ + +CvCaptureCAM::CvCaptureCAM(int cameraNum) { + mCaptureSession = nil; + mCaptureDeviceInput = nil; + mCaptureVideoDataOutput = nil; + mCaptureDevice = nil; + mCapture = nil; + + width = 0; + height = 0; + settingWidth = 0; + settingHeight = 0; + + camNum = cameraNum; + + if ( ! startCaptureDevice(camNum) ) { + fprintf(stderr, "OpenCV: camera failed to properly initialize!\n"); + started = 0; + } else { + started = 1; + } +} + +CvCaptureCAM::~CvCaptureCAM() { + stopCaptureDevice(); +} + +int CvCaptureCAM::didStart() { + return started; +} + + +bool CvCaptureCAM::grabFrame() { + return grabFrame(1); +} + +bool CvCaptureCAM::grabFrame(double timeOut) { + NSAutoreleasePool *localpool = [[NSAutoreleasePool alloc] init]; + + bool isGrabbed = false; + NSDate *limit = [NSDate dateWithTimeIntervalSinceNow: timeOut]; + if ( [mCapture grabImageUntilDate: limit] ) { + [mCapture updateImage]; + isGrabbed = true; + } + + [localpool drain]; + return isGrabbed; +} + +IplImage* CvCaptureCAM::retrieveFrame(int) { + return [mCapture getOutput]; +} + +void CvCaptureCAM::stopCaptureDevice() { + NSAutoreleasePool *localpool = [[NSAutoreleasePool alloc] init]; + + [mCaptureSession stopRunning]; + + [mCaptureSession release]; + [mCaptureDeviceInput release]; + [mCaptureDevice release]; + + [mCaptureVideoDataOutput release]; + [mCapture release]; + + [localpool drain]; +} + +int CvCaptureCAM::startCaptureDevice(int cameraNum) { + NSAutoreleasePool *localpool = [[NSAutoreleasePool alloc] init]; + + // get capture device + NSArray *devices = [AVCaptureDevice devicesWithMediaType: AVMediaTypeVideo]; + + if ( devices.count == 0 ) { + fprintf(stderr, "OpenCV: AVFoundation didn't find any attached Video Input Devices!\n"); + [localpool drain]; + return 0; + } + + if ( cameraNum < 0 || devices.count <= NSUInteger(cameraNum) ) { + fprintf(stderr, "OpenCV: out device of bound (0-%ld): %d\n", devices.count-1, cameraNum); + [localpool drain]; + return 0; + } + + mCaptureDevice = devices[cameraNum]; + + if ( ! mCaptureDevice ) { + fprintf(stderr, "OpenCV: device %d not able to use.\n", cameraNum); + [localpool drain]; + return 0; + } + + // get input device + NSError *error = nil; + mCaptureDeviceInput = [[AVCaptureDeviceInput alloc] initWithDevice: mCaptureDevice + error: &error]; + if ( error ) { + fprintf(stderr, "OpenCV: error in [AVCaptureDeviceInput initWithDevice:error:]\n"); + NSLog(@"OpenCV: %@", error.localizedDescription); + [localpool drain]; + return 0; + } + + // create output + mCapture = [[CaptureDelegate alloc] init]; + mCaptureVideoDataOutput = [[AVCaptureVideoDataOutput alloc] init]; + dispatch_queue_t queue = dispatch_queue_create("cameraQueue", DISPATCH_QUEUE_SERIAL); + [mCaptureVideoDataOutput setSampleBufferDelegate: mCapture queue: queue]; + dispatch_release(queue); + + OSType pixelFormat = kCVPixelFormatType_32BGRA; + //OSType pixelFormat = kCVPixelFormatType_422YpCbCr8; + NSDictionary *pixelBufferOptions; + if (width > 0 && height > 0) { + pixelBufferOptions = + @{ + (id)kCVPixelBufferWidthKey: @(1.0*width), + (id)kCVPixelBufferHeightKey: @(1.0*height), + (id)kCVPixelBufferPixelFormatTypeKey: @(pixelFormat) + }; + } else { + pixelBufferOptions = + @{ + (id)kCVPixelBufferPixelFormatTypeKey: @(pixelFormat) + }; + } + mCaptureVideoDataOutput.videoSettings = pixelBufferOptions; + mCaptureVideoDataOutput.alwaysDiscardsLateVideoFrames = YES; + + // create session + mCaptureSession = [[AVCaptureSession alloc] init]; + mCaptureSession.sessionPreset = AVCaptureSessionPresetMedium; + [mCaptureSession addInput: mCaptureDeviceInput]; + [mCaptureSession addOutput: mCaptureVideoDataOutput]; + + [mCaptureSession startRunning]; + + // flush old position image + grabFrame(1); + + [localpool drain]; + return 1; +} + +void CvCaptureCAM::setWidthHeight() { + NSMutableDictionary *pixelBufferOptions = [mCaptureVideoDataOutput.videoSettings mutableCopy]; + + while ( true ) { + // auto matching + pixelBufferOptions[(id)kCVPixelBufferWidthKey] = @(1.0*width); + pixelBufferOptions[(id)kCVPixelBufferHeightKey] = @(1.0*height); + mCaptureVideoDataOutput.videoSettings = pixelBufferOptions; + + // compare matched size and my options + CMFormatDescriptionRef format = mCaptureDevice.activeFormat.formatDescription; + CMVideoDimensions deviceSize = CMVideoFormatDescriptionGetDimensions(format); + if ( deviceSize.width == width && deviceSize.height == height ) { + break; + } + + // fit my options to matched size + width = deviceSize.width; + height = deviceSize.height; + } + + // flush old size image + grabFrame(1); + + [pixelBufferOptions release]; +} + + +double CvCaptureCAM::getProperty(int property_id) const{ + NSAutoreleasePool *localpool = [[NSAutoreleasePool alloc] init]; + + CMFormatDescriptionRef format = mCaptureDevice.activeFormat.formatDescription; + CMVideoDimensions s1 = CMVideoFormatDescriptionGetDimensions(format); + double retval = 0; + + switch (property_id) { + case CV_CAP_PROP_FRAME_WIDTH: + retval = s1.width; + break; + case CV_CAP_PROP_FRAME_HEIGHT: + retval = s1.height; + break; + case CV_CAP_PROP_FPS: + { + CMTime frameDuration = mCaptureDevice.activeVideoMaxFrameDuration; + retval = frameDuration.timescale / double(frameDuration.value); + } + break; + case CV_CAP_PROP_FORMAT: + retval = CV_8UC3; + break; + default: + break; + } + + [localpool drain]; + return retval; +} + +bool CvCaptureCAM::setProperty(int property_id, double value) { + NSAutoreleasePool *localpool = [[NSAutoreleasePool alloc] init]; + + bool isSucceeded = false; + + switch (property_id) { + case CV_CAP_PROP_FRAME_WIDTH: + width = value; + settingWidth = 1; + if (settingWidth && settingHeight) { + setWidthHeight(); + settingWidth = 0; + settingHeight = 0; + } + isSucceeded = true; + break; + case CV_CAP_PROP_FRAME_HEIGHT: + height = value; + settingHeight = 1; + if (settingWidth && settingHeight) { + setWidthHeight(); + settingWidth = 0; + settingHeight = 0; + } + isSucceeded = true; + break; + case CV_CAP_PROP_FPS: + if ( [mCaptureDevice lockForConfiguration: NULL] ) { + NSArray * ranges = mCaptureDevice.activeFormat.videoSupportedFrameRateRanges; + AVFrameRateRange *matchedRange = ranges[0]; + double minDiff = fabs(matchedRange.maxFrameRate - value); + for ( AVFrameRateRange *range in ranges ) { + double diff = fabs(range.maxFrameRate - value); + if ( diff < minDiff ) { + minDiff = diff; + matchedRange = range; + } + } + mCaptureDevice.activeVideoMinFrameDuration = matchedRange.minFrameDuration; + mCaptureDevice.activeVideoMaxFrameDuration = matchedRange.minFrameDuration; + isSucceeded = true; + [mCaptureDevice unlockForConfiguration]; + } + break; + default: + break; + } + + [localpool drain]; + return isSucceeded; +} + + +/***************************************************************************** + * + * CaptureDelegate Implementation. + * + * CaptureDelegate is notified on a separate thread by the OS whenever there + * is a new frame. When "updateImage" is called from the main thread, it + * copies this new frame into an IplImage, but only if this frame has not + * been copied before. When "getOutput" is called from the main thread, + * it gives the last copied IplImage. + * + *****************************************************************************/ + + +@implementation CaptureDelegate + +- (id)init { + [super init]; + mHasNewFrame = [[NSCondition alloc] init]; + mCurrentImageBuffer = NULL; + mGrabbedPixels = NULL; + mDeviceImage = NULL; + mOutImagedata = NULL; + mOutImage = NULL; + currSize = 0; + return self; +} + +-(void)dealloc { + free(mOutImagedata); + cvReleaseImage(&mOutImage); + cvReleaseImage(&mDeviceImage); + CVBufferRelease(mCurrentImageBuffer); + CVBufferRelease(mGrabbedPixels); + [mHasNewFrame release]; + [super dealloc]; +} + +- (void)captureOutput:(AVCaptureOutput *)captureOutput +didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer + fromConnection:(AVCaptureConnection *)connection { + (void)captureOutput; + (void)sampleBuffer; + (void)connection; + + CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); + CVBufferRetain(imageBuffer); + + [mHasNewFrame lock]; + + CVBufferRelease(mCurrentImageBuffer); + mCurrentImageBuffer = imageBuffer; + [mHasNewFrame signal]; + + [mHasNewFrame unlock]; + +} + +-(IplImage*) getOutput { + return mOutImage; +} + +-(BOOL) grabImageUntilDate: (NSDate *)limit { + BOOL isGrabbed = NO; + [mHasNewFrame lock]; + + if ( mGrabbedPixels ) { + CVBufferRelease(mGrabbedPixels); + } + if ( [mHasNewFrame waitUntilDate: limit] ) { + isGrabbed = YES; + mGrabbedPixels = CVBufferRetain(mCurrentImageBuffer); + } + + [mHasNewFrame unlock]; + return isGrabbed; +} + +-(int) updateImage { + if ( ! mGrabbedPixels ) { + return 0; + } + + CVPixelBufferLockBaseAddress(mGrabbedPixels, 0); + void *baseaddress = CVPixelBufferGetBaseAddress(mGrabbedPixels); + + size_t width = CVPixelBufferGetWidth(mGrabbedPixels); + size_t height = CVPixelBufferGetHeight(mGrabbedPixels); + size_t rowBytes = CVPixelBufferGetBytesPerRow(mGrabbedPixels); + OSType pixelFormat = CVPixelBufferGetPixelFormatType(mGrabbedPixels); + + if ( rowBytes == 0 ) { + fprintf(stderr, "OpenCV: error: rowBytes == 0\n"); + CVPixelBufferUnlockBaseAddress(mGrabbedPixels, 0); + CVBufferRelease(mGrabbedPixels); + mGrabbedPixels = NULL; + return 0; + } + + if ( currSize != width*3*height ) { + currSize = width*3*height; + free(mOutImagedata); + mOutImagedata = reinterpret_cast(malloc(currSize)); + } + + if (mOutImage == NULL) { + mOutImage = cvCreateImageHeader(cvSize((int)width,(int)height), IPL_DEPTH_8U, 3); + } + mOutImage->width = int(width); + mOutImage->height = int(height); + mOutImage->nChannels = 3; + mOutImage->depth = IPL_DEPTH_8U; + mOutImage->widthStep = int(width*3); + mOutImage->imageData = reinterpret_cast(mOutImagedata); + mOutImage->imageSize = int(currSize); + + if ( pixelFormat == kCVPixelFormatType_32BGRA ) { + if (mDeviceImage == NULL) { + mDeviceImage = cvCreateImageHeader(cvSize(int(width),int(height)), IPL_DEPTH_8U, 4); + } + mDeviceImage->width = int(width); + mDeviceImage->height = int(height); + mDeviceImage->nChannels = 4; + mDeviceImage->depth = IPL_DEPTH_8U; + mDeviceImage->widthStep = int(rowBytes); + mDeviceImage->imageData = reinterpret_cast(baseaddress); + mDeviceImage->imageSize = int(rowBytes*height); + + cvCvtColor(mDeviceImage, mOutImage, CV_BGRA2BGR); + } else if ( pixelFormat == kCVPixelFormatType_422YpCbCr8 ) { + if ( currSize != width*3*height ) { + currSize = width*3*height; + free(mOutImagedata); + mOutImagedata = reinterpret_cast(malloc(currSize)); + } + + if (mDeviceImage == NULL) { + mDeviceImage = cvCreateImageHeader(cvSize(int(width),int(height)), IPL_DEPTH_8U, 2); + } + mDeviceImage->width = int(width); + mDeviceImage->height = int(height); + mDeviceImage->nChannels = 2; + mDeviceImage->depth = IPL_DEPTH_8U; + mDeviceImage->widthStep = int(rowBytes); + mDeviceImage->imageData = reinterpret_cast(baseaddress); + mDeviceImage->imageSize = int(rowBytes*height); + + cvCvtColor(mDeviceImage, mOutImage, CV_YUV2BGR_UYVY); + } else { + fprintf(stderr, "OpenCV: unknown pixel format 0x%08X\n", pixelFormat); + CVPixelBufferUnlockBaseAddress(mGrabbedPixels, 0); + CVBufferRelease(mGrabbedPixels); + mGrabbedPixels = NULL; + return 0; + } + + CVPixelBufferUnlockBaseAddress(mGrabbedPixels, 0); + CVBufferRelease(mGrabbedPixels); + mGrabbedPixels = NULL; + + return 1; +} + +@end + + +/***************************************************************************** + * + * CvCaptureFile Implementation. + * + * CvCaptureFile is the instantiation of a capture source for video files. + * + *****************************************************************************/ + +CvCaptureFile::CvCaptureFile(const char* filename) { + NSAutoreleasePool *localpool = [[NSAutoreleasePool alloc] init]; + + mAsset = nil; + mAssetTrack = nil; + mAssetReader = nil; + mTrackOutput = nil; + mDeviceImage = NULL; + mOutImage = NULL; + mOutImagedata = NULL; + currSize = 0; + mMode = CV_CAP_MODE_BGR; + mFormat = CV_8UC3; + mCurrentSampleBuffer = NULL; + mGrabbedPixels = NULL; + mFrameTimestamp = kCMTimeZero; + mFrameNum = 0; + + started = 0; + + mAsset = [[AVAsset assetWithURL:[NSURL fileURLWithPath: @(filename)]] retain]; + + if ( mAsset == nil ) { + fprintf(stderr, "OpenCV: Couldn't read movie file \"%s\"\n", filename); + [localpool drain]; + started = 0; + return; + } + + mAssetTrack = [[mAsset tracksWithMediaType: AVMediaTypeVideo][0] retain]; + + if ( ! setupReadingAt(kCMTimeZero) ) { + fprintf(stderr, "OpenCV: Couldn't read movie file \"%s\"\n", filename); + [localpool drain]; + started = 0; + return; + } + + started = 1; + [localpool drain]; +} + +CvCaptureFile::~CvCaptureFile() { + NSAutoreleasePool *localpool = [[NSAutoreleasePool alloc] init]; + + free(mOutImagedata); + cvReleaseImage(&mOutImage); + cvReleaseImage(&mDeviceImage); + [mAssetReader release]; + [mTrackOutput release]; + [mAssetTrack release]; + [mAsset release]; + CVBufferRelease(mGrabbedPixels); + if ( mCurrentSampleBuffer ) { + CFRelease(mCurrentSampleBuffer); + } + + [localpool drain]; +} + +bool CvCaptureFile::setupReadingAt(CMTime position) { + if (mAssetReader) { + if (mAssetReader.status == AVAssetReaderStatusReading) { + [mAssetReader cancelReading]; + } + [mAssetReader release]; + mAssetReader = nil; + } + if (mTrackOutput) { + [mTrackOutput release]; + mTrackOutput = nil; + } + + // Capture in a pixel format that can be converted efficiently to the output mode. + OSType pixelFormat; + if (mMode == CV_CAP_MODE_BGR || mMode == CV_CAP_MODE_RGB) { + // For CV_CAP_MODE_BGR, read frames as BGRA (AV Foundation's YUV->RGB conversion is slightly faster than OpenCV's CV_YUV2BGR_YV12) + // kCVPixelFormatType_32ABGR is reportedly faster on OS X, but OpenCV doesn't have a CV_ABGR2BGR conversion. + // kCVPixelFormatType_24RGB is significanly slower than kCVPixelFormatType_32BGRA. + pixelFormat = kCVPixelFormatType_32BGRA; + mFormat = CV_8UC3; + } else if (mMode == CV_CAP_MODE_GRAY) { + // For CV_CAP_MODE_GRAY, read frames as 420v (faster than 420f or 422 -- at least for H.264 files) + pixelFormat = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange; + mFormat = CV_8UC1; + } else if (mMode == CV_CAP_MODE_YUYV) { + // For CV_CAP_MODE_YUYV, read frames directly as 422. + pixelFormat = kCVPixelFormatType_422YpCbCr8; + mFormat = CV_8UC2; + } else { + fprintf(stderr, "VIDEOIO ERROR: AVF Mac: Unsupported mode: %d\n", mMode); + return false; + } + + NSDictionary *settings = + @{ + (id)kCVPixelBufferPixelFormatTypeKey: @(pixelFormat) + }; + mTrackOutput = [[AVAssetReaderTrackOutput assetReaderTrackOutputWithTrack: mAssetTrack + outputSettings: settings] retain]; + + if ( !mTrackOutput ) { + fprintf(stderr, "OpenCV: error in [AVAssetReaderTrackOutput assetReaderTrackOutputWithTrack:outputSettings:]\n"); + return false; + } + + NSError *error = nil; + mAssetReader = [[AVAssetReader assetReaderWithAsset: mAsset + error: &error] retain]; + if ( error ) { + fprintf(stderr, "OpenCV: error in [AVAssetReader assetReaderWithAsset:error:]\n"); + NSLog(@"OpenCV: %@", error.localizedDescription); + return false; + } + + mAssetReader.timeRange = CMTimeRangeMake(position, kCMTimePositiveInfinity); + mFrameTimestamp = position; + mFrameNum = round((mFrameTimestamp.value * mAssetTrack.nominalFrameRate) / double(mFrameTimestamp.timescale)); + [mAssetReader addOutput: mTrackOutput]; + [mAssetReader startReading]; + + return true; +} + +int CvCaptureFile::didStart() { + return started; +} + +bool CvCaptureFile::grabFrame() { + NSAutoreleasePool *localpool = [[NSAutoreleasePool alloc] init]; + + CVBufferRelease(mGrabbedPixels); + if ( mCurrentSampleBuffer ) { + CFRelease(mCurrentSampleBuffer); + } + mCurrentSampleBuffer = [mTrackOutput copyNextSampleBuffer]; + mGrabbedPixels = CMSampleBufferGetImageBuffer(mCurrentSampleBuffer); + CVBufferRetain(mGrabbedPixels); + mFrameTimestamp = CMSampleBufferGetOutputPresentationTimeStamp(mCurrentSampleBuffer); + mFrameNum++; + + bool isReading = (mAssetReader.status == AVAssetReaderStatusReading); + [localpool drain]; + return isReading; +} + + +IplImage* CvCaptureFile::retrieveFramePixelBuffer() { + if ( ! mGrabbedPixels ) { + return 0; + } + + NSAutoreleasePool *localpool = [[NSAutoreleasePool alloc] init]; + + CVPixelBufferLockBaseAddress(mGrabbedPixels, 0); + void *baseaddress; + size_t width, height, rowBytes; + + OSType pixelFormat = CVPixelBufferGetPixelFormatType(mGrabbedPixels); + + if (CVPixelBufferIsPlanar(mGrabbedPixels)) { + baseaddress = CVPixelBufferGetBaseAddressOfPlane(mGrabbedPixels, 0); + width = CVPixelBufferGetWidthOfPlane(mGrabbedPixels, 0); + height = CVPixelBufferGetHeightOfPlane(mGrabbedPixels, 0); + rowBytes = CVPixelBufferGetBytesPerRowOfPlane(mGrabbedPixels, 0); + } else { + baseaddress = CVPixelBufferGetBaseAddress(mGrabbedPixels); + width = CVPixelBufferGetWidth(mGrabbedPixels); + height = CVPixelBufferGetHeight(mGrabbedPixels); + rowBytes = CVPixelBufferGetBytesPerRow(mGrabbedPixels); + } + + if ( rowBytes == 0 ) { + fprintf(stderr, "OpenCV: error: rowBytes == 0\n"); + CVPixelBufferUnlockBaseAddress(mGrabbedPixels, 0); + CVBufferRelease(mGrabbedPixels); + mGrabbedPixels = NULL; + return 0; + } + + // Output image paramaters. + int outChannels; + if (mMode == CV_CAP_MODE_BGR || mMode == CV_CAP_MODE_RGB) { + outChannels = 3; + } else if (mMode == CV_CAP_MODE_GRAY) { + outChannels = 1; + } else if (mMode == CV_CAP_MODE_YUYV) { + outChannels = 2; + } else { + fprintf(stderr, "VIDEOIO ERROR: AVF Mac: Unsupported mode: %d\n", mMode); + CVPixelBufferUnlockBaseAddress(mGrabbedPixels, 0); + CVBufferRelease(mGrabbedPixels); + mGrabbedPixels = NULL; + return 0; + } + + if ( currSize != width*outChannels*height ) { + currSize = width*outChannels*height; + free(mOutImagedata); + mOutImagedata = reinterpret_cast(malloc(currSize)); + } + + // Build the header for the output image. + if (mOutImage == NULL) { + mOutImage = cvCreateImageHeader(cvSize((int)width,(int)height), IPL_DEPTH_8U, outChannels); + } + mOutImage->width = int(width); + mOutImage->height = int(height); + mOutImage->nChannels = outChannels; + mOutImage->depth = IPL_DEPTH_8U; + mOutImage->widthStep = int(width*outChannels); + mOutImage->imageData = reinterpret_cast(mOutImagedata); + mOutImage->imageSize = int(currSize); + + // Device image paramaters and conversion code. + // (Not all of these conversions are used in production, but they were all tested to find the fastest options.) + int deviceChannels; + int cvtCode; + + if ( pixelFormat == kCVPixelFormatType_32BGRA ) { + deviceChannels = 4; + + if (mMode == CV_CAP_MODE_BGR) { + cvtCode = CV_BGRA2BGR; + } else if (mMode == CV_CAP_MODE_RGB) { + cvtCode = CV_BGRA2RGB; + } else if (mMode == CV_CAP_MODE_GRAY) { + cvtCode = CV_BGRA2GRAY; + } else { + CVPixelBufferUnlockBaseAddress(mGrabbedPixels, 0); + CVBufferRelease(mGrabbedPixels); + mGrabbedPixels = NULL; + fprintf(stderr, "OpenCV: unsupported pixel conversion mode\n"); + return 0; + } + } else if ( pixelFormat == kCVPixelFormatType_24RGB ) { + deviceChannels = 3; + + if (mMode == CV_CAP_MODE_BGR) { + cvtCode = CV_RGB2BGR; + } else if (mMode == CV_CAP_MODE_RGB) { + cvtCode = 0; + } else if (mMode == CV_CAP_MODE_GRAY) { + cvtCode = CV_RGB2GRAY; + } else { + CVPixelBufferUnlockBaseAddress(mGrabbedPixels, 0); + CVBufferRelease(mGrabbedPixels); + mGrabbedPixels = NULL; + fprintf(stderr, "OpenCV: unsupported pixel conversion mode\n"); + return 0; + } + } else if ( pixelFormat == kCVPixelFormatType_422YpCbCr8 ) { // 422 (2vuy, UYVY) + deviceChannels = 2; + + if (mMode == CV_CAP_MODE_BGR) { + cvtCode = CV_YUV2BGR_UYVY; + } else if (mMode == CV_CAP_MODE_RGB) { + cvtCode = CV_YUV2RGB_UYVY; + } else if (mMode == CV_CAP_MODE_GRAY) { + cvtCode = CV_YUV2GRAY_UYVY; + } else if (mMode == CV_CAP_MODE_YUYV) { + cvtCode = -1; // Copy + } else { + CVPixelBufferUnlockBaseAddress(mGrabbedPixels, 0); + CVBufferRelease(mGrabbedPixels); + mGrabbedPixels = NULL; + fprintf(stderr, "OpenCV: unsupported pixel conversion mode\n"); + return 0; + } + } else if ( pixelFormat == kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange || // 420v + pixelFormat == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange ) { // 420f + // cvCvtColor(CV_YUV2GRAY_420) is expecting a single buffer with both the Y plane and the CrCb planes. + // So, lie about the height of the buffer. cvCvtColor(CV_YUV2GRAY_420) will only read the first 2/3 of it. + height = height * 3 / 2; + deviceChannels = 1; + + if (mMode == CV_CAP_MODE_BGR) { + cvtCode = CV_YUV2BGR_YV12; + } else if (mMode == CV_CAP_MODE_RGB) { + cvtCode = CV_YUV2RGB_YV12; + } else if (mMode == CV_CAP_MODE_GRAY) { + cvtCode = CV_YUV2GRAY_420; + } else { + CVPixelBufferUnlockBaseAddress(mGrabbedPixels, 0); + CVBufferRelease(mGrabbedPixels); + mGrabbedPixels = NULL; + fprintf(stderr, "OpenCV: unsupported pixel conversion mode\n"); + return 0; + } + } else { + fprintf(stderr, "OpenCV: unsupported pixel format 0x%08X\n", pixelFormat); + CVPixelBufferUnlockBaseAddress(mGrabbedPixels, 0); + CVBufferRelease(mGrabbedPixels); + mGrabbedPixels = NULL; + return 0; + } + + // Build the header for the device image. + if (mDeviceImage == NULL) { + mDeviceImage = cvCreateImageHeader(cvSize(int(width),int(height)), IPL_DEPTH_8U, deviceChannels); + } + mDeviceImage->width = int(width); + mDeviceImage->height = int(height); + mDeviceImage->nChannels = deviceChannels; + mDeviceImage->depth = IPL_DEPTH_8U; + mDeviceImage->widthStep = int(rowBytes); + mDeviceImage->imageData = reinterpret_cast(baseaddress); + mDeviceImage->imageSize = int(rowBytes*height); + + // Convert the device image into the output image. + if (cvtCode == -1) { + // Copy. + cv::cvarrToMat(mDeviceImage).copyTo(cv::cvarrToMat(mOutImage)); + } else { + cvCvtColor(mDeviceImage, mOutImage, cvtCode); + } + + + CVPixelBufferUnlockBaseAddress(mGrabbedPixels, 0); + + [localpool drain]; + + return mOutImage; +} + + +IplImage* CvCaptureFile::retrieveFrame(int) { + return retrieveFramePixelBuffer(); +} + +double CvCaptureFile::getProperty(int property_id) const{ + if (mAsset == nil) return 0; + + CMTime t; + + switch (property_id) { + case CV_CAP_PROP_POS_MSEC: + return mFrameTimestamp.value * 1000.0 / mFrameTimestamp.timescale; + case CV_CAP_PROP_POS_FRAMES: + return mFrameNum; + case CV_CAP_PROP_POS_AVI_RATIO: + t = [mAsset duration]; + return (mFrameTimestamp.value * t.timescale) / double(mFrameTimestamp.timescale * t.value); + case CV_CAP_PROP_FRAME_WIDTH: + return mAssetTrack.naturalSize.width; + case CV_CAP_PROP_FRAME_HEIGHT: + return mAssetTrack.naturalSize.height; + case CV_CAP_PROP_FPS: + return mAssetTrack.nominalFrameRate; + case CV_CAP_PROP_FRAME_COUNT: + t = [mAsset duration]; + return round((t.value * mAssetTrack.nominalFrameRate) / double(t.timescale)); + case CV_CAP_PROP_FORMAT: + return mFormat; + case CV_CAP_PROP_MODE: + return mMode; + default: + break; + } + + return 0; +} + +bool CvCaptureFile::setProperty(int property_id, double value) { + if (mAsset == nil) return false; + + NSAutoreleasePool* localpool = [[NSAutoreleasePool alloc] init]; + + bool retval = false; + CMTime t; + + switch (property_id) { + case CV_CAP_PROP_POS_MSEC: + t = mAsset.duration; + t.value = value * t.timescale / 1000; + setupReadingAt(t); + retval = true; + break; + case CV_CAP_PROP_POS_FRAMES: + setupReadingAt(CMTimeMake(value, mAssetTrack.nominalFrameRate)); + retval = true; + break; + case CV_CAP_PROP_POS_AVI_RATIO: + t = mAsset.duration; + t.value = round(t.value * value); + setupReadingAt(t); + retval = true; + break; + case CV_CAP_PROP_MODE: + int mode; + mode = cvRound(value); + if (mMode == mode) { + retval = true; + } else { + switch (mode) { + case CV_CAP_MODE_BGR: + case CV_CAP_MODE_RGB: + case CV_CAP_MODE_GRAY: + case CV_CAP_MODE_YUYV: + mMode = mode; + setupReadingAt(mFrameTimestamp); + retval = true; + break; + default: + fprintf(stderr, "VIDEOIO ERROR: AVF Mac: Unsupported mode: %d\n", mode); + retval=false; + break; + } + } + break; + default: + break; + } + + [localpool drain]; + return retval; +} + + +/***************************************************************************** + * + * CvVideoWriter_AVFoundation Implementation. + * + * CvVideoWriter_AVFoundation is the instantiation of a video output class. + * + *****************************************************************************/ + + +CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(const char* filename, int fourcc, + double fps, CvSize frame_size, + int is_color) { + + NSAutoreleasePool* localpool = [[NSAutoreleasePool alloc] init]; + + + mFrameNum = 0; + mMovieFPS = fps; + movieSize = frame_size; + movieColor = is_color; + argbimage = cvCreateImage(movieSize, IPL_DEPTH_8U, 4); + path = [[[NSString stringWithCString:filename encoding:NSASCIIStringEncoding] stringByExpandingTildeInPath] retain]; + + + /* + AVFileTypeQuickTimeMovie + UTI for the QuickTime movie file format. + The value of this UTI is com.apple.quicktime-movie. Files are identified with the .mov and .qt extensions. + + AVFileTypeMPEG4 + UTI for the MPEG-4 file format. + The value of this UTI is public.mpeg-4. Files are identified with the .mp4 extension. + + AVFileTypeAppleM4V + UTI for the iTunes video file format. + The value of this UTI is com.apple.mpeg-4-video. Files are identified with the .m4v extension. + + AVFileType3GPP + UTI for the 3GPP file format. + The value of this UTI is public.3gpp. Files are identified with the .3gp, .3gpp, and .sdv extensions. + */ + + NSString *fileExt =[[[path pathExtension] lowercaseString] copy]; + if ([fileExt isEqualToString:@"mov"] || [fileExt isEqualToString:@"qt"]){ + fileType = [AVFileTypeQuickTimeMovie copy]; + }else if ([fileExt isEqualToString:@"mp4"]){ + fileType = [AVFileTypeMPEG4 copy]; + }else if ([fileExt isEqualToString:@"m4v"]){ + fileType = [AVFileTypeAppleM4V copy]; +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + }else if ([fileExt isEqualToString:@"3gp"] || [fileExt isEqualToString:@"3gpp"] || [fileExt isEqualToString:@"sdv"] ){ + fileType = [AVFileType3GPP copy]; +#endif + } else{ + fileType = [AVFileTypeMPEG4 copy]; //default mp4 + } + [fileExt release]; + + char cc[5]; + cc[0] = fourcc & 255; + cc[1] = (fourcc >> 8) & 255; + cc[2] = (fourcc >> 16) & 255; + cc[3] = (fourcc >> 24) & 255; + cc[4] = 0; + int cc2 = CV_FOURCC(cc[0], cc[1], cc[2], cc[3]); + if (cc2!=fourcc) { + fprintf(stderr, "OpenCV: Didn't properly encode FourCC. Expected 0x%08X but got 0x%08X.\n", fourcc, cc2); + //exception; + } + + // Two codec supported AVVideoCodecH264 AVVideoCodecJPEG + // On iPhone 3G H264 is not supported. + if (fourcc == CV_FOURCC('J','P','E','G') || fourcc == CV_FOURCC('j','p','e','g') || + fourcc == CV_FOURCC('M','J','P','G') || fourcc == CV_FOURCC('m','j','p','g') ){ + codec = [AVVideoCodecJPEG copy]; // Use JPEG codec if specified, otherwise H264 + }else if(fourcc == CV_FOURCC('H','2','6','4') || fourcc == CV_FOURCC('a','v','c','1')){ + codec = [AVVideoCodecH264 copy]; + }else{ + codec = [AVVideoCodecH264 copy]; // default canonical H264. + + } + + //NSLog(@"Path: %@", path); + + NSError *error = nil; + + + // Make sure the file does not already exist. Necessary to overwirte?? + /* + NSFileManager *fileManager = [NSFileManager defaultManager]; + if ([fileManager fileExistsAtPath:path]){ + [fileManager removeItemAtPath:path error:&error]; + } + */ + + // Wire the writer: + // Supported file types: + // AVFileTypeQuickTimeMovie AVFileTypeMPEG4 AVFileTypeAppleM4V AVFileType3GPP + + mMovieWriter = [[AVAssetWriter alloc] initWithURL:[NSURL fileURLWithPath:path] + fileType:fileType + error:&error]; + //NSParameterAssert(mMovieWriter); + + NSDictionary *videoSettings = [NSDictionary dictionaryWithObjectsAndKeys: + codec, AVVideoCodecKey, + [NSNumber numberWithInt:movieSize.width], AVVideoWidthKey, + [NSNumber numberWithInt:movieSize.height], AVVideoHeightKey, + nil]; + + mMovieWriterInput = [[AVAssetWriterInput + assetWriterInputWithMediaType:AVMediaTypeVideo + outputSettings:videoSettings] retain]; + + //NSParameterAssert(mMovieWriterInput); + //NSParameterAssert([mMovieWriter canAddInput:mMovieWriterInput]); + + [mMovieWriter addInput:mMovieWriterInput]; + + mMovieWriterAdaptor = [[AVAssetWriterInputPixelBufferAdaptor alloc] initWithAssetWriterInput:mMovieWriterInput sourcePixelBufferAttributes:nil]; + + + //Start a session: + [mMovieWriter startWriting]; + [mMovieWriter startSessionAtSourceTime:kCMTimeZero]; + + + if(mMovieWriter.status == AVAssetWriterStatusFailed){ + NSLog(@"AVF: AVAssetWriter status: %@", [mMovieWriter.error localizedDescription]); + // TODO: error handling, cleanup. Throw execption? + // return; + } + + [localpool drain]; +} + + +CvVideoWriter_AVFoundation::~CvVideoWriter_AVFoundation() { + NSAutoreleasePool* localpool = [[NSAutoreleasePool alloc] init]; + + [mMovieWriterInput markAsFinished]; + [mMovieWriter finishWriting]; + [mMovieWriter release]; + [mMovieWriterInput release]; + [mMovieWriterAdaptor release]; + [path release]; + [codec release]; + [fileType release]; + cvReleaseImage(&argbimage); + + [localpool drain]; + +} + +static void releaseCallback( void *releaseRefCon, const void * ) { + CFRelease((CFDataRef)releaseRefCon); +} + +bool CvVideoWriter_AVFoundation::writeFrame(const IplImage* iplimage) { + NSAutoreleasePool* localpool = [[NSAutoreleasePool alloc] init]; + + // writer status check + if (mMovieWriter.status != AVAssetWriterStatusWriting ) { + NSLog(@"mMovieWriter.status: %d. Error: %@", (int)mMovieWriter.status, [mMovieWriter.error localizedDescription]); + [localpool drain]; + return false; + } + + // Make writeFrame() a blocking call. + while (![mMovieWriterInput isReadyForMoreMediaData]) { + fprintf(stderr, "OpenCV: AVF: waiting to write video data.\n"); + // Sleep 1 msec. + usleep(1000); + } + + BOOL success = FALSE; + + if (iplimage->height!=movieSize.height || iplimage->width!=movieSize.width){ + fprintf(stderr, "OpenCV: Frame size does not match video size.\n"); + [localpool drain]; + return false; + } + + if (movieColor) { + //assert(iplimage->nChannels == 3); + cvCvtColor(iplimage, argbimage, CV_BGR2BGRA); + }else{ + //assert(iplimage->nChannels == 1); + cvCvtColor(iplimage, argbimage, CV_GRAY2BGRA); + } + //IplImage -> CGImage conversion + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + NSData *nsData = [NSData dataWithBytes:argbimage->imageData length:argbimage->imageSize]; + CGDataProviderRef provider = CGDataProviderCreateWithCFData((CFDataRef)nsData); + CGImageRef cgImage = CGImageCreate(argbimage->width, argbimage->height, + argbimage->depth, argbimage->depth * argbimage->nChannels, argbimage->widthStep, + colorSpace, kCGImageAlphaLast|kCGBitmapByteOrderDefault, + provider, NULL, false, kCGRenderingIntentDefault); + + //CGImage -> CVPixelBufferRef coversion + CVPixelBufferRef pixelBuffer = NULL; + CFDataRef cfData = CGDataProviderCopyData(CGImageGetDataProvider(cgImage)); + int status = CVPixelBufferCreateWithBytes(NULL, + movieSize.width, + movieSize.height, + kCVPixelFormatType_32BGRA, + (void*)CFDataGetBytePtr(cfData), + CGImageGetBytesPerRow(cgImage), + &releaseCallback, + (void *)cfData, + NULL, + &pixelBuffer); + if(status == kCVReturnSuccess){ + success = [mMovieWriterAdaptor appendPixelBuffer:pixelBuffer + withPresentationTime:CMTimeMake(mFrameNum, mMovieFPS)]; + } + + //cleanup + CVPixelBufferRelease(pixelBuffer); + CGImageRelease(cgImage); + CGDataProviderRelease(provider); + CGColorSpaceRelease(colorSpace); + + [localpool drain]; + + if (success) { + mFrameNum ++; + //NSLog(@"Frame #%d", mFrameNum); + return true; + }else{ + NSLog(@"Frame appendPixelBuffer failed."); + return false; + } + +} diff --git a/modules/videoio/src/cap_dshow.cpp b/modules/videoio/src/cap_dshow.cpp index 8b793ac202..8360e4318b 100644 --- a/modules/videoio/src/cap_dshow.cpp +++ b/modules/videoio/src/cap_dshow.cpp @@ -204,6 +204,7 @@ DEFINE_GUID(IID_ICreateDevEnum,0x29840822,0x5b84,0x11d0,0xbd,0x3b,0x00,0xa0,0xc9 DEFINE_GUID(IID_IGraphBuilder,0x56a868a9,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); DEFINE_GUID(IID_IMPEG2PIDMap,0xafb6c2a1,0x2c41,0x11d3,0x8a,0x60,0x00,0x00,0xf8,0x1e,0x0e,0x4a); DEFINE_GUID(IID_IMediaControl,0x56a868b1,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); +DEFINE_GUID(IID_IMediaEventEx, 0x56a868c0,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); DEFINE_GUID(IID_IMediaFilter,0x56a86899,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); DEFINE_GUID(IID_ISampleGrabber,0x6b652fff,0x11fe,0x4fce,0x92,0xad,0x02,0x66,0xb5,0xd7,0xc7,0x8f); DEFINE_GUID(LOOK_UPSTREAM_ONLY,0xac798be0,0x98e3,0x11d1,0xb3,0xf1,0x00,0xaa,0x00,0x37,0x61,0xc5); @@ -573,6 +574,8 @@ class videoInput{ int getVideoPropertyFromCV(int cv_property); int getCameraPropertyFromCV(int cv_property); + bool isDeviceDisconnected(int deviceID); + private: void setPhyCon(int deviceID, int conn); void setAttemptCaptureSize(int deviceID, int w, int h,GUID mediaType=MEDIASUBTYPE_RGB24); @@ -2309,6 +2312,27 @@ int videoInput::getCameraPropertyFromCV(int cv_property){ return -1; } +bool videoInput::isDeviceDisconnected(int deviceNumber) +{ + if (!isDeviceSetup(deviceNumber)) return true; + long evCode; + LONG_PTR param1, param2; + bool disconnected = false; + + while (S_OK == VDList[deviceNumber]->pMediaEvent->GetEvent(&evCode, ¶m1, ¶m2, 0)) + { + DebugPrintOut("Event: Code: %#04x Params: %d, %d\n", evCode, param1, param2); + + VDList[deviceNumber]->pMediaEvent->FreeEventParams(evCode, param1, param2); + if (evCode == EC_DEVICE_LOST) + { + DebugPrintOut("ERROR: Device disconnected\n"); + disconnected = true; + } + } + return disconnected; +} + void videoInput::getCameraPropertyAsString(int prop, char * propertyAsString){ char tmpStr[16]; @@ -2511,6 +2535,16 @@ int videoInput::start(int deviceID, videoDevice *VD){ return hr; } + //MEDIA EVENT// + //Used to obtain event when capture device is disconnected + hr = VD->pGraph->QueryInterface(IID_IMediaEventEx, (void**)&VD->pMediaEvent); + if (FAILED(hr)) + { + DebugPrintOut("ERROR - Could not create media event object\n"); + stopDevice(deviceID); + return hr; + } + //SET THE FILTERGRAPH// hr = VD->pCaptureGraph->SetFiltergraph(VD->pGraph); if (FAILED(hr)) @@ -3309,7 +3343,7 @@ bool VideoCapture_DShow::setProperty(int propIdx, double propVal) bool VideoCapture_DShow::grabFrame() { - return true; + return !g_VI.isDeviceDisconnected(m_index); } bool VideoCapture_DShow::retrieveFrame(int, OutputArray frame) { diff --git a/modules/videoio/src/cap_ffmpeg.cpp b/modules/videoio/src/cap_ffmpeg.cpp index 772996e505..26e2ead0cd 100644 --- a/modules/videoio/src/cap_ffmpeg.cpp +++ b/modules/videoio/src/cap_ffmpeg.cpp @@ -65,9 +65,11 @@ static cv::Mutex _icvInitFFMPEG_mutex; static const HMODULE cv_GetCurrentModule() { HMODULE h = 0; +#if _WIN32_WINNT >= 0x0501 ::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, reinterpret_cast(cv_GetCurrentModule), &h); +#endif return h; } #endif @@ -98,22 +100,16 @@ private: icvInitFFMPEG() { #if defined WIN32 || defined _WIN32 + const wchar_t* module_name_ = L"opencv_ffmpeg" + CVAUX_STRW(CV_MAJOR_VERSION) CVAUX_STRW(CV_MINOR_VERSION) CVAUX_STRW(CV_SUBMINOR_VERSION) + #if (defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__) + L"_64" + #endif + L".dll"; # ifdef WINRT - const wchar_t* module_name = L"opencv_ffmpeg" - CVAUX_STRW(CV_MAJOR_VERSION) CVAUX_STRW(CV_MINOR_VERSION) CVAUX_STRW(CV_SUBMINOR_VERSION) - #if (defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__) - L"_64" - #endif - L".dll"; - - icvFFOpenCV = LoadPackagedLibrary( module_name, 0 ); + icvFFOpenCV = LoadPackagedLibrary( module_name_, 0 ); # else - const std::wstring module_name = L"opencv_ffmpeg" - CVAUX_STRW(CV_MAJOR_VERSION) CVAUX_STRW(CV_MINOR_VERSION) CVAUX_STRW(CV_SUBMINOR_VERSION) - #if (defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__) - L"_64" - #endif - L".dll"; + const std::wstring module_name(module_name_); const wchar_t* ffmpeg_env_path = _wgetenv(L"OPENCV_FFMPEG_DLL_DIR"); std::wstring module_path = diff --git a/modules/videoio/src/cap_ffmpeg_impl.hpp b/modules/videoio/src/cap_ffmpeg_impl.hpp index a0b9d402f6..e7ece78a01 100644 --- a/modules/videoio/src/cap_ffmpeg_impl.hpp +++ b/modules/videoio/src/cap_ffmpeg_impl.hpp @@ -1135,7 +1135,14 @@ int CvCapture_FFMPEG::get_bitrate() const double CvCapture_FFMPEG::get_fps() const { +#if 0 && LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(55, 1, 100) && LIBAVFORMAT_VERSION_MICRO >= 100 + double fps = r2d(av_guess_frame_rate(ic, ic->streams[video_stream], NULL)); +#else +#if LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(54, 1, 0) + double fps = r2d(ic->streams[video_stream]->avg_frame_rate); +#else double fps = r2d(ic->streams[video_stream]->r_frame_rate); +#endif #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(52, 111, 0) if (fps < eps_zero) @@ -1148,7 +1155,7 @@ double CvCapture_FFMPEG::get_fps() const { fps = 1.0 / r2d(ic->streams[video_stream]->codec->time_base); } - +#endif return fps; } @@ -1575,6 +1582,10 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc, } #endif +#if LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(52, 42, 0) + st->avg_frame_rate = (AVRational){frame_rate, frame_rate_base}; +#endif + return st; } diff --git a/modules/videoio/src/cap_ios_abstract_camera.mm b/modules/videoio/src/cap_ios_abstract_camera.mm index 565807cccc..79e0c3d7a9 100644 --- a/modules/videoio/src/cap_ios_abstract_camera.mm +++ b/modules/videoio/src/cap_ios_abstract_camera.mm @@ -37,7 +37,7 @@ @interface CvAbstractCamera () -@property (nonatomic, retain) AVCaptureVideoPreviewLayer* captureVideoPreviewLayer; +@property (nonatomic, strong) AVCaptureVideoPreviewLayer* captureVideoPreviewLayer; - (void)deviceOrientationDidChange:(NSNotification*)notification; - (void)startCaptureSession; @@ -170,7 +170,7 @@ } running = YES; - // TOOD update image size data before actually starting (needed for recording) + // TODO: update image size data before actually starting (needed for recording) [self updateSize]; if (cameraAvailable) { @@ -193,16 +193,19 @@ // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; - for (AVCaptureInput *input in self.captureSession.inputs) { - [self.captureSession removeInput:input]; + if (self.captureSession) { + for (AVCaptureInput *input in self.captureSession.inputs) { + [self.captureSession removeInput:input]; + } + + for (AVCaptureOutput *output in self.captureSession.outputs) { + [self.captureSession removeOutput:output]; + } + + [self.captureSession stopRunning]; + self.captureSession = nil; } - for (AVCaptureOutput *output in self.captureSession.outputs) { - [self.captureSession removeOutput:output]; - } - - [self.captureSession stopRunning]; - self.captureSession = nil; self.captureVideoPreviewLayer = nil; self.videoCaptureConnection = nil; captureSessionLoaded = NO; @@ -320,7 +323,7 @@ NSError* error = nil; AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error]; if (!input) { - NSLog(@"error creating input %@", [error localizedDescription]); + NSLog(@"error creating input %@", [error description]); } // support for autofocus @@ -330,7 +333,7 @@ device.focusMode = AVCaptureFocusModeContinuousAutoFocus; [device unlockForConfiguration]; } else { - NSLog(@"unable to lock device for autofocos configuration %@", [error localizedDescription]); + NSLog(@"unable to lock device for autofocus configuration %@", [error description]); } } [self.captureSession addInput:input]; @@ -376,13 +379,13 @@ - (void)createCaptureOutput; { [NSException raise:NSInternalInconsistencyException - format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)]; + format:@"You must override %s in a subclass", __FUNCTION__]; } - (void)createCustomVideoPreview; { [NSException raise:NSInternalInconsistencyException - format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)]; + format:@"You must override %s in a subclass", __FUNCTION__]; } - (void)updateOrientation; @@ -433,7 +436,7 @@ device.focusMode = AVCaptureFocusModeLocked; [device unlockForConfiguration]; } else { - NSLog(@"unable to lock device for locked focus configuration %@", [error localizedDescription]); + NSLog(@"unable to lock device for locked focus configuration %@", [error description]); } } } @@ -447,7 +450,7 @@ device.focusMode = AVCaptureFocusModeContinuousAutoFocus; [device unlockForConfiguration]; } else { - NSLog(@"unable to lock device for autofocus configuration %@", [error localizedDescription]); + NSLog(@"unable to lock device for autofocus configuration %@", [error description]); } } } @@ -461,7 +464,7 @@ device.exposureMode = AVCaptureExposureModeLocked; [device unlockForConfiguration]; } else { - NSLog(@"unable to lock device for locked exposure configuration %@", [error localizedDescription]); + NSLog(@"unable to lock device for locked exposure configuration %@", [error description]); } } } @@ -475,7 +478,7 @@ device.exposureMode = AVCaptureExposureModeContinuousAutoExposure; [device unlockForConfiguration]; } else { - NSLog(@"unable to lock device for autoexposure configuration %@", [error localizedDescription]); + NSLog(@"unable to lock device for autoexposure configuration %@", [error description]); } } } @@ -489,7 +492,7 @@ device.whiteBalanceMode = AVCaptureWhiteBalanceModeLocked; [device unlockForConfiguration]; } else { - NSLog(@"unable to lock device for locked white balance configuration %@", [error localizedDescription]); + NSLog(@"unable to lock device for locked white balance configuration %@", [error description]); } } } @@ -503,7 +506,7 @@ device.whiteBalanceMode = AVCaptureWhiteBalanceModeContinuousAutoWhiteBalance; [device unlockForConfiguration]; } else { - NSLog(@"unable to lock device for auto white balance configuration %@", [error localizedDescription]); + NSLog(@"unable to lock device for auto white balance configuration %@", [error description]); } } } diff --git a/modules/videoio/src/cap_ios_photo_camera.mm b/modules/videoio/src/cap_ios_photo_camera.mm index c6c93a8cf0..9b44156efc 100644 --- a/modules/videoio/src/cap_ios_photo_camera.mm +++ b/modules/videoio/src/cap_ios_photo_camera.mm @@ -36,8 +36,11 @@ @interface CvPhotoCamera () +{ + id _delegate; +} -@property (nonatomic, retain) AVCaptureStillImageOutput* stillImageOutput; +@property (nonatomic, strong) AVCaptureStillImageOutput* stillImageOutput; @end @@ -53,8 +56,14 @@ #pragma mark Public @synthesize stillImageOutput; -@synthesize delegate; +- (void)setDelegate:(id)newDelegate { + _delegate = newDelegate; +} + +- (id)delegate { + return _delegate; +} #pragma mark - Public interface @@ -106,9 +115,7 @@ cameraAvailable = YES; NSLog(@"CvPhotoCamera captured image"); - if (self.delegate) { - [self.delegate photoCamera:self capturedImage:newImage]; - } + [self.delegate photoCamera:self capturedImage:newImage]; [self.captureSession startRunning]; }); diff --git a/modules/videoio/src/cap_ios_video_camera.mm b/modules/videoio/src/cap_ios_video_camera.mm index 8d483092c5..54471cee2d 100644 --- a/modules/videoio/src/cap_ios_video_camera.mm +++ b/modules/videoio/src/cap_ios_video_camera.mm @@ -49,8 +49,8 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} - (void)createVideoFileOutput; -@property (nonatomic, retain) CALayer *customPreviewLayer; -@property (nonatomic, retain) AVCaptureVideoDataOutput *videoDataOutput; +@property (nonatomic, strong) CALayer *customPreviewLayer; +@property (nonatomic, strong) AVCaptureVideoDataOutput *videoDataOutput; @end @@ -61,11 +61,12 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} @implementation CvVideoCamera +{ + id _delegate; +} - -@synthesize delegate; @synthesize grayscaleMode; @synthesize customPreviewLayer; @@ -78,7 +79,13 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} @synthesize recordPixelBufferAdaptor; @synthesize recordAssetWriter; +- (void)setDelegate:(id)newDelegate { + _delegate = newDelegate; +} +- (id)delegate { + return _delegate; +} #pragma mark - Constructors @@ -122,10 +129,6 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} - (void)stop; { - if (self.running == NO) { - return; - } - [super stop]; self.videoDataOutput = nil; @@ -134,21 +137,24 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} } if (self.recordVideo == YES) { - - if (self.recordAssetWriter.status == AVAssetWriterStatusWriting) { - [self.recordAssetWriter finishWriting]; - NSLog(@"[Camera] recording stopped"); - } else { - NSLog(@"[Camera] Recording Error: asset writer status is not writing"); + if (self.recordAssetWriter) { + if (self.recordAssetWriter.status == AVAssetWriterStatusWriting) { + [self.recordAssetWriter finishWriting]; + NSLog(@"[Camera] recording stopped"); + } else { + NSLog(@"[Camera] Recording Error: asset writer status is not writing"); + } + self.recordAssetWriter = nil; } - self.recordAssetWriter = nil; self.recordAssetWriterInput = nil; self.recordPixelBufferAdaptor = nil; } - [self.customPreviewLayer removeFromSuperlayer]; - self.customPreviewLayer = nil; + if (self.customPreviewLayer) { + [self.customPreviewLayer removeFromSuperlayer]; + self.customPreviewLayer = nil; + } } // TODO fix @@ -184,7 +190,7 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} break; // leave the layer in its last known orientation } - switch (defaultAVCaptureVideoOrientation) { + switch (self.defaultAVCaptureVideoOrientation) { case AVCaptureVideoOrientationLandscapeRight: rotation_angle += 180; break; @@ -250,7 +256,7 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} break; // leave the layer in its last known orientation } - switch (defaultAVCaptureVideoOrientation) { + switch (self.defaultAVCaptureVideoOrientation) { case AVCaptureVideoOrientationLandscapeRight: rotation_angle += 180; break; @@ -451,7 +457,8 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} { (void)captureOutput; (void)connection; - if (self.delegate) { + auto strongDelegate = self.delegate; + if (strongDelegate) { // convert from Core Media to Core Video CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); @@ -493,8 +500,8 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} CGImage* dstImage; - if ([self.delegate respondsToSelector:@selector(processImage:)]) { - [self.delegate processImage:image]; + if ([strongDelegate respondsToSelector:@selector(processImage:)]) { + [strongDelegate processImage:image]; } // check if matrix data pointer or dimensions were changed by the delegate diff --git a/modules/videoio/src/cap_openni2.cpp b/modules/videoio/src/cap_openni2.cpp index aebf1889a1..775038e93f 100644 --- a/modules/videoio/src/cap_openni2.cpp +++ b/modules/videoio/src/cap_openni2.cpp @@ -1086,7 +1086,7 @@ CvCapture* cvCreateCameraCapture_OpenNI2( int index ) return 0; } -CvCapture* cvCreateFileCapture_OpenNI( const char* filename ) +CvCapture* cvCreateFileCapture_OpenNI2( const char* filename ) { CvCapture_OpenNI2* capture = new CvCapture_OpenNI2( filename ); diff --git a/modules/videoio/src/cap_v4l.cpp b/modules/videoio/src/cap_v4l.cpp index 01a250b41e..9114108dfd 100644 --- a/modules/videoio/src/cap_v4l.cpp +++ b/modules/videoio/src/cap_v4l.cpp @@ -453,6 +453,10 @@ static int try_init_v4l2(CvCaptureCAM_V4L* capture, const char *deviceName) } static int autosetup_capture_mode_v4l2(CvCaptureCAM_V4L* capture) { + //in case palette is already set and works, no need to setup. + if(capture->palette != 0 and try_palette_v4l2(capture)){ + return 0; + } __u32 try_order[] = { V4L2_PIX_FMT_BGR24, V4L2_PIX_FMT_YVU420, @@ -466,7 +470,8 @@ static int autosetup_capture_mode_v4l2(CvCaptureCAM_V4L* capture) { V4L2_PIX_FMT_SN9C10X, V4L2_PIX_FMT_SBGGR8, V4L2_PIX_FMT_SGBRG8, - V4L2_PIX_FMT_RGB24 + V4L2_PIX_FMT_RGB24, + V4L2_PIX_FMT_Y16 }; for (size_t i = 0; i < sizeof(try_order) / sizeof(__u32); i++) { @@ -558,6 +563,7 @@ static int v4l2_num_channels(__u32 palette) { case V4L2_PIX_FMT_YVU420: case V4L2_PIX_FMT_MJPEG: case V4L2_PIX_FMT_JPEG: + case V4L2_PIX_FMT_Y16: return 1; case V4L2_PIX_FMT_YUYV: case V4L2_PIX_FMT_UYVY: @@ -573,6 +579,7 @@ static int v4l2_num_channels(__u32 palette) { static void v4l2_create_frame(CvCaptureCAM_V4L *capture) { CvSize size(capture->form.fmt.pix.width, capture->form.fmt.pix.height); int channels = 3; + int depth = IPL_DEPTH_8U; if (!capture->convert_rgb) { channels = v4l2_num_channels(capture->palette); @@ -585,11 +592,16 @@ static void v4l2_create_frame(CvCaptureCAM_V4L *capture) { case V4L2_PIX_FMT_YVU420: size.height = size.height * 3 / 2; // "1.5" channels break; + case V4L2_PIX_FMT_Y16: + if(!capture->convert_rgb){ + depth = IPL_DEPTH_16U; + } + break; } } /* Set up Image data */ - cvInitImageHeader(&capture->frame, size, IPL_DEPTH_8U, channels); + cvInitImageHeader(&capture->frame, size, depth, channels); /* Allocate space for pixelformat we convert to. * If we do not convert frame is just points to the buffer @@ -1089,6 +1101,15 @@ uyvy_to_rgb24 (int width, int height, unsigned char *src, unsigned char *dst) cvtColor(Mat(height, width, CV_8UC2, src), Mat(height, width, CV_8UC3, dst), COLOR_YUV2BGR_UYVY); } + +static inline void +y16_to_rgb24 (int width, int height, unsigned char* src, unsigned char* dst) +{ + Mat gray8; + Mat(height, width, CV_16UC1, src).convertTo(gray8, CV_8U, 0.00390625); + cvtColor(gray8,Mat(height, width, CV_8UC3, dst),COLOR_GRAY2BGR); +} + #ifdef HAVE_JPEG /* convert from mjpeg to rgb24 */ @@ -1546,6 +1567,18 @@ static IplImage* icvRetrieveFrameCAM_V4L( CvCaptureCAM_V4L* capture, int) { (unsigned char*)capture->buffers[(capture->bufferIndex+1) % capture->req.count].start, (unsigned char*)capture->frame.imageData); break; + case V4L2_PIX_FMT_Y16: + if(capture->convert_rgb){ + y16_to_rgb24(capture->form.fmt.pix.width, + capture->form.fmt.pix.height, + (unsigned char*)capture->buffers[capture->bufferIndex].start, + (unsigned char*)capture->frame.imageData); + }else{ + memcpy((char *)capture->frame.imageData, + (char *)capture->buffers[capture->bufferIndex].start, + capture->frame.imageSize); + } + break; } return(&capture->frame); @@ -1764,6 +1797,20 @@ static int icvSetPropertyCAM_V4L( CvCaptureCAM_V4L* capture, capture->convert_rgb = bool(value) && possible; retval = possible || !bool(value); break; + case CV_CAP_PROP_FOURCC: + { + __u32 old_palette = capture->palette; + __u32 new_palette = static_cast<__u32>(value); + capture->palette = new_palette; + if (v4l2_reset(capture)) { + retval = true; + } else { + capture->palette = old_palette; + v4l2_reset(capture); + retval = false; + } + } + break; default: retval = icvSetControl(capture, property_id, value); break; diff --git a/modules/videoio/src/precomp.hpp b/modules/videoio/src/precomp.hpp index 45ce1a1f60..e166596cad 100644 --- a/modules/videoio/src/precomp.hpp +++ b/modules/videoio/src/precomp.hpp @@ -66,7 +66,7 @@ #ifdef HAVE_MSMF #define _WIN32_WINNT 0x0600 // Windows Vista #else - #define _WIN32_WINNT 0x0500 // Windows 2000 + #define _WIN32_WINNT 0x0501 // Windows XP #endif #endif @@ -124,6 +124,7 @@ CvVideoWriter* cvCreateVideoWriter_MSMF( const char* filename, int fourcc, CvCapture* cvCreateCameraCapture_OpenNI( int index ); CvCapture* cvCreateCameraCapture_OpenNI2( int index ); CvCapture* cvCreateFileCapture_OpenNI( const char* filename ); +CvCapture* cvCreateFileCapture_OpenNI2( const char* filename ); CvCapture* cvCreateCameraCapture_Android( int index ); CvCapture* cvCreateCameraCapture_XIMEA( int index ); CvCapture* cvCreateCameraCapture_AVFoundation(int index); @@ -192,6 +193,6 @@ namespace cv Ptr createGPhoto2Capture(int index); Ptr createGPhoto2Capture(const String& deviceName); -}; +} #endif /* __VIDEOIO_H_ */ diff --git a/modules/videostab/src/deblurring.cpp b/modules/videostab/src/deblurring.cpp index 2f4cfd0725..dd6cfac825 100644 --- a/modules/videostab/src/deblurring.cpp +++ b/modules/videostab/src/deblurring.cpp @@ -52,6 +52,8 @@ namespace videostab float calcBlurriness(const Mat &frame) { + CV_INSTRUMENT_REGION() + Mat Gx, Gy; Sobel(frame, Gx, CV_32F, 1, 0); Sobel(frame, Gy, CV_32F, 0, 1); @@ -70,6 +72,8 @@ WeightingDeblurer::WeightingDeblurer() void WeightingDeblurer::deblur(int idx, Mat &frame) { + CV_INSTRUMENT_REGION() + CV_Assert(frame.type() == CV_8UC3); bSum_.create(frame.size()); diff --git a/modules/videostab/src/global_motion.cpp b/modules/videostab/src/global_motion.cpp index f7938d5c4c..53603382ad 100644 --- a/modules/videostab/src/global_motion.cpp +++ b/modules/videostab/src/global_motion.cpp @@ -356,6 +356,8 @@ static Mat estimateGlobMotionLeastSquaresAffine( Mat estimateGlobalMotionLeastSquares( InputOutputArray points0, InputOutputArray points1, int model, float *rmse) { + CV_INSTRUMENT_REGION() + CV_Assert(model <= MM_AFFINE); CV_Assert(points0.type() == points1.type()); const int npoints = points0.getMat().checkVector(2); @@ -380,6 +382,8 @@ Mat estimateGlobalMotionRansac( InputArray points0, InputArray points1, int model, const RansacParams ¶ms, float *rmse, int *ninliers) { + CV_INSTRUMENT_REGION() + CV_Assert(model <= MM_AFFINE); CV_Assert(points0.type() == points1.type()); const int npoints = points0.getMat().checkVector(2); @@ -844,6 +848,8 @@ Mat KeypointBasedMotionEstimatorGpu::estimate(const cuda::GpuMat &frame0, const Mat getMotion(int from, int to, const std::vector &motions) { + CV_INSTRUMENT_REGION() + Mat M = Mat::eye(3, 3, CV_32F); if (to > from) { diff --git a/modules/videostab/src/inpainting.cpp b/modules/videostab/src/inpainting.cpp index 991112712d..19f8e519fc 100644 --- a/modules/videostab/src/inpainting.cpp +++ b/modules/videostab/src/inpainting.cpp @@ -103,6 +103,8 @@ void InpaintingPipeline::setStabilizationMotions(const std::vector &val) void InpaintingPipeline::inpaint(int idx, Mat &frame, Mat &mask) { + CV_INSTRUMENT_REGION() + for (size_t i = 0; i < inpainters_.size(); ++i) inpainters_[i]->inpaint(idx, frame, mask); } @@ -124,6 +126,8 @@ ConsistentMosaicInpainter::ConsistentMosaicInpainter() void ConsistentMosaicInpainter::inpaint(int idx, Mat &frame, Mat &mask) { + CV_INSTRUMENT_REGION() + CV_Assert(frame.type() == CV_8UC3); CV_Assert(mask.size() == frame.size() && mask.type() == CV_8U); @@ -336,6 +340,8 @@ MotionInpainter::MotionInpainter() void MotionInpainter::inpaint(int idx, Mat &frame, Mat &mask) { + CV_INSTRUMENT_REGION() + std::priority_queue > neighbors; std::vector vmotions(2*radius_ + 1); @@ -456,6 +462,8 @@ public: void ColorAverageInpainter::inpaint(int /*idx*/, Mat &frame, Mat &mask) { + CV_INSTRUMENT_REGION() + ColorAverageInpaintBody body; body.mask = mask; body.frame = frame; @@ -465,6 +473,8 @@ void ColorAverageInpainter::inpaint(int /*idx*/, Mat &frame, Mat &mask) void ColorInpainter::inpaint(int /*idx*/, Mat &frame, Mat &mask) { + CV_INSTRUMENT_REGION() + bitwise_not(mask, invMask_); cv::inpaint(frame, invMask_, frame, radius_, method_); } @@ -474,6 +484,8 @@ void calcFlowMask( const Mat &flowX, const Mat &flowY, const Mat &errors, float maxError, const Mat &mask0, const Mat &mask1, Mat &flowMask) { + CV_INSTRUMENT_REGION() + CV_Assert(flowX.type() == CV_32F && flowX.size() == mask0.size()); CV_Assert(flowY.type() == CV_32F && flowY.size() == mask0.size()); CV_Assert(errors.type() == CV_32F && errors.size() == mask0.size()); @@ -508,6 +520,8 @@ void completeFrameAccordingToFlow( const Mat &flowMask, const Mat &flowX, const Mat &flowY, const Mat &frame1, const Mat &mask1, float distThresh, Mat &frame0, Mat &mask0) { + CV_INSTRUMENT_REGION() + CV_Assert(flowMask.type() == CV_8U); CV_Assert(flowX.type() == CV_32F && flowX.size() == flowMask.size()); CV_Assert(flowY.type() == CV_32F && flowY.size() == flowMask.size()); diff --git a/modules/videostab/src/motion_stabilizing.cpp b/modules/videostab/src/motion_stabilizing.cpp index d31c420f64..025b7d56de 100644 --- a/modules/videostab/src/motion_stabilizing.cpp +++ b/modules/videostab/src/motion_stabilizing.cpp @@ -637,6 +637,8 @@ static inline void relaxMotion(const float M[], float t, float res[]) Mat ensureInclusionConstraint(const Mat &M, Size size, float trimRatio) { + CV_INSTRUMENT_REGION() + CV_Assert(M.size() == Size(3,3) && M.type() == CV_32F); const float w = static_cast(size.width); @@ -672,6 +674,8 @@ Mat ensureInclusionConstraint(const Mat &M, Size size, float trimRatio) // TODO can be estimated for O(1) time float estimateOptimalTrimRatio(const Mat &M, Size size) { + CV_INSTRUMENT_REGION() + CV_Assert(M.size() == Size(3,3) && M.type() == CV_32F); const float w = static_cast(size.width); diff --git a/modules/videostab/src/outlier_rejection.cpp b/modules/videostab/src/outlier_rejection.cpp index 3ae6e6b271..0e9769c522 100644 --- a/modules/videostab/src/outlier_rejection.cpp +++ b/modules/videostab/src/outlier_rejection.cpp @@ -51,6 +51,8 @@ namespace videostab void NullOutlierRejector::process( Size /*frameSize*/, InputArray points0, InputArray points1, OutputArray mask) { + CV_INSTRUMENT_REGION() + CV_Assert(points0.type() == points1.type()); CV_Assert(points0.getMat().checkVector(2) == points1.getMat().checkVector(2)); @@ -70,6 +72,8 @@ TranslationBasedLocalOutlierRejector::TranslationBasedLocalOutlierRejector() void TranslationBasedLocalOutlierRejector::process( Size frameSize, InputArray points0, InputArray points1, OutputArray mask) { + CV_INSTRUMENT_REGION() + CV_Assert(points0.type() == points1.type()); CV_Assert(points0.getMat().checkVector(2) == points1.getMat().checkVector(2)); diff --git a/modules/viz/src/vtk/vtkCloudMatSink.cpp b/modules/viz/src/vtk/vtkCloudMatSink.cpp index 8bd1011323..aa3d34ca4f 100644 --- a/modules/viz/src/vtk/vtkCloudMatSink.cpp +++ b/modules/viz/src/vtk/vtkCloudMatSink.cpp @@ -42,7 +42,7 @@ // //M*/ -#include "precomp.hpp" +#include "../precomp.hpp" namespace cv { namespace viz { diff --git a/modules/viz/src/vtk/vtkCloudMatSource.cpp b/modules/viz/src/vtk/vtkCloudMatSource.cpp index 1d8ab7894c..3e3ef16722 100644 --- a/modules/viz/src/vtk/vtkCloudMatSource.cpp +++ b/modules/viz/src/vtk/vtkCloudMatSource.cpp @@ -42,7 +42,7 @@ // //M*/ -#include "precomp.hpp" +#include "../precomp.hpp" namespace cv { namespace viz { diff --git a/modules/viz/src/vtk/vtkImageMatSource.cpp b/modules/viz/src/vtk/vtkImageMatSource.cpp index 6586175236..d9de698df9 100644 --- a/modules/viz/src/vtk/vtkImageMatSource.cpp +++ b/modules/viz/src/vtk/vtkImageMatSource.cpp @@ -42,7 +42,7 @@ // //M*/ -#include "precomp.hpp" +#include "../precomp.hpp" namespace cv { namespace viz { diff --git a/modules/viz/src/vtk/vtkImageMatSource.h b/modules/viz/src/vtk/vtkImageMatSource.h index db0c093ed8..a7a41e082f 100644 --- a/modules/viz/src/vtk/vtkImageMatSource.h +++ b/modules/viz/src/vtk/vtkImageMatSource.h @@ -42,7 +42,7 @@ // //M*/ -#include "precomp.hpp" +#include "../precomp.hpp" #ifndef __vtkImageMatSource_h #define __vtkImageMatSource_h diff --git a/modules/viz/src/vtk/vtkOBJWriter.cpp b/modules/viz/src/vtk/vtkOBJWriter.cpp index 7480b11ac2..296b6eb065 100644 --- a/modules/viz/src/vtk/vtkOBJWriter.cpp +++ b/modules/viz/src/vtk/vtkOBJWriter.cpp @@ -42,7 +42,7 @@ // //M*/ -#include "precomp.hpp" +#include "../precomp.hpp" namespace cv { namespace viz { diff --git a/modules/viz/src/vtk/vtkTrajectorySource.cpp b/modules/viz/src/vtk/vtkTrajectorySource.cpp index 2036e09af3..d0e180a9c1 100644 --- a/modules/viz/src/vtk/vtkTrajectorySource.cpp +++ b/modules/viz/src/vtk/vtkTrajectorySource.cpp @@ -42,7 +42,7 @@ // //M*/ -#include "precomp.hpp" +#include "../precomp.hpp" namespace cv { namespace viz { diff --git a/modules/viz/src/vtk/vtkVizInteractorStyle.cpp b/modules/viz/src/vtk/vtkVizInteractorStyle.cpp index 9b5eca2b0e..e2d338066e 100644 --- a/modules/viz/src/vtk/vtkVizInteractorStyle.cpp +++ b/modules/viz/src/vtk/vtkVizInteractorStyle.cpp @@ -43,7 +43,7 @@ // //M*/ -#include "precomp.hpp" +#include "../precomp.hpp" namespace cv { namespace viz { diff --git a/modules/viz/src/vtk/vtkXYZReader.cpp b/modules/viz/src/vtk/vtkXYZReader.cpp index 283a592489..57726eae9b 100644 --- a/modules/viz/src/vtk/vtkXYZReader.cpp +++ b/modules/viz/src/vtk/vtkXYZReader.cpp @@ -42,7 +42,7 @@ // //M*/ -#include "precomp.hpp" +#include "../precomp.hpp" namespace cv { namespace viz { diff --git a/modules/viz/src/vtk/vtkXYZWriter.cpp b/modules/viz/src/vtk/vtkXYZWriter.cpp index 5a3d7d5c83..cf95e3c6a0 100644 --- a/modules/viz/src/vtk/vtkXYZWriter.cpp +++ b/modules/viz/src/vtk/vtkXYZWriter.cpp @@ -42,7 +42,7 @@ // //M*/ -#include "precomp.hpp" +#include "../precomp.hpp" namespace cv { namespace viz { diff --git a/platforms/android/android.toolchain.cmake b/platforms/android/android.toolchain.cmake index e0b4bf8d65..1d69b7504a 100644 --- a/platforms/android/android.toolchain.cmake +++ b/platforms/android/android.toolchain.cmake @@ -1048,8 +1048,7 @@ if( BUILD_WITH_ANDROID_NDK ) set( ANDROID_RTTI ON ) set( __libstl "${ANDROID_NDK}/sources/cxx-stl/llvm-libc++" ) set( __libstl "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/libc++_static.a" ) - set( __libgnustl "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}" ) - set( ANDROID_STL_INCLUDE_DIRS "${__libgnustl}/include" "${__libgnustl}/libs/${ANDROID_NDK_ABI_NAME}/include" "${__libgnustl}/include/backward" ) + set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/android/support/include" "${ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libcxx/include" "${ANDROID_NDK}/sources/cxx-stl/llvm-libc++abi/libcxxabi/include" ) else() message( FATAL_ERROR "Unknown runtime: ${ANDROID_STL}" ) endif() diff --git a/platforms/ios/build_framework.py b/platforms/ios/build_framework.py index 34500d7f14..c3a048b323 100644 --- a/platforms/ios/build_framework.py +++ b/platforms/ios/build_framework.py @@ -195,6 +195,10 @@ if __name__ == "__main__": args = parser.parse_args() b = Builder(args.opencv, args.contrib, + [ + ("armv7", "iPhoneOS"), + ("arm64", "iPhoneOS"), + ] if os.environ.get('BUILD_PRECOMMIT', None) else [ ("armv7", "iPhoneOS"), ("armv7s", "iPhoneOS"), diff --git a/samples/cpp/camshiftdemo.cpp b/samples/cpp/camshiftdemo.cpp index 4286e253e9..22ce7f8488 100644 --- a/samples/cpp/camshiftdemo.cpp +++ b/samples/cpp/camshiftdemo.cpp @@ -20,6 +20,7 @@ Point origin; Rect selection; int vmin = 10, vmax = 256, smin = 30; +// User draws box around object to track. This triggers CAMShift to start tracking static void onMouse( int event, int x, int y, int, void* ) { if( selectObject ) @@ -42,7 +43,7 @@ static void onMouse( int event, int x, int y, int, void* ) case EVENT_LBUTTONUP: selectObject = false; if( selection.width > 0 && selection.height > 0 ) - trackObject = -1; + trackObject = -1; // Set up CAMShift properties in main() loop break; } } @@ -133,12 +134,13 @@ int main( int argc, const char** argv ) if( trackObject < 0 ) { + // Object has been selected by user, set up CAMShift search properties once Mat roi(hue, selection), maskroi(mask, selection); calcHist(&roi, 1, 0, maskroi, hist, 1, &hsize, &phranges); normalize(hist, hist, 0, 255, NORM_MINMAX); trackWindow = selection; - trackObject = 1; + trackObject = 1; // Don't set up again, unless user selects new ROI histimg = Scalar::all(0); int binW = histimg.cols / hsize; @@ -156,6 +158,7 @@ int main( int argc, const char** argv ) } } + // Perform CAMShift calcBackProject(&hue, 1, 0, hist, backproj, &phranges); backproj &= mask; RotatedRect trackBox = CamShift(backproj, trackWindow, diff --git a/samples/cpp/edge.cpp b/samples/cpp/edge.cpp index 88abd8b257..4fbef937a1 100644 --- a/samples/cpp/edge.cpp +++ b/samples/cpp/edge.cpp @@ -9,19 +9,34 @@ using namespace cv; using namespace std; int edgeThresh = 1; -Mat image, gray, edge, cedge; +int edgeThreshScharr=1; + +Mat image, gray, blurImage, edge1, edge2, cedge; + +const char* window_name1 = "Edge map : Canny default (Sobel gradient)"; +const char* window_name2 = "Edge map : Canny with custom gradient (Scharr)"; // define a trackbar callback static void onTrackbar(int, void*) { - blur(gray, edge, Size(3,3)); + blur(gray, blurImage, Size(3,3)); // Run the edge detector on grayscale - Canny(edge, edge, edgeThresh, edgeThresh*3, 3); + Canny(blurImage, edge1, edgeThresh, edgeThresh*3, 3); cedge = Scalar::all(0); - image.copyTo(cedge, edge); - imshow("Edge map", cedge); + image.copyTo(cedge, edge1); + imshow(window_name1, cedge); + + /// Canny detector with scharr + Mat dx,dy; + Scharr(blurImage,dx,CV_16S,1,0); + Scharr(blurImage,dy,CV_16S,0,1); + Canny( dx,dy, edge2, edgeThreshScharr, edgeThreshScharr*3 ); + /// Using Canny's output as a mask, we display our result + cedge = Scalar::all(0); + image.copyTo(cedge, edge2); + imshow(window_name2, cedge); } static void help() @@ -57,10 +72,12 @@ int main( int argc, const char** argv ) cvtColor(image, gray, COLOR_BGR2GRAY); // Create a window - namedWindow("Edge map", 1); + namedWindow(window_name1, 1); + namedWindow(window_name2, 1); // create a toolbar - createTrackbar("Canny threshold", "Edge map", &edgeThresh, 100, onTrackbar); + createTrackbar("Canny threshold default", window_name1, &edgeThresh, 100, onTrackbar); + createTrackbar("Canny threshold Scharr", window_name2, &edgeThreshScharr, 400, onTrackbar); // Show the image onTrackbar(0, 0); diff --git a/samples/cpp/filestorage_base64.cpp b/samples/cpp/filestorage_base64.cpp new file mode 100644 index 0000000000..dcd46544f9 --- /dev/null +++ b/samples/cpp/filestorage_base64.cpp @@ -0,0 +1,71 @@ +#include "opencv2/core.hpp" +#include +#include + +static CvFileStorage * three_same_ways_of_write_base64() +{ + CvFileStorage * fs = 0; + cv::RNG rng; + switch ( rng.uniform( 0, 2 ) ) + { + case 0: + //! [suffix_in_file_name] + fs = cvOpenFileStorage( "example.yml?base64", 0, CV_STORAGE_WRITE ); + //! [suffix_in_file_name] + break; + case 1: + //! [flag_write_base64] + fs = cvOpenFileStorage( "example.yml" , 0, CV_STORAGE_WRITE_BASE64 ); + //! [flag_write_base64] + break; + case 2: + //! [flag_write_and_flag_base64] + fs = cvOpenFileStorage( "example.yml" , 0, CV_STORAGE_WRITE | CV_STORAGE_BASE64 ); + //! [flag_write_and_flag_base64] + break; + default: + break; + } + return fs; +} + +static void two_ways_to_write_rawdata_in_base64() +{ + std::vector rawdata(10, 0x00010203); + + { // [1] + //! [without_base64_flag] + CvFileStorage* fs = cvOpenFileStorage( "example.xml", 0, CV_STORAGE_WRITE ); + // both CV_NODE_SEQ and "binary" are necessary. + cvStartWriteStruct(fs, "rawdata", CV_NODE_SEQ | CV_NODE_FLOW, "binary"); + cvWriteRawDataBase64(fs, rawdata.data(), static_cast(rawdata.size()), "i"); + cvEndWriteStruct(fs); + cvReleaseFileStorage( &fs ); + //! [without_base64_flag] + } + + { // [2] + //! [with_write_base64_flag] + CvFileStorage* fs = cvOpenFileStorage( "example.xml", 0, CV_STORAGE_WRITE_BASE64); + // parameter, typename "binary" could be omitted. + cvStartWriteStruct(fs, "rawdata", CV_NODE_SEQ | CV_NODE_FLOW); + cvWriteRawData(fs, rawdata.data(), static_cast(rawdata.size()), "i"); + cvEndWriteStruct(fs); + cvReleaseFileStorage( &fs ); + //! [with_write_base64_flag] + } +} + +int main(int /* argc */, char** /* argv */) +{ + { // base64 mode + CvFileStorage * fs = three_same_ways_of_write_base64(); + cvReleaseFileStorage( &fs ); + } + + { // output rawdata by `cvWriteRawdata*` + two_ways_to_write_rawdata_in_base64(); + } + + return 0; +} diff --git a/samples/cpp/houghcircles.cpp b/samples/cpp/houghcircles.cpp index 26c4dbae08..f749b0e247 100644 --- a/samples/cpp/houghcircles.cpp +++ b/samples/cpp/houghcircles.cpp @@ -24,39 +24,48 @@ int main(int argc, char** argv) help(); return 0; } + //![load] string filename = parser.get("@image"); - if (filename.empty()) - { - help(); - cout << "no image_name provided" << endl; - return -1; - } - Mat img = imread(filename, 0); + Mat img = imread(filename, IMREAD_COLOR); if(img.empty()) { help(); cout << "can not open " << filename << endl; return -1; } + //![load] - Mat cimg; - medianBlur(img, img, 5); - cvtColor(img, cimg, COLOR_GRAY2BGR); + //![convert_to_gray] + Mat gray; + cvtColor(img, gray, COLOR_BGR2GRAY); + //![convert_to_gray] + //![reduce_noise] + medianBlur(gray, gray, 5); + //![reduce_noise] + + //![houghcircles] vector circles; - HoughCircles(img, circles, HOUGH_GRADIENT, 1, 10, + HoughCircles(gray, circles, HOUGH_GRADIENT, 1, + gray.rows/16, // change this value to detect circles with different distances to each other 100, 30, 1, 30 // change the last two parameters // (min_radius & max_radius) to detect larger circles ); + //![houghcircles] + + //![draw] for( size_t i = 0; i < circles.size(); i++ ) { Vec3i c = circles[i]; - circle( cimg, Point(c[0], c[1]), c[2], Scalar(0,0,255), 3, LINE_AA); - circle( cimg, Point(c[0], c[1]), 2, Scalar(0,255,0), 3, LINE_AA); + circle( img, Point(c[0], c[1]), c[2], Scalar(0,0,255), 3, LINE_AA); + circle( img, Point(c[0], c[1]), 2, Scalar(0,255,0), 3, LINE_AA); } + //![draw] - imshow("detected circles", cimg); + //![display] + imshow("detected circles", img); waitKey(); + //![display] return 0; } diff --git a/samples/cpp/peopledetect.cpp b/samples/cpp/peopledetect.cpp new file mode 100644 index 0000000000..aca05fd0ca --- /dev/null +++ b/samples/cpp/peopledetect.cpp @@ -0,0 +1,177 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace cv; +using namespace std; + + +const char* keys = +{ + "{ help h | | print help message }" + "{ image i | | specify input image}" + "{ camera c | | enable camera capturing }" + "{ video v | ../data/768x576.avi | use video as input }" + "{ directory d | | images directory}" +}; + +static void detectAndDraw(const HOGDescriptor &hog, Mat &img) +{ + vector found, found_filtered; + double t = (double) getTickCount(); + // Run the detector with default parameters. to get a higher hit-rate + // (and more false alarms, respectively), decrease the hitThreshold and + // groupThreshold (set groupThreshold to 0 to turn off the grouping completely). + hog.detectMultiScale(img, found, 0, Size(8,8), Size(32,32), 1.05, 2); + t = (double) getTickCount() - t; + cout << "detection time = " << (t*1000./cv::getTickFrequency()) << " ms" << endl; + + for(size_t i = 0; i < found.size(); i++ ) + { + Rect r = found[i]; + + size_t j; + // Do not add small detections inside a bigger detection. + for ( j = 0; j < found.size(); j++ ) + if ( j != i && (r & found[j]) == r ) + break; + + if ( j == found.size() ) + found_filtered.push_back(r); + } + + for (size_t i = 0; i < found_filtered.size(); i++) + { + Rect r = found_filtered[i]; + + // The HOG detector returns slightly larger rectangles than the real objects, + // so we slightly shrink the rectangles to get a nicer output. + r.x += cvRound(r.width*0.1); + r.width = cvRound(r.width*0.8); + r.y += cvRound(r.height*0.07); + r.height = cvRound(r.height*0.8); + rectangle(img, r.tl(), r.br(), cv::Scalar(0,255,0), 3); + } +} + +int main(int argc, char** argv) +{ + CommandLineParser parser(argc, argv, keys); + + if (parser.has("help")) + { + cout << "\nThis program demonstrates the use of the HoG descriptor using\n" + " HOGDescriptor::hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector());\n"; + parser.printMessage(); + cout << "During execution:\n\tHit q or ESC key to quit.\n" + "\tUsing OpenCV version " << CV_VERSION << "\n" + "Note: camera device number must be different from -1.\n" << endl; + return 0; + } + + HOGDescriptor hog; + hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector()); + namedWindow("people detector", 1); + + string pattern_glob = ""; + string video_filename = "../data/768x576.avi"; + int camera_id = -1; + if (parser.has("directory")) + { + pattern_glob = parser.get("directory"); + } + else if (parser.has("image")) + { + pattern_glob = parser.get("image"); + } + else if (parser.has("camera")) + { + camera_id = parser.get("camera"); + } + else if (parser.has("video")) + { + video_filename = parser.get("video"); + } + + if (!pattern_glob.empty() || camera_id != -1 || !video_filename.empty()) + { + //Read from input image files + vector filenames; + //Read from video file + VideoCapture vc; + Mat frame; + + if (!pattern_glob.empty()) + { + String folder(pattern_glob); + glob(folder, filenames); + } + else if (camera_id != -1) + { + vc.open(camera_id); + if (!vc.isOpened()) + { + stringstream msg; + msg << "can't open camera: " << camera_id; + throw runtime_error(msg.str()); + } + } + else + { + vc.open(video_filename.c_str()); + if (!vc.isOpened()) + throw runtime_error(string("can't open video file: " + video_filename)); + } + + vector::const_iterator it_image = filenames.begin(); + + for (;;) + { + if (!pattern_glob.empty()) + { + bool read_image_ok = false; + for (; it_image != filenames.end(); ++it_image) + { + cout << "\nRead: " << *it_image << endl; + // Read current image + frame = imread(*it_image); + + if (!frame.empty()) + { + ++it_image; + read_image_ok = true; + break; + } + } + + //No more valid images + if (!read_image_ok) + { + //Release the image in order to exit the while loop + frame.release(); + } + } + else + { + vc >> frame; + } + + if (frame.empty()) + break; + + detectAndDraw(hog, frame); + + imshow("people detector", frame); + int c = waitKey( vc.isOpened() ? 30 : 0 ) & 255; + if ( c == 'q' || c == 'Q' || c == 27) + break; + } + } + + return 0; +} diff --git a/samples/cpp/polar_transforms.cpp b/samples/cpp/polar_transforms.cpp index 3cbc431c3c..adbc955b17 100644 --- a/samples/cpp/polar_transforms.cpp +++ b/samples/cpp/polar_transforms.cpp @@ -34,10 +34,10 @@ int main( int argc, char** argv ) return -1; } - namedWindow( "Linear-Polar", WINDOW_NORMAL ); - namedWindow( "Log-Polar", WINDOW_NORMAL ); - namedWindow( "Recovered Linear-Polar", WINDOW_NORMAL ); - namedWindow( "Recovered Log-Polar", WINDOW_NORMAL ); + namedWindow( "Linear-Polar", WINDOW_AUTOSIZE ); + namedWindow( "Log-Polar", WINDOW_AUTOSIZE); + namedWindow( "Recovered Linear-Polar", WINDOW_AUTOSIZE); + namedWindow( "Recovered Log-Polar", WINDOW_AUTOSIZE); moveWindow( "Linear-Polar", 20,20 ); moveWindow( "Log-Polar", 700,20 ); @@ -53,13 +53,14 @@ int main( int argc, char** argv ) break; Point2f center( (float)frame.cols / 2, (float)frame.rows / 2 ); - double M = (double)frame.cols / 8; + double radius = (double)frame.cols / 4; + double M = (double)frame.cols / log(radius); logPolar(frame,log_polar_img, center, M, INTER_LINEAR + WARP_FILL_OUTLIERS); - linearPolar(frame,lin_polar_img, center, M, INTER_LINEAR + WARP_FILL_OUTLIERS); + linearPolar(frame,lin_polar_img, center, radius, INTER_LINEAR + WARP_FILL_OUTLIERS); logPolar(log_polar_img, recovered_log_polar, center, M, WARP_INVERSE_MAP + INTER_LINEAR); - linearPolar(lin_polar_img, recovered_lin_polar_img, center, M, WARP_INVERSE_MAP + INTER_LINEAR + WARP_FILL_OUTLIERS); + linearPolar(lin_polar_img, recovered_lin_polar_img, center, radius, WARP_INVERSE_MAP + INTER_LINEAR + WARP_FILL_OUTLIERS); imshow("Log-Polar", log_polar_img ); imshow("Linear-Polar", lin_polar_img ); diff --git a/samples/cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp b/samples/cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp index 93a7b48b19..51522fa5ca 100644 --- a/samples/cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp +++ b/samples/cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp @@ -21,6 +21,7 @@ Mat src1; Mat src2; Mat dst; +//![on_trackbar] /** * @function on_trackbar * @brief Callback for trackbar @@ -35,7 +36,7 @@ static void on_trackbar( int, void* ) imshow( "Linear Blend", dst ); } - +//![on_trackbar] /** * @function main @@ -43,9 +44,11 @@ static void on_trackbar( int, void* ) */ int main( void ) { - /// Read image ( same size, same type ) + //![load] + /// Read images ( both have to be of the same size and type ) src1 = imread("../data/LinuxLogo.jpg"); src2 = imread("../data/WindowsLogo.jpg"); + //![load] if( src1.empty() ) { printf("Error loading src1 \n"); return -1; } if( src2.empty() ) { printf("Error loading src2 \n"); return -1; } @@ -53,13 +56,15 @@ int main( void ) /// Initialize values alpha_slider = 0; - /// Create Windows - namedWindow("Linear Blend", 1); + //![window] + namedWindow("Linear Blend", WINDOW_AUTOSIZE); // Create Window + //![window] - /// Create Trackbars + //![create_trackbar] char TrackbarName[50]; sprintf( TrackbarName, "Alpha x %d", alpha_slider_max ); createTrackbar( TrackbarName, "Linear Blend", &alpha_slider, alpha_slider_max, on_trackbar ); + //![create_trackbar] /// Show some stuff on_trackbar( alpha_slider, 0 ); diff --git a/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp b/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp index 626bd8b960..cfcd75553f 100644 --- a/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp +++ b/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp @@ -66,6 +66,7 @@ int main( int, char** argv ) return 0; } +//![erosion] /** * @function Erosion */ @@ -76,14 +77,19 @@ void Erosion( int, void* ) else if( erosion_elem == 1 ){ erosion_type = MORPH_CROSS; } else if( erosion_elem == 2) { erosion_type = MORPH_ELLIPSE; } + //![kernel] Mat element = getStructuringElement( erosion_type, Size( 2*erosion_size + 1, 2*erosion_size+1 ), Point( erosion_size, erosion_size ) ); + //![kernel] + /// Apply the erosion operation erode( src, erosion_dst, element ); imshow( "Erosion Demo", erosion_dst ); } +//![erosion] +//![dilation] /** * @function Dilation */ @@ -97,7 +103,9 @@ void Dilation( int, void* ) Mat element = getStructuringElement( dilation_type, Size( 2*dilation_size + 1, 2*dilation_size+1 ), Point( dilation_size, dilation_size ) ); + /// Apply the dilation operation dilate( src, dilation_dst, element ); imshow( "Dilation Demo", dilation_dst ); } +//![dilation] diff --git a/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp b/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp index 97304a4612..7a8fb57284 100644 --- a/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp +++ b/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp @@ -31,27 +31,35 @@ void Morphology_Operations( int, void* ); */ int main( int, char** argv ) { - /// Load an image - src = imread( argv[1], IMREAD_COLOR ); + //![load] + src = imread( argv[1], IMREAD_COLOR ); // Load an image if( src.empty() ) { return -1; } + //![load] - /// Create window - namedWindow( window_name, WINDOW_AUTOSIZE ); + //![window] + namedWindow( window_name, WINDOW_AUTOSIZE ); // Create window + //![window] + //![create_trackbar1] /// Create Trackbar to select Morphology operation createTrackbar("Operator:\n 0: Opening - 1: Closing \n 2: Gradient - 3: Top Hat \n 4: Black Hat", window_name, &morph_operator, max_operator, Morphology_Operations ); + //![create_trackbar1] + //![create_trackbar2] /// Create Trackbar to select kernel type createTrackbar( "Element:\n 0: Rect - 1: Cross - 2: Ellipse", window_name, &morph_elem, max_elem, Morphology_Operations ); + //![create_trackbar2] + //![create_trackbar3] /// Create Trackbar to choose kernel size createTrackbar( "Kernel size:\n 2n +1", window_name, &morph_size, max_kernel_size, Morphology_Operations ); + //![create_trackbar3] /// Default start Morphology_Operations( 0, 0 ); @@ -60,13 +68,16 @@ int main( int, char** argv ) return 0; } +//![morphology_operations] /** * @function Morphology_Operations */ void Morphology_Operations( int, void* ) { // Since MORPH_X : 2,3,4,5 and 6 + //![operation] int operation = morph_operator + 2; + //![operation] Mat element = getStructuringElement( morph_elem, Size( 2*morph_size + 1, 2*morph_size+1 ), Point( morph_size, morph_size ) ); @@ -74,3 +85,4 @@ void Morphology_Operations( int, void* ) morphologyEx( src, dst, operation, element ); imshow( window_name, dst ); } +//![morphology_operations] diff --git a/samples/cpp/tutorial_code/ImgProc/Pyramids.cpp b/samples/cpp/tutorial_code/ImgProc/Pyramids.cpp index e4b7096e6d..d8067f9869 100644 --- a/samples/cpp/tutorial_code/ImgProc/Pyramids.cpp +++ b/samples/cpp/tutorial_code/ImgProc/Pyramids.cpp @@ -28,39 +28,50 @@ int main( void ) printf( " * [d] -> Zoom out \n" ); printf( " * [ESC] -> Close program \n \n" ); - /// Test image - Make sure it s divisible by 2^{n} - src = imread( "../data/chicky_512.png" ); + //![load] + src = imread( "../data/chicky_512.png" ); // Loads the test image if( src.empty() ) { printf(" No data! -- Exiting the program \n"); return -1; } + //![load] tmp = src; dst = tmp; - /// Create window - namedWindow( window_name, WINDOW_AUTOSIZE ); + //![create_window] imshow( window_name, dst ); + //![create_window] - /// Loop + //![infinite_loop] for(;;) { int c; - c = waitKey(10); + c = waitKey(0); if( (char)c == 27 ) { break; } if( (char)c == 'u' ) - { pyrUp( tmp, dst, Size( tmp.cols*2, tmp.rows*2 ) ); + { + //![pyrup] + pyrUp( tmp, dst, Size( tmp.cols*2, tmp.rows*2 ) ); + //![pyrup] printf( "** Zoom In: Image x 2 \n" ); } else if( (char)c == 'd' ) - { pyrDown( tmp, dst, Size( tmp.cols/2, tmp.rows/2 ) ); + { + //![pyrdown] + pyrDown( tmp, dst, Size( tmp.cols/2, tmp.rows/2 ) ); + //![pyrdown] printf( "** Zoom Out: Image / 2 \n" ); } imshow( window_name, dst ); + + //![update_tmp] tmp = dst; + //![update_tmp] } + //![infinite_loop] return 0; } diff --git a/samples/cpp/tutorial_code/ImgProc/Smoothing.cpp b/samples/cpp/tutorial_code/ImgProc/Smoothing.cpp index 6a84da073b..58aa474c38 100644 --- a/samples/cpp/tutorial_code/ImgProc/Smoothing.cpp +++ b/samples/cpp/tutorial_code/ImgProc/Smoothing.cpp @@ -43,33 +43,38 @@ int main( void ) /// Applying Homogeneous blur if( display_caption( "Homogeneous Blur" ) != 0 ) { return 0; } + //![blur] for ( int i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 ) { blur( src, dst, Size( i, i ), Point(-1,-1) ); if( display_dst( DELAY_BLUR ) != 0 ) { return 0; } } - + //![blur] /// Applying Gaussian blur if( display_caption( "Gaussian Blur" ) != 0 ) { return 0; } + //![gaussianblur] for ( int i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 ) { GaussianBlur( src, dst, Size( i, i ), 0, 0 ); if( display_dst( DELAY_BLUR ) != 0 ) { return 0; } } - + //![gaussianblur] /// Applying Median blur if( display_caption( "Median Blur" ) != 0 ) { return 0; } + //![medianblur] for ( int i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 ) { medianBlur ( src, dst, i ); if( display_dst( DELAY_BLUR ) != 0 ) { return 0; } } - + //![medianblur] /// Applying Bilateral Filter if( display_caption( "Bilateral Blur" ) != 0 ) { return 0; } + //![bilateralfilter] for ( int i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 ) { bilateralFilter ( src, dst, i, i*2, i/2 ); if( display_dst( DELAY_BLUR ) != 0 ) { return 0; } } + //![bilateralfilter] /// Wait until user press a key display_caption( "End: Press a key!" ); diff --git a/samples/cpp/tutorial_code/ImgProc/Threshold.cpp b/samples/cpp/tutorial_code/ImgProc/Threshold.cpp index 36943028d9..cee1a51c9c 100644 --- a/samples/cpp/tutorial_code/ImgProc/Threshold.cpp +++ b/samples/cpp/tutorial_code/ImgProc/Threshold.cpp @@ -32,29 +32,30 @@ void Threshold_Demo( int, void* ); */ int main( int, char** argv ) { - /// Load an image - src = imread( argv[1], IMREAD_COLOR ); + //! [load] + src = imread( argv[1], IMREAD_COLOR ); // Load an image if( src.empty() ) { return -1; } - /// Convert the image to Gray - cvtColor( src, src_gray, COLOR_BGR2GRAY ); + cvtColor( src, src_gray, COLOR_BGR2GRAY ); // Convert the image to Gray + //! [load] - /// Create a window to display results - namedWindow( window_name, WINDOW_AUTOSIZE ); + //! [window] + namedWindow( window_name, WINDOW_AUTOSIZE ); // Create a window to display results + //! [window] - /// Create Trackbar to choose type of Threshold + //! [trackbar] createTrackbar( trackbar_type, window_name, &threshold_type, - max_type, Threshold_Demo ); + max_type, Threshold_Demo ); // Create Trackbar to choose type of Threshold createTrackbar( trackbar_value, window_name, &threshold_value, - max_value, Threshold_Demo ); + max_value, Threshold_Demo ); // Create Trackbar to choose Threshold value + //! [trackbar] - /// Call the function to initialize - Threshold_Demo( 0, 0 ); + Threshold_Demo( 0, 0 ); // Call the function to initialize /// Wait until user finishes program for(;;) @@ -67,7 +68,7 @@ int main( int, char** argv ) } - +//![Threshold_Demo] /** * @function Threshold_Demo */ @@ -84,3 +85,4 @@ void Threshold_Demo( int, void* ) imshow( window_name, dst ); } +//![Threshold_Demo] diff --git a/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp b/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp index 8b94bb3207..efdeca1425 100644 --- a/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp +++ b/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp @@ -10,8 +10,7 @@ using namespace cv; -/// Global variables - +//![variables] Mat src, src_gray; Mat dst, detected_edges; @@ -21,6 +20,7 @@ int const max_lowThreshold = 100; int ratio = 3; int kernel_size = 3; const char* window_name = "Edge Map"; +//![variables] /** * @function CannyThreshold @@ -28,17 +28,28 @@ const char* window_name = "Edge Map"; */ static void CannyThreshold(int, void*) { + //![reduce_noise] /// Reduce noise with a kernel 3x3 blur( src_gray, detected_edges, Size(3,3) ); + //![reduce_noise] + //![canny] /// Canny detector Canny( detected_edges, detected_edges, lowThreshold, lowThreshold*ratio, kernel_size ); + //![canny] /// Using Canny's output as a mask, we display our result + //![fill] dst = Scalar::all(0); + //![fill] + //![copyto] src.copyTo( dst, detected_edges); + //![copyto] + + //![display] imshow( window_name, dst ); + //![display] } @@ -47,23 +58,30 @@ static void CannyThreshold(int, void*) */ int main( int, char** argv ) { - /// Load an image - src = imread( argv[1], IMREAD_COLOR ); + //![load] + src = imread( argv[1], IMREAD_COLOR ); // Load an image if( src.empty() ) { return -1; } + //![load] + //![create_mat] /// Create a matrix of the same type and size as src (for dst) dst.create( src.size(), src.type() ); + //![create_mat] - /// Convert the image to grayscale + //![convert_to_gray] cvtColor( src, src_gray, COLOR_BGR2GRAY ); + //![convert_to_gray] - /// Create a window + //![create_window] namedWindow( window_name, WINDOW_AUTOSIZE ); + //![create_window] + //![create_trackbar] /// Create a Trackbar for user to enter threshold createTrackbar( "Min Threshold:", window_name, &lowThreshold, max_lowThreshold, CannyThreshold ); + //![create_trackbar] /// Show the image CannyThreshold(0, 0); diff --git a/samples/cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp b/samples/cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp index 386b26da74..6a41c3a1c3 100644 --- a/samples/cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp +++ b/samples/cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp @@ -15,39 +15,45 @@ using namespace cv; */ int main( int, char** argv ) { - + //![variables] Mat src, src_gray, dst; int kernel_size = 3; int scale = 1; int delta = 0; int ddepth = CV_16S; const char* window_name = "Laplace Demo"; + //![variables] - /// Load an image - src = imread( argv[1], IMREAD_COLOR ); + //![load] + src = imread( argv[1], IMREAD_COLOR ); // Load an image if( src.empty() ) { return -1; } + //![load] - /// Remove noise by blurring with a Gaussian filter + //![reduce_noise] + /// Reduce noise by blurring with a Gaussian filter GaussianBlur( src, src, Size(3,3), 0, 0, BORDER_DEFAULT ); + //![reduce_noise] - /// Convert the image to grayscale - cvtColor( src, src_gray, COLOR_RGB2GRAY ); - - /// Create window - namedWindow( window_name, WINDOW_AUTOSIZE ); + //![convert_to_gray] + cvtColor( src, src_gray, COLOR_BGR2GRAY ); // Convert the image to grayscale + //![convert_to_gray] /// Apply Laplace function Mat abs_dst; - + //![laplacian] Laplacian( src_gray, dst, ddepth, kernel_size, scale, delta, BORDER_DEFAULT ); + //![laplacian] + + //![convert] convertScaleAbs( dst, abs_dst ); + //![convert] - /// Show what you got + //![display] imshow( window_name, abs_dst ); - waitKey(0); + //![display] return 0; } diff --git a/samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp b/samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp index efe4c71691..ad45452021 100644 --- a/samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp +++ b/samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp @@ -1,6 +1,6 @@ /** * @file Sobel_Demo.cpp - * @brief Sample code using Sobel and/orScharr OpenCV functions to make a simple Edge Detector + * @brief Sample code using Sobel and/or Scharr OpenCV functions to make a simple Edge Detector * @author OpenCV team */ @@ -15,28 +15,31 @@ using namespace cv; */ int main( int, char** argv ) { - + //![variables] Mat src, src_gray; Mat grad; const char* window_name = "Sobel Demo - Simple Edge Detector"; int scale = 1; int delta = 0; int ddepth = CV_16S; + //![variables] - /// Load an image - src = imread( argv[1], IMREAD_COLOR ); + //![load] + src = imread( argv[1], IMREAD_COLOR ); // Load an image if( src.empty() ) { return -1; } + //![load] + //![reduce_noise] GaussianBlur( src, src, Size(3,3), 0, 0, BORDER_DEFAULT ); + //![reduce_noise] - /// Convert it to gray - cvtColor( src, src_gray, COLOR_RGB2GRAY ); - - /// Create window - namedWindow( window_name, WINDOW_AUTOSIZE ); + //![convert_to_gray] + cvtColor( src, src_gray, COLOR_BGR2GRAY ); + //![convert_to_gray] + //![sobel] /// Generate grad_x and grad_y Mat grad_x, grad_y; Mat abs_grad_x, abs_grad_y; @@ -44,19 +47,26 @@ int main( int, char** argv ) /// Gradient X //Scharr( src_gray, grad_x, ddepth, 1, 0, scale, delta, BORDER_DEFAULT ); Sobel( src_gray, grad_x, ddepth, 1, 0, 3, scale, delta, BORDER_DEFAULT ); - convertScaleAbs( grad_x, abs_grad_x ); /// Gradient Y //Scharr( src_gray, grad_y, ddepth, 0, 1, scale, delta, BORDER_DEFAULT ); Sobel( src_gray, grad_y, ddepth, 0, 1, 3, scale, delta, BORDER_DEFAULT ); - convertScaleAbs( grad_y, abs_grad_y ); + //![sobel] + //![convert] + convertScaleAbs( grad_x, abs_grad_x ); + convertScaleAbs( grad_y, abs_grad_y ); + //![convert] + + //![blend] /// Total Gradient (approximate) addWeighted( abs_grad_x, 0.5, abs_grad_y, 0.5, 0, grad ); + //![blend] + //![display] imshow( window_name, grad ); - waitKey(0); + //![display] return 0; } diff --git a/samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp b/samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp index 6da2b296b2..60a6d9fcb5 100644 --- a/samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp +++ b/samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp @@ -10,12 +10,13 @@ using namespace cv; -/// Global Variables +//![variables] Mat src, dst; int top, bottom, left, right; int borderType; const char* window_name = "copyMakeBorder Demo"; RNG rng(12345); +//![variables] /** * @function main @@ -25,14 +26,15 @@ int main( int, char** argv ) int c; - /// Load an image - src = imread( argv[1], IMREAD_COLOR ); + //![load] + src = imread( argv[1], IMREAD_COLOR ); // Load an image if( src.empty() ) { printf(" No data entered, please enter the path to an image file \n"); return -1; } + //![load] /// Brief how-to for this program printf( "\n \t copyMakeBorder Demo: \n" ); @@ -41,18 +43,22 @@ int main( int, char** argv ) printf( " ** Press 'r' to set the border to be replicated \n"); printf( " ** Press 'ESC' to exit the program \n"); - /// Create window + //![create_window] namedWindow( window_name, WINDOW_AUTOSIZE ); + //![create_window] + //![init_arguments] /// Initialize arguments for the filter top = (int) (0.05*src.rows); bottom = (int) (0.05*src.rows); left = (int) (0.05*src.cols); right = (int) (0.05*src.cols); - dst = src; + //![init_arguments] + dst = src; imshow( window_name, dst ); for(;;) { + //![check_keypress] c = waitKey(500); if( (char)c == 27 ) @@ -61,11 +67,19 @@ int main( int, char** argv ) { borderType = BORDER_CONSTANT; } else if( (char)c == 'r' ) { borderType = BORDER_REPLICATE; } + //![check_keypress] + //![update_value] Scalar value( rng.uniform(0, 255), rng.uniform(0, 255), rng.uniform(0, 255) ); - copyMakeBorder( src, dst, top, bottom, left, right, borderType, value ); + //![update_value] + //![copymakeborder] + copyMakeBorder( src, dst, top, bottom, left, right, borderType, value ); + //![copymakeborder] + + //![display] imshow( window_name, dst ); + //![display] } return 0; diff --git a/samples/cpp/tutorial_code/ImgTrans/filter2D_demo.cpp b/samples/cpp/tutorial_code/ImgTrans/filter2D_demo.cpp index 6fc04d8f41..e1ceb0bf6d 100644 --- a/samples/cpp/tutorial_code/ImgTrans/filter2D_demo.cpp +++ b/samples/cpp/tutorial_code/ImgTrans/filter2D_demo.cpp @@ -27,19 +27,19 @@ int main ( int, char** argv ) int c; - /// Load an image - src = imread( argv[1], IMREAD_COLOR ); + //![load] + src = imread( argv[1], IMREAD_COLOR ); // Load an image if( src.empty() ) { return -1; } + //![load] - /// Create window - namedWindow( window_name, WINDOW_AUTOSIZE ); - + //![init_arguments] /// Initialize arguments for the filter anchor = Point( -1, -1 ); delta = 0; ddepth = -1; + //![init_arguments] /// Loop - Will filter the image with different kernel sizes each 0.5 seconds int ind = 0; @@ -50,12 +50,15 @@ int main ( int, char** argv ) if( (char)c == 27 ) { break; } + //![update_kernel] /// Update kernel size for a normalized box filter kernel_size = 3 + 2*( ind%5 ); kernel = Mat::ones( kernel_size, kernel_size, CV_32F )/ (float)(kernel_size*kernel_size); + //![update_kernel] - /// Apply filter + //![apply_filter] filter2D(src, dst, ddepth , kernel, anchor, delta, BORDER_DEFAULT ); + //![apply_filter] imshow( window_name, dst ); ind++; } diff --git a/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp b/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp index 29d75515cf..1e5585aa5f 100644 --- a/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp +++ b/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp @@ -25,22 +25,34 @@ void thresh_callback(int, void* ); */ int main( int, char** argv ) { - /// Load source image and convert it to gray + //![setup] + /// Load source image src = imread( argv[1], IMREAD_COLOR ); /// Convert image to gray and blur it cvtColor( src, src_gray, COLOR_BGR2GRAY ); blur( src_gray, src_gray, Size(3,3) ); + //![setup] + //![createWindow] /// Create Window const char* source_window = "Source"; namedWindow( source_window, WINDOW_AUTOSIZE ); imshow( source_window, src ); + //![createWindow] + //![taskbar] createTrackbar( " Threshold:", "Source", &thresh, max_thresh, thresh_callback ); - thresh_callback( 0, 0 ); + //![taskbar] + //![callback00] + thresh_callback( 0, 0 ); + //![callback00] + + //![waitForIt] waitKey(0); + //![waitForIt] + return(0); } @@ -53,10 +65,15 @@ void thresh_callback(int, void* ) vector > contours; vector hierarchy; + //![threshold] /// Detect edges using Threshold threshold( src_gray, threshold_output, thresh, 255, THRESH_BINARY ); + //![threshold] + + //![findContours] /// Find contours findContours( threshold_output, contours, hierarchy, RETR_TREE, CHAIN_APPROX_SIMPLE, Point(0, 0) ); + //![findContours] /// Approximate contours to polygons + get bounding rects and circles vector > contours_poly( contours.size() ); @@ -64,24 +81,33 @@ void thresh_callback(int, void* ) vectorcenter( contours.size() ); vectorradius( contours.size() ); + //![allthework] for( size_t i = 0; i < contours.size(); i++ ) - { approxPolyDP( Mat(contours[i]), contours_poly[i], 3, true ); - boundRect[i] = boundingRect( Mat(contours_poly[i]) ); - minEnclosingCircle( contours_poly[i], center[i], radius[i] ); - } - + { + approxPolyDP( Mat(contours[i]), contours_poly[i], 3, true ); + boundRect[i] = boundingRect( Mat(contours_poly[i]) ); + minEnclosingCircle( contours_poly[i], center[i], radius[i] ); + } + //![allthework] + //![zeroMat] /// Draw polygonal contour + bonding rects + circles Mat drawing = Mat::zeros( threshold_output.size(), CV_8UC3 ); - for( size_t i = 0; i< contours.size(); i++ ) - { - Scalar color = Scalar( rng.uniform(0, 255), rng.uniform(0,255), rng.uniform(0,255) ); - drawContours( drawing, contours_poly, (int)i, color, 1, 8, vector(), 0, Point() ); - rectangle( drawing, boundRect[i].tl(), boundRect[i].br(), color, 2, 8, 0 ); - circle( drawing, center[i], (int)radius[i], color, 2, 8, 0 ); - } + //![zeroMat] + //![forContour] + for( size_t i = 0; i< contours.size(); i++ ) + { + Scalar color = Scalar( rng.uniform(0, 255), rng.uniform(0,255), rng.uniform(0,255) ); + drawContours( drawing, contours_poly, (int)i, color, 1, 8, vector(), 0, Point() ); + rectangle( drawing, boundRect[i].tl(), boundRect[i].br(), color, 2, 8, 0 ); + circle( drawing, center[i], (int)radius[i], color, 2, 8, 0 ); + } + //![forContour] + + //![showDrawings] /// Show in a window namedWindow( "Contours", WINDOW_AUTOSIZE ); imshow( "Contours", drawing ); + //![showDrawings] } diff --git a/samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp b/samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp index 7fe5b71f98..e583791d12 100644 --- a/samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp +++ b/samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp @@ -49,7 +49,6 @@ int main( int, char** argv ) */ void thresh_callback(int, void* ) { - Mat src_copy = src.clone(); Mat threshold_output; vector > contours; vector hierarchy; diff --git a/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp b/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp index 580fe73792..b5647b5ebc 100644 --- a/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp +++ b/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp @@ -1,7 +1,8 @@ #include #include -#include -#include +#include +#include +#include #include #include @@ -11,10 +12,6 @@ #include #include -#ifndef _CRT_SECURE_NO_WARNINGS -# define _CRT_SECURE_NO_WARNINGS -#endif - using namespace cv; using namespace std; @@ -73,6 +70,12 @@ public: node["Show_UndistortedImage"] >> showUndistorsed; node["Input"] >> input; node["Input_Delay"] >> delay; + node["Fix_K1"] >> fixK1; + node["Fix_K2"] >> fixK2; + node["Fix_K3"] >> fixK3; + node["Fix_K4"] >> fixK4; + node["Fix_K5"] >> fixK5; + validate(); } void validate() @@ -127,16 +130,23 @@ public: goodInput = false; } - flag = CALIB_FIX_K4 | CALIB_FIX_K5; + flag = 0; if(calibFixPrincipalPoint) flag |= CALIB_FIX_PRINCIPAL_POINT; if(calibZeroTangentDist) flag |= CALIB_ZERO_TANGENT_DIST; if(aspectRatio) flag |= CALIB_FIX_ASPECT_RATIO; + if(fixK1) flag |= CALIB_FIX_K1; + if(fixK2) flag |= CALIB_FIX_K2; + if(fixK3) flag |= CALIB_FIX_K3; + if(fixK4) flag |= CALIB_FIX_K4; + if(fixK5) flag |= CALIB_FIX_K5; if (useFisheye) { // the fisheye model has its own enum, so overwrite the flags - flag = fisheye::CALIB_FIX_SKEW | fisheye::CALIB_RECOMPUTE_EXTRINSIC | - // fisheye::CALIB_FIX_K1 | - fisheye::CALIB_FIX_K2 | fisheye::CALIB_FIX_K3 | fisheye::CALIB_FIX_K4; + flag = fisheye::CALIB_FIX_SKEW | fisheye::CALIB_RECOMPUTE_EXTRINSIC; + if(fixK1) flag |= fisheye::CALIB_FIX_K1; + if(fixK2) flag |= fisheye::CALIB_FIX_K2; + if(fixK3) flag |= fisheye::CALIB_FIX_K3; + if(fixK4) flag |= fisheye::CALIB_FIX_K4; } calibrationPattern = NOT_EXISTING; @@ -196,6 +206,11 @@ public: bool showUndistorsed; // Show undistorted images after calibration string input; // The input -> bool useFisheye; // use fisheye camera model for calibration + bool fixK1; // fix K1 distortion coefficient + bool fixK2; // fix K2 distortion coefficient + bool fixK3; // fix K3 distortion coefficient + bool fixK4; // fix K4 distortion coefficient + bool fixK5; // fix K5 distortion coefficient int cameraID; vector imageList; @@ -369,7 +384,10 @@ int main(int argc, char* argv[]) if( mode == CALIBRATED && s.showUndistorsed ) { Mat temp = view.clone(); - undistort(temp, view, cameraMatrix, distCoeffs); + if (s.useFisheye) + cv::fisheye::undistortImage(temp, view, cameraMatrix, distCoeffs); + else + undistort(temp, view, cameraMatrix, distCoeffs); } //! [output_undistorted] //------------------------------ Show image and check for input commands ------------------- @@ -567,25 +585,31 @@ static void saveCameraParams( Settings& s, Size& imageSize, Mat& cameraMatrix, M if (s.flag) { + std::stringstream flagsStringStream; if (s.useFisheye) { - sprintf(buf, "flags:%s%s%s%s%s%s", - s.flag & fisheye::CALIB_FIX_SKEW ? " +fix_skew" : "", - s.flag & fisheye::CALIB_FIX_K1 ? " +fix_k1" : "", - s.flag & fisheye::CALIB_FIX_K2 ? " +fix_k2" : "", - s.flag & fisheye::CALIB_FIX_K3 ? " +fix_k3" : "", - s.flag & fisheye::CALIB_FIX_K4 ? " +fix_k4" : "", - s.flag & fisheye::CALIB_RECOMPUTE_EXTRINSIC ? " +recompute_extrinsic" : ""); + flagsStringStream << "flags:" + << (s.flag & fisheye::CALIB_FIX_SKEW ? " +fix_skew" : "") + << (s.flag & fisheye::CALIB_FIX_K1 ? " +fix_k1" : "") + << (s.flag & fisheye::CALIB_FIX_K2 ? " +fix_k2" : "") + << (s.flag & fisheye::CALIB_FIX_K3 ? " +fix_k3" : "") + << (s.flag & fisheye::CALIB_FIX_K4 ? " +fix_k4" : "") + << (s.flag & fisheye::CALIB_RECOMPUTE_EXTRINSIC ? " +recompute_extrinsic" : ""); } else { - sprintf(buf, "flags:%s%s%s%s", - s.flag & CALIB_USE_INTRINSIC_GUESS ? " +use_intrinsic_guess" : "", - s.flag & CALIB_FIX_ASPECT_RATIO ? " +fix_aspectRatio" : "", - s.flag & CALIB_FIX_PRINCIPAL_POINT ? " +fix_principal_point" : "", - s.flag & CALIB_ZERO_TANGENT_DIST ? " +zero_tangent_dist" : ""); + flagsStringStream << "flags:" + << (s.flag & CALIB_USE_INTRINSIC_GUESS ? " +use_intrinsic_guess" : "") + << (s.flag & CALIB_FIX_ASPECT_RATIO ? " +fix_aspectRatio" : "") + << (s.flag & CALIB_FIX_PRINCIPAL_POINT ? " +fix_principal_point" : "") + << (s.flag & CALIB_ZERO_TANGENT_DIST ? " +zero_tangent_dist" : "") + << (s.flag & CALIB_FIX_K1 ? " +fix_k1" : "") + << (s.flag & CALIB_FIX_K2 ? " +fix_k2" : "") + << (s.flag & CALIB_FIX_K3 ? " +fix_k3" : "") + << (s.flag & CALIB_FIX_K4 ? " +fix_k4" : "") + << (s.flag & CALIB_FIX_K5 ? " +fix_k5" : ""); } - cvWriteComment(*fs, buf, 0); + fs.writeComment(flagsStringStream.str()); } fs << "flags" << s.flag; @@ -602,19 +626,33 @@ static void saveCameraParams( Settings& s, Size& imageSize, Mat& cameraMatrix, M if(s.writeExtrinsics && !rvecs.empty() && !tvecs.empty() ) { CV_Assert(rvecs[0].type() == tvecs[0].type()); - Mat bigmat((int)rvecs.size(), 6, rvecs[0].type()); + Mat bigmat((int)rvecs.size(), 6, CV_MAKETYPE(rvecs[0].type(), 1)); + bool needReshapeR = rvecs[0].depth() != 1 ? true : false; + bool needReshapeT = tvecs[0].depth() != 1 ? true : false; + for( size_t i = 0; i < rvecs.size(); i++ ) { Mat r = bigmat(Range(int(i), int(i+1)), Range(0,3)); Mat t = bigmat(Range(int(i), int(i+1)), Range(3,6)); - CV_Assert(rvecs[i].rows == 3 && rvecs[i].cols == 1); - CV_Assert(tvecs[i].rows == 3 && tvecs[i].cols == 1); - //*.t() is MatExpr (not Mat) so we can use assignment operator - r = rvecs[i].t(); - t = tvecs[i].t(); + if(needReshapeR) + rvecs[i].reshape(1, 1).copyTo(r); + else + { + //*.t() is MatExpr (not Mat) so we can use assignment operator + CV_Assert(rvecs[i].rows == 3 && rvecs[i].cols == 1); + r = rvecs[i].t(); + } + + if(needReshapeT) + tvecs[i].reshape(1, 1).copyTo(t); + else + { + CV_Assert(tvecs[i].rows == 3 && tvecs[i].cols == 1); + t = tvecs[i].t(); + } } - //cvWriteComment( *fs, "a set of 6-tuples (rotation vector + translation vector) for each view", 0 ); + fs.writeComment("a set of 6-tuples (rotation vector + translation vector) for each view"); fs << "extrinsic_parameters" << bigmat; } diff --git a/samples/cpp/tutorial_code/calib3d/camera_calibration/in_VID5.xml b/samples/cpp/tutorial_code/calib3d/camera_calibration/in_VID5.xml index 98269ecb6e..5659651e6c 100644 --- a/samples/cpp/tutorial_code/calib3d/camera_calibration/in_VID5.xml +++ b/samples/cpp/tutorial_code/calib3d/camera_calibration/in_VID5.xml @@ -41,6 +41,17 @@ 1 1 - + + 0 + + 0 + + 0 + + 0 + + 1 + + 1 diff --git a/samples/cpp/tutorial_code/ImgProc/AddingImages.cpp b/samples/cpp/tutorial_code/core/AddingImages/AddingImages.cpp similarity index 81% rename from samples/cpp/tutorial_code/ImgProc/AddingImages.cpp rename to samples/cpp/tutorial_code/core/AddingImages/AddingImages.cpp index 20b09ec32b..491ae7ad9e 100644 --- a/samples/cpp/tutorial_code/ImgProc/AddingImages.cpp +++ b/samples/cpp/tutorial_code/core/AddingImages/AddingImages.cpp @@ -16,7 +16,6 @@ using namespace cv; */ int main( void ) { - double alpha = 0.5; double beta; double input; Mat src1, src2, dst; @@ -27,26 +26,28 @@ int main( void ) std::cout<<"* Enter alpha [0-1]: "; std::cin>>input; - // We use the alpha provided by the user iff it is between 0 and 1 + // We use the alpha provided by the user if it is between 0 and 1 if( alpha >= 0 && alpha <= 1 ) { alpha = input; } - /// Read image ( same size, same type ) + //![load] + /// Read images ( both have to be of the same size and type ) src1 = imread("../data/LinuxLogo.jpg"); src2 = imread("../data/WindowsLogo.jpg"); + //![load] if( src1.empty() ) { std::cout<< "Error loading src1"< +#include +#include + +using namespace cv; +using namespace std; + +int main(int, char**) +{ + Mat frame; + //--- INITIALIZE VIDEOCAPTURE + VideoCapture cap; + // open the default camera using default API + cap.open(0); + // OR advance usage: select any API backend + int deviceID = 0; // 0 = open default camera + int apiID = cv::CAP_ANY; // 0 = autodetect default API + // open selected camera using selected API + cap.open(deviceID + apiID); + // check if we succeeded + if (!cap.isOpened()) { + cerr << "ERROR! Unable to open camera\n"; + return -1; + } + + //--- GRAB AND WRITE LOOP + cout << "Start grabbing" << endl + << "Press any key to terminate" << endl; + for (;;) + { + // wait for a new frame from camera and store it into 'frame' + cap.read(frame); + // check if we succeeded + if (frame.empty()) { + cerr << "ERROR! blank frame grabbed\n"; + break; + } + // show live and wait for a key with timeout long enough to show images + imshow("Live", frame); + if (waitKey(5) >= 0) + break; + } + // the camera will be deinitialized automatically in VideoCapture destructor + return 0; +} \ No newline at end of file diff --git a/samples/cpp/starter_video.cpp b/samples/cpp/videocapture_starter.cpp similarity index 95% rename from samples/cpp/starter_video.cpp rename to samples/cpp/videocapture_starter.cpp index 2839b03d7e..58f1145ed5 100644 --- a/samples/cpp/starter_video.cpp +++ b/samples/cpp/videocapture_starter.cpp @@ -1,14 +1,13 @@ -/* -* starter_video.cpp +/** +* @file videocapture_starter.cpp +* @brief A starter sample for using OpenCV VideoCapture with capture devices, video files or image sequences +* easy as CV_PI right? * * Created on: Nov 23, 2010 * Author: Ethan Rublee * * Modified on: April 17, 2013 * Author: Kevin Hughes -* -* A starter sample for using OpenCV VideoCapture with capture devices, video files or image sequences -* easy as CV_PI right? */ #include diff --git a/samples/cpp/videowriter_basic.cpp b/samples/cpp/videowriter_basic.cpp new file mode 100644 index 0000000000..9ab4efcc90 --- /dev/null +++ b/samples/cpp/videowriter_basic.cpp @@ -0,0 +1,65 @@ +/** + @file videowriter_basic.cpp + @brief A very basic sample for using VideoWriter and VideoCapture + @author PkLab.net + @date Aug 24, 2016 +*/ + +#include +#include +#include + +using namespace cv; +using namespace std; + +int main(int, char**) +{ + Mat src; + // use default camera as video source + VideoCapture cap(0); + // check if we succeeded + if (!cap.isOpened()) { + cerr << "ERROR! Unable to open camera\n"; + return -1; + } + // get one frame from camera to know frame size and type + cap >> src; + // check if we succeeded + if (src.empty()) { + cerr << "ERROR! blank frame grabbed\n"; + return -1; + } + bool isColor = (src.type() == CV_8UC3); + + //--- INITIALIZE VIDEOWRITER + VideoWriter writer; + int codec = CV_FOURCC('M', 'J', 'P', 'G'); // select desired codec (must be available at runtime) + double fps = 25.0; // framerate of the created video stream + string filename = "./live.avi"; // name of the output video file + writer.open(filename, codec, fps, src.size(), isColor); + // check if we succeeded + if (!writer.isOpened()) { + cerr << "Could not open the output video file for write\n"; + return -1; + } + + //--- GRAB AND WRITE LOOP + cout << "Writing videofile: " << filename << endl + << "Press any key to terminate" << endl; + for (;;) + { + // check if we succeeded + if (!cap.read(src)) { + cerr << "ERROR! blank frame grabbed\n"; + break; + } + // encode the frame into the videofile stream + writer.write(src); + // show live and wait for a key with timeout long enough to show images + imshow("Live", src); + if (waitKey(5) >= 0) + break; + } + // the videofile will be closed and released automatically in VideoWriter destructor + return 0; +} \ No newline at end of file diff --git a/samples/python/houghcircles.py b/samples/python/houghcircles.py index 41cce29be7..c766c1cab2 100755 --- a/samples/python/houghcircles.py +++ b/samples/python/houghcircles.py @@ -30,7 +30,7 @@ if __name__ == '__main__': circles = cv2.HoughCircles(img, cv2.HOUGH_GRADIENT, 1, 10, np.array([]), 100, 30, 1, 30) - if circles != None: # Check if circles have been found and only then iterate over these and add them to the image + if circles is not None: # Check if circles have been found and only then iterate over these and add them to the image a, b, c = circles.shape for i in range(b): cv2.circle(cimg, (circles[0][i][0], circles[0][i][1]), circles[0][i][2], (0, 0, 255), 3, cv2.LINE_AA) diff --git a/samples/python/houghlines.py b/samples/python/houghlines.py index 445068aef4..76e074cb1b 100755 --- a/samples/python/houghlines.py +++ b/samples/python/houghlines.py @@ -36,7 +36,7 @@ if __name__ == '__main__': else: # HoughLines lines = cv2.HoughLines(dst, 1, math.pi/180.0, 50, np.array([]), 0, 0) - if lines != None: + if lines is not None: a,b,c = lines.shape for i in range(a): rho = lines[i][0][0] diff --git a/samples/python/tst_scene_render.py b/samples/python/tst_scene_render.py index 992baf34f3..78ce478a12 100644 --- a/samples/python/tst_scene_render.py +++ b/samples/python/tst_scene_render.py @@ -21,7 +21,7 @@ class TestSceneRender(): self.deformation = deformation self.speed = speed - if bgImg != None: + if bgImg is not None: self.sceneBg = bgImg.copy() else: self.sceneBg = np.zeros(defaultSize, defaultSize, np.uint8) @@ -29,7 +29,7 @@ class TestSceneRender(): self.w = self.sceneBg.shape[0] self.h = self.sceneBg.shape[1] - if fgImg != None: + if fgImg is not None: self.foreground = fgImg.copy() self.center = self.currentCenter = (int(self.w/2 - fgImg.shape[0]/2), int(self.h/2 - fgImg.shape[1]/2)) @@ -52,7 +52,7 @@ class TestSceneRender(): def getRectInTime(self, time): - if self.foreground != None: + if self.foreground is not None: tmp = np.array(self.center) + np.array((self.getXOffset(time), self.getYOffset(time))) x0, y0 = tmp x1, y1 = tmp + self.foreground.shape[0:2] @@ -64,7 +64,7 @@ class TestSceneRender(): def getCurrentRect(self): - if self.foreground != None: + if self.foreground is not None: x0 = self.currentCenter[0] y0 = self.currentCenter[1] @@ -79,7 +79,7 @@ class TestSceneRender(): def getNextFrame(self): img = self.sceneBg.copy() - if self.foreground != None: + if self.foreground is not None: self.currentCenter = (self.center[0] + self.getXOffset(self.time), self.center[1] + self.getYOffset(self.time)) img[self.currentCenter[0]:self.currentCenter[0]+self.foreground.shape[0], self.currentCenter[1]:self.currentCenter[1]+self.foreground.shape[1]] = self.foreground