unrealcv/unrealcv

UnrealCV Problems with UE 4.22.3

Opened this issue · 16 comments

  • Operating System: Win 10, 64Bit
  • UE4 Version: 4.22.3
  • UnrealCV Version: various
  • Client (python2, 3 or matlab): python2
  • Problem Description:

I am able to compile the unrealcv-master for UE 4.22.3 only. However, for this version of the plugin I run into issues with the object_mask not working (getting some gray valued scene instead) and the depth image that is written to file is binary (just black and white). Finally, the size of the normal image is not 640x480, but instead is size of screen.

I've been going through the issues and see that people use other versions of the plugin. However, they do not properly build:

  • The 4.22 branch version seems to compile all the code correctly, but then fails to package the plugin (exception line 175 in ActionGraph.cs).

  • The fast branch version flags an error 'Could not find definition for module ShaderCore'. Others have reported this issue as well, but then someone pointed to the master branch instead ...

Which version of the plugin is the one that should/could work with UE 4.22.3? Or is it simply not supported yet? Anyone else have similar problems as me?

Thanks!

This is an issue posted long ago and sorry for not responding to it timely. I am personally using the 4.22 branch in Linux and Mac with UE4.22.

If anyone else came across the same issue as reported here, feel free to leave comments here.

Is it possible to add the precompiled plugins to the releases? The latest release version available is for UE4.16 which is pretty old.

Hi, the 4.22 branch has been updated.
Now, it can be successfully complied and packaged in UE4.22.3!

It is true that it can be successfully compiled and packaged in UE4.22.3.

But the object_mask is still not working.

lit
object_mask

Hi, @seino-tsuyoshi

Can you try this.

Drag a Fusion Camera Actor from the left side "Place Actors" panel. And get the segmentation mask from camera id 1.

@qiuwch
Thank you for your advice!

I tried this, and I could took object mask data on UE4.22.3.

objectmask

@qiuwch
Thank you for your advice!

I tried this, and I could took object mask data on UE4.22.3.

objectmask

Hello, I have the same problem with you,but I can't find the Fusion Camera Actor in my UE4 project,Can you tell me where it is.thank you

@qiuwch
Thank you for your advice!
I tried this, and I could took object mask data on UE4.22.3.
objectmask

Hello, I have the same problem with you,but I can't find the Fusion Camera Actor in my UE4 project,Can you tell me where it is.thank you

Hi, there. I can't find Fusion Camera Actor either. Did you solve your problem?

I posted the blog about it below (Sorry Japanese only / please use google translate).

https://dev.classmethod.jp/articles/how-to-get-segmentation-mask-on-ue4-22-3/

In a nutshell,

  1. checkout unrealcv 4.22 branch
  2. execute build.py
  3. There is directory called "Plugins" under the branch
  4. copy that directory to your project
  5. reopen your project
  6. confirm ([edit] => [plugins]
  7. find Fusion Camera Actor from the panel "Modes"

Good luck.

I posted the blog about it below (Sorry Japanese only / please use google translate).

https://dev.classmethod.jp/articles/how-to-get-segmentation-mask-on-ue4-22-3/

In a nutshell,

  1. checkout unrealcv 4.22 branch
  2. execute build.py
  3. There is directory called "Plugins" under the branch
  4. copy that directory to your project
  5. reopen your project
  6. confirm ([edit] => [plugins]
  7. find Fusion Camera Actor from the panel "Modes"

Good luck.

Quite a lovely blog! Your blog helps me a lot. However, I found that Fusion Camera Actor (camera 1) could not be manipulated by vset command, correct?

使用unrealcv分支4.25 在你的ue4项目下新建一个Plugins文件夹,把下载下来的分支文件全部放到Plugins下,然后用vs重新编译一下

---Original--- From: @.> Date: Tue, Jun 8, 2021 11:15 AM To: @.>; Cc: @.@.>; Subject: Re: [unrealcv/unrealcv] UnrealCV Problems with UE 4.22.3 (#186) @qiuwch Thank you for your advice! I tried this, and I could took object mask data on UE4.22.3. Hello, I have the same problem with you,but I can't find the Fusion Camera Actor in my UE4 project,Can you tell me where it is.thank you Hi, there. I can't find Fusion Camera Actor either. Did you solve your problem? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

4.25一堆报错,编译失败

Sorry for asking so many stupid questions. Finally, I came to a pipeline that works fine:

  1. clone 4.25 branch
  2. add #include “Runtime/Engine/Classes/Camera/CameraTypes.h” to Source/UnrealCV/Public/Sensor/CameraSensor/FusionCamSensor.h
  3. compile UnrealCV plugin
  4. new a C++ project as #195 said
  5. drag a Fusion Camera Actor in map, call it with ID 1 using this command: vget /camera/1/object_mask PATH
  6. set above map as default in project config
  7. package this baby and enjoy it!

FYI this also worked for me with Unreal Engine 4.26, though I had to comment out lines 89-95 of Plugins\UnrealCV\Source\UnrealCV\Private\Sensor\TextureReader.cpp

/*
	ENQUEUE_UNIQUE_RENDER_COMMAND_TWOPARAMETER(
		FastReadBuffer,
		TFunction<void(FRHICommandListImmediate&, FTexture2DRHIRef)>, InRenderCommand, RenderCommand,
		FTexture2DRHIRef, InTexture2D, Texture2D,
		{
			InRenderCommand(RHICmdList, InTexture2D);
		});
*/

And edit line 57 of Plugins\UnrealCV\Source\UnrealCV\Private\BPFunctionLib\VisionBPLib.cpp, adding an "L" before the quotes

if (FFileHelper::SaveStringToFile(L"", *Filename))