mirror of
https://github.com/nihui/opencv-mobile.git
synced 2025-10-12 20:11:00 +08:00
update opencv 4.10.0 (#121)
This commit is contained in:
652
patches/opencv-4.10.0-no-rtti.patch
Normal file
652
patches/opencv-4.10.0-no-rtti.patch
Normal file
@@ -0,0 +1,652 @@
|
||||
diff -Nuarp opencv-4.10.0.orig/modules/core/include/opencv2/core/bindings_utils.hpp opencv-4.10.0/modules/core/include/opencv2/core/bindings_utils.hpp
|
||||
--- opencv-4.10.0.orig/modules/core/include/opencv2/core/bindings_utils.hpp 2024-06-02 04:41:06.000000000 +0800
|
||||
+++ opencv-4.10.0/modules/core/include/opencv2/core/bindings_utils.hpp 2024-06-04 21:07:18.095333593 +0800
|
||||
@@ -202,12 +202,6 @@ void generateVectorOfMat(size_t len, int
|
||||
}
|
||||
|
||||
CV_WRAP static inline
|
||||
-void testRaiseGeneralException()
|
||||
-{
|
||||
- throw std::runtime_error("exception text");
|
||||
-}
|
||||
-
|
||||
-CV_WRAP static inline
|
||||
AsyncArray testAsyncArray(InputArray argument)
|
||||
{
|
||||
AsyncPromise p;
|
||||
@@ -219,14 +213,6 @@ CV_WRAP static inline
|
||||
AsyncArray testAsyncException()
|
||||
{
|
||||
AsyncPromise p;
|
||||
- try
|
||||
- {
|
||||
- CV_Error(Error::StsOk, "Test: Generated async error");
|
||||
- }
|
||||
- catch (const cv::Exception& e)
|
||||
- {
|
||||
- p.setException(e);
|
||||
- }
|
||||
return p.getArrayResult();
|
||||
}
|
||||
|
||||
diff -Nuarp opencv-4.10.0.orig/modules/core/src/async.cpp opencv-4.10.0/modules/core/src/async.cpp
|
||||
--- opencv-4.10.0.orig/modules/core/src/async.cpp 2024-06-02 04:41:06.000000000 +0800
|
||||
+++ opencv-4.10.0/modules/core/src/async.cpp 2024-06-04 21:07:18.096333587 +0800
|
||||
@@ -108,7 +108,6 @@ struct AsyncArray::Impl
|
||||
if (has_exception)
|
||||
{
|
||||
result_is_fetched = true;
|
||||
- throw cv_exception;
|
||||
}
|
||||
CV_Error(Error::StsInternal, "AsyncArray: invalid state of 'has_result = true'");
|
||||
}
|
||||
diff -Nuarp opencv-4.10.0.orig/modules/core/src/bindings_utils.cpp opencv-4.10.0/modules/core/src/bindings_utils.cpp
|
||||
--- opencv-4.10.0.orig/modules/core/src/bindings_utils.cpp 2024-06-02 04:41:06.000000000 +0800
|
||||
+++ opencv-4.10.0/modules/core/src/bindings_utils.cpp 2024-06-04 21:07:18.096333587 +0800
|
||||
@@ -17,7 +17,7 @@ String dumpInputArray(InputArray argumen
|
||||
return "InputArray: noArray()";
|
||||
std::ostringstream ss;
|
||||
ss << "InputArray:";
|
||||
- try {
|
||||
+ {
|
||||
do {
|
||||
ss << (argument.empty() ? " empty()=true" : " empty()=false");
|
||||
ss << cv::format(" kind=0x%08llx", (long long int)argument.kind());
|
||||
@@ -51,10 +51,6 @@ String dumpInputArray(InputArray argumen
|
||||
ss << " type(-1)=" << cv::typeToString(argument.type(-1));
|
||||
} while (0);
|
||||
}
|
||||
- catch (...)
|
||||
- {
|
||||
- ss << " ERROR: exception occurred, dump is non-complete"; // need to properly support different kinds
|
||||
- }
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
@@ -64,7 +60,7 @@ CV_EXPORTS_W String dumpInputArrayOfArra
|
||||
return "InputArrayOfArrays: noArray()";
|
||||
std::ostringstream ss;
|
||||
ss << "InputArrayOfArrays:";
|
||||
- try {
|
||||
+ {
|
||||
do {
|
||||
ss << (argument.empty() ? " empty()=true" : " empty()=false");
|
||||
ss << cv::format(" kind=0x%08llx", (long long int)argument.kind());
|
||||
@@ -104,10 +100,6 @@ CV_EXPORTS_W String dumpInputArrayOfArra
|
||||
}
|
||||
} while (0);
|
||||
}
|
||||
- catch (...)
|
||||
- {
|
||||
- ss << " ERROR: exception occurred, dump is non-complete"; // need to properly support different kinds
|
||||
- }
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
@@ -117,7 +109,7 @@ CV_EXPORTS_W String dumpInputOutputArray
|
||||
return "InputOutputArray: noArray()";
|
||||
std::ostringstream ss;
|
||||
ss << "InputOutputArray:";
|
||||
- try {
|
||||
+ {
|
||||
do {
|
||||
ss << (argument.empty() ? " empty()=true" : " empty()=false");
|
||||
ss << cv::format(" kind=0x%08llx", (long long int)argument.kind());
|
||||
@@ -151,10 +143,6 @@ CV_EXPORTS_W String dumpInputOutputArray
|
||||
ss << " type(-1)=" << cv::typeToString(argument.type(-1));
|
||||
} while (0);
|
||||
}
|
||||
- catch (...)
|
||||
- {
|
||||
- ss << " ERROR: exception occurred, dump is non-complete"; // need to properly support different kinds
|
||||
- }
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
@@ -164,7 +152,7 @@ CV_EXPORTS_W String dumpInputOutputArray
|
||||
return "InputOutputArrayOfArrays: noArray()";
|
||||
std::ostringstream ss;
|
||||
ss << "InputOutputArrayOfArrays:";
|
||||
- try {
|
||||
+ {
|
||||
do {
|
||||
ss << (argument.empty() ? " empty()=true" : " empty()=false");
|
||||
ss << cv::format(" kind=0x%08llx", (long long int)argument.kind());
|
||||
@@ -204,10 +192,6 @@ CV_EXPORTS_W String dumpInputOutputArray
|
||||
}
|
||||
} while (0);
|
||||
}
|
||||
- catch (...)
|
||||
- {
|
||||
- ss << " ERROR: exception occurred, dump is non-complete"; // need to properly support different kinds
|
||||
- }
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
diff -Nuarp opencv-4.10.0.orig/modules/core/src/command_line_parser.cpp opencv-4.10.0/modules/core/src/command_line_parser.cpp
|
||||
--- opencv-4.10.0.orig/modules/core/src/command_line_parser.cpp 2024-06-02 04:41:06.000000000 +0800
|
||||
+++ opencv-4.10.0/modules/core/src/command_line_parser.cpp 2024-06-04 21:08:17.261040642 +0800
|
||||
@@ -119,7 +119,6 @@ static void from_str(const String& str,
|
||||
|
||||
void CommandLineParser::getByName(const String& name, bool space_delete, Param type, void* dst) const
|
||||
{
|
||||
- try
|
||||
{
|
||||
for (size_t i = 0; i < impl->data.size(); i++)
|
||||
{
|
||||
@@ -144,12 +143,6 @@ void CommandLineParser::getByName(const
|
||||
}
|
||||
}
|
||||
}
|
||||
- catch (const Exception& e)
|
||||
- {
|
||||
- impl->error = true;
|
||||
- impl->error_message = impl->error_message + "Parameter '"+ name + "': " + e.err + "\n";
|
||||
- return;
|
||||
- }
|
||||
|
||||
CV_Error_(Error::StsBadArg, ("undeclared key '%s' requested", name.c_str()));
|
||||
}
|
||||
@@ -157,7 +150,6 @@ void CommandLineParser::getByName(const
|
||||
|
||||
void CommandLineParser::getByIndex(int index, bool space_delete, Param type, void* dst) const
|
||||
{
|
||||
- try
|
||||
{
|
||||
for (size_t i = 0; i < impl->data.size(); i++)
|
||||
{
|
||||
@@ -177,12 +169,6 @@ void CommandLineParser::getByIndex(int i
|
||||
}
|
||||
}
|
||||
}
|
||||
- catch (const Exception& e)
|
||||
- {
|
||||
- impl->error = true;
|
||||
- impl->error_message = impl->error_message + format("Parameter #%d: ", index) + e.err + "\n";
|
||||
- return;
|
||||
- }
|
||||
|
||||
CV_Error_(Error::StsBadArg, ("undeclared position %d requested", index));
|
||||
}
|
||||
@@ -464,16 +450,7 @@ std::vector<String> CommandLineParser::I
|
||||
{
|
||||
if (begin == true)
|
||||
{
|
||||
- throw cv::Exception(cv::Error::StsParseError,
|
||||
- String("error in split_range_string(")
|
||||
- + str
|
||||
- + String(", ")
|
||||
- + String(1, fs)
|
||||
- + String(", ")
|
||||
- + String(1, ss)
|
||||
- + String(")"),
|
||||
- "", __FILE__, __LINE__
|
||||
- );
|
||||
+ return vec;
|
||||
}
|
||||
begin = true;
|
||||
word = "";
|
||||
@@ -484,16 +461,7 @@ std::vector<String> CommandLineParser::I
|
||||
{
|
||||
if (begin == false)
|
||||
{
|
||||
- throw cv::Exception(cv::Error::StsParseError,
|
||||
- String("error in split_range_string(")
|
||||
- + str
|
||||
- + String(", ")
|
||||
- + String(1, fs)
|
||||
- + String(", ")
|
||||
- + String(1, ss)
|
||||
- + String(")"),
|
||||
- "", __FILE__, __LINE__
|
||||
- );
|
||||
+ return vec;
|
||||
}
|
||||
begin = false;
|
||||
vec.push_back(word);
|
||||
@@ -508,16 +476,7 @@ std::vector<String> CommandLineParser::I
|
||||
|
||||
if (begin == true)
|
||||
{
|
||||
- throw cv::Exception(cv::Error::StsParseError,
|
||||
- String("error in split_range_string(")
|
||||
- + str
|
||||
- + String(", ")
|
||||
- + String(1, fs)
|
||||
- + String(", ")
|
||||
- + String(1, ss)
|
||||
- + String(")"),
|
||||
- "", __FILE__, __LINE__
|
||||
- );
|
||||
+ return vec;
|
||||
}
|
||||
|
||||
return vec;
|
||||
diff -Nuarp opencv-4.10.0.orig/modules/core/src/glob.cpp opencv-4.10.0/modules/core/src/glob.cpp
|
||||
--- opencv-4.10.0.orig/modules/core/src/glob.cpp 2024-06-02 04:41:06.000000000 +0800
|
||||
+++ opencv-4.10.0/modules/core/src/glob.cpp 2024-06-04 21:07:18.096333587 +0800
|
||||
@@ -243,7 +243,6 @@ static void glob_rec(const cv::String& d
|
||||
if ((dir = opendir (directory.c_str())) != 0)
|
||||
{
|
||||
/* find all the files and directories within directory */
|
||||
- try
|
||||
{
|
||||
struct dirent *ent;
|
||||
while ((ent = readdir (dir)) != 0)
|
||||
@@ -267,11 +266,6 @@ static void glob_rec(const cv::String& d
|
||||
result.push_back(entry);
|
||||
}
|
||||
}
|
||||
- catch (...)
|
||||
- {
|
||||
- closedir(dir);
|
||||
- throw;
|
||||
- }
|
||||
closedir(dir);
|
||||
}
|
||||
else
|
||||
diff -Nuarp opencv-4.10.0.orig/modules/core/src/matrix.cpp opencv-4.10.0/modules/core/src/matrix.cpp
|
||||
--- opencv-4.10.0.orig/modules/core/src/matrix.cpp 2024-06-02 04:41:06.000000000 +0800
|
||||
+++ opencv-4.10.0/modules/core/src/matrix.cpp 2024-06-04 21:07:18.096333587 +0800
|
||||
@@ -698,18 +698,10 @@ void Mat::create(int d, const int* _size
|
||||
#endif
|
||||
if(!a)
|
||||
a = a0;
|
||||
- try
|
||||
{
|
||||
u = a->allocate(dims, size, _type, 0, step.p, ACCESS_RW /* ignored */, USAGE_DEFAULT);
|
||||
CV_Assert(u != 0);
|
||||
}
|
||||
- catch (...)
|
||||
- {
|
||||
- if (a == a0)
|
||||
- throw;
|
||||
- u = a0->allocate(dims, size, _type, 0, step.p, ACCESS_RW /* ignored */, USAGE_DEFAULT);
|
||||
- CV_Assert(u != 0);
|
||||
- }
|
||||
CV_Assert( step[dims-1] == (size_t)CV_ELEM_SIZE(flags) );
|
||||
}
|
||||
|
||||
@@ -759,7 +751,6 @@ Mat::Mat(const Mat& m, const Range& _row
|
||||
}
|
||||
|
||||
*this = m;
|
||||
- try
|
||||
{
|
||||
if( _rowRange != Range::all() && _rowRange != Range(0,rows) )
|
||||
{
|
||||
@@ -779,11 +770,6 @@ Mat::Mat(const Mat& m, const Range& _row
|
||||
flags |= SUBMATRIX_FLAG;
|
||||
}
|
||||
}
|
||||
- catch(...)
|
||||
- {
|
||||
- release();
|
||||
- throw;
|
||||
- }
|
||||
|
||||
updateContinuityFlag();
|
||||
|
||||
diff -Nuarp opencv-4.10.0.orig/modules/core/src/parallel/parallel.cpp opencv-4.10.0/modules/core/src/parallel/parallel.cpp
|
||||
--- opencv-4.10.0.orig/modules/core/src/parallel/parallel.cpp 2024-06-02 04:41:06.000000000 +0800
|
||||
+++ opencv-4.10.0/modules/core/src/parallel/parallel.cpp 2024-06-04 21:07:18.097333583 +0800
|
||||
@@ -60,7 +60,6 @@ std::shared_ptr<ParallelForAPI> createPa
|
||||
}
|
||||
isKnown = true;
|
||||
}
|
||||
- try
|
||||
{
|
||||
CV_LOG_DEBUG(NULL, "core(parallel): trying backend: " << info.name << " (priority=" << info.priority << ")");
|
||||
if (!info.backendFactory)
|
||||
@@ -79,14 +78,6 @@ std::shared_ptr<ParallelForAPI> createPa
|
||||
getParallelBackendName() = info.name;
|
||||
return backend;
|
||||
}
|
||||
- catch (const std::exception& e)
|
||||
- {
|
||||
- CV_LOG_WARNING(NULL, "core(parallel): can't initialize " << info.name << " backend: " << e.what());
|
||||
- }
|
||||
- catch (...)
|
||||
- {
|
||||
- CV_LOG_WARNING(NULL, "core(parallel): can't initialize " << info.name << " backend: Unknown C++ exception");
|
||||
- }
|
||||
}
|
||||
if (name.empty())
|
||||
{
|
||||
diff -Nuarp opencv-4.10.0.orig/modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp opencv-4.10.0/modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp
|
||||
--- opencv-4.10.0.orig/modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp 2024-06-02 04:41:06.000000000 +0800
|
||||
+++ opencv-4.10.0/modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp 2024-06-04 21:07:18.097333583 +0800
|
||||
@@ -155,15 +155,10 @@ protected:
|
||||
void initBackend()
|
||||
{
|
||||
AutoLock lock(getInitializationMutex());
|
||||
- try
|
||||
{
|
||||
if (!initialized)
|
||||
loadPlugin();
|
||||
}
|
||||
- catch (...)
|
||||
- {
|
||||
- CV_LOG_INFO(NULL, "core(parallel): exception during plugin loading: " << baseName_ << ". SKIP");
|
||||
- }
|
||||
initialized = true;
|
||||
}
|
||||
void loadPlugin();
|
||||
@@ -243,7 +238,6 @@ void PluginParallelBackendFactory::loadP
|
||||
{
|
||||
continue;
|
||||
}
|
||||
- try
|
||||
{
|
||||
auto pluginBackend = std::make_shared<PluginParallelBackend>(lib);
|
||||
if (!pluginBackend)
|
||||
@@ -264,10 +258,6 @@ void PluginParallelBackendFactory::loadP
|
||||
backend = pluginBackend;
|
||||
return;
|
||||
}
|
||||
- catch (...)
|
||||
- {
|
||||
- CV_LOG_WARNING(NULL, "core(parallel): exception during plugin initialization: " << toPrintablePath(plugin) << ". SKIP");
|
||||
- }
|
||||
}
|
||||
}
|
||||
|
||||
diff -Nuarp opencv-4.10.0.orig/modules/core/src/parallel.cpp opencv-4.10.0/modules/core/src/parallel.cpp
|
||||
--- opencv-4.10.0.orig/modules/core/src/parallel.cpp 2024-06-02 04:41:06.000000000 +0800
|
||||
+++ opencv-4.10.0/modules/core/src/parallel.cpp 2024-06-04 21:07:18.097333583 +0800
|
||||
@@ -351,29 +351,9 @@ namespace {
|
||||
CV_TRACE_ARG_VALUE(range_end, "range.end", (int64)r.end);
|
||||
#endif
|
||||
|
||||
- try
|
||||
{
|
||||
(*ctx.body)(r);
|
||||
}
|
||||
-#if CV__EXCEPTION_PTR
|
||||
- catch (...)
|
||||
- {
|
||||
- ctx.recordException();
|
||||
- }
|
||||
-#else
|
||||
- catch (const cv::Exception& e)
|
||||
- {
|
||||
- ctx.recordException(e.what());
|
||||
- }
|
||||
- catch (const std::exception& e)
|
||||
- {
|
||||
- ctx.recordException(e.what());
|
||||
- }
|
||||
- catch (...)
|
||||
- {
|
||||
- ctx.recordException("Unknown exception");
|
||||
- }
|
||||
-#endif
|
||||
|
||||
if (!ctx.is_rng_used && !(cv::theRNG() == ctx.rng))
|
||||
ctx.is_rng_used = true;
|
||||
@@ -519,16 +499,10 @@ void parallel_for_(const cv::Range& rang
|
||||
isNotNestedRegion = !flagNestedParallelFor.exchange(true);
|
||||
if (isNotNestedRegion)
|
||||
{
|
||||
- try
|
||||
{
|
||||
parallel_for_impl(range, body, nstripes);
|
||||
flagNestedParallelFor = false;
|
||||
}
|
||||
- catch (...)
|
||||
- {
|
||||
- flagNestedParallelFor = false;
|
||||
- throw;
|
||||
- }
|
||||
}
|
||||
else // nested parallel_for_() calls are not parallelized
|
||||
{
|
||||
diff -Nuarp opencv-4.10.0.orig/modules/core/src/persistence.cpp opencv-4.10.0/modules/core/src/persistence.cpp
|
||||
--- opencv-4.10.0.orig/modules/core/src/persistence.cpp 2024-06-02 04:41:06.000000000 +0800
|
||||
+++ opencv-4.10.0/modules/core/src/persistence.cpp 2024-06-04 21:07:18.097333583 +0800
|
||||
@@ -723,7 +723,7 @@ bool FileStorage::Impl::open(const char
|
||||
strbufpos = bufOffset;
|
||||
bufofs = 0;
|
||||
|
||||
- try {
|
||||
+ {
|
||||
char *ptr = bufferStart();
|
||||
ptr[0] = ptr[1] = ptr[2] = '\0';
|
||||
FileNode root_nodes(fs_ext, 0, 0);
|
||||
@@ -764,13 +764,6 @@ bool FileStorage::Impl::open(const char
|
||||
}
|
||||
}
|
||||
}
|
||||
- catch (...)
|
||||
- {
|
||||
- // FIXIT log error message
|
||||
- is_opened = true;
|
||||
- release();
|
||||
- throw;
|
||||
- }
|
||||
|
||||
// release resources that we do not need anymore
|
||||
closeFile();
|
||||
@@ -1903,18 +1896,12 @@ FileStorage::~FileStorage()
|
||||
|
||||
bool FileStorage::open(const String& filename, int flags, const String& encoding)
|
||||
{
|
||||
- try
|
||||
{
|
||||
bool ok = p->open(filename.c_str(), flags, encoding.c_str());
|
||||
if(ok)
|
||||
state = FileStorage::NAME_EXPECTED + FileStorage::INSIDE_MAP;
|
||||
return ok;
|
||||
}
|
||||
- catch (...)
|
||||
- {
|
||||
- release();
|
||||
- throw; // re-throw
|
||||
- }
|
||||
}
|
||||
|
||||
bool FileStorage::isOpened() const { return p->is_opened; }
|
||||
diff -Nuarp opencv-4.10.0.orig/modules/core/src/system.cpp opencv-4.10.0/modules/core/src/system.cpp
|
||||
--- opencv-4.10.0.orig/modules/core/src/system.cpp 2024-06-02 04:41:06.000000000 +0800
|
||||
+++ opencv-4.10.0/modules/core/src/system.cpp 2024-06-04 21:07:18.098333578 +0800
|
||||
@@ -1273,7 +1273,6 @@ void error( const Exception& exc )
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
- throw exc;
|
||||
#ifdef __GNUC__
|
||||
# if !defined __clang__ && !defined __APPLE__
|
||||
// this suppresses this warning: "noreturn" function does return [enabled by default]
|
||||
@@ -2075,15 +2074,9 @@ void* TLSDataContainer::getData() const
|
||||
{
|
||||
// Create new data instance and save it to TLS storage
|
||||
pData = createDataInstance();
|
||||
- try
|
||||
{
|
||||
getTlsStorage().setData(key_, pData);
|
||||
}
|
||||
- catch (...)
|
||||
- {
|
||||
- deleteDataInstance(pData);
|
||||
- throw;
|
||||
- }
|
||||
}
|
||||
return pData;
|
||||
}
|
||||
@@ -2187,7 +2180,7 @@ inline bool parseOption(const std::strin
|
||||
{
|
||||
return false;
|
||||
}
|
||||
- throw ParseError(value);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -2208,7 +2201,7 @@ inline size_t parseOption(const std::str
|
||||
return v * 1024 * 1024;
|
||||
else if (suffixStr == "KB" || suffixStr == "Kb" || suffixStr == "kb")
|
||||
return v * 1024;
|
||||
- throw ParseError(value);
|
||||
+ return v;
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -2251,16 +2244,11 @@ static inline const char * envRead(const
|
||||
template<typename T>
|
||||
inline T read(const std::string & k, const T & defaultValue)
|
||||
{
|
||||
- try
|
||||
{
|
||||
const char * res = envRead(k.c_str());
|
||||
if (res)
|
||||
return parseOption<T>(std::string(res));
|
||||
}
|
||||
- catch (const ParseError &err)
|
||||
- {
|
||||
- CV_Error(cv::Error::StsBadArg, err.toString(k));
|
||||
- }
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
diff -Nuarp opencv-4.10.0.orig/modules/core/src/umatrix.cpp opencv-4.10.0/modules/core/src/umatrix.cpp
|
||||
--- opencv-4.10.0.orig/modules/core/src/umatrix.cpp 2024-06-02 04:41:06.000000000 +0800
|
||||
+++ opencv-4.10.0/modules/core/src/umatrix.cpp 2024-06-04 21:07:18.098333578 +0800
|
||||
@@ -602,14 +602,9 @@ UMat Mat::getUMat(AccessFlag accessFlags
|
||||
new_u->originalUMatData = u;
|
||||
}
|
||||
bool allocated = false;
|
||||
- try
|
||||
{
|
||||
allocated = UMat::getStdAllocator()->allocate(new_u, accessFlags, usageFlags);
|
||||
}
|
||||
- catch (const cv::Exception& e)
|
||||
- {
|
||||
- fprintf(stderr, "Exception: %s\n", e.what());
|
||||
- }
|
||||
if (!allocated)
|
||||
{
|
||||
allocated = getDefaultAllocator()->allocate(new_u, accessFlags, usageFlags);
|
||||
@@ -626,7 +621,6 @@ UMat Mat::getUMat(AccessFlag accessFlags
|
||||
CV_XADD(&(u->refcount), 1);
|
||||
CV_XADD(&(u->urefcount), 1);
|
||||
}
|
||||
- try
|
||||
{
|
||||
hdr.flags = flags;
|
||||
hdr.usageFlags = usageFlags;
|
||||
@@ -637,16 +631,6 @@ UMat Mat::getUMat(AccessFlag accessFlags
|
||||
hdr.addref();
|
||||
return hdr;
|
||||
}
|
||||
- catch(...)
|
||||
- {
|
||||
- if (u != NULL)
|
||||
- {
|
||||
- CV_XADD(&(u->refcount), -1);
|
||||
- CV_XADD(&(u->urefcount), -1);
|
||||
- }
|
||||
- new_u->currAllocator->deallocate(new_u);
|
||||
- throw;
|
||||
- }
|
||||
|
||||
}
|
||||
|
||||
@@ -698,17 +682,10 @@ void UMat::create(int d, const int* _siz
|
||||
a = a0;
|
||||
a0 = Mat::getDefaultAllocator();
|
||||
}
|
||||
- try
|
||||
{
|
||||
u = a->allocate(dims, size, _type, 0, step.p, ACCESS_RW /* ignored */, usageFlags);
|
||||
CV_Assert(u != 0);
|
||||
}
|
||||
- catch(...)
|
||||
- {
|
||||
- if(a != a0)
|
||||
- u = a0->allocate(dims, size, _type, 0, step.p, ACCESS_RW /* ignored */, usageFlags);
|
||||
- CV_Assert(u != 0);
|
||||
- }
|
||||
CV_Assert( step[dims-1] == (size_t)CV_ELEM_SIZE(flags) );
|
||||
}
|
||||
|
||||
@@ -1075,7 +1052,6 @@ Mat UMat::getMat(AccessFlag accessFlags)
|
||||
// TODO Support ACCESS_READ (ACCESS_WRITE) without unnecessary data transfers
|
||||
accessFlags |= ACCESS_RW;
|
||||
UMatDataAutoLock autolock(u);
|
||||
- try
|
||||
{
|
||||
if(CV_XADD(&u->refcount, 1) == 0)
|
||||
u->currAllocator->map(u, accessFlags);
|
||||
@@ -1090,11 +1066,6 @@ Mat UMat::getMat(AccessFlag accessFlags)
|
||||
return hdr;
|
||||
}
|
||||
}
|
||||
- catch(...)
|
||||
- {
|
||||
- CV_XADD(&u->refcount, -1);
|
||||
- throw;
|
||||
- }
|
||||
CV_XADD(&u->refcount, -1);
|
||||
CV_Assert(u->data != 0 && "Error mapping of UMat to host memory.");
|
||||
return Mat();
|
||||
diff -Nuarp opencv-4.10.0.orig/modules/core/src/utils/filesystem.cpp opencv-4.10.0/modules/core/src/utils/filesystem.cpp
|
||||
--- opencv-4.10.0.orig/modules/core/src/utils/filesystem.cpp 2024-06-02 04:41:06.000000000 +0800
|
||||
+++ opencv-4.10.0/modules/core/src/utils/filesystem.cpp 2024-06-04 21:07:18.098333578 +0800
|
||||
@@ -508,14 +508,9 @@ cv::String getCacheDirectory(const char*
|
||||
&& !utils::fs::isDirectory(default_cache_path))
|
||||
{
|
||||
std::vector<cv::String> existedCacheDirs;
|
||||
- try
|
||||
{
|
||||
utils::fs::glob_relative(default_cache_path_base, "*", existedCacheDirs, false, true);
|
||||
}
|
||||
- catch (...)
|
||||
- {
|
||||
- // ignore
|
||||
- }
|
||||
if (!existedCacheDirs.empty())
|
||||
{
|
||||
CV_LOG_WARNING(NULL, "Creating new OpenCV cache directory: " << default_cache_path);
|
||||
diff -Nuarp opencv-4.10.0.orig/modules/imgproc/src/contours.cpp opencv-4.10.0/modules/imgproc/src/contours.cpp
|
||||
--- opencv-4.10.0.orig/modules/imgproc/src/contours.cpp 2024-06-02 04:41:06.000000000 +0800
|
||||
+++ opencv-4.10.0/modules/imgproc/src/contours.cpp 2024-06-04 21:07:18.098333578 +0800
|
||||
@@ -1760,7 +1760,6 @@ cvFindContours_Impl( void* img, CvMemS
|
||||
}
|
||||
else
|
||||
{
|
||||
- try
|
||||
{
|
||||
scanner = cvStartFindContours_Impl( img, storage, cntHeaderSize, mode, method, offset,
|
||||
needFillBorder);
|
||||
@@ -1772,12 +1771,6 @@ cvFindContours_Impl( void* img, CvMemS
|
||||
}
|
||||
while( contour != 0 );
|
||||
}
|
||||
- catch(...)
|
||||
- {
|
||||
- if( scanner )
|
||||
- cvEndFindContours(&scanner);
|
||||
- throw;
|
||||
- }
|
||||
|
||||
*firstContour = cvEndFindContours( &scanner );
|
||||
}
|
||||
diff -Nuarp opencv-4.10.0.orig/modules/video/src/tracking/detail/tracking_feature.cpp opencv-4.10.0/modules/video/src/tracking/detail/tracking_feature.cpp
|
||||
--- opencv-4.10.0.orig/modules/video/src/tracking/detail/tracking_feature.cpp 2024-06-02 04:41:06.000000000 +0800
|
||||
+++ opencv-4.10.0/modules/video/src/tracking/detail/tracking_feature.cpp 2024-06-04 21:07:18.099333573 +0800
|
||||
@@ -107,15 +107,9 @@ void CvHaarEvaluator::generateFeatures(i
|
||||
|
||||
CvHaarEvaluator::FeatureHaar::FeatureHaar(Size patchSize)
|
||||
{
|
||||
- try
|
||||
{
|
||||
generateRandomFeature(patchSize);
|
||||
}
|
||||
- catch (...)
|
||||
- {
|
||||
- // FIXIT
|
||||
- throw;
|
||||
- }
|
||||
}
|
||||
|
||||
void CvHaarEvaluator::FeatureHaar::generateRandomFeature(Size patchSize)
|
Reference in New Issue
Block a user