Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UE5 GetDllHandle Opencv_world.dll cause DeadLock #23121

Open
4 tasks done
agan19830404 opened this issue Jan 10, 2023 · 1 comment
Open
4 tasks done

UE5 GetDllHandle Opencv_world.dll cause DeadLock #23121

agan19830404 opened this issue Jan 10, 2023 · 1 comment

Comments

@agan19830404
Copy link

System Information

OpenCV version: 4.2.2
Operating System / Platform: windows 10
Compiler & compiler version: VS2019

Detailed description

When I compile UE project,and the project use opencv .But the project cannot run.

Steps to reproduce

std::string dllname = "opencv_core412.dll";
directory += dllname;
FString enginePluginsDir = FPaths::EnginePluginsDir();
std::string path(TCHAR_TO_UTF8(*enginePluginsDir));
path += directory;
FString LibraryPath = (path).c_str();
FString FullPath=FPaths::ConvertRelativePathToFull(LibraryPath);
UE_LOG(ViboxTracker, Log, TEXT("pathname %s"), *FullPath);
TrackerLibraryHandle = !LibraryPath.IsEmpty() ? FPlatformProcess::GetDllHandle(*LibraryPath) : nullptr;

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)
@asmorkalov
Copy link
Contributor

  1. OpenCV 4.2.2 is very old version. OpenCV team does not support it. Please try to update to 4.7.0.
  2. Most probable deadlock reason is parallel engines conflict between UE and OpenCV. E.g. OpenCV is built with TBB, but IE is built with OpenMP. You need to rebuild OpenCV to use the same threading backend in OpenCV as all other parts of your project. CMake options like WITH_OPENMP, WITH_TBB allows to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants