unrealcv/unrealcv

vget return images always from the same location

dmambelli opened this issue · 8 comments

  • Operating System: macOS Catalina 10.15.5
  • UE4 Version: 4.25.3
  • UnrealCV Version: 0.4.0
  • Client (python2, 3 or matlab): python2/3
  • Problem Description:
    I am trying to collect a sequence of images over a trajectory previously recorded. When I run my code I see in the editor the camera following the trajectory but the images that I collect using "client.request('vget /camera/0/lit png')" are all taken from the initial position. I am using a World that I generated where I added the Unrealcv plugin.

Hi, @dmambelli

You can drag a Fusion Camera Actor from the left side "Place Actors" panel. And control this camera with camera id 1. Actually, you can put as many cameras as you need in this way.

image

I will check what is wrong with camera 0 and make a fix.

Thanks @qiuwch. This solved my problem!

Great. Let me know if you find any other issues.

I will keep this issue open until I fixed it, so that others can find the solution here.

One follow up question.
I have an element in one of my assets that I want to remove, the easiest way that I found to do that is to assign a transparent material to the element. In my application I am mainly interested in capturing the depth.

I realized the transparent material following https://answers.unrealengine.com/questions/11377/view.html.

When I use "vset /viewmode depth" in the editor I don't see the transparent element as desired. However, as soon as I use client.request('vget /camera/1/depth npy') to capture an image I get the depth image with the transparent element visible.

Is there any way to obtain the same behaviour of "vset /viewmode depth" using "vget /camera/1/depth npy"?

Solved by setting the variable "bIgnoreTransparentObjects" to true in DepthCamSensor.cpp, and then building again the plugin.

Cool! Thanks for sharing this tip.

Is there a way to solve this issue without using the fusion camera? The main problem I'm having is that the LoDs will only change depending on the distance to camera0, not camera1. So a lot of my textures are low resolution.

Hi, @dmambelli

You can drag a Fusion Camera Actor from the left side "Place Actors" panel. And control this camera with camera id 1. Actually, you can put as many cameras as you need in this way.

image

I will check what is wrong with camera 0 and make a fix.

Hi I am not very familiar with UnrealEngine, and I coudn't find "Fusion Camera Actor" in UE4.16 or UE4.27. And I have searched for this but got nothing. Could you tell me which version of UE do you use?
And I want to control more than one camera, but I don't know how to do that.