Skip to content

Commit f29f399

Browse files
authored
Merge pull request #3938 from saihv/PR/OpticalFlow
Optical flow camera
2 parents e692a6f + 4e3f875 commit f29f399

File tree

6 files changed

+14
-0
lines changed

6 files changed

+14
-0
lines changed

AirLib/include/common/ImageCaptureBase.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ namespace airlib
2626
Segmentation,
2727
SurfaceNormals,
2828
Infrared,
29+
OpticalFlow,
30+
OpticalFlowVis,
2931
Count //must be last
3032
};
3133

PythonClient/airsim/types.py

+6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ def SurfaceNormals(cls):
3737
return 6
3838
def Infrared(cls):
3939
return 7
40+
def OpticalFlow(cls):
41+
return 8
42+
def OpticalFlowVis(cls):
43+
return 9
4044

4145
def __getattr__(self, key):
4246
if key == 'DepthPlanner':
@@ -52,6 +56,8 @@ class ImageType(metaclass=_ImageType):
5256
Segmentation = 5
5357
SurfaceNormals = 6
5458
Infrared = 7
59+
OpticalFlow = 8
60+
OpticalFlowVis = 9
5561

5662
class DrivetrainType:
5763
MaxDegreeOfFreedom = 0
Binary file not shown.
Binary file not shown.
Binary file not shown.

Unreal/Plugins/AirSim/Source/PIPCamera.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ APIPCamera::APIPCamera()
4141
image_type_to_pixel_format_map_.Add(5, EPixelFormat::PF_B8G8R8A8);
4242
image_type_to_pixel_format_map_.Add(6, EPixelFormat::PF_B8G8R8A8);
4343
image_type_to_pixel_format_map_.Add(7, EPixelFormat::PF_B8G8R8A8);
44+
image_type_to_pixel_format_map_.Add(8, EPixelFormat::PF_B8G8R8A8);
45+
image_type_to_pixel_format_map_.Add(9, EPixelFormat::PF_B8G8R8A8);
4446

4547
object_filter_ = FObjectFilter();
4648
}
@@ -70,6 +72,10 @@ void APIPCamera::PostInitializeComponents()
7072
UAirBlueprintLib::GetActorComponent<USceneCaptureComponent2D>(this, TEXT("InfraredCaptureComponent"));
7173
captures_[Utils::toNumeric(ImageType::SurfaceNormals)] =
7274
UAirBlueprintLib::GetActorComponent<USceneCaptureComponent2D>(this, TEXT("NormalsCaptureComponent"));
75+
captures_[Utils::toNumeric(ImageType::OpticalFlow)] =
76+
UAirBlueprintLib::GetActorComponent<USceneCaptureComponent2D>(this, TEXT("OpticalFlowCaptureComponent"));
77+
captures_[Utils::toNumeric(ImageType::OpticalFlowVis)] =
78+
UAirBlueprintLib::GetActorComponent<USceneCaptureComponent2D>(this, TEXT("OpticalFlowVisCaptureComponent"));
7379

7480
for (unsigned int i = 0; i < imageTypeCount(); ++i) {
7581
detections_[i] = NewObject<UDetectionComponent>(this);

0 commit comments

Comments
 (0)