This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix & update yuyv/uyvy encodings (#6445)
**User-Facing Changes** - Renamed raw image encoding `uyuv` to `uyvy` for accuracy. - Added support for raw image encoding `yuv422_yuy2` as an alias for `yuyv`. **Description** - Fixes #6271, fixes FG-3953 - Schemas PR: foxglove/schemas#121 All [YUV 4:2:2 formats](https://en.wikipedia.org/wiki/Chroma_subsampling) encode one U and one V value for every two Y values. The byte orders supported by Studio and by other apps in the ecosystem are `[U, Y1, V, Y2]` and `[Y1, U, Y2, V]`. - Replaces `uyuv`, which seems to have been a typo introduced in #5292, with `uyvy`, which accurately represents the byte order we are decoding. - Adds `yuv422_yuy2` as an encoding alias for `yuyv`, taken from ROS: - [sensor_msgs/image_encodings.hpp](https://github.com/ros2/common_interfaces/blob/366eea24ffce6c87f8860cbcd27f4863f46ad822/sensor_msgs/include/sensor_msgs/image_encodings.hpp) - ros2/common_interfaces#76 - ros2/common_interfaces#214 - `yuv422_yuy2` is the default encoding used by [usb_cam](https://github.com/ros-drivers/usb_cam/tree/ros2) - Remove incorrect and useless `Int8Array` type casting - Update YUV-to-RGB conversion formula to be faster and match RViz code - Added story for both UYVY and YUYV - Confirmed compatibility with rqt_image_view and rviz (although those two look slightly different from each other): <img width="1730" alt="Screenshot 2023-07-13 at 5 02 16 PM" src="https://github.com/foxglove/studio/assets/14237/c7be26e5-3bee-417b-8e67-c3a305e8453c"> Other references: - https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/pixfmt-packed-yuv.html
- Loading branch information
Showing
3 changed files
with
151 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters