Skip to content

Commit

Permalink
added initial infrared view
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Jan 13, 2018
1 parent 1c52399 commit e680442
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 15 deletions.
1 change: 1 addition & 0 deletions AirLib/include/common/ImageCaptureBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class ImageCaptureBase
DisparityNormalized,
Segmentation,
SurfaceNormals,
Infrared,
Count //must be last
};

Expand Down
Binary file modified Unreal/Plugins/AirSim/Content/Blueprints/BP_PIPCamera.uasset
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
2 changes: 2 additions & 0 deletions Unreal/Plugins/AirSim/Source/PIPCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ void APIPCamera::PostInitializeComponents()
UAirBlueprintLib::GetActorComponent<USceneCaptureComponent2D>(this, TEXT("DisparityNormalizedCaptureComponent"));
captures_[Utils::toNumeric(ImageType::Segmentation)] =
UAirBlueprintLib::GetActorComponent<USceneCaptureComponent2D>(this, TEXT("SegmentationCaptureComponent"));
captures_[Utils::toNumeric(ImageType::Infrared)] =
UAirBlueprintLib::GetActorComponent<USceneCaptureComponent2D>(this, TEXT("InfraredCaptureComponent"));
captures_[Utils::toNumeric(ImageType::SurfaceNormals)] =
UAirBlueprintLib::GetActorComponent<USceneCaptureComponent2D>(this, TEXT("NormalsCaptureComponent"));

Expand Down
6 changes: 5 additions & 1 deletion docs/image_apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ To change resolution, FOV etc, you can use [settings.json](settings.md). For exa
DepthVis = 3,
DisparityNormalized = 4,
Segmentation = 5,
SurfaceNormals = 6
SurfaceNormals = 6,
Infrared = 7
```

### DepthPlanner and DepthPerspective
Expand Down Expand Up @@ -228,6 +229,9 @@ print(np.unique(img_rgba[:,:,2], return_counts=True)) #blue

A complete ready-to-run example can be found in [segmentation.py](https://github.com/Microsoft/AirSim/blob/master/PythonClient/segmentation.py).

### Infrared
Currently this is just a map from object ID to grey scale 0-255. So any mesh with object ID 42 shows up with color (42, 42, 42). Please see [segmentation section](#segmentation) for more details on how to set object IDs. Typically noise setting can be applied for this image type to get slightly more realistic effect. We are still working on adding other infrared artifacts and any contributions are welcome.

#### How to Find Mesh Names?
To get desired ground truth segmentation you will need to know names of the meshes in your Unreal environment that you are interested in. To do this, you will need to open up Unreal Environment in Unreal Editor and then inspect the names of the meshes you are interested in the World Outliner. For example, below we see the meshe names for he ground in Blocks environment in right panel in the editor:

Expand Down
16 changes: 2 additions & 14 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Below are complete list of settings available along with their default values. I
{"WindowID": 0, "CameraID": 0, "ImageType": 3, "Visible": false},
{"WindowID": 1, "CameraID": 0, "ImageType": 5, "Visible": false},
{"WindowID": 2, "CameraID": 0, "ImageType": 0, "Visible": false}
]
],
"SimpleFlight": {
"FirmwareName": "SimpleFlight",
"DefaultVehicleState": "Armed",
Expand Down Expand Up @@ -124,19 +124,7 @@ Below are complete list of settings available along with their default values. I
## Image Capture Settings
The `CaptureSettings` determines how different image types such as scene, depth, disparity, surface normals and segmentation views are rendered. The Width, Height and FOV settings should be self explanatory. The AutoExposureSpeed decides how fast eye adaptation works. We set to generally high value such as 100 to avoid artifacts in image capture. Simplarly we set MotionBlurAmount to 0 by default to avoid artifacts in groung truth images. For explanation of other settings, please see [this article](https://docs.unrealengine.com/latest/INT/Engine/Rendering/PostProcessEffects/AutomaticExposure/).

The `ImageType` element determines which image type the settings applies to. The valid values are:

```
Scene = 0,
DepthPlanner = 1,
DepthPerspective = 2,
DepthVis = 3,
DisparityNormalized = 4,
Segmentation = 5,
SurfaceNormals = 6
```

In addition, we also support special value `ImageType: -1` to apply the settings to external camera (i.e. what you are looking at on the screen).
The `ImageType` element determines which image type the settings applies to. The valid values are described in [ImageType section](image_apis.md#available-imagetype). In addition, we also support special value `ImageType: -1` to apply the settings to external camera (i.e. what you are looking at on the screen).

Note that `CaptureSettings` element is json array so you can add settings for multiple image types easily.

Expand Down

0 comments on commit e680442

Please sign in to comment.