Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Get pixel values of an image
Forum Updated to NodeBB v4.3 + New Features

Get pixel values of an image

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 2 Posters 3.3k 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.
  • J Offline
    J Offline
    Javeria
    wrote on last edited by
    #1

    Is it possible to learn pixel values of an image?

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      Yes it is possible, check "QImage::​pixel":http://doc.qt.io/qt-5/qimage.html#pixel.

      157

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Javeria
        wrote on last edited by
        #3

        Sorry my bad, i meant that if i can get x and y coordinates (point) that the user clicked inside the image?

        1 Reply Last reply
        0
        • p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          Yes. Define a MouseArea for that Image element and then in onClicked event handler use mouseX and mouseY attached properties.

          157

          1 Reply Last reply
          0
          • J Offline
            J Offline
            Javeria
            wrote on last edited by
            #5

            will that exactly map to the matrix coordinates of that image?

            1 Reply Last reply
            0
            • J Offline
              J Offline
              Javeria
              wrote on last edited by
              #6

              Matrix coordinate will be referred by the opencv lib, as the image will be processed after clicking on the gui

              1 Reply Last reply
              0
              • p3c0P Offline
                p3c0P Offline
                p3c0
                Moderators
                wrote on last edited by
                #7

                Well I'm not sure what Matrix Coodrinates of OpenCV you are referring but mouseX and mouseY properties definitely gives the exact coordinates respected to the Image's Width and Height on clicking.

                157

                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