Hi everyone,
I have to make a project for Android using OpenCV. I’ve tried to add OpenCV support as a third party software and as an engine plugin. In both cases, the building of the engine and the editor from source finishes without problem, but when I start a new C++ project it says that he can’t find (or the file is compiled with another version of UE) UE4-OpenCV.lib. Every time I try to recompile it, without any good result.
I’m using the static libraries provided from OpenCV community for Android, not the C++ source.
Now I’m i’m integrating the software as an engine plugin.
Here is the Build.cs file:
public OpenCV(TargetInfo Target) {
string sdkBase = "J:/GitHubRepos/UnrealEngine/Engine/Plugins/OpenCV/Source/";
PublicIncludePaths.Add(sdkBase + "Public");
if (Target.Platform == UnrealTargetPlatform.Android) {
sdkBase = sdkBase + "libs/";
PublicLibraryPaths.AddRange(new string[] {
sdkBase + "armeabi-v7a/",
});
string CPU = "armeabi-v7a/";
PublicAdditionalLibraries.AddRange(new string[] {
sdkBase + CPU + "libopencv_calib3d.a",
sdkBase + CPU + "libopencv_core.a",
sdkBase + CPU + "libopencv_features2d.a",
sdkBase + CPU + "libopencv_flann.a",
sdkBase + CPU + "libopencv_highgui.a",
sdkBase + CPU + "libopencv_imgcodecs.a",
sdkBase + CPU + "libopencv_imgproc.a",
sdkBase + CPU + "libopencv_ml.a",
sdkBase + CPU + "libopencv_objdetect.a",
sdkBase + CPU + "libopencv_photo.a",
sdkBase + CPU + "libopencv_shape.a",
sdkBase + CPU + "libopencv_stitching.a",
sdkBase + CPU + "libopencv_superres.a",
sdkBase + CPU + "libopencv_videoio.a",
sdkBase + CPU + "libopencv_video.a",
sdkBase + CPU + "libopencv_videostab.a"
});
}
}
and the .uplugin file:
{
“FileVersion”: 3,
“Version”: 1,
“VersionName”: “1.0”,
“FriendlyName”: “OpenCV”,
“Description”: “”,
“Category”: “Other”,
“CreatedBy”: “”,
“CreatedByURL”: “”,
“DocsURL”: “”,
“MarketplaceURL”: “”,
“SupportURL”: “”,
“CanContainContent”: true,
“IsBetaVersion”: false,
“Installed”: false,
“EnabledByDefault”: true,
“Modules”: [
{
“Name”: “OpenCV”,
“Type”: “Runtime”,
“LoadingPhase”: “Default”,
“WhitelistPlatforms”: “Android”
}
]
}
Can someone tell me if I am doing wrong something?
Thank You in advance