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. High performance image blending
Qt 6.11 is out! See what's new in the release blog

High performance image blending

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 647 Views 1 Watching
  • 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.
  • Y Offline
    Y Offline
    yalee
    wrote on last edited by
    #1

    Hi,
    I would like to blend 2 images (original and mask) as shown in image separately below including example results
    Original
    OriginalImage.png

    Mask
    person_mask_640.png

    Result example (just focus on the boy blending)
    result.png

    In Open CV this is equivalent with :
    cv::addWeighted( image1, alpha, image2, beta, 0.0, blendedImage);

    In QT you may be able to do similar using qpainter setCompositionMode and then draw the image on top. However, this is very slow and i was wondering if there is a better way to do the same on QT with better performance. thanks

    SGaistS 1 Reply Last reply
    0
    • Y yalee

      Hi,
      I would like to blend 2 images (original and mask) as shown in image separately below including example results
      Original
      OriginalImage.png

      Mask
      person_mask_640.png

      Result example (just focus on the boy blending)
      result.png

      In Open CV this is equivalent with :
      cv::addWeighted( image1, alpha, image2, beta, 0.0, blendedImage);

      In QT you may be able to do similar using qpainter setCompositionMode and then draw the image on top. However, this is very slow and i was wondering if there is a better way to do the same on QT with better performance. thanks

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Depending on what you want to do, you can simply convert the result from OpenCV to a QPixmap to show it.

      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
      0

      • Login

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