mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Merge branch 4.x
This commit is contained in:
@@ -156,7 +156,12 @@ void check_failed_MatType(const int v, const CheckContext& ctx)
|
||||
}
|
||||
void check_failed_MatChannels(const int v, const CheckContext& ctx)
|
||||
{
|
||||
check_failed_auto_<int>(v, ctx);
|
||||
std::stringstream ss;
|
||||
ss << ctx.message << ":" << std::endl
|
||||
<< " '" << ctx.p2_str << "'" << std::endl
|
||||
<< "where" << std::endl
|
||||
<< " '" << ctx.p1_str << "' is " << v;
|
||||
cv::error(cv::Error::BadNumChannels, ss.str(), ctx.func, ctx.file, ctx.line);
|
||||
}
|
||||
void check_failed_true(const bool v, const CheckContext& ctx)
|
||||
{
|
||||
|
||||
@@ -791,7 +791,7 @@ struct iPow_SIMD
|
||||
#if (CV_SIMD || CV_SIMD_SCALABLE)
|
||||
|
||||
template <>
|
||||
struct iPow_SIMD<uchar, int>
|
||||
struct iPow_SIMD<uchar, unsigned>
|
||||
{
|
||||
int operator() ( const uchar * src, uchar * dst, int len, int power )
|
||||
{
|
||||
@@ -871,7 +871,7 @@ struct iPow_SIMD<schar, int>
|
||||
};
|
||||
|
||||
template <>
|
||||
struct iPow_SIMD<ushort, int>
|
||||
struct iPow_SIMD<ushort, unsigned>
|
||||
{
|
||||
int operator() ( const ushort * src, ushort * dst, int len, int power)
|
||||
{
|
||||
@@ -1203,16 +1203,6 @@ static bool ocl_pow(InputArray _src, double power, OutputArray _dst,
|
||||
_dst.createSameSize(_src, type);
|
||||
if (is_ipower)
|
||||
{
|
||||
if (ipower == 0)
|
||||
{
|
||||
_dst.setTo(Scalar::all(1));
|
||||
return true;
|
||||
}
|
||||
if (ipower == 1)
|
||||
{
|
||||
_src.copyTo(_dst);
|
||||
return true;
|
||||
}
|
||||
if( ipower < 0 )
|
||||
{
|
||||
if( depth == CV_32F || depth == CV_64F )
|
||||
@@ -1271,11 +1261,7 @@ void pow( InputArray _src, double power, OutputArray _dst )
|
||||
bool useOpenCL = _dst.isUMat() && _src.dims() <= 2;
|
||||
#endif
|
||||
|
||||
if( is_ipower
|
||||
#ifdef HAVE_OPENCL
|
||||
&& !(useOpenCL && ocl::Device::getDefault().isIntel() && depth != CV_64F)
|
||||
#endif
|
||||
)
|
||||
if (is_ipower)
|
||||
{
|
||||
switch( ipower )
|
||||
{
|
||||
@@ -1291,8 +1277,6 @@ void pow( InputArray _src, double power, OutputArray _dst )
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
CV_Assert( depth == CV_32F || depth == CV_64F );
|
||||
|
||||
CV_OCL_RUN(useOpenCL, ocl_pow(_src, power, _dst, is_ipower, ipower))
|
||||
|
||||
|
||||
@@ -72,6 +72,10 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__QNX__)
|
||||
#include <sys/syspage.h>
|
||||
#endif
|
||||
|
||||
#ifndef OPENCV_DISABLE_THREAD_SUPPORT
|
||||
#include <thread>
|
||||
#endif
|
||||
@@ -1011,7 +1015,9 @@ int getNumberOfCPUs_()
|
||||
|
||||
static unsigned cpu_count_sysconf = (unsigned)sysconf( _SC_NPROCESSORS_ONLN );
|
||||
ncpus = minNonZero(ncpus, cpu_count_sysconf);
|
||||
|
||||
#elif defined (__QNX__)
|
||||
static unsigned cpu_count_sysconf = _syspage_ptr->num_cpu;
|
||||
ncpus = minNonZero(ncpus, cpu_count_sysconf);
|
||||
#endif
|
||||
|
||||
return ncpus != 0 ? ncpus : 1;
|
||||
|
||||
@@ -46,6 +46,15 @@
|
||||
#include <iostream>
|
||||
#include <ostream>
|
||||
|
||||
#ifdef __QNX__
|
||||
#include <unistd.h>
|
||||
#include <sys/neutrino.h>
|
||||
#include <sys/syspage.h>
|
||||
#ifdef __aarch64__
|
||||
#include <aarch64/syspage.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <opencv2/core/utils/configuration.private.hpp>
|
||||
#include <opencv2/core/utils/trace.private.hpp>
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <errno.h>
|
||||
#include <io.h>
|
||||
#include <stdio.h>
|
||||
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __GNU__ || defined __EMSCRIPTEN__
|
||||
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __GNU__ || defined __EMSCRIPTEN__ || defined __QNX__
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
@@ -194,7 +194,7 @@ cv::String getcwd()
|
||||
sz = GetCurrentDirectoryA((DWORD)buf.size(), buf.data());
|
||||
return cv::String(buf.data(), (size_t)sz);
|
||||
#endif
|
||||
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __EMSCRIPTEN__
|
||||
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __EMSCRIPTEN__ || defined __QNX__
|
||||
for(;;)
|
||||
{
|
||||
char* p = ::getcwd(buf.data(), buf.size());
|
||||
@@ -228,7 +228,7 @@ bool createDirectory(const cv::String& path)
|
||||
#else
|
||||
int result = _mkdir(path.c_str());
|
||||
#endif
|
||||
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __EMSCRIPTEN__
|
||||
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __EMSCRIPTEN__ || defined __QNX__
|
||||
int result = mkdir(path.c_str(), 0777);
|
||||
#else
|
||||
int result = -1;
|
||||
@@ -343,7 +343,7 @@ private:
|
||||
Impl& operator=(const Impl&); // disabled
|
||||
};
|
||||
|
||||
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __GNU__ || defined __EMSCRIPTEN__
|
||||
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __GNU__ || defined __EMSCRIPTEN__ || defined __QNX__
|
||||
|
||||
struct FileLock::Impl
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user