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

Compare commits

...

94 Commits

Author SHA1 Message Date
Alexander Alekhin dc15187f1b release: OpenCV 3.4.12 2020-10-10 20:14:29 +00:00
Alexander Alekhin ae1a249a0a Merge pull request #18557 from alalek:cuda_cmake_fix_auto 2020-10-10 20:02:03 +00:00
Alexander Alekhin 171fbf879f cmake: fix typo in CUDA_GENERATION=Auto cache 2020-10-09 22:00:02 +00:00
Alexander Alekhin 8a1caa0d16 Merge pull request #18554 from alalek:issue_17945 2020-10-09 19:54:17 +00:00
Alexander Alekhin cdcf7e62f3 dnn(opencl): bypass unsupported fusion cases 2 2020-10-09 18:59:08 +00:00
Alexander Alekhin 083727b0a6 Merge pull request #18551 from alalek:issue_17964 2020-10-09 16:08:12 +00:00
Alexander Alekhin 718dd9f170 dnn(opencl): bypass unsupported fusion cases 2020-10-09 12:33:06 +00:00
Alexander Alekhin 6c218c7b0f Merge pull request #18545 from alalek:enable_tests_17953 2020-10-08 21:39:48 +00:00
Alexander Alekhin e87a0baa4b dnn(test): enable tests from issue 17953 2020-10-08 20:27:03 +00:00
Alexander Alekhin 8ee5f2ad89 Merge pull request #18534 from alalek:build_opencv_winpack_dldt_2021.1.0 2020-10-08 15:32:03 +00:00
Alexander Alekhin ee76cef1ff Merge pull request #18527 from alalek:dnn_test_openvino 2020-10-08 15:27:50 +00:00
Alexander Alekhin 6da05f7086 dnn(test): update tests for OpenVINO 2021.1 2020-10-08 10:22:31 +00:00
Alexander Alekhin e24b1629a0 Merge pull request #18536 from alalek:backport_doxygen_style_18195 2020-10-07 21:35:58 +00:00
Alexander Alekhin d9ea9bedb2 doxygen: backport style changes 2020-10-07 20:16:40 +00:00
Alexander Alekhin 1546b9bf99 build: winpack_dldt with dldt 2021.1.0 2020-10-07 16:16:53 +00:00
Alexander Alekhin 62b5d37b6b Merge pull request #18526 from alalek:fix_uninitialized_warnings 2020-10-06 22:49:55 +00:00
Alexander Alekhin d78d9bf151 Merge pull request #18519 from alalek:fix_javadoc 2020-10-06 22:48:21 +00:00
Alexander Alekhin a5f0fb6008 Merge pull request #18518 from alalek:backport_17993 2020-10-06 22:47:45 +00:00
Alexander Alekhin f2bb3d0d80 videoio(dc1394_v2): ensure variable initialization 2020-10-06 21:00:36 +00:00
Alexander Alekhin 037a72debd Merge pull request #18517 from alalek:backport_18031 2020-10-06 19:56:49 +00:00
Alexander Alekhin 1ef4b7ae5a Merge pull request #18515 from alalek:test_18473 2020-10-06 19:39:28 +00:00
Alexander Alekhin b314cc4c23 Merge pull request #18506 from alalek:issue_18472 2020-10-06 19:37:40 +00:00
Alexander Alekhin 644de8f22a java: fix javadoc generation 2020-10-06 04:28:25 +00:00
Maksim Doronin 36f61f3879 [IE][VPU]: Refactor vpu configs
backported commit: 7fe87d9a5b
2020-10-05 20:27:52 +00:00
Ilya Churaev aa11f7d8a3 Removed get_output_as_single_output_node method
backported commit: 5fd3d36fe8
2020-10-05 20:24:21 +00:00
Alexander Alekhin f30aafc3cc core(test): regression test for 18473 2020-10-05 17:14:22 +00:00
Alexander Alekhin 2f065b8b4c Merge pull request #18509 from alalek:issue_18392 2020-10-05 17:03:27 +00:00
Alexander Alekhin aece3e732e Merge pull request #18507 from sizeofvoid:openbsd 2020-10-05 17:02:38 +00:00
Alexander Alekhin ebe9327a92 Merge pull request #18473 from BioDataAnalysis:bda_fix_cv_mat_steps 2020-10-05 16:59:05 +00:00
Mario Emmenlauer 102d8f67cd matrix.cpp::setSize(): fixed out-of-bounds access on cv::Mat steps 2020-10-05 10:19:53 +02:00
Alexander Alekhin a00fe15abd dnn: check for empty Net in .forward() 2020-10-05 06:23:47 +00:00
Rafael Sadowski 3acf8cfd63 Add an OpenBSD check 2020-10-05 08:23:23 +02:00
Alexander Alekhin d34717d8c9 core: allow to disable including of unsupported/Eigen/CXX11/Tensor
- define OPENCV_DISABLE_EIGEN_TENSOR_SUPPORT
2020-10-04 15:14:46 +00:00
Alexander Alekhin a5b8f163d7 Merge pull request #18488 from alalek:maxflow_missing_check 2020-10-02 15:04:28 +00:00
Alexander Alekhin 6add3b9161 Merge pull request #18487 from aitikgupta:unnecessary-variable 2020-10-02 15:03:59 +00:00
Alexander Alekhin 1ddd61f98a Merge pull request #18458 from sturkmen72:Update_window_w32_cpp 2020-10-02 15:00:44 +00:00
Alexander Alekhin 3503a36e5e Merge pull request #18444 from aitikgupta:check-minimum-points 2020-10-02 14:59:07 +00:00
Alexander Alekhin 2ea7269450 Merge pull request #18431 from zhuqiang00099:fix-darknet_relu 2020-10-02 14:58:48 +00:00
zhuqiang00099 a968eadbf1 fix darknet-relu bug in darknet_io.cpp 2020-10-02 06:16:38 +00:00
Alexander Alekhin c6b63e0e28 calib3d/imgproc: add GCGraph::maxFlow() missing empty checks 2020-10-02 05:15:20 +00:00
Aitik Gupta 7bd8ddc8fa removed no-affect variable 2020-10-02 09:27:16 +05:30
Suleyman TURKMEN 14e264f646 Update window_w32.cpp 2020-09-29 21:50:06 +03:00
Alexander Alekhin 969b55036f Merge pull request #18438 from alalek:dnn_onnx_importer_error_reporting 2020-09-29 13:49:02 +00:00
Aitik Gupta cbf978d1f7 added minPoints Homography test 2020-09-29 01:04:15 +05:30
Aitik Gupta 94e0ac7d9f need atleast 4 corresponding points to calculate homography 2020-09-29 01:04:01 +05:30
Alexander Alekhin 08b36e4f48 Merge pull request #18449 from alalek:ios_dont_disable_world_automatically 2020-09-28 18:46:28 +00:00
Alexander Alekhin d62d880316 Merge pull request #18447 from alalek:fix_17953 2020-09-28 18:45:31 +00:00
Alexander Alekhin 361b5e0ebf Merge pull request #18430 from alalek:ippicv_tpp 2020-09-28 18:45:00 +00:00
Alexander Alekhin c16e2e6234 ios: don't force BUILD_opencv_world=OFF in case of excluded modules 2020-09-28 01:11:15 +00:00
Alexander Alekhin c08f29c803 dnn(opencl): fix convolution kernel w/o bias with activation 2020-09-27 23:42:30 +00:00
Alexander Alekhin ecb6d03ccd Merge pull request #18445 from alalek:fix_test_python_ml 2020-09-27 23:12:02 +00:00
Alexander Alekhin e59793cc75 dnn: improve debugging of ONNX parsing errors 2020-09-27 23:04:48 +00:00
Alexander Alekhin 236ad4aeda Merge pull request #18441 from alalek:core_check_force_string_literals 2020-09-27 23:03:18 +00:00
Alexander Alekhin 97bb91d5fa ml: fix python test 2020-09-27 21:14:55 +00:00
Alexander Alekhin 233030e417 core: force check for string literals are used in the message 2020-09-27 06:37:44 +00:00
Alexander Alekhin 6256e425f3 Merge pull request #18434 from tomoaki0705:loosenDNNEps 2020-09-26 21:08:13 +00:00
Tomoaki Teshima 48368dc9a1 loosen threshold for Mali 2020-09-27 00:37:52 +09:00
Alexander Alekhin 691c655630 ippicv: install third-party-programs.txt file 2020-09-25 22:09:25 +00:00
Alexander Alekhin b88ad7f2d9 Merge pull request #18427 from tomoaki0705:improveFlipTest 2020-09-25 19:49:26 +00:00
Alexander Alekhin b300b6b3bd Merge pull request #18424 from tomoaki0705:addRTX3080s 2020-09-25 19:48:04 +00:00
Tomoaki Teshima 234117800f brush up by following the comments 2020-09-25 23:57:15 +09:00
Tomoaki Teshima ac58b2f857 compute capability 8.6
- CC for RTX3090, RTX3080 and RTX3070
2020-09-25 22:33:55 +09:00
Alexander Alekhin 220b37144b Merge pull request #18395 from tomoaki0705:fixNativePow 2020-09-23 18:27:45 +00:00
Tomoaki Teshima 74c8ccb45b fix build error of kernel on Mali 2020-09-23 21:38:12 +09:00
Alexander Alekhin 9cfe981e1f Merge pull request #18378 from nathanrgodwin:ippe_fix 2020-09-23 09:13:49 +00:00
Nathan Godwin 2f9072efdc Fixed assertions on ippe solver 2020-09-21 21:56:28 -05:00
Alexander Alekhin 5e90802b1a Merge pull request #18363 from alalek:issue_18349 2020-09-19 16:53:34 +00:00
Alexander Alekhin 45fee13f3d Merge pull request #18362 from alalek:ocl_async_kernel_reschedule_bug 2020-09-19 16:53:16 +00:00
Alexander Alekhin 261ad78122 core: emit more clear messages in OutputArray::create() 2020-09-18 15:25:29 +00:00
Alexander Alekhin 4fa82809df ocl: avoid rescheduling of async kernels 2020-09-18 14:53:50 +00:00
Alexander Alekhin 3e3787ecb6 Merge pull request #18360 from tomoaki0705:fixClampFailure 2020-09-18 13:10:36 +00:00
Alexander Alekhin a723aaedd8 Merge pull request #18354 from takehirokj:fix_typo_in_doc 2020-09-18 13:10:10 +00:00
Liubov Batanina ebb528976f Merge pull request #18353 from l-bat:issue_18350
* Fixed bug in ONNX Mul op

* Replaced node
2020-09-18 13:01:14 +00:00
Tomoaki Teshima f77c2d700f add explicit cast for half 2020-09-18 21:04:24 +09:00
Takehiro Kajihara 8c44b8306b Fix typo in videoio doc 2020-09-18 07:34:10 +09:00
Alexander Alekhin e668cff573 Merge pull request #18348 from tomoaki0705:fixNppFlipInplace 2020-09-17 13:56:17 +00:00
Sergei Slashchinin fa953e4205 Merge pull request #18316 from sl-sergei:fix_18253
Fix loading of ONNX models with Resize operation with Opset 11 for newer versions of Pytorch

* Add reproducer for Resize operation from newer versions of Pytorch

* Fix loading of scales parameter for Resize layer

* Change check type for better diagnostic messages
2020-09-17 11:05:22 +00:00
Maksim Shabunin 540982cc9d Merge pull request #18331 from or-toledano:3.4 2020-09-16 21:00:05 +00:00
Tomoaki Teshima a61546680b use only even number for inplace flip 2020-09-16 15:45:03 +09:00
Alexander Alekhin 8cb7eae5c9 Merge pull request #18294 from mshabunin:install-bin-samples 2020-09-15 19:38:02 +00:00
Alexander Alekhin 18440c1faf Merge pull request #18314 from gilsho:components 2020-09-14 20:15:38 +00:00
Alexander Alekhin 9f69ca503a Merge pull request #18325 from alalek:issue_18166 2020-09-14 18:17:58 +00:00
or-toledano 49ba744130 Fix np row,column to cv y,x
This explanation was created to avoid confusion, but it seems like the author was confused :D
2020-09-14 14:23:38 +03:00
Alexander Alekhin 4b24ddd70d Merge pull request #18317 from sl-sergei:restored_pr_17629 2020-09-13 12:51:41 +00:00
Gil Shotan 1612db5f91 Fix signed integer overflow in connected components 2020-09-13 11:20:42 +00:00
Alexander Alekhin 7dfe68cac6 imgcodecs: lazy on-demand codecs initialization 2020-09-13 11:14:56 +00:00
Alexander Alekhin 83807811cd Merge pull request #18299 from l-bat:onnx_reduce_max 2020-09-12 22:01:09 +00:00
Shubham Singh 23e71d1aa2 fixes #17187 probably
Added Eltwise Layer Support
2020-09-11 18:53:42 +03:00
Liubov Batanina b542a1804c Support global reduce ops 2020-09-09 11:56:20 +03:00
Maksim Shabunin 2dff2f36bf Install: added prebuilt samples installation 2020-09-08 20:22:26 +03:00
Alexander Alekhin 6b674709b8 Merge pull request #18284 from alalek:update_ffmpeg_3.4 2020-09-08 11:26:48 +00:00
Alexander Alekhin f56445d7ca ffmpeg/3.4: update FFmpeg wrapper
- FFmpeg 3.4.8
2020-09-07 17:55:22 +00:00
Alexander Alekhin 03bee14372 Merge pull request #18282 from alalek:update_version_3.4.12-pre 2020-09-07 16:57:21 +00:00
Alexander Alekhin 50ff40d684 pre: OpenCV 3.4.12 (version++) 2020-09-06 22:26:32 +00:00
68 changed files with 1040 additions and 357 deletions
+5 -5
View File
@@ -1,8 +1,8 @@
# Binaries branch name: ffmpeg/3.4_20200608
# Binaries were created for OpenCV: 458f1d5ebe31e22789d9d781d0ca2ca936758fde
ocv_update(FFMPEG_BINARIES_COMMIT "57064cd66d98994503b34aade3c8d8ff25007b46")
ocv_update(FFMPEG_FILE_HASH_BIN32 "6fff20f5617bd1b7362058790db52caa")
ocv_update(FFMPEG_FILE_HASH_BIN64 "15df55131471191b575668a424dff385")
# Binaries branch name: ffmpeg/3.4_20200907
# Binaries were created for OpenCV: 03bee14372f5537daa56c62e771ec16181ca1f98
ocv_update(FFMPEG_BINARIES_COMMIT "2a96257b743695a47f8012aab1ffb995a1dee8b4")
ocv_update(FFMPEG_FILE_HASH_BIN32 "5e68a3ff82f43ac6524e50e448a34c9c")
ocv_update(FFMPEG_FILE_HASH_BIN64 "205db629d893e7d4865fd1459807ff47")
ocv_update(FFMPEG_FILE_HASH_CMAKE "3b90f67f4b429e77d3da36698cef700c")
function(download_win_ffmpeg script_var)
+1
View File
@@ -463,6 +463,7 @@ OCV_OPTION(BUILD_JAVA "Enable Java support"
# OpenCV installation options
# ===================================================
OCV_OPTION(INSTALL_CREATE_DISTRIB "Change install rules to build the distribution package" OFF )
OCV_OPTION(INSTALL_BIN_EXAMPLES "Install prebuilt examples" WIN32 IF BUILD_EXAMPLES)
OCV_OPTION(INSTALL_C_EXAMPLES "Install C examples" OFF )
OCV_OPTION(INSTALL_PYTHON_EXAMPLES "Install Python examples" OFF )
OCV_OPTION(INSTALL_ANDROID_EXAMPLES "Install Android examples" OFF IF ANDROID )
+2 -2
View File
@@ -90,7 +90,7 @@ if(CUDA_FOUND)
set(_arch_pascal "6.0;6.1")
set(_arch_volta "7.0")
set(_arch_turing "7.5")
set(_arch_ampere "8.0")
set(_arch_ampere "8.0;8.6")
if(NOT CMAKE_CROSSCOMPILING)
list(APPEND _generations "Auto")
endif()
@@ -198,7 +198,7 @@ if(CUDA_FOUND)
if(${status} EQUAL 0)
# cache detected values
set(OPENCV_CACHE_CUDA_ACTIVE_CC ${${result_list}} CACHE INTERNAL "")
set(OPENCV_CACHE_CUDA_ACTIVE_CC ${${output}} CACHE INTERNAL "")
set(OPENCV_CACHE_CUDA_ACTIVE_CC_check "${__cache_key_check}" CACHE INTERNAL "")
endif()
endif()
+1
View File
@@ -252,6 +252,7 @@ if(NOT DEFINED IPPROOT)
else()
ocv_install_3rdparty_licenses(ippicv "${ICV_PACKAGE_ROOT}/EULA.txt")
endif()
ocv_install_3rdparty_licenses(ippicv "${ICV_PACKAGE_ROOT}/third-party-programs.txt")
endif()
file(TO_CMAKE_PATH "${IPPROOT}" __IPPROOT)
+2 -2
View File
@@ -1337,8 +1337,8 @@ function(ocv_add_samples)
endif()
add_dependencies(${parent_target} ${the_target})
if(WIN32)
install(TARGETS ${the_target} RUNTIME DESTINATION "samples/${module_id}" COMPONENT samples)
if(INSTALL_BIN_EXAMPLES)
install(TARGETS ${the_target} RUNTIME DESTINATION "${OPENCV_SAMPLES_BIN_INSTALL_PATH}/${module_id}" COMPONENT samples)
endif()
endforeach()
endif()
@@ -78,7 +78,7 @@ pixelpoints = np.transpose(np.nonzero(mask))
Here, two methods, one using Numpy functions, next one using OpenCV function (last commented line)
are given to do the same. Results are also same, but with a slight difference. Numpy gives
coordinates in **(row, column)** format, while OpenCV gives coordinates in **(x,y)** format. So
basically the answers will be interchanged. Note that, **row = x** and **column = y**.
basically the answers will be interchanged. Note that, **row = y** and **column = x**.
7. Maximum Value, Minimum Value and their locations
---------------------------------------------------
+20 -3
View File
@@ -6,12 +6,11 @@ body, table, div, p, dl {
}
code {
font: 12px Consolas, "Liberation Mono", Courier, monospace;
font-size: 85%;
font-family: "SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace;
white-space: pre-wrap;
padding: 1px 5px;
padding: 0;
background-color: #ddd;
background-color: rgb(223, 229, 241);
vertical-align: baseline;
}
@@ -20,6 +19,16 @@ body {
margin: 0 auto;
}
div.fragment {
padding: 3px;
padding-bottom: 0px;
}
div.line {
padding-bottom: 3px;
font-family: "SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace;
}
div.contents {
width: 980px;
margin: 0 auto;
@@ -35,3 +44,11 @@ span.arrow {
div.image img{
max-width: 900px;
}
#projectlogo
{
text-align: center;
vertical-align: middle;
border-collapse: separate;
padding-left: 0.5em;
}
@@ -15,7 +15,7 @@ Tutorial was written for the following versions of corresponding software:
- Download and install Android Studio from https://developer.android.com/studio.
- Get the latest pre-built OpenCV for Android release from https://github.com/opencv/opencv/releases and unpack it (for example, `opencv-3.4.11-android-sdk.zip`).
- Get the latest pre-built OpenCV for Android release from https://github.com/opencv/opencv/releases and unpack it (for example, `opencv-3.X.Y-android-sdk.zip`).
- Download MobileNet object detection model from https://github.com/chuanqi305/MobileNet-SSD. We need a configuration file `MobileNetSSD_deploy.prototxt` and weights `MobileNetSSD_deploy.caffemodel`.
@@ -39,14 +39,14 @@ Open your Doxyfile using your favorite text editor and search for the key
`TAGFILES`. Change it as follows:
@code
TAGFILES = ./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/3.4.11
TAGFILES = ./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/3.4.12
@endcode
If you had other definitions already, you can append the line using a `\`:
@code
TAGFILES = ./docs/doxygen-tags/libstdc++.tag=https://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen \
./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/3.4.11
./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/3.4.12
@endcode
Doxygen can now use the information from the tag file to link to the OpenCV
+1 -1
View File
@@ -2163,7 +2163,7 @@ final fundamental matrix. It can be set to something like 1-3, depending on the
point localization, image resolution, and the image noise.
@param confidence Parameter used for the RANSAC and LMedS methods only. It specifies a desirable level
of confidence (probability) that the estimated matrix is correct.
@param mask
@param[out] mask optional output mask
@param maxIters The maximum number of robust method iterations.
The epipolar geometry is described by the following equation:
+3
View File
@@ -374,6 +374,9 @@ cv::Mat cv::findHomography( InputArray _points1, InputArray _points2,
return Mat();
convertPointsFromHomogeneous(p, p);
}
// Need at least 4 point correspondences to calculate Homography
if( npoints < 4 )
CV_Error(Error::StsVecLengthErr , "The input arrays should have at least 4 corresponding point sets to calculate Homography");
p.reshape(2, npoints).convertTo(m, CV_32F);
}
+4 -4
View File
@@ -77,18 +77,18 @@ void PoseSolver::solveGeneric(InputArray _objectPoints, InputArray _normalizedIn
OutputArray _Ma, OutputArray _Mb)
{
//argument checking:
size_t n = static_cast<size_t>(_objectPoints.rows() * _objectPoints.cols()); //number of points
size_t n = static_cast<size_t>(_normalizedInputPoints.rows()) * static_cast<size_t>(_normalizedInputPoints.cols()); //number of points
int objType = _objectPoints.type();
int type_input = _normalizedInputPoints.type();
CV_CheckType(objType, objType == CV_32FC3 || objType == CV_64FC3,
"Type of _objectPoints must be CV_32FC3 or CV_64FC3" );
CV_CheckType(type_input, type_input == CV_32FC2 || type_input == CV_64FC2,
"Type of _normalizedInputPoints must be CV_32FC3 or CV_64FC3" );
"Type of _normalizedInputPoints must be CV_32FC2 or CV_64FC2" );
CV_Assert(_objectPoints.rows() == 1 || _objectPoints.cols() == 1);
CV_Assert(_objectPoints.rows() >= 4 || _objectPoints.cols() >= 4);
CV_Assert(_normalizedInputPoints.rows() == 1 || _normalizedInputPoints.cols() == 1);
CV_Assert(static_cast<size_t>(_objectPoints.rows() * _objectPoints.cols()) == n);
CV_Assert(static_cast<size_t>(_objectPoints.rows()) * static_cast<size_t>(_objectPoints.cols()) == n);
Mat normalizedInputPoints;
if (type_input == CV_32FC2)
@@ -101,7 +101,7 @@ void PoseSolver::solveGeneric(InputArray _objectPoints, InputArray _normalizedIn
}
Mat objectInputPoints;
if (type_input == CV_32FC3)
if (objType == CV_32FC3)
{
_objectPoints.getMat().convertTo(objectInputPoints, CV_64F);
}
+25 -1
View File
@@ -63,6 +63,7 @@ namespace opencv_test { namespace {
#define MESSAGE_RANSAC_DIFF "Reprojection error for current pair of points more than required."
#define MAX_COUNT_OF_POINTS 303
#define MIN_COUNT_OF_POINTS 4
#define COUNT_NORM_TYPES 3
#define METHODS_COUNT 4
@@ -249,7 +250,7 @@ void CV_HomographyTest::print_information_8(int _method, int j, int N, int k, in
void CV_HomographyTest::run(int)
{
for (int N = 4; N <= MAX_COUNT_OF_POINTS; ++N)
for (int N = MIN_COUNT_OF_POINTS; N <= MAX_COUNT_OF_POINTS; ++N)
{
RNG& rng = ts->get_rng();
@@ -711,4 +712,27 @@ TEST(Calib3d_Homography, fromImages)
ASSERT_GE(ninliers1, 80);
}
TEST(Calib3d_Homography, minPoints)
{
float pt1data[] =
{
2.80073029e+002f, 2.39591217e+002f, 2.21912201e+002f, 2.59783997e+002f
};
float pt2data[] =
{
1.84072723e+002f, 1.43591202e+002f, 1.25912483e+002f, 1.63783859e+002f
};
int npoints = (int)(sizeof(pt1data)/sizeof(pt1data[0])/2);
printf("npoints = %d\n", npoints); // npoints = 2
Mat p1(1, npoints, CV_32FC2, pt1data);
Mat p2(1, npoints, CV_32FC2, pt2data);
Mat mask;
// findHomography should raise an error since npoints < MIN_COUNT_OF_POINTS
EXPECT_THROW(findHomography(p1, p2, RANSAC, 0.01, mask), cv::Exception);
}
}} // namespace
+1 -1
View File
@@ -63,7 +63,7 @@ struct CheckContext {
#define CV__CHECK_LOCATION_VARNAME(id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_check_, id), __LINE__)
#define CV__DEFINE_CHECK_CONTEXT(id, message, testOp, p1_str, p2_str) \
static const cv::detail::CheckContext CV__CHECK_LOCATION_VARNAME(id) = \
{ CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, message, p1_str, p2_str }
{ CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str }
CV_EXPORTS void CV_NORETURN check_failed_auto(const int v1, const int v2, const CheckContext& ctx);
CV_EXPORTS void CV_NORETURN check_failed_auto(const size_t v1, const size_t v2, const CheckContext& ctx);
+4 -2
View File
@@ -58,11 +58,13 @@
#pragma warning( disable: 4244 ) //conversion from '__int64' to 'int', possible loss of data
#endif
#if !defined(OPENCV_DISABLE_EIGEN_TENSOR_SUPPORT)
#if EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3 \
&& defined(CV_CXX11) && defined(CV_CXX_STD_ARRAY)
#include <unsupported/Eigen/CXX11/Tensor>
#define OPENCV_EIGEN_TENSOR_SUPPORT
#endif // EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3
#define OPENCV_EIGEN_TENSOR_SUPPORT 1
#endif // EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3
#endif // !defined(OPENCV_DISABLE_EIGEN_TENSOR_SUPPORT)
namespace cv
{
@@ -7,8 +7,8 @@
#define CV_VERSION_MAJOR 3
#define CV_VERSION_MINOR 4
#define CV_VERSION_REVISION 11
#define CV_VERSION_STATUS "-dev"
#define CV_VERSION_REVISION 12
#define CV_VERSION_STATUS ""
#define CVAUX_STR_EXP(__A) #__A
#define CVAUX_STR(__A) CVAUX_STR_EXP(__A)
+11 -4
View File
@@ -237,12 +237,19 @@ void setSize( Mat& m, int _dims, const int* _sz, const size_t* _steps, bool auto
if( _steps )
{
if (_steps[i] % esz1 != 0)
if (i < _dims-1)
{
CV_Error(Error::BadStep, "Step must be a multiple of esz1");
}
if (_steps[i] % esz1 != 0)
{
CV_Error_(Error::BadStep, ("Step %zu for dimension %d must be a multiple of esz1 %zu", _steps[i], i, esz1));
}
m.step.p[i] = i < _dims-1 ? _steps[i] : esz;
m.step.p[i] = _steps[i];
}
else
{
m.step.p[i] = esz;
}
}
else if( autoSteps )
{
+8 -6
View File
@@ -1247,6 +1247,7 @@ void _OutputArray::create(int d, const int* sizes, int mtype, int i,
{
CV_Assert( i < 0 );
Mat& m = *(Mat*)obj;
CV_Assert(!(m.empty() && fixedType() && fixedSize()) && "Can't reallocate empty Mat with locked layout (probably due to misused 'const' modifier)");
if (allowTransposed && !m.empty() &&
d == 2 && m.dims == 2 &&
m.type() == mtype && m.rows == sizes[1] && m.cols == sizes[0] &&
@@ -1260,13 +1261,13 @@ void _OutputArray::create(int d, const int* sizes, int mtype, int i,
if(CV_MAT_CN(mtype) == m.channels() && ((1 << CV_MAT_TYPE(flags)) & fixedDepthMask) != 0 )
mtype = m.type();
else
CV_CheckTypeEQ(m.type(), CV_MAT_TYPE(mtype), "");
CV_CheckTypeEQ(m.type(), CV_MAT_TYPE(mtype), "Can't reallocate Mat with locked type (probably due to misused 'const' modifier)");
}
if(fixedSize())
{
CV_CheckEQ(m.dims, d, "");
CV_CheckEQ(m.dims, d, "Can't reallocate Mat with locked size (probably due to misused 'const' modifier)");
for(int j = 0; j < d; ++j)
CV_CheckEQ(m.size[j], sizes[j], "");
CV_CheckEQ(m.size[j], sizes[j], "Can't reallocate Mat with locked size (probably due to misused 'const' modifier)");
}
m.create(d, sizes, mtype);
return;
@@ -1276,6 +1277,7 @@ void _OutputArray::create(int d, const int* sizes, int mtype, int i,
{
CV_Assert( i < 0 );
UMat& m = *(UMat*)obj;
CV_Assert(!(m.empty() && fixedType() && fixedSize()) && "Can't reallocate empty UMat with locked layout (probably due to misused 'const' modifier)");
if (allowTransposed && !m.empty() &&
d == 2 && m.dims == 2 &&
m.type() == mtype && m.rows == sizes[1] && m.cols == sizes[0] &&
@@ -1289,13 +1291,13 @@ void _OutputArray::create(int d, const int* sizes, int mtype, int i,
if(CV_MAT_CN(mtype) == m.channels() && ((1 << CV_MAT_TYPE(flags)) & fixedDepthMask) != 0 )
mtype = m.type();
else
CV_CheckTypeEQ(m.type(), CV_MAT_TYPE(mtype), "");
CV_CheckTypeEQ(m.type(), CV_MAT_TYPE(mtype), "Can't reallocate UMat with locked type (probably due to misused 'const' modifier)");
}
if(fixedSize())
{
CV_CheckEQ(m.dims, d, "");
CV_CheckEQ(m.dims, d, "Can't reallocate UMat with locked size (probably due to misused 'const' modifier)");
for(int j = 0; j < d; ++j)
CV_CheckEQ(m.size[j], sizes[j], "");
CV_CheckEQ(m.size[j], sizes[j], "Can't reallocate UMat with locked size (probably due to misused 'const' modifier)");
}
m.create(d, sizes, mtype);
return;
+35 -2
View File
@@ -2755,7 +2755,7 @@ KernelArg KernelArg::Constant(const Mat& m)
struct Kernel::Impl
{
Impl(const char* kname, const Program& prog) :
refcount(1), handle(NULL), isInProgress(false), nu(0)
refcount(1), handle(NULL), isInProgress(false), isAsyncRun(false), nu(0)
{
cl_program ph = (cl_program)prog.ptr();
cl_int retval = 0;
@@ -2832,6 +2832,7 @@ struct Kernel::Impl
enum { MAX_ARRS = 16 };
UMatData* u[MAX_ARRS];
bool isInProgress;
bool isAsyncRun; // true if kernel was scheduled in async mode
int nu;
std::list<Image2D> images;
bool haveTempDstUMats;
@@ -3111,13 +3112,45 @@ bool Kernel::run(int dims, size_t _globalsize[], size_t _localsize[],
}
static bool isRaiseErrorOnReuseAsyncKernel()
{
static bool initialized = false;
static bool value = false;
if (!initialized)
{
value = cv::utils::getConfigurationParameterBool("OPENCV_OPENCL_RAISE_ERROR_REUSE_ASYNC_KERNEL", false);
initialized = true;
}
return value;
}
bool Kernel::Impl::run(int dims, size_t globalsize[], size_t localsize[],
bool sync, int64* timeNS, const Queue& q)
{
CV_INSTRUMENT_REGION_OPENCL_RUN(name.c_str());
if (!handle || isInProgress)
if (!handle)
{
CV_LOG_ERROR(NULL, "OpenCL kernel has zero handle: " << name);
return false;
}
if (isAsyncRun)
{
CV_LOG_ERROR(NULL, "OpenCL kernel can't be reused in async mode: " << name);
if (isRaiseErrorOnReuseAsyncKernel())
CV_Assert(0);
return false; // OpenCV 5.0: raise error
}
isAsyncRun = !sync;
if (isInProgress)
{
CV_LOG_ERROR(NULL, "Previous OpenCL kernel launch is not finished: " << name);
if (isRaiseErrorOnReuseAsyncKernel())
CV_Assert(0);
return false; // OpenCV 5.0: raise error
}
cl_command_queue qq = getQueue(q);
if (haveTempDstUMats)
+2 -1
View File
@@ -54,7 +54,8 @@
#endif
#if defined __linux__ || defined __APPLE__ || defined __GLIBC__ \
|| defined __HAIKU__ || defined __EMSCRIPTEN__ || defined __FreeBSD__
|| defined __HAIKU__ || defined __EMSCRIPTEN__ || defined __FreeBSD__ \
|| defined __OpenBSD__
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
+28
View File
@@ -2185,4 +2185,32 @@ TEST(Mat, empty_iterator_16855)
EXPECT_TRUE(m.begin<uchar>() == m.end<uchar>());
}
TEST(Mat, regression_18473)
{
std::vector<int> sizes(3);
sizes[0] = 20;
sizes[1] = 50;
sizes[2] = 100;
#if 1 // with the fix
std::vector<size_t> steps(2);
steps[0] = 50*100*2;
steps[1] = 100*2;
#else // without the fix
std::vector<size_t> steps(3);
steps[0] = 50*100*2;
steps[1] = 100*2;
steps[2] = 2;
#endif
std::vector<short> data(20*50*100, 0); // 1Mb
data[data.size() - 1] = 5;
// param steps Array of ndims-1 steps
Mat m(sizes, CV_16SC1, (void*)data.data(), (const size_t*)steps.data());
ASSERT_FALSE(m.empty());
EXPECT_EQ((int)5, (int)m.at<short>(19, 49, 99));
}
}} // namespace
+5 -1
View File
@@ -163,8 +163,12 @@ void cv::cuda::flip(InputArray _src, OutputArray _dst, int flipCode, Stream& str
_dst.create(src.size(), src.type());
GpuMat dst = getOutputMat(_dst, src.size(), src.type(), stream);
bool isInplace = (src.data == dst.data) || (src.refcount == dst.refcount);
bool isSizeOdd = (src.cols & 1) == 1 || (src.rows & 1) == 1;
if (isInplace && isSizeOdd)
CV_Error(Error::BadROISize, "In-place version of flip only accepts even width/height");
if (src.refcount != dst.refcount)
if (isInplace == false)
funcs[src.depth()][src.channels() - 1](src, dst, flipCode, StreamAccessor::getStream(stream));
else // in-place
ifuncs[src.depth()][src.channels() - 1](src, flipCode, StreamAccessor::getStream(stream));
+6 -1
View File
@@ -282,8 +282,13 @@ CUDA_TEST_P(Flip, Accuracy)
CUDA_TEST_P(Flip, AccuracyInplace)
{
cv::Mat src = randomMat(size, type);
bool isSizeOdd = ((size.width & 1) == 1) || ((size.height & 1) == 1);
cv::cuda::GpuMat srcDst = loadMat(src, useRoi);
if(isSizeOdd)
{
EXPECT_THROW(cv::cuda::flip(srcDst, srcDst, flip_code), cv::Exception);
return;
}
cv::cuda::flip(srcDst, srcDst, flip_code);
cv::Mat dst_gold;
+2 -2
View File
@@ -47,9 +47,9 @@
#include "opencv2/core/async.hpp"
#if !defined CV_DOXYGEN && !defined CV_STATIC_ANALYSIS && !defined CV_DNN_DONT_ADD_EXPERIMENTAL_NS
#define CV__DNN_EXPERIMENTAL_NS_BEGIN namespace experimental_dnn_34_v18 {
#define CV__DNN_EXPERIMENTAL_NS_BEGIN namespace experimental_dnn_34_v19 {
#define CV__DNN_EXPERIMENTAL_NS_END }
namespace cv { namespace dnn { namespace experimental_dnn_34_v18 { } using namespace experimental_dnn_34_v18; }}
namespace cv { namespace dnn { namespace experimental_dnn_34_v19 { } using namespace experimental_dnn_34_v19; }}
#else
#define CV__DNN_EXPERIMENTAL_NS_BEGIN
#define CV__DNN_EXPERIMENTAL_NS_END
+17 -1
View File
@@ -111,6 +111,10 @@ PERF_TEST_P_(DNNTestNetwork, ENet)
if ((backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019 && target != DNN_TARGET_CPU) ||
(backend == DNN_BACKEND_OPENCV && target == DNN_TARGET_OPENCL_FP16))
throw SkipTestException("");
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_GE(2021010000)
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
throw SkipTestException("");
#endif
processNet("dnn/Enet-model-best.net", "", "enet.yml",
Mat(cv::Size(512, 256), CV_32FC3));
}
@@ -202,6 +206,10 @@ PERF_TEST_P_(DNNTestNetwork, YOLOv3)
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && target == DNN_TARGET_OPENCL_FP16)
throw SkipTestException("Test is disabled in OpenVINO 2020.4");
#endif
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2021010000) // nGraph compilation failure
if (target == DNN_TARGET_MYRIAD)
throw SkipTestException("");
#endif
Mat sample = imread(findDataFile("dnn/dog416.png"));
cvtColor(sample, sample, COLOR_BGR2RGB);
@@ -214,7 +222,7 @@ PERF_TEST_P_(DNNTestNetwork, YOLOv4)
{
if (backend == DNN_BACKEND_HALIDE)
throw SkipTestException("");
if (target == DNN_TARGET_MYRIAD)
if (target == DNN_TARGET_MYRIAD) // not enough resources
throw SkipTestException("");
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2020040000) // nGraph compilation failure
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && target == DNN_TARGET_OPENCL)
@@ -233,6 +241,10 @@ PERF_TEST_P_(DNNTestNetwork, YOLOv4_tiny)
{
if (backend == DNN_BACKEND_HALIDE)
throw SkipTestException("");
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2021010000) // nGraph compilation failure
if (target == DNN_TARGET_MYRIAD)
throw SkipTestException("");
#endif
Mat sample = imread(findDataFile("dnn/dog416.png"));
cvtColor(sample, sample, COLOR_BGR2RGB);
Mat inp;
@@ -263,6 +275,10 @@ PERF_TEST_P_(DNNTestNetwork, Inception_v2_Faster_RCNN)
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019020000)
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
throw SkipTestException("Test is disabled in OpenVINO 2019R2");
#endif
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2021010000)
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && target == DNN_TARGET_MYRIAD)
throw SkipTestException("Test is disabled in OpenVINO 2021.1 / MYRIAD");
#endif
if (backend == DNN_BACKEND_HALIDE ||
(backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019 && target != DNN_TARGET_CPU) ||
+2 -2
View File
@@ -984,8 +984,8 @@ namespace cv {
}
std::string activation = getParam<std::string>(layer_params, "activation", "linear");
if(activation == "leaky" || activation == "swish" || activation == "mish" || activation == "logistic")
++cv_layers_counter; // For ReLU, Swish, Mish, Sigmoid
if (activation != "linear")
++cv_layers_counter; // For ReLU, Swish, Mish, Sigmoid, etc
if(!darknet_layers_counter)
tensor_shape.resize(1);
+73 -18
View File
@@ -2113,7 +2113,9 @@ struct Net::Impl : public detail::NetImplBase
auto ieInpNode = inputNodes[i].dynamicCast<InfEngineNgraphNode>();
CV_Assert(oid < ieInpNode->node->get_output_size());
#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2020_3)
#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2020_4)
inputNodes[i] = Ptr<BackendNode>(new InfEngineNgraphNode(ieInpNode->node));
#elif INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2020_3)
inputNodes[i] = Ptr<BackendNode>(new InfEngineNgraphNode(ieInpNode->node->get_output_as_single_output_node(oid)));
#else
inputNodes[i] = Ptr<BackendNode>(new InfEngineNgraphNode(ieInpNode->node->get_output_as_single_output_node(oid, false)));
@@ -2411,14 +2413,42 @@ struct Net::Impl : public detail::NetImplBase
}
// fuse convolution layer followed by eltwise + relu
if ( IS_DNN_OPENCL_TARGET(preferableTarget) && ld.layerInstance->type == "Convolution" )
while (nextData && IS_DNN_OPENCL_TARGET(preferableTarget) && ld.layerInstance->type == "Convolution") // semantic of 'if'
{
Ptr<EltwiseLayer> nextEltwiseLayer;
if( nextData )
nextEltwiseLayer = nextData->layerInstance.dynamicCast<EltwiseLayer>();
Ptr<EltwiseLayer> nextEltwiseLayer = nextData->layerInstance.dynamicCast<EltwiseLayer>();
if (nextEltwiseLayer.empty())
break;
if (pinsToKeep.count(lpNext) != 0)
break;
if (nextData->inputBlobsId.size() != 2)
break;
if (!nextData->params.has("operation") || nextData->params.get<String>("operation").toLowerCase() == "sum")
{
if (nextData->params.has("coeff"))
{
DictValue paramCoeff = nextData->params.get("coeff");
int n = paramCoeff.size();
bool isCoeffOneOne = (n == 2);
for (int i = 0; isCoeffOneOne && i < n; i++)
{
float c = paramCoeff.get<float>(i);
isCoeffOneOne &= (c == 1.0f);
}
if (!isCoeffOneOne)
{
CV_LOG_DEBUG(NULL, "DNN/OpenCL: fusion of 'Sum' without coeffs (or {1.0, 1.0}) is supported only");
break;
}
}
}
else
{
CV_LOG_DEBUG(NULL, "DNN/OpenCL: fusion with eltwise operation is not supported: " << nextData->params.get<String>("operation"));
break;
}
if( !nextEltwiseLayer.empty() && pinsToKeep.count(lpNext) == 0 &&
nextData && nextData->inputBlobsId.size() == 2 )
{
LayerData *eltwiseData = nextData;
@@ -2458,10 +2488,12 @@ struct Net::Impl : public detail::NetImplBase
if( nextData )
nextActivLayer = nextData->layerInstance.dynamicCast<ActivationLayer>();
Ptr<PowerLayer> activ_power;
if( !nextActivLayer.empty() &&
(!nextData->type.compare("ReLU") ||
!nextData->type.compare("ChannelsPReLU") ||
!nextData->type.compare("Power")) &&
(!nextData->type.compare("Power") && (activ_power = nextActivLayer.dynamicCast<PowerLayer>()) && activ_power->scale == 1.0f)
) &&
currLayer->setActivation(nextActivLayer) )
{
CV_Assert_N(biasLayerData->outputBlobsWrappers.size() == 1, ld.inputBlobsWrappers.size() == 1);
@@ -2513,6 +2545,8 @@ struct Net::Impl : public detail::NetImplBase
}
}
}
break;
}
}
@@ -2694,11 +2728,11 @@ struct Net::Impl : public detail::NetImplBase
Ptr<Layer> layer = ld.layerInstance;
TickMeter tm;
tm.start();
if( !ld.skip )
{
TickMeter tm;
tm.start();
std::map<int, Ptr<BackendNode> >::iterator it = ld.backendNodes.find(preferableBackend);
if (preferableBackend == DNN_BACKEND_OPENCV || it == ld.backendNodes.end() || it->second.empty())
{
@@ -2877,12 +2911,15 @@ struct Net::Impl : public detail::NetImplBase
CV_Error(Error::StsNotImplemented, "Unknown backend identifier");
}
}
tm.stop();
int64 t = tm.getTimeTicks();
layersTimings[ld.id] = (t > 0) ? t : t + 1; // zero for skipped layers only
}
else
tm.reset();
tm.stop();
layersTimings[ld.id] = tm.getTimeTicks();
{
layersTimings[ld.id] = 0;
}
ld.flag = 1;
}
@@ -3486,11 +3523,16 @@ void Net::connect(String _outPin, String _inPin)
Mat Net::forward(const String& outputName)
{
CV_TRACE_FUNCTION();
CV_Assert(!empty());
String layerName = outputName;
if (layerName.empty())
layerName = getLayerNames().back();
{
std::vector<String> layerNames = getLayerNames();
CV_Assert(!layerNames.empty());
layerName = layerNames.back();
}
std::vector<LayerPin> pins(1, impl->getPinByAlias(layerName));
impl->setUpNet(pins);
@@ -3502,11 +3544,17 @@ Mat Net::forward(const String& outputName)
AsyncArray Net::forwardAsync(const String& outputName)
{
CV_TRACE_FUNCTION();
CV_Assert(!empty());
#ifdef CV_CXX11
String layerName = outputName;
if (layerName.empty())
layerName = getLayerNames().back();
{
std::vector<String> layerNames = getLayerNames();
CV_Assert(!layerNames.empty());
layerName = layerNames.back();
}
std::vector<LayerPin> pins(1, impl->getPinByAlias(layerName));
impl->setUpNet(pins);
@@ -3527,11 +3575,16 @@ AsyncArray Net::forwardAsync(const String& outputName)
void Net::forward(OutputArrayOfArrays outputBlobs, const String& outputName)
{
CV_TRACE_FUNCTION();
CV_Assert(!empty());
String layerName = outputName;
if (layerName.empty())
layerName = getLayerNames().back();
{
std::vector<String> layerNames = getLayerNames();
CV_Assert(!layerNames.empty());
layerName = layerNames.back();
}
std::vector<LayerPin> pins(1, impl->getPinByAlias(layerName));
impl->setUpNet(pins);
@@ -4118,6 +4171,8 @@ std::vector<Ptr<Layer> > Net::getLayerInputs(LayerId layerId)
std::vector<String> Net::getLayerNames() const
{
CV_TRACE_FUNCTION();
std::vector<String> res;
res.reserve(impl->layers.size());
+4
View File
@@ -684,7 +684,11 @@ void InfEngineNgraphNet::initPlugin(InferenceEngine::CNNNetwork& net)
}
std::map<std::string, std::string> config;
if (device_name == "MYRIAD") {
#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2020_4)
config.emplace("MYRIAD_DETECT_NETWORK_BATCH", CONFIG_VALUE(NO));
#else
config.emplace("VPU_DETECT_NETWORK_BATCH", CONFIG_VALUE(NO));
#endif
}
bool isHetero = device_name == "FPGA";
@@ -46,6 +46,8 @@
#include "../op_inf_engine.hpp"
#include "../ie_ngraph.hpp"
#include <opencv2/core/utils/logger.hpp>
#include "opencv2/core/hal/hal.hpp"
#include "opencv2/core/hal/intrin.hpp"
#include <iostream>
@@ -371,6 +373,14 @@ public:
Ptr<PowerLayer> activ_power = activ.dynamicCast<PowerLayer>();
if (!activ_power.empty())
{
if (activ_power->scale != 1.0f) // not supported well by implementation, #17964
{
// FIXIT no way to check number of blobs (like, eltwise input)
CV_LOG_DEBUG(NULL, "DNN/OpenCL: can't configure Power activation (scale != 1.0f)");
activ.release();
newActiv = false;
return false;
}
if (activ_power->scale != 1.f || activ_power->shift != 0.f)
{
const int outCh = blobs[0].size[0];
+1 -1
View File
@@ -39,7 +39,7 @@ public:
CV_Assert(params.has("zoom_factor_x") && params.has("zoom_factor_y"));
}
interpolation = params.get<String>("interpolation");
CV_Assert(interpolation == "nearest" || interpolation == "opencv_linear" || interpolation == "bilinear");
CV_Check(interpolation, interpolation == "nearest" || interpolation == "opencv_linear" || interpolation == "bilinear", "");
alignCorners = params.get<bool>("align_corners", false);
}
@@ -46,6 +46,8 @@
#include <vector>
#include "opencl_kernels_dnn.hpp"
#include "opencv2/core/utils/logger.hpp"
namespace cv { namespace dnn { namespace ocl4dnn {
enum gemm_data_type_t
@@ -238,10 +240,6 @@ static bool ocl4dnnFastImageGEMM(const CBLAS_TRANSPOSE TransA,
kernel_name += "_float";
}
ocl::Kernel oclk_gemm_float(kernel_name.c_str(), ocl::dnn::gemm_image_oclsrc, opts);
if (oclk_gemm_float.empty())
return false;
while (C_start_y < M)
{
blockC_width = std::min(static_cast<int>(N) - C_start_x, blocksize);
@@ -348,6 +346,10 @@ static bool ocl4dnnFastImageGEMM(const CBLAS_TRANSPOSE TransA,
}
local[1] = 1;
ocl::Kernel oclk_gemm_float(kernel_name.c_str(), ocl::dnn::gemm_image_oclsrc, opts);
if (oclk_gemm_float.empty())
return false;
cl_uint arg_idx = 0;
if (is_image_a)
oclk_gemm_float.set(arg_idx++, ocl::KernelArg::PtrReadOnly(A));
@@ -378,7 +380,10 @@ static bool ocl4dnnFastImageGEMM(const CBLAS_TRANSPOSE TransA,
oclk_gemm_float.set(arg_idx++, isFirstColBlock);
if (!oclk_gemm_float.run(2, global, local, false))
{
CV_LOG_WARNING(NULL, "OpenCL kernel enqueue failed: " << kernel_name);
return false;
}
if (TransA == CblasNoTrans)
A_start_x += blockA_width;
@@ -607,6 +607,7 @@ void OCL4DNNConvSpatial<Dtype>::calculateBenchmark(const UMat &bottom, UMat &ver
{
options_.str(""); options_.clear(); // clear contents and state flags
createBasicKernel(1, 1, 1);
CV_Assert(!kernelQueue.empty()); // basic kernel must be available
kernel_index_ = kernelQueue.size() - 1;
convolve(bottom, verifyTop, weight, bias, numImages, kernelQueue[kernel_index_]);
CV_Assert(phash.find(kernelQueue[kernel_index_]->kernelName) != phash.end());
@@ -1713,6 +1714,7 @@ void OCL4DNNConvSpatial<float>::useFirstAvailable(const UMat &bottom,
tunerItems[i]->blockHeight,
tunerItems[i]->blockDepth))
{
CV_Assert(!kernelQueue.empty()); // basic kernel must be available
int kernelIdx = kernelQueue.size() - 1;
kernelConfig* config = kernelQueue[kernelIdx].get();
bool failed = false;
@@ -1883,6 +1885,7 @@ void OCL4DNNConvSpatial<float>::setupConvolution(const UMat &bottom,
CV_LOG_INFO(NULL, "fallback to basic kernel");
options_.str(""); options_.clear(); // clear contents and state flags
createBasicKernel(1, 1, 1);
CV_Assert(!kernelQueue.empty()); // basic kernel must be available
kernel_index_ = kernelQueue.size() - 1;
}
this->bestKernelConfig = kernelQueue[kernel_index_];
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -205,7 +205,7 @@ __kernel void ConvolveBasic(
#if APPLY_BIAS
ACTIVATION_FUNCTION(convolved_image, offset, sum[kern] + bias[biasIndex + kern], biasIndex + kern);
#else
ACTIVATION_FUNCTION(convolved_image, offset, sum[kern], biasIndex + kern);
ACTIVATION_FUNCTION(convolved_image, offset, sum[kern], kernelNum + kern);
#endif
}
}
+2 -2
View File
@@ -83,7 +83,7 @@ __kernel void TEMPLATE(lrn_full_no_scale,Dtype)(const int nthreads, __global con
* in_off[(head - size) * step];
}
scale_val = k + accum_scale * alpha_over_size;
out_off[(head - post_pad) * step] = in_off[(head - post_pad) * step] * (Dtype)native_powr((Dtype)scale_val, (Dtype)negative_beta);
out_off[(head - post_pad) * step] = in_off[(head - post_pad) * step] * (Dtype)native_powr(scale_val, negative_beta);
++head;
}
// subtract only
@@ -93,7 +93,7 @@ __kernel void TEMPLATE(lrn_full_no_scale,Dtype)(const int nthreads, __global con
* in_off[(head - size) * step];
}
scale_val = k + accum_scale * alpha_over_size;
out_off[(head - post_pad) * step] = in_off[(head - post_pad) * step] * (Dtype)native_powr((Dtype)scale_val, (Dtype)negative_beta);
out_off[(head - post_pad) * step] = in_off[(head - post_pad) * step] * (Dtype)native_powr(scale_val, negative_beta);
++head;
}
}
+1 -1
View File
@@ -114,6 +114,6 @@ __kernel void clip(const int nthreads,
for (int index = get_global_id(0); index < nthreads; index += get_global_size(0))
{
Dtype4 vec = vload4(index, dst);
vstore4(clamp(vec, 0.0f, 1.0f), index, dst);
vstore4(clamp(vec, (Dtype)0.0f, (Dtype)1.0f), index, dst);
}
}
+2 -2
View File
@@ -63,10 +63,10 @@ void normAssert(
double l1 /*= 0.00001*/, double lInf /*= 0.0001*/)
{
double normL1 = cvtest::norm(ref, test, cv::NORM_L1) / ref.getMat().total();
EXPECT_LE(normL1, l1) << comment;
EXPECT_LE(normL1, l1) << comment << " |ref| = " << cvtest::norm(ref, cv::NORM_INF);
double normInf = cvtest::norm(ref, test, cv::NORM_INF);
EXPECT_LE(normInf, lInf) << comment;
EXPECT_LE(normInf, lInf) << comment << " |ref| = " << cvtest::norm(ref, cv::NORM_INF);
}
std::vector<cv::Rect2d> matToBoxes(const cv::Mat& m)
@@ -625,6 +625,11 @@ TEST_P(Test_Darknet_nets, YOLOv4_tiny)
target == DNN_TARGET_CPU ? CV_TEST_TAG_MEMORY_512MB : CV_TEST_TAG_MEMORY_1GB
);
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2021010000) // nGraph compilation failure
if (target == DNN_TARGET_MYRIAD)
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE_VERSION);
#endif
const double confThreshold = 0.5;
// batchId, classId, confidence, left, top, right, bottom
const int N0 = 2;
+5 -40
View File
@@ -2219,17 +2219,6 @@ TEST_P(ConvolutionActivationFusion, Accuracy)
Backend backendId = get<0>(get<2>(GetParam()));
Target targetId = get<1>(get<2>(GetParam()));
// bug: https://github.com/opencv/opencv/issues/17964
if (actType == "Power" && backendId == DNN_BACKEND_OPENCV && (targetId == DNN_TARGET_OPENCL || targetId == DNN_TARGET_OPENCL_FP16))
applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL);
// bug: https://github.com/opencv/opencv/issues/17953
if (actType == "ChannelsPReLU" && bias_term == false &&
backendId == DNN_BACKEND_OPENCV && (targetId == DNN_TARGET_OPENCL || targetId == DNN_TARGET_OPENCL_FP16))
{
applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL);
}
Net net;
int convId = net.addLayer(convParams.name, convParams.type, convParams);
int activId = net.addLayerToPrev(activationParams.name, activationParams.type, activationParams);
@@ -2242,7 +2231,7 @@ TEST_P(ConvolutionActivationFusion, Accuracy)
expectedFusedLayers.push_back(activId); // all activations are fused
else if (targetId == DNN_TARGET_OPENCL || targetId == DNN_TARGET_OPENCL_FP16)
{
if (actType == "ReLU" || actType == "ChannelsPReLU" || actType == "ReLU6" || actType == "TanH" || actType == "Power")
if (actType == "ReLU" || actType == "ChannelsPReLU" || actType == "ReLU6" || actType == "TanH" /*|| actType == "Power"*/)
expectedFusedLayers.push_back(activId);
}
}
@@ -2352,21 +2341,6 @@ TEST_P(ConvolutionEltwiseActivationFusion, Accuracy)
Backend backendId = get<0>(get<4>(GetParam()));
Target targetId = get<1>(get<4>(GetParam()));
// bug: https://github.com/opencv/opencv/issues/17945
if ((eltwiseOp != "sum" || weightedEltwise) && backendId == DNN_BACKEND_OPENCV && (targetId == DNN_TARGET_OPENCL || targetId == DNN_TARGET_OPENCL_FP16))
applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL);
// bug: https://github.com/opencv/opencv/issues/17953
if (eltwiseOp == "sum" && actType == "ChannelsPReLU" && bias_term == false &&
backendId == DNN_BACKEND_OPENCV && (targetId == DNN_TARGET_OPENCL || targetId == DNN_TARGET_OPENCL_FP16))
{
applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL);
}
// bug: https://github.com/opencv/opencv/issues/17964
if (actType == "Power" && backendId == DNN_BACKEND_OPENCV && (targetId == DNN_TARGET_OPENCL || targetId == DNN_TARGET_OPENCL_FP16))
applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL);
Net net;
int convId = net.addLayer(convParams.name, convParams.type, convParams);
int eltwiseId = net.addLayer(eltwiseParams.name, eltwiseParams.type, eltwiseParams);
@@ -2383,7 +2357,9 @@ TEST_P(ConvolutionEltwiseActivationFusion, Accuracy)
expectedFusedLayers.push_back(activId); // activation is fused with eltwise layer
else if (targetId == DNN_TARGET_OPENCL || targetId == DNN_TARGET_OPENCL_FP16)
{
if (actType == "ReLU" || actType == "ChannelsPReLU" || actType == "Power")
if (eltwiseOp == "sum" && !weightedEltwise &&
(actType == "ReLU" || actType == "ChannelsPReLU" /*|| actType == "Power"*/)
)
{
expectedFusedLayers.push_back(eltwiseId);
expectedFusedLayers.push_back(activId);
@@ -2445,17 +2421,6 @@ TEST_P(ConvolutionActivationEltwiseFusion, Accuracy)
Backend backendId = get<0>(get<4>(GetParam()));
Target targetId = get<1>(get<4>(GetParam()));
// bug: https://github.com/opencv/opencv/issues/17964
if (actType == "Power" && backendId == DNN_BACKEND_OPENCV && (targetId == DNN_TARGET_OPENCL || targetId == DNN_TARGET_OPENCL_FP16))
applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL);
// bug: https://github.com/opencv/opencv/issues/17953
if (actType == "ChannelsPReLU" && bias_term == false &&
backendId == DNN_BACKEND_OPENCV && (targetId == DNN_TARGET_OPENCL || targetId == DNN_TARGET_OPENCL_FP16))
{
applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL);
}
Net net;
int convId = net.addLayer(convParams.name, convParams.type, convParams);
int activId = net.addLayer(activationParams.name, activationParams.type, activationParams);
@@ -2472,7 +2437,7 @@ TEST_P(ConvolutionActivationEltwiseFusion, Accuracy)
expectedFusedLayers.push_back(activId); // activation fused with convolution
else if (targetId == DNN_TARGET_OPENCL || targetId == DNN_TARGET_OPENCL_FP16)
{
if (actType == "ReLU" || actType == "ChannelsPReLU" || actType == "ReLU6" || actType == "TanH" || actType == "Power")
if (actType == "ReLU" || actType == "ChannelsPReLU" || actType == "ReLU6" || actType == "TanH" /*|| actType == "Power"*/)
expectedFusedLayers.push_back(activId); // activation fused with convolution
}
}
+9
View File
@@ -99,6 +99,15 @@ TEST(readNet, do_not_call_setInput) // https://github.com/opencv/opencv/issues/
EXPECT_TRUE(res.empty()) << res.size;
}
TEST(Net, empty_forward_18392)
{
cv::dnn::Net net;
Mat image(Size(512, 512), CV_8UC3, Scalar::all(0));
Mat inputBlob = cv::dnn::blobFromImage(image, 1.0, Size(512, 512), Scalar(0,0,0), true, false);
net.setInput(inputBlob);
EXPECT_ANY_THROW(Mat output = net.forward());
}
#ifdef HAVE_INF_ENGINE
static
void test_readNet_IE_do_not_call_setInput(Backend backendId)
+17
View File
@@ -262,6 +262,18 @@ TEST_P(Test_ONNX_layers, ReduceSum)
testONNXModels("reduce_sum");
}
TEST_P(Test_ONNX_layers, ReduceMaxGlobal)
{
testONNXModels("reduce_max");
}
TEST_P(Test_ONNX_layers, Scale)
{
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER);
testONNXModels("scale");
}
TEST_P(Test_ONNX_layers, ReduceMean3D)
{
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019 && target != DNN_TARGET_CPU)
@@ -631,6 +643,11 @@ TEST_P(Test_ONNX_layers, MatmulWithTwoInputs)
testONNXModels("matmul_with_two_inputs");
}
TEST_P(Test_ONNX_layers, ResizeOpset11_Torch1_6)
{
testONNXModels("resize_opset11_torch1.6");
}
INSTANTIATE_TEST_CASE_P(/*nothing*/, Test_ONNX_layers, dnnBackendsAndTargets());
class Test_ONNX_nets : public Test_ONNX_layers
+6 -2
View File
@@ -113,7 +113,7 @@ TEST_P(Test_Torch_layers, run_convolution)
{
// Output reference values are in range [23.4018, 72.0181]
double l1 = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD) ? 0.08 : default_l1;
double lInf = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD) ? 0.42 : default_lInf;
double lInf = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD) ? 0.43 : default_lInf;
runTorchNet("net_conv", "", false, true, true, l1, lInf);
}
@@ -165,7 +165,7 @@ TEST_P(Test_Torch_layers, run_concat)
TEST_P(Test_Torch_layers, run_depth_concat)
{
runTorchNet("net_depth_concat", "", false, true, true, 0.0,
target == DNN_TARGET_OPENCL_FP16 ? 0.021 : 0.0);
target == DNN_TARGET_OPENCL_FP16 ? 0.032 : 0.0);
}
TEST_P(Test_Torch_layers, run_deconv)
@@ -359,6 +359,10 @@ TEST_P(Test_Torch_nets, ENet_accuracy)
if (target == DNN_TARGET_MYRIAD) applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER);
throw SkipTestException("");
}
#endif
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_GE(2021010000)
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
#endif
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && target != DNN_TARGET_CPU)
{
+2 -2
View File
@@ -250,13 +250,13 @@ CV_IMPL int cvInitSystem( int, char** )
wndc.lpszMenuName = highGUIclassName;
wndc.hIcon = LoadIcon(0, IDI_APPLICATION);
wndc.hCursor = (HCURSOR)LoadCursor(0, (LPSTR)(size_t)IDC_CROSS );
wndc.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH);
wndc.hbrBackground = (HBRUSH)GetStockObject(DKGRAY_BRUSH);
RegisterClass(&wndc);
wndc.lpszClassName = mainHighGUIclassName;
wndc.lpszMenuName = mainHighGUIclassName;
wndc.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH);
wndc.hbrBackground = (HBRUSH)GetStockObject(DKGRAY_BRUSH);
wndc.lpfnWndProc = MainWindowProc;
RegisterClass(&wndc);
+16 -1
View File
@@ -189,7 +189,19 @@ struct ImageCodecInitializer
std::vector<ImageEncoder> encoders;
};
static ImageCodecInitializer codecs;
static
ImageCodecInitializer& getCodecs()
{
#ifdef CV_CXX11
static ImageCodecInitializer g_codecs;
return g_codecs;
#else
// C++98 doesn't guarantee correctness of multi-threaded initialization of static global variables
// (memory leak here is not critical, use C++11 to avoid that)
static ImageCodecInitializer* g_codecs = new ImageCodecInitializer();
return *g_codecs;
#endif
}
/**
* Find the decoders
@@ -203,6 +215,7 @@ static ImageDecoder findDecoder( const String& filename ) {
size_t i, maxlen = 0;
/// iterate through list of registered codecs
ImageCodecInitializer& codecs = getCodecs();
for( i = 0; i < codecs.decoders.size(); i++ )
{
size_t len = codecs.decoders[i]->signatureLength();
@@ -240,6 +253,7 @@ static ImageDecoder findDecoder( const Mat& buf )
if( buf.rows*buf.cols < 1 || !buf.isContinuous() )
return ImageDecoder();
ImageCodecInitializer& codecs = getCodecs();
for( i = 0; i < codecs.decoders.size(); i++ )
{
size_t len = codecs.decoders[i]->signatureLength();
@@ -272,6 +286,7 @@ static ImageEncoder findEncoder( const String& _ext )
for( ext++; len < 128 && isalnum(ext[len]); len++ )
;
ImageCodecInitializer& codecs = getCodecs();
for( size_t i = 0; i < codecs.encoders.size(); i++ )
{
String description = codecs.encoders[i]->getDescription();
+14 -7
View File
@@ -145,14 +145,21 @@ namespace cv{
void finish(){
for (int l = 0; l < statsv.rows; ++l){
int *row =& statsv.at<int>(l, 0);
row[CC_STAT_WIDTH] = row[CC_STAT_WIDTH] - row[CC_STAT_LEFT] + 1;
row[CC_STAT_HEIGHT] = row[CC_STAT_HEIGHT] - row[CC_STAT_TOP] + 1;
Point2ui64& integral = integrals[l];
double *centroid = &centroidsv.at<double>(l, 0);
double area = ((unsigned*)row)[CC_STAT_AREA];
centroid[0] = double(integral.x) / area;
centroid[1] = double(integral.y) / area;
double *centroid = &centroidsv.at<double>(l, 0);
if (area > 0){
row[CC_STAT_WIDTH] = row[CC_STAT_WIDTH] - row[CC_STAT_LEFT] + 1;
row[CC_STAT_HEIGHT] = row[CC_STAT_HEIGHT] - row[CC_STAT_TOP] + 1;
Point2ui64& integral = integrals[l];
centroid[0] = double(integral.x) / area;
centroid[1] = double(integral.y) / area;
} else {
row[CC_STAT_WIDTH] = 0;
row[CC_STAT_HEIGHT] = 0;
row[CC_STAT_LEFT] = -1;
centroid[0] = std::numeric_limits<double>::quiet_NaN();
centroid[1] = std::numeric_limits<double>::quiet_NaN();
}
}
}
+2
View File
@@ -152,6 +152,8 @@ void GCGraph<TWeight>::addTermWeights( int i, TWeight sourceW, TWeight sinkW )
template <class TWeight>
TWeight GCGraph<TWeight>::maxFlow()
{
CV_Assert(!vtcs.empty());
CV_Assert(!edges.empty());
const int TERMINAL = -1, ORPHAN = -2;
Vtx stub, *nilNode = &stub, *first = nilNode, *last = nilNode;
int curr_ts = 0;
+3 -4
View File
@@ -758,7 +758,6 @@ void Subdiv2D::getTriangleList(std::vector<Vec6f>& triangleList) const
triangleList.clear();
int i, total = (int)(qedges.size()*4);
std::vector<bool> edgemask(total, false);
const bool filterPoints = true;
Rect2f rect(topLeft.x, topLeft.y, bottomRight.x - topLeft.x, bottomRight.y - topLeft.y);
for( i = 4; i < total; i += 2 )
@@ -768,15 +767,15 @@ void Subdiv2D::getTriangleList(std::vector<Vec6f>& triangleList) const
Point2f a, b, c;
int edge_a = i;
edgeOrg(edge_a, &a);
if (filterPoints && !rect.contains(a))
if ( !rect.contains(a) )
continue;
int edge_b = getEdge(edge_a, NEXT_AROUND_LEFT);
edgeOrg(edge_b, &b);
if (filterPoints && !rect.contains(b))
if ( !rect.contains(b) )
continue;
int edge_c = getEdge(edge_b, NEXT_AROUND_LEFT);
edgeOrg(edge_c, &c);
if (filterPoints && !rect.contains(c))
if ( !rect.contains(c) )
continue;
edgemask[edge_a] = true;
edgemask[edge_b] = true;
@@ -225,5 +225,19 @@ TEST(Imgproc_ConnectedComponents, parallel_wu_labels)
EXPECT_EQ(nbPixels, area);
}
TEST(Imgproc_ConnectedComponents, missing_background_pixels)
{
cv::Mat m = Mat::ones(10, 10, CV_8U);
cv::Mat labels;
cv::Mat stats;
cv::Mat centroids;
EXPECT_NO_THROW(cv::connectedComponentsWithStats(m, labels, stats, centroids, 8, CV_32S, cv::CCL_WU) );
EXPECT_EQ(stats.at<int32_t>(0, cv::CC_STAT_WIDTH), 0);
EXPECT_EQ(stats.at<int32_t>(0, cv::CC_STAT_HEIGHT), 0);
EXPECT_EQ(stats.at<int32_t>(0, cv::CC_STAT_LEFT), -1);
EXPECT_TRUE(std::isnan(centroids.at<double>(0, 0)));
EXPECT_TRUE(std::isnan(centroids.at<double>(0, 1)));
}
}} // namespace
+1
View File
@@ -769,6 +769,7 @@ class JavaWrapperGenerator(object):
inCode = True
if "</code>" in line:
inCode = False
line = line.replace('@result ', '@return ') # @result is valid in Doxygen, but invalid in Javadoc
if "@return " in line:
returnTag = True
@@ -11,7 +11,7 @@ from tests_common import NewOpenCVTests
class TestGoodFeaturesToTrack_test(NewOpenCVTests):
def test_goodFeaturesToTrack(self):
arr = self.get_sample('samples/data/lena.jpg', 0)
original = arr.copy(True)
original = arr.copy()
threshes = [ x / 100. for x in range(1,10) ]
numPoints = 20000
+1 -1
View File
@@ -9,7 +9,7 @@ def main():
os.chdir(SCRIPT_DIR)
package_name = 'opencv'
package_version = os.environ.get('OPENCV_VERSION', '3.4.11') # TODO
package_version = os.environ.get('OPENCV_VERSION', '3.4.12') # TODO
long_description = 'Open Source Computer Vision Library Python bindings' # TODO
@@ -77,7 +77,7 @@ for the operating system. Thus you can't use VideoCapture or VideoWriter with t
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
It is a common case that these 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.
@@ -85,9 +85,9 @@ 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
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.
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
+19 -22
View File
@@ -221,60 +221,57 @@ bool CvCaptureCAM_DC1394_v2_CPP::startCapture()
DC1394_ISO_SPEED_3200);
}
// should a specific mode be used
if (userMode >= 0)
dc1394video_modes_t videoModes;
dc1394_video_get_supported_modes(dcCam, &videoModes);
// should a specific mode be used
while (userMode >= 0) // 'if' semantic, no real loop here
{
dc1394video_mode_t wantedMode;
dc1394video_modes_t videoModes;
dc1394_video_get_supported_modes(dcCam, &videoModes);
//set mode from number, for example the second supported mode, i.e userMode = 1
if (userMode < (int)videoModes.num)
{
// set mode from number, for example the second supported mode, i.e userMode = 1
wantedMode = videoModes.modes[userMode];
}
//set modes directly from DC134 constants (from dc1394video_mode_t)
else if ((userMode >= DC1394_VIDEO_MODE_MIN) && (userMode <= DC1394_VIDEO_MODE_MAX ))
else if ((userMode >= DC1394_VIDEO_MODE_MIN) && (userMode <= DC1394_VIDEO_MODE_MAX))
{
// set modes directly from DC134 constants (from dc1394video_mode_t)
//search for wanted mode, to check if camera supports it
int j = 0;
while ((j< (int)videoModes.num) && videoModes.modes[j]!=userMode)
while ((j < (int)videoModes.num) && videoModes.modes[j] != userMode)
{
j++;
}
if ((int)videoModes.modes[j]==userMode)
{
wantedMode = videoModes.modes[j];
}
else
if (!(j < (int)videoModes.num))
{
userMode = -1; // wanted mode not supported, search for best mode
break;
}
wantedMode = videoModes.modes[j];
}
else
{
userMode = -1; // wanted mode not supported, search for best mode
userMode = -1; // wanted mode not supported, search for best mode
break;
}
//if userMode is available: set it and update size
if (userMode != -1)
{
code = dc1394_video_set_mode(dcCam, wantedMode);
uint32_t width, height;
uint32_t width = 0, height = 0;
dc1394_get_image_size_from_video_mode(dcCam, wantedMode, &width, &height);
frameWidth = (int)width;
frameHeight = (int)height;
}
break;
}
if (userMode == -1 && (frameWidth > 0 || frameHeight > 0))
{
dc1394video_mode_t bestMode = (dc1394video_mode_t) - 1;
dc1394video_modes_t videoModes;
dc1394_video_get_supported_modes(dcCam, &videoModes);
dc1394video_mode_t bestMode = (dc1394video_mode_t)(-1);
for (i = 0; i < (int)videoModes.num; i++)
{
dc1394video_mode_t mode = videoModes.modes[i];
+1 -1
View File
@@ -269,7 +269,7 @@ class Builder:
# Add extra data
apkxmldest = check_dir(os.path.join(apkdest, "res", "xml"), create=True)
apklibdest = check_dir(os.path.join(apkdest, "libs", abi.name), create=True)
for ver, d in self.extra_packs + [("3.4.11", os.path.join(self.libdest, "lib"))]:
for ver, d in self.extra_packs + [("3.4.12", os.path.join(self.libdest, "lib"))]:
r = ET.Element("library", attrib={"version": ver})
log.info("Adding libraries from %s", d)
+1 -1
View File
@@ -12,7 +12,7 @@ manually using adb tool:
adb install <path-to-OpenCV-sdk>/apk/OpenCV_<version>_Manager_<app_version>_<platform>.apk
Example: OpenCV_3.4.11-dev_Manager_3.49_armeabi-v7a.apk
Example: OpenCV_3.4.12-dev_Manager_3.49_armeabi-v7a.apk
Use the list of platforms below to determine proper OpenCV Manager package for your device:
-1
View File
@@ -150,7 +150,6 @@ class Builder:
] if self.debug_info else [])
if len(self.exclude) > 0:
args += ["-DBUILD_opencv_world=OFF"] if not self.dynamic else []
args += ["-DBUILD_opencv_%s=OFF" % m for m in self.exclude]
if len(self.disable) > 0:
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.opencv</groupId>
<artifactId>opencv-parent</artifactId>
<version>3.4.11</version>
<version>3.4.12</version>
</parent>
<groupId>org.opencv</groupId>
<artifactId>opencv-it</artifactId>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.opencv</groupId>
<artifactId>opencv-parent</artifactId>
<version>3.4.11</version>
<version>3.4.12</version>
</parent>
<groupId>org.opencv</groupId>
<artifactId>opencv</artifactId>
+1 -1
View File
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.opencv</groupId>
<artifactId>opencv-parent</artifactId>
<version>3.4.11</version>
<version>3.4.12</version>
<packaging>pom</packaging>
<name>OpenCV Parent POM</name>
<licenses>
@@ -0,0 +1,12 @@
diff --git a/inference-engine/thirdparty/clDNN/kernel_selector/common/tensor_type.h b/inference-engine/thirdparty/clDNN/kernel_selector/common/tensor_type.h
index 3dbdfd0b..6b04b910 100644
--- a/inference-engine/thirdparty/clDNN/kernel_selector/common/tensor_type.h
+++ b/inference-engine/thirdparty/clDNN/kernel_selector/common/tensor_type.h
@@ -15,6 +15,7 @@
#pragma once
+#include <stdexcept>
#include "common_types.h"
#include "common_tools.h"
#include <vector>
@@ -1,3 +1,4 @@
applyPatch('20200701-dldt-disable-unused-targets.patch')
applyPatch('20200413-dldt-pdb.patch')
applyPatch('20200604-dldt-disable-multidevice.patch')
applyPatch('20201005-dldt-fix-cldnn-compilation.patch')
@@ -0,0 +1,14 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1f981ed2..90eb500a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,6 +22,9 @@ endif()
project(OpenVINO)
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi /FS")
+set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
+
set(OpenVINO_MAIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(IE_MAIN_SOURCE_DIR ${OpenVINO_MAIN_SOURCE_DIR}/inference-engine)
list(APPEND CMAKE_MODULE_PATH "${OpenVINO_MAIN_SOURCE_DIR}/cmake")
@@ -0,0 +1,13 @@
diff --git a/inference-engine/src/CMakeLists.txt b/inference-engine/src/CMakeLists.txt
index 0ba0dd78..7d34e7cb 100644
--- a/inference-engine/src/CMakeLists.txt
+++ b/inference-engine/src/CMakeLists.txt
@@ -26,7 +26,7 @@ endif()
add_subdirectory(hetero_plugin)
-add_subdirectory(multi_device)
+#add_subdirectory(multi_device)
add_subdirectory(transformations)
@@ -0,0 +1,178 @@
diff --git a/inference-engine/CMakeLists.txt b/inference-engine/CMakeLists.txt
index 7f45ab02..a7bac7e9 100644
--- a/inference-engine/CMakeLists.txt
+++ b/inference-engine/CMakeLists.txt
@@ -70,7 +70,7 @@ if(ENABLE_TESTS)
add_subdirectory(tests)
endif()
-add_subdirectory(tools)
+#add_subdirectory(tools)
function(ie_build_samples)
# samples should be build with the same flags as from OpenVINO package,
@@ -89,7 +89,7 @@ endfunction()
# gflags and format_reader targets are kept inside of samples directory and
# they must be built even if samples build is disabled (required for tests and tools).
-ie_build_samples()
+#ie_build_samples()
file(GLOB_RECURSE SAMPLES_SOURCES samples/*.cpp samples/*.hpp samples/*.h)
add_cpplint_target(sample_cpplint
@@ -180,7 +180,7 @@ endif()
# Developer package
#
-ie_developer_export_targets(format_reader)
+#ie_developer_export_targets(format_reader)
ie_developer_export_targets(${NGRAPH_LIBRARIES})
# for Template plugin
@@ -188,7 +188,7 @@ if(NGRAPH_INTERPRETER_ENABLE)
ie_developer_export_targets(ngraph_backend interpreter_backend)
endif()
-ie_developer_export()
+#ie_developer_export()
configure_file(
"${IE_MAIN_SOURCE_DIR}/cmake/developer_package_config.cmake.in"
diff --git a/inference-engine/src/inference_engine/CMakeLists.txt b/inference-engine/src/inference_engine/CMakeLists.txt
index 9ab88898..8badb591 100644
--- a/inference-engine/src/inference_engine/CMakeLists.txt
+++ b/inference-engine/src/inference_engine/CMakeLists.txt
@@ -118,7 +118,7 @@ add_cpplint_target(${TARGET_NAME}_plugin_api_cpplint FOR_SOURCES ${plugin_api_sr
# Create common base object library
-add_library(${TARGET_NAME}_common_obj OBJECT
+add_library(${TARGET_NAME}_common_obj OBJECT EXCLUDE_FROM_ALL
${IE_BASE_SOURCE_FILES})
target_compile_definitions(${TARGET_NAME}_common_obj PRIVATE IMPLEMENT_INFERENCE_ENGINE_API)
@@ -132,7 +132,7 @@ target_include_directories(${TARGET_NAME}_common_obj SYSTEM PRIVATE
# Create object library
-add_library(${TARGET_NAME}_obj OBJECT
+add_library(${TARGET_NAME}_obj OBJECT EXCLUDE_FROM_ALL
${LIBRARY_SRC}
${LIBRARY_HEADERS}
${PUBLIC_HEADERS})
@@ -183,7 +183,7 @@ ie_register_plugins(MAIN_TARGET ${TARGET_NAME}
# Static library used for unit tests which are always built
-add_library(${TARGET_NAME}_s STATIC
+add_library(${TARGET_NAME}_s STATIC EXCLUDE_FROM_ALL
$<TARGET_OBJECTS:${TARGET_NAME}_obj>
$<TARGET_OBJECTS:${TARGET_NAME}_common_obj>
$<TARGET_OBJECTS:${TARGET_NAME}_legacy_obj>
diff --git a/inference-engine/src/legacy_api/CMakeLists.txt b/inference-engine/src/legacy_api/CMakeLists.txt
index ed87a073..b30e6671 100644
--- a/inference-engine/src/legacy_api/CMakeLists.txt
+++ b/inference-engine/src/legacy_api/CMakeLists.txt
@@ -26,7 +26,7 @@ endif()
# Create object library
-add_library(${TARGET_NAME}_obj OBJECT
+add_library(${TARGET_NAME}_obj OBJECT EXCLUDE_FROM_ALL
${LIBRARY_SRC}
${PUBLIC_HEADERS})
diff --git a/inference-engine/src/mkldnn_plugin/CMakeLists.txt b/inference-engine/src/mkldnn_plugin/CMakeLists.txt
index 166818cd..6c1e8e36 100644
--- a/inference-engine/src/mkldnn_plugin/CMakeLists.txt
+++ b/inference-engine/src/mkldnn_plugin/CMakeLists.txt
@@ -193,7 +193,7 @@ cross_compiled_file(${TARGET_NAME}
# add test object library
-add_library(${TARGET_NAME}_obj OBJECT ${SOURCES} ${HEADERS})
+add_library(${TARGET_NAME}_obj OBJECT EXCLUDE_FROM_ALL ${SOURCES} ${HEADERS})
target_include_directories(${TARGET_NAME}_obj PRIVATE $<TARGET_PROPERTY:inference_engine_preproc_s,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:inference_engine_lp_transformations,INTERFACE_INCLUDE_DIRECTORIES>
diff --git a/inference-engine/src/preprocessing/CMakeLists.txt b/inference-engine/src/preprocessing/CMakeLists.txt
index f4fed72a..9cedd6b5 100644
--- a/inference-engine/src/preprocessing/CMakeLists.txt
+++ b/inference-engine/src/preprocessing/CMakeLists.txt
@@ -124,7 +124,7 @@ endif()
# Create object library
-add_library(${TARGET_NAME}_obj OBJECT
+add_library(${TARGET_NAME}_obj OBJECT EXCLUDE_FROM_ALL
${LIBRARY_SRC}
${LIBRARY_HEADERS})
@@ -175,7 +175,7 @@ add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME}
# Static library used for unit tests which are always built
-add_library(${TARGET_NAME}_s STATIC
+add_library(${TARGET_NAME}_s STATIC EXCLUDE_FROM_ALL
$<TARGET_OBJECTS:${TARGET_NAME}_obj>)
set_ie_threading_interface_for(${TARGET_NAME}_s)
diff --git a/inference-engine/src/vpu/common/CMakeLists.txt b/inference-engine/src/vpu/common/CMakeLists.txt
index b291d5b4..74ab8287 100644
--- a/inference-engine/src/vpu/common/CMakeLists.txt
+++ b/inference-engine/src/vpu/common/CMakeLists.txt
@@ -57,7 +57,7 @@ add_common_target("vpu_common_lib" FALSE)
# Unit tests support for graph transformer
if(WIN32)
- add_common_target("vpu_common_lib_test_static" TRUE)
+ #add_common_target("vpu_common_lib_test_static" TRUE)
else()
add_library("vpu_common_lib_test_static" ALIAS "vpu_common_lib")
endif()
diff --git a/inference-engine/src/vpu/graph_transformer/CMakeLists.txt b/inference-engine/src/vpu/graph_transformer/CMakeLists.txt
index a4543745..807b8e36 100644
--- a/inference-engine/src/vpu/graph_transformer/CMakeLists.txt
+++ b/inference-engine/src/vpu/graph_transformer/CMakeLists.txt
@@ -65,7 +65,7 @@ add_graph_transformer_target("vpu_graph_transformer" FALSE)
# Unit tests support for graph transformer
if(WIN32)
- add_graph_transformer_target("vpu_graph_transformer_test_static" TRUE)
+ #add_graph_transformer_target("vpu_graph_transformer_test_static" TRUE)
else()
add_library("vpu_graph_transformer_test_static" ALIAS "vpu_graph_transformer")
endif()
diff --git a/inference-engine/thirdparty/CMakeLists.txt b/inference-engine/thirdparty/CMakeLists.txt
index a2550bfa..10ce316f 100644
--- a/inference-engine/thirdparty/CMakeLists.txt
+++ b/inference-engine/thirdparty/CMakeLists.txt
@@ -56,13 +56,13 @@ function(build_with_lto)
endfunction()
ie_build_pugixml()
- add_subdirectory(stb_lib)
+ #add_subdirectory(stb_lib)
add_subdirectory(ade)
add_subdirectory(fluid/modules/gapi)
target_include_directories(pugixml INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/pugixml/src>")
- set_target_properties(pugixml ade fluid stb_image
+ set_target_properties(pugixml ade fluid
PROPERTIES FOLDER thirdparty)
# developer package
diff --git a/inference-engine/thirdparty/pugixml/CMakeLists.txt b/inference-engine/thirdparty/pugixml/CMakeLists.txt
index 8bcb2801..380fb468 100644
--- a/inference-engine/thirdparty/pugixml/CMakeLists.txt
+++ b/inference-engine/thirdparty/pugixml/CMakeLists.txt
@@ -41,7 +41,7 @@ if(BUILD_SHARED_LIBS)
else()
add_library(pugixml STATIC ${SOURCES})
if (MSVC)
- add_library(pugixml_mt STATIC ${SOURCES})
+ #add_library(pugixml_mt STATIC ${SOURCES})
#if (WIN32)
# set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
@@ -0,0 +1,3 @@
applyPatch('20201005-dldt-disable-unused-targets.patch')
applyPatch('20200413-dldt-pdb.patch')
applyPatch('20200604-dldt-disable-multidevice.patch')
@@ -0,0 +1,56 @@
sysroot_bin_dir = prepare_dir(self.sysrootdir / 'bin')
copytree(self.build_dir / 'install', self.sysrootdir / 'ngraph')
#rm_one(self.sysrootdir / 'ngraph' / 'lib' / 'ngraph.dll')
build_config = 'Release' if not self.config.build_debug else 'Debug'
build_bin_dir = self.build_dir / 'bin' / 'intel64' / build_config
def copy_bin(name):
global build_bin_dir, sysroot_bin_dir
copytree(build_bin_dir / name, sysroot_bin_dir / name)
dll_suffix = 'd' if self.config.build_debug else ''
def copy_dll(name):
global copy_bin, dll_suffix
copy_bin(name + dll_suffix + '.dll')
copy_bin(name + dll_suffix + '.pdb')
copy_bin('cache.json')
copy_dll('clDNNPlugin')
copy_dll('HeteroPlugin')
copy_dll('inference_engine')
copy_dll('inference_engine_ir_reader')
copy_dll('inference_engine_legacy')
copy_dll('inference_engine_transformations') # runtime
copy_dll('inference_engine_lp_transformations') # runtime
copy_dll('MKLDNNPlugin') # runtime
copy_dll('myriadPlugin') # runtime
#copy_dll('MultiDevicePlugin') # runtime, not used
copy_dll('ngraph')
copy_bin('plugins.xml')
copytree(self.build_dir / 'bin' / 'intel64' / 'pcie-ma248x.elf', sysroot_bin_dir / 'pcie-ma248x.elf')
copytree(self.build_dir / 'bin' / 'intel64' / 'usb-ma2x8x.mvcmd', sysroot_bin_dir / 'usb-ma2x8x.mvcmd')
copytree(self.build_dir / 'bin' / 'intel64' / 'usb-ma2450.mvcmd', sysroot_bin_dir / 'usb-ma2450.mvcmd')
copytree(self.srcdir / 'inference-engine' / 'temp' / 'tbb' / 'bin', sysroot_bin_dir)
copytree(self.srcdir / 'inference-engine' / 'temp' / 'tbb', self.sysrootdir / 'tbb')
sysroot_ie_dir = prepare_dir(self.sysrootdir / 'deployment_tools' / 'inference_engine')
sysroot_ie_lib_dir = prepare_dir(sysroot_ie_dir / 'lib' / 'intel64')
copytree(self.srcdir / 'inference-engine' / 'include', sysroot_ie_dir / 'include')
if not self.config.build_debug:
copytree(self.build_dir / 'install' / 'lib' / 'ngraph.lib', sysroot_ie_lib_dir / 'ngraph.lib')
copytree(build_bin_dir / 'inference_engine.lib', sysroot_ie_lib_dir / 'inference_engine.lib')
copytree(build_bin_dir / 'inference_engine_ir_reader.lib', sysroot_ie_lib_dir / 'inference_engine_ir_reader.lib')
copytree(build_bin_dir / 'inference_engine_legacy.lib', sysroot_ie_lib_dir / 'inference_engine_legacy.lib')
else:
copytree(self.build_dir / 'install' / 'lib' / 'ngraphd.lib', sysroot_ie_lib_dir / 'ngraphd.lib')
copytree(build_bin_dir / 'inference_engined.lib', sysroot_ie_lib_dir / 'inference_engined.lib')
copytree(build_bin_dir / 'inference_engine_ir_readerd.lib', sysroot_ie_lib_dir / 'inference_engine_ir_readerd.lib')
copytree(build_bin_dir / 'inference_engine_legacyd.lib', sysroot_ie_lib_dir / 'inference_engine_legacyd.lib')
sysroot_license_dir = prepare_dir(self.sysrootdir / 'etc' / 'licenses')
copytree(self.srcdir / 'LICENSE', sysroot_license_dir / 'dldt-LICENSE')
copytree(self.srcdir / 'ngraph/LICENSE', sysroot_license_dir / 'ngraph-LICENSE')
copytree(self.sysrootdir / 'tbb/LICENSE', sysroot_license_dir / 'tbb-LICENSE')
+2 -2
View File
@@ -443,8 +443,8 @@ class Builder:
def main():
dldt_src_url = 'https://github.com/openvinotoolkit/openvino'
dldt_src_commit = '2020.4'
dldt_release = '2020040000'
dldt_src_commit = '2021.1'
dldt_release = '2021010000'
build_cache_dir_default = os.environ.get('BUILD_CACHE_DIR', '.build_cache')
build_subst_drive = os.environ.get('BUILD_SUBST_DRIVE', None)
+6 -2
View File
@@ -15,8 +15,12 @@ function(ocv_define_sample out_target source sub)
if(WIN32 AND MSVC AND NOT BUILD_SHARED_LIBS)
set_target_properties(${the_target} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /DEBUG")
endif()
if(WIN32)
install(TARGETS ${the_target} RUNTIME DESTINATION "samples/${sub}" COMPONENT samples)
# Should be usable in stand-alone build scenario
if((NOT DEFINED INSTALL_BIN_EXAMPLES AND WIN32) OR INSTALL_BIN_EXAMPLES)
if(NOT DEFINED OPENCV_SAMPLES_BIN_INSTALL_PATH)
set(OPENCV_SAMPLES_BIN_INSTALL_PATH "samples")
endif()
install(TARGETS ${the_target} RUNTIME DESTINATION "${OPENCV_SAMPLES_BIN_INSTALL_PATH}/${sub}" COMPONENT samples)
endif()
# Add single target to build all samples in the group: 'make opencv_samples_cpp'
set(parent_target opencv_samples_${sub})