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. Loading Images with small CPU load
Forum Updated to NodeBB v4.3 + New Features

Loading Images with small CPU load

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
8 Posts 6 Posters 2.1k Views 3 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.
  • S Offline
    S Offline
    Snoopy
    wrote on 31 Jan 2018, 20:26 last edited by
    #1

    Hello,

    Has somebody experience what's the best or correct way for image loading with preferably a small CPU load ?
    Because it's an embedded system I've to get along with a not very powerfull CPU.

    I've over hundred images as png-Files. Everyone with size of 300 x 300 Pixel
    In my usecase every 100 ms I've to replace an image with a new one. For the intervall I'm using a timer.

    Can somebody give a tip ?

    Thanks and best regards,

    snoopy

    J 1 Reply Last reply 16 Feb 2018, 05:43
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 31 Jan 2018, 20:31 last edited by
      #2

      Hi,

      Depending on what these images you should avoid using a compressed format.

      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
      • S Offline
        S Offline
        Snoopy
        wrote on 31 Jan 2018, 22:19 last edited by
        #3

        I'm using images in PNG-Format

        J 1 Reply Last reply 1 Feb 2018, 05:44
        0
        • S Snoopy
          31 Jan 2018, 22:19

          I'm using images in PNG-Format

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 1 Feb 2018, 05:44 last edited by
          #4

          @Snoopy PNG is compressed

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • T Offline
            T Offline
            timday
            wrote on 14 Feb 2018, 18:56 last edited by
            #5

            That much image data would be ~205MByte stored uncompressed (at 24bits/pixel) per hundred images. Might be a lot for an embedded system? But if you've got the storage available you could just store the raw image data into files and load when needed and point a QImage at the data. (Or memory-mapping the image data might be better depending whether usage patterns and available RAM lead to some caching and re-use of already loaded data).

            1 Reply Last reply
            2
            • S Snoopy
              31 Jan 2018, 20:26

              Hello,

              Has somebody experience what's the best or correct way for image loading with preferably a small CPU load ?
              Because it's an embedded system I've to get along with a not very powerfull CPU.

              I've over hundred images as png-Files. Everyone with size of 300 x 300 Pixel
              In my usecase every 100 ms I've to replace an image with a new one. For the intervall I'm using a timer.

              Can somebody give a tip ?

              Thanks and best regards,

              snoopy

              J Offline
              J Offline
              JKSH
              Moderators
              wrote on 16 Feb 2018, 05:43 last edited by
              #6

              @Snoopy said in Loading Images with small CPU load:

              For the intervall I'm using a timer.

              How far did you get with the advice you got from https://forum.qt.io/topic/87537/need-a-timer-which-works-exactly/ ?

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              S 1 Reply Last reply 16 Feb 2018, 07:28
              0
              • J JKSH
                16 Feb 2018, 05:43

                @Snoopy said in Loading Images with small CPU load:

                For the intervall I'm using a timer.

                How far did you get with the advice you got from https://forum.qt.io/topic/87537/need-a-timer-which-works-exactly/ ?

                S Offline
                S Offline
                Snoopy
                wrote on 16 Feb 2018, 07:28 last edited by
                #7

                @JKSH

                I've detected that in my case the QML Timer was the problem and not loading the images. The Timer himself is imprecise. I've checked it by comparing the elapsed time with the system time of the PC.
                One more example: If there is only running the timer with an interval of 100 ms (without loading images), and I'm moving the mouse the triggeredEvents will be fired only after 180 ms in average.

                Now I've integrated the QTimer based on C++ into my QML-code. I'm using the QTimer with type PreciseTimer.
                This works very fine.

                In combination with loading images I've opened a new topic
                https://forum.qt.io/topic/87826/caching-many-png-images-files-in-one-go
                I would be very gratefull If you could look inside it. Maybe you have experience with this topic.

                Thanks.

                Best regards

                Snoopy

                1 Reply Last reply
                1
                • P Offline
                  P Offline
                  Pablo J. Rogina
                  wrote on 16 Feb 2018, 19:35 last edited by
                  #8

                  @Snoopy you may want to take a look at a series of blog posts regarding Fast-Booting Qt Devices. Although some items covered there might not apply to you, some tips about do's and do not's could be relevant.

                  Upvote the answer(s) that helped you solve the issue
                  Use "Topic Tools" button to mark your post as Solved
                  Add screenshots via postimage.org
                  Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                  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