Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to Convert YCbCr image data to an image and display the same

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 1.1k Views
  • 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 Offline
    D Offline
    Deepak Dinesh
    wrote on last edited by
    #1

    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 ???

    kshegunovK 1 Reply Last reply
    0
    • D Deepak Dinesh

      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 ???

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      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
      2
      • D Offline
        D Offline
        Deepak Dinesh
        wrote on last edited by
        #3

        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
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved