# About Using OpenCV in Unreal Engine 4 [closed]

Hello everyone, I'm currently developing an application for the Microsoft's Hololens 2 at my work, and I need to recognize an image or pattern in order to be able to trigger an event.

What I want to know more about is the implementation of OpenCV in Unreal Engine 4, in order to test if OpenCV is our way to go with the application we are currently developng. I tried following a legacy documentation to add OpenCV 3 to UE4, but I had no luck with this. Any advices?

PD: Using Unity is not an option, my bosses insist in working with Unreal Engine 4. Thanks in advance for your answers.

edit retag reopen merge delete

### Closed for the following reason question is off-topic or not relevant by berak close date 2020-11-21 02:15:02.602212

LOL berak :)

( 2020-11-21 11:33:32 -0500 )edit

Sort by » oldest newest most voted

There is no good reason to use OpenCV 3 over 4, if you're just starting out.

The easiest way to install OpenCV is to use the pre-built library at: https://sourceforge.net/projects/open...

Run that file to extract the contents to your hard drive (for instance, C:\temp\opencv450).

Copy the include files: Go to C:\temp\opencv450\opencv\build\include -- copy the opencv2 folder to your Visual C++ folder (for instance, C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include)

Copy the lib files: Go to C:\temp\opencv450\opencv\build\x64\vc15\lib -- copy the lib files to your Visual C++ folder (for instance, C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\lib\x64)

Copy the DLL and exe files: Go to C:\temp\opencv450\opencv\build\x64\vc15\bin -- copy the dll and exe files to your C:\windows\system32 folder.

Once you have all of these files in place, you can add these to your code:

#include <opencv2/opencv.hpp>
using namespace cv;
#pragma comment(lib, "opencv_world450.lib")

more

those files don't belong in those directories. DO NOT mix files into unrelated directories. instead, the proper way to do it is configure the project/solution's include and library paths, and add to PATH the directory with dlls in them.

( 2020-11-21 14:19:50 -0500 )edit

Your method doesn't work for s**t when you're compiling on the command line. STFU or be constructive.

( 2020-11-21 20:54:21 -0500 )edit

first, mind your tongue. your hostility is uncalled for and the polar opposite of constructive. your answer/advice requires mention of what's wrong with it and why. second, even "on the command line" you can pass additional include and library directories to the compiler and linker. since the question didn't mention command line usage, nothing more on that needs to be said.

( 2020-11-22 16:27:59 -0500 )edit

Official site

GitHub

Wiki

Documentation