1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2025-04-28 22:13:51 +03:00
243 changed files with 12965 additions and 3216 deletions
@@ -2565,7 +2565,17 @@ inline v_int64 v_dotprod_expand_fast(const v_int16& a, const v_int16& b, const v
// 32 >> 64f
#if CV_SIMD_SCALABLE_64F
inline v_float64 v_dotprod_expand_fast(const v_int32& a, const v_int32& b)
{ return v_cvt_f64(v_dotprod_fast(a, b)); }
{
vfloat64m1_t zero = __riscv_vfmv_v_f_f64m1(0, VTraits<vuint64m1_t>::vlanes());
auto prod_i64 = __riscv_vwmul(a, b, VTraits<v_int32>::vlanes());
// Convert to f64 before reduction to avoid overflow: #27003
auto prod_f64 = __riscv_vfcvt_f(prod_i64, VTraits<v_int32>::vlanes());
return __riscv_vset( // Needs v_float64 (vfloat64m2_t) here.
v_setall_f64(0.0f), // zero_f64m2
0,
__riscv_vfredusum_tu(zero, prod_f64, zero, VTraits<v_int32>::vlanes())
);
}
inline v_float64 v_dotprod_expand_fast(const v_int32& a, const v_int32& b, const v_float64& c)
{ return v_add(v_dotprod_expand_fast(a, b) , c); }
#endif
+10
View File
@@ -494,6 +494,7 @@ public:
void clear() const;
void setTo(const _InputArray& value, const _InputArray & mask = _InputArray()) const;
void setZero() const;
Mat reinterpret( int type ) const;
void assign(const UMat& u) const;
void assign(const Mat& m) const;
@@ -1540,6 +1541,15 @@ public:
*/
Mat reshape(int cn, std::initializer_list<int> newshape) const;
/** @brief Reset the type of matrix.
The methods reset the data type of matrix. If the new type and the old type of the matrix
have the same element size, the current buffer can be reused. The method needs to consider whether the
current mat is a submatrix or has any references.
@param type New data type.
*/
Mat reinterpret( int type ) const;
/** @brief Transposes a matrix.
The method performs matrix transposition by means of matrix expressions. It does not perform the
@@ -206,7 +206,6 @@ T* allocSingletonNew() { return new(allocSingletonNewBuffer(sizeof(T))) T(); }
// Temporary disabled named IPP region. Performance
#define IPP_DISABLE_PERF_COPYMAKE 1 // performance variations
#define IPP_DISABLE_PERF_LUT 1 // there are no performance benefits (PR #2653)
#define IPP_DISABLE_PERF_TRUE_DIST_MT 1 // cv::distanceTransform OpenCV MT performance is better
#define IPP_DISABLE_PERF_CANNY_MT 1 // cv::Canny OpenCV MT performance is better
@@ -43,6 +43,44 @@ CV_EXPORTS void writeLogMessage(LogLevel logLevel, const char* message);
/** Write log message */
CV_EXPORTS void writeLogMessageEx(LogLevel logLevel, const char* tag, const char* file, int line, const char* func, const char* message);
/**
* @brief Function pointer type for writeLogMessage. Used by replaceWriteLogMessage.
*/
typedef void (*WriteLogMessageFuncType)(LogLevel, const char*);
/**
* @brief Function pointer type for writeLogMessageEx. Used by replaceWriteLogMessageEx.
*/
typedef void (*WriteLogMessageExFuncType)(LogLevel, const char*, const char*, int, const char*, const char*);
/**
* @brief Replaces the OpenCV writeLogMessage function with a user-defined function.
* @note The user-defined function must have the same signature as writeLogMessage.
* @note The user-defined function must accept arguments that can be potentially null.
* @note The user-defined function must be thread-safe, as OpenCV logging may be called
* from multiple threads.
* @note The user-defined function must not perform any action that can trigger
* deadlocks or infinite loop. Many OpenCV functions are not re-entrant.
* @note Once replaced, logs will not go through the OpenCV writeLogMessage function.
* @note To restore, call this function with a nullptr.
*/
CV_EXPORTS void replaceWriteLogMessage(WriteLogMessageFuncType f);
/**
* @brief Replaces the OpenCV writeLogMessageEx function with a user-defined function.
* @note The user-defined function must have the same signature as writeLogMessage.
* @note The user-defined function must accept arguments that can be potentially null.
* @note The user-defined function must be thread-safe, as OpenCV logging may be called
* from multiple threads.
* @note The user-defined function must not perform any action that can trigger
* deadlocks or infinite loop. Many OpenCV functions are not re-entrant.
* @note Once replaced, logs will not go through any of the OpenCV logging functions
* such as writeLogMessage or writeLogMessageEx, until their respective restore
* methods are called.
* @note To restore, call this function with a nullptr.
*/
CV_EXPORTS void replaceWriteLogMessageEx(WriteLogMessageExFuncType f);
} // namespace
struct LogTagAuto