Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. OpenCV Matrix with OpenGLTexture setData
QtWS25 Last Chance

OpenCV Matrix with OpenGLTexture setData

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 846 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.
  • S Offline
    S Offline
    Sandip
    wrote on last edited by
    #1

    I have been trying to pass the OpenCV Matrix (converted BGR to RGB) data to OpenGLTexture(ES 2.0) setData but unable to display the texture.

    Here is code for same

    texture = new QOpenGLTexture(QOpenGLTexture::Target2D);
    uploadPixel.setAlignment(1);
    texture->setFormat(QOpenGLTexture::RGBA8_UNorm); (Also tried RGBAFormat for OpenGL ES 2.0)
    texture->setSize(mOrigImage.cols,mOrigImage.rows);
    texture->allocateStorage();
    texture->setData(QOpenGLTexture::RGBA,QOpenGLTexture::UInt8,mOrigImage.data,&uploadPixel);
    texture->setMinificationFilter(QOpenGLTexture::Nearest);
    texture->setMagnificationFilter(QOpenGLTexture::Linear);

    I think, some issue with internal Texture with set format or the pixel format and type. So anyone tell me the correct Pixel Format and Type for OpenCV matrix?

    1 Reply Last reply
    0

    • Login

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