OpenSimulationInterface / open-simulation-interface

A generic interface for the environmental perception of automated driving functions in virtual scenarios.
Other
269 stars 125 forks source link

Image data pixel order specification #681

Closed thomassedlmayer closed 1 year ago

thomassedlmayer commented 2 years ago

Describe the feature

Currently, it is not possible to define the starting point of the first pixel row and column for camera image data (CameraSensorView>image_data) in the CameraSensorViewConfiguration. It could be top left or bottom right or any other combination but it can not be specified in OSI.

Proposed solution:

Add an enum to CameraSensorViewConfiguration, indicating starting point of pixel ordering (e.g., bottom-left, top-left) or processing/storage order (left-right-top-down, right-left-bottom-up, etc.)

Other considered options with disadvantages:

Describe the backwards compatibility

Breaking changes are not necessary with the proposed solution. So far you could not make any specifications or assumptions concerning pixel order, so this is just additional information, which is necessary to reliably interpret given image data.

raue commented 2 years ago

First thought was driven by the wish to be related to something real, i.e. do it like image sensors. By reading data sheets and asking camera experts it turns out, that there seems to be no standard. Some of those semiconductors have even configuration options for selecting different kinds of readout orders.
Second thought was heading in the direction of image formats. BMP (s. https://docs.fileformat.com/image/bmp/) for instance starts from bottom left. Others seem to differ from that (s. https://stackoverflow.com/questions/24223299/what-is-the-ordering-of-pixel-rows-for-common-image-formats).

Therefore, we cannot define a standard in OSI, since pixel-order can come in any possible way. Giving the opportunity to select/define any possible pixel-order in CameraSensorViewConfiguration would be preferable.

thomassedlmayer commented 1 year ago

Resolved by #698