Skip to content

Commit d643a90

Browse files
committed
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
2 parents b450dd7 + 04a9ff8 commit d643a90

File tree

15 files changed

+651
-370
lines changed

15 files changed

+651
-370
lines changed

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,12 @@ if(COMMAND ocv_pylint_finalize)
999999
ocv_pylint_add_directory_recurse(${CMAKE_CURRENT_LIST_DIR}/samples/python/tutorial_code)
10001000
ocv_pylint_finalize()
10011001
endif()
1002+
if(TARGET check_pylint)
1003+
message(STATUS "Registered 'check_pylint' target: using ${PYLINT_EXECUTABLE} (ver: ${PYLINT_VERSION}), checks: ${PYLINT_TOTAL_TARGETS}")
1004+
endif()
1005+
if(TARGET check_flake8)
1006+
message(STATUS "Registered 'check_flake8' target: using ${FLAKE8_EXECUTABLE} (ver: ${FLAKE8_VERSION})")
1007+
endif()
10021008

10031009
if(OPENCV_GENERATE_SETUPVARS)
10041010
include(cmake/OpenCVGenSetupVars.cmake)
@@ -1628,12 +1634,6 @@ endif()
16281634

16291635
status("")
16301636
status(" Python (for build):" PYTHON_DEFAULT_AVAILABLE THEN "${PYTHON_DEFAULT_EXECUTABLE}" ELSE NO)
1631-
if(PYLINT_FOUND AND PYLINT_EXECUTABLE)
1632-
status(" Pylint:" PYLINT_FOUND THEN "${PYLINT_EXECUTABLE} (ver: ${PYLINT_VERSION}, checks: ${PYLINT_TOTAL_TARGETS})" ELSE NO)
1633-
endif()
1634-
if(FLAKE8_FOUND AND FLAKE8_EXECUTABLE)
1635-
status(" Flake8:" FLAKE8_FOUND THEN "${FLAKE8_EXECUTABLE} (ver: ${FLAKE8_VERSION})" ELSE NO)
1636-
endif()
16371637

16381638
# ========================== java ==========================
16391639
if(BUILD_JAVA)

cmake/FindPylint.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if(PYLINT_EXECUTABLE AND NOT DEFINED PYLINT_VERSION)
1616
execute_process(COMMAND ${PYLINT_EXECUTABLE} --version RESULT_VARIABLE _result OUTPUT_VARIABLE PYLINT_VERSION_RAW)
1717
if(NOT _result EQUAL 0)
1818
ocv_clear_vars(PYLINT_EXECUTABLE PYLINT_VERSION)
19-
elseif(PYLINT_VERSION_RAW MATCHES "pylint([^,]*) ([0-9\\.]+[0-9])")
19+
elseif(PYLINT_VERSION_RAW MATCHES "pylint([^,\n]*) ([0-9\\.]+[0-9])")
2020
set(PYLINT_VERSION "${CMAKE_MATCH_2}")
2121
else()
2222
set(PYLINT_VERSION "unknown")

cmake/OpenCVPylint.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ function(ocv_pylint_finalize)
122122

123123
list(LENGTH PYLINT_TARGET_ID __total)
124124
set(PYLINT_TOTAL_TARGETS "${__total}" CACHE INTERNAL "")
125-
message(STATUS "Pylint: registered ${__total} targets. Build 'check_pylint' target to run checks (\"cmake --build . --target check_pylint\" or \"make check_pylint\")")
126125
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/pylint.cmake.in" "${CMAKE_BINARY_DIR}/pylint.cmake" @ONLY)
127126

128127
add_custom_target(check_pylint

modules/calib3d/src/polynom_solver.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ int solve_deg3(double a, double b, double c, double d,
6565
return 3;
6666
}
6767
else {
68-
x0 = pow(2 * R, 1 / 3.0) - b_a_3;
68+
double cube_root = cv::cubeRoot(2 * R);
69+
x0 = cube_root - b_a_3;
6970
return 1;
7071
}
7172
}
@@ -82,8 +83,15 @@ int solve_deg3(double a, double b, double c, double d,
8283
}
8384

8485
// D > 0, only one real root
85-
double AD = pow(fabs(R) + sqrt(D), 1.0 / 3.0) * (R > 0 ? 1 : (R < 0 ? -1 : 0));
86-
double BD = (AD == 0) ? 0 : -Q / AD;
86+
double AD = 0.;
87+
double BD = 0.;
88+
double R_abs = fabs(R);
89+
if (R_abs > DBL_EPSILON)
90+
{
91+
AD = cv::cubeRoot(R_abs + sqrt(D));
92+
AD = (R >= 0) ? AD : -AD;
93+
BD = -Q / AD;
94+
}
8795

8896
// Calculate the only real root
8997
x0 = AD + BD - b_a_3;

modules/core/include/opencv2/core/base.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,16 @@ _AccTp normInf(const _Tp* a, const _Tp* b, int n)
538538
*/
539539
CV_EXPORTS_W float cubeRoot(float val);
540540

541+
/** @overload
542+
543+
cubeRoot with argument of `double` type calls `std::cbrt(double)`
544+
*/
545+
static inline
546+
double cubeRoot(double val)
547+
{
548+
return std::cbrt(val);
549+
}
550+
541551
/** @brief Calculates the angle of a 2D vector in degrees.
542552
543553
The function fastAtan2 calculates the full-range angle of an input 2D vector. The angle is measured

0 commit comments

Comments
 (0)