Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to create a QImage from an average of ten others



  • Is there method for creating 10 QImages and creating an average of them? The append method for QByteArray changes the size of the array. Has anyone done this within Qt? I know there may be a solution using perhaps the STL or even SIMD instructions. Just want to do it solely in Qt.

    Thanks



  • The QImage is able to return a color or pixel value for every pixel it contains. Think the math for the average you should do yourself. Then use the setPixel etc to create a new average QImage.



  • [quote author="Jeroentje@home" date="1408517326"]The QImage is able to return a color or pixel value for every pixel it contains. Think the math for the average you should do yourself. Then use the setPixel etc to create a new average QImage.
    [/quote]

    Thanks.

    If I understand what you wrote, you are suggesting doing the average of all the pixels in one image at a time? That's not what I asked and the math is NOT the issue. It seems that the approach will be employing some vector methods or MMX (SIMD) calls.

    Thanks anyway for replying



  • Just for my curiosity, but what do you mean with average of 10 images?



  • [quote author="Jeroentje@home" date="1408540940"]Just for my curiosity, but what do you mean with average of 10 images?[/quote]

    10 frames captured on command from streaming video, each frame converted to QImage.


Log in to reply