Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved How to Convert YCbCr image data to an image and display the same

    General and Desktop
    3
    4
    744
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      Deepak Dinesh last edited by

      I am getting a buffer containing Ycbcr format image data from a thermal camera and i have to capture the data and display the same as the image captured by the camera in qt GUI ; how do i convert the data to image and display the same ???

      kshegunov 1 Reply Last reply Reply Quote 0
      • kshegunov
        kshegunov Moderators @Deepak Dinesh last edited by

        Convert the pixel color data to RGB and set it to the image's pixel. The required color transformation is on wikipedia (you can google it yourself), and for setting a pixel's color you can use QImage::setPixel or QImage::setPixelColor.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply Reply Quote 2
        • D
          Deepak Dinesh last edited by

          Actualy i need to discard all Y values and convert the CB and CR values to RGB data ; do you know any algorithm to convert only cb and cr values to RGB data ;

          only one i was able to find is

          float r = std::max(0.0f, std::min(1.0f, (float)(ycbcr.Y + 0.0000 * ycbcr.Cb + 1.4022 * ycbcr.Cr)));
          float g = std::max(0.0f, std::min(1.0f, (float)(ycbcr.Y - 0.3456 * ycbcr.Cb - 0.7145 * ycbcr.Cr)));
          float b = std::max(0.0f, std::min(1.0f, (float)(ycbcr.Y + 1.7710 * ycbcr.Cb + 0.0000 * ycbcr.Cr)));

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Hi,

            Fix the Y value to the default and use the equation as usual.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 1
            • First post
              Last post