diff --git a/Docs/python_api.md b/Docs/python_api.md index 7f97c1486b7..f9d2332902e 100644 --- a/Docs/python_api.md +++ b/Docs/python_api.md @@ -1547,6 +1547,59 @@ If __True__, Pedestrian navigation will be enabled using Recast tool. For very l --- +## carla.OpticalFlowImage +Inherited from _[carla.SensorData](#carla.SensorData)_
+Class that defines an optical flow image of 2-Dimension float (32-bit) vectors representing the optical flow detected in the field of view. The components of the vector represents the displacement of an object in the image plane. Each component outputs values in the normalized range [-2,2] which scales to [-2 size, 2 size] with size being the total resolution in the corresponding component. + +### Instance Variables +- **fov** (_float – degrees_) +Horizontal field of view of the image. +- **height** (_int_) +Image height in pixels. +- **width** (_int_) +Image width in pixels. +- **raw_data** (_bytes_) + +### Methods + +##### Getters +- **get_color_coded_flow**(**self**) +Visualization helper. Converts the optical flow image to an RGB image. + - **Return:** _[carla.Image](#carla.Image)_ + +##### Dunder methods +- **\__getitem__**(**self**, **pos**=int) +- **\__iter__**(**self**) +Iterate over the [carla.OpticalFlowPixel](#carla.OpticalFlowPixel) that form the image. +- **\__len__**(**self**) +- **\__setitem__**(**self**, **pos**=int, **color**=[carla.Color](#carla.Color)) +- **\__str__**(**self**) + +--- + +## carla.OpticalFlowPixel +Class that defines a 2 dimensional vector representing an optical flow pixel. + +### Instance Variables +- **x** (_float_) +Optical flow in the x component. +- **y** (_float_) +Optical flow in the y component. + +### Methods +- **\__init__**(**self**, **x**=0, **y**=0) +Initializes the Optical Flow Pixel. Zero by default. + - **Parameters:** + - `x` (_float_) + - `y` (_float_) + +##### Dunder methods +- **\__eq__**(**self**, **other**=[carla.OpticalFlowPixel](#carla.OpticalFlowPixel)) +- **\__ne__**(**self**, **other**=[carla.OpticalFlowPixel](#carla.OpticalFlowPixel)) +- **\__str__**(**self**) + +--- + ## carla.Osm2Odr Class that converts an OpenStreetMap map to OpenDRIVE format, so that it can be loaded in CARLA. Find out more about this feature in the [docs](tuto_G_openstreetmap.md). @@ -3664,28 +3717,8 @@ if vehicle_actor.is_at_traffic_light(): - - -