Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2024-11-13 09:02:39 +03:00
51 changed files with 861 additions and 303 deletions

View File

@@ -551,13 +551,9 @@ static int tsErrorCallback( int status, const char* func_name, const char* err_m
void TS::init( const string& modulename )
{
data_search_subdir.push_back(modulename);
#ifndef WINRT
char* datapath_dir = getenv("OPENCV_TEST_DATA_PATH");
#else
char* datapath_dir = OPENCV_TEST_DATA_PATH;
#endif
std::string datapath_dir = cv::utils::getConfigurationParameterString("OPENCV_TEST_DATA_PATH");
if( datapath_dir )
if( !datapath_dir.empty() )
{
data_path = path_join(path_join(datapath_dir, modulename), "");
}
@@ -850,11 +846,7 @@ void parseCustomOptions(int argc, char **argv)
test_ipp_check = parser.get<bool>("test_ipp_check");
if (!test_ipp_check)
#ifndef WINRT
test_ipp_check = getenv("OPENCV_IPP_CHECK") != NULL;
#else
test_ipp_check = false;
#endif
test_ipp_check = cv::utils::getConfigurationParameterBool("OPENCV_IPP_CHECK");
param_seed = parser.get<unsigned int>("test_seed");
@@ -900,9 +892,14 @@ static bool isDirectory(const std::string& path)
void addDataSearchPath(const std::string& path)
{
if (isDirectory(path))
if (!path.empty() && isDirectory(path))
TS::ptr()->data_search_path.push_back(path);
}
void addDataSearchEnv(const std::string& env_name)
{
const std::string val = cv::utils::getConfigurationParameterString(env_name.c_str());
cvtest::addDataSearchPath(val);
}
void addDataSearchSubDirectory(const std::string& subdir)
{
TS::ptr()->data_search_subdir.push_back(subdir);
@@ -948,14 +945,10 @@ static std::string findData(const std::string& relative_path, bool required, boo
const std::vector<std::string>& search_subdir = TS::ptr()->data_search_subdir;
#ifndef WINRT
char* datapath_dir = getenv("OPENCV_TEST_DATA_PATH");
#else
char* datapath_dir = OPENCV_TEST_DATA_PATH;
#endif
std::string datapath_dir = cv::utils::getConfigurationParameterString("OPENCV_TEST_DATA_PATH");
std::string datapath;
if (datapath_dir)
if (!datapath_dir.empty())
{
datapath = datapath_dir;
//CV_Assert(isDirectory(datapath) && "OPENCV_TEST_DATA_PATH is specified but it doesn't exist");