Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7801445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:57:17+00:00 2026-06-02T00:57:17+00:00

I am working on an interactive application which needs to read and manipulate several

  • 0

I am working on an interactive application which needs to read and manipulate several very large images at once (25 images at a time, roughly 350 Mb total size). OpenCV is quite speedy and handles the algorithms with relative ease. But drawing them with Qt is proving to be a problem. Here are two less-than-ideal solutions I have tried.

Solution 1 (too slow)

Every time you need to draw a different OpenCV image, convert it to a
QImage and draw that. The conversion, unfortunately, takes a while and
we cannot switch between images at interactive speeds.

Solution 2 (too memory-intensive)

Maintain two stacks of images, one for OpenCV and one for Qt. Use the
appropriate one at the appropriate time.

I have direct access to the OpenCV pixel data. I know the width and height of the image, and I know that pixels are 3-byte RGB values. It seems like it should be possible to draw the OpenCV image quickly without copying it to a QImage container that (as far as I can tell) just contains a duplicate of the data.

Where do I need to look to get this kind of capability out of Qt?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T00:57:19+00:00Added an answer on June 2, 2026 at 12:57 am

    You can share the data between QImage and openCV – both of them have a ctor which uses existing data – supplied by a pointer.

    cv::Mat(int _rows, int _cols, int _type, void* _data, size_t _step=AUTO_STEP)
    QImage ( uchar * data, int width, int height, int bytesPerLine, Format format)

    There might be an issue with the padding if the rows don’t end up being multiples of 4bytes but I would expect the padding to align on both types with the same pixel size – at least on the same hardware

    One issue is that openCV uses BGR by default which isn’t very optimal for QImage (or any other display). Although I’m not sure that QImage::Format_ARGB32_Premultiplied is necessarily that much quicker anymore on Qt which use accelerated openGL for rendering QImage.

    An alternative is to use opencv then copy the resulting data direct to an openGL texture and then use QGlWidget to display the image without another copy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on an application which needs to divert phone calls to other
I am working on a very large application that has multiple processes running simultaneously;
I'm working on an interactive application using a draggable time-line. This time-line have two
I'm working on an interactive web application, currently set up on http://picselbocs.com/projects/goalcandy (user: demo@demo.com,
I'm working on an interactive web application, currently set up on http://picselbocs.com/projects/goalcandy (user: demo@demo.com,
I'm working on an interactive web application, currently set up on http://picselbocs.com/projects/goalcandy (user: demo@demo.com,
I'm working on a graphical application which looks something like this: while (Simulator.simulating) {
I'm working on an application which interacts with hundreds of devices across a network.
I am working on an android application for my company which connects to a
I'm currently working on an application that needs to change certain settings on the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.