Giter VIP home page Giter VIP logo

Comments (9)

pablo-quilez avatar pablo-quilez commented on July 20, 2024

Hello Crusty,

ROS latest version Melodic seems not to support YUV format natively, at least according to the standard encodings found here http://docs.ros.org/melodic/api/sensor_msgs/html/image__encodings_8h_source.html

I think it may not be possible to add this in the camera, at least without adding it first to the ROS vision stack. Please someone correct me if I am wrong or missing future stack improvements.

Cheers,
Pablo

from pylon-ros-camera.

pablo-quilez avatar pablo-quilez commented on July 20, 2024

Hello @Crusty82

I think we may add in the driver this format (8 bit):
const std::string YUV422="yuv422";

Would be this a solution to you? I can prepare a Pull Request for you to test it.

from pylon-ros-camera.

Crusty82 avatar Crusty82 commented on July 20, 2024

Yep that would be great if I understand that correctly!

from pylon-ros-camera.

pablo-quilez avatar pablo-quilez commented on July 20, 2024

Hello @Crusty82

I am taking a look now to the issue. Which camera model are you using? Do you know exactly which format is the relevant in your case? Do your camera support YUV422_YUYV_Packed?

1) Basler YUV suported formats (camera-depend) are: YCbCr422_8, YUV422Packed, YUV422_YUYV_Packed, YCbCr420_8

YUV* formats are supported by the old cameras, but the newest models support only YCbCr422_8.
It seems that the format YUV422_YUYV_Packed is the one which ROS required. For YCbCr422_8 probably we will need some conversion algorithm, for example http://e2e.ti.com/support/processors/f/791/t/199637?YUYV-to-UYVY-formart-conversion-on-DM8168

2) ROS seems to support natively the following packaged UYVY format:

00098     // Miscellaneous
00099     // This is the UYVY version of YUV422 codec http://www.fourcc.org/yuv.php#UYVY
00100     // with an 8-bit depth
00101     const std::string YUV422="yuv422";

http://docs.ros.org/jade/api/sensor_msgs/html/image__encodings_8h_source.html

YUV 4:2:2 (Y sample at every pixel, U and V sampled at every second pixel horizontally on each line). A macropixel contains 2 pixels in 1 u_int32.

UYVY format has a horizontal subsampling period of 2 for both the U and V components indicating that U and V samples are taken for every second pixel across a line. Their vertical subsampling period is 1 indicating that U and V samples are taken on each line of the image.

from pylon-ros-camera.

Crusty82 avatar Crusty82 commented on July 20, 2024

from pylon-ros-camera.

pablo-quilez avatar pablo-quilez commented on July 20, 2024

Hi,

https://github.com/basler/pylon-ros-camera/tree/yuv422 we have created a branch to test the feature. It is possible that is still not working as expected because we tested it first with a modern camera which has YCbCr422_8 instead of YUV422_YUYV_Packed encoding. Until next week will be difficult for us to test it with a YUV422_YUYV_Packed compatible model. Sorry for the late reply, I hope the topic is still relevant to you and thanks for your understanding.

Regards,
Pablo

from pylon-ros-camera.

pablo-quilez avatar pablo-quilez commented on July 20, 2024

Hi,

after testing with different real hardware, it seems that is not working directly without a transformation. I tested the three formats YCbCr422_8, YUV422_YUYV_Packed and YUV422Packed and non of them were correctly displayed in rviz.

Basler format:
https://www.baslerweb.com/en/sales-support/knowledge-base/frequently-asked-questions/how-does-the-yuv-color-coding-work/15182/

ROS: This is the UYVY version of YUV422 codec http://www.fourcc.org/yuv.php#UYVY with an 8-bit depth
http://www.fourcc.org/yuv.php#UYVY

It seems that a transformation from YCbCr422_8 or YUV422Packed to RGB / ROS yuv422 would be needed. According to the documentation, is an 8-bit UYVY implementation which in theory should be compatible with YUV422_YUYV_Packed but in the real tests it seems to be different. I think this issue would require much more effort, also considering that a transformation will affect the performance.

Regards

from pylon-ros-camera.

pablo-quilez avatar pablo-quilez commented on July 20, 2024

Hi,

The driver is now supporting YUV format as I merged into devel after testing it. In the next days I am planning to merge devel into master.

The camera format YUV422Packed is the same UYVY format as the supported by ROS. U and V components are the color components and first and second Y correspond with the brightness of the first and second pixels. I had the chance to test the branch with the acA1440-73gc camera, so that I was able to fix some issues and finish the implementation.

image_view can display yuv422 format. RVIZ plugin doesn't support the format.
result_yuv2

rviz message

Cheers,
Pablo

from pylon-ros-camera.

m-binev avatar m-binev commented on July 20, 2024

@Crusty82 Hi, check this out, please. I could fix it eventually! Cheers, Momchil

from pylon-ros-camera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.