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. Line Tracer/Digitizer
Forum Updated to NodeBB v4.3 + New Features

Line Tracer/Digitizer

Scheduled Pinned Locked Moved Unsolved General and Desktop
14 Posts 4 Posters 1.2k Views 2 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.
  • P Offline
    P Offline
    ParanoidAndroid
    wrote on 27 Nov 2019, 23:22 last edited by
    #1

    I am relatively new to QT and am looking to build a graph digitizer which runs manually (User clicks positions on graph) and automatically. I have managed to get the manual side of the graph working but am looking to build the automatic side.
    This involves clicking on the line graph line to say select colour and then have the program automatically give a vector of positions for the line which could be saved into .csv and used to recreate a digital version of the graph image. I am currently using a QImage to import the graph picture.

    Any help would be well received

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 27 Nov 2019, 23:53 last edited by
      #2

      Hi and welcome to the forums

      Since you have the manual part working click on the image and so on, what
      part do you want help on ?
      The math in the "automatically give a vector of position" or saving to
      csv or where lies the dog ? ( not sure its the right expression :)

      P 1 Reply Last reply 27 Nov 2019, 23:58
      0
      • M mrjj
        27 Nov 2019, 23:53

        Hi and welcome to the forums

        Since you have the manual part working click on the image and so on, what
        part do you want help on ?
        The math in the "automatically give a vector of position" or saving to
        csv or where lies the dog ? ( not sure its the right expression :)

        P Offline
        P Offline
        ParanoidAndroid
        wrote on 27 Nov 2019, 23:58 last edited by
        #3

        @mrjj

        I need it to automatically detect the line and plot the points so instead of the user clicking several points on the line they instead click a couple and the program autofills the other points according to the line

        M 1 Reply Last reply 28 Nov 2019, 00:01
        0
        • P ParanoidAndroid
          27 Nov 2019, 23:58

          @mrjj

          I need it to automatically detect the line and plot the points so instead of the user clicking several points on the line they instead click a couple and the program autofills the other points according to the line

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 28 Nov 2019, 00:01 last edited by mrjj
          #4

          @ParanoidAndroid
          Ok and are those lines straight or more like a spline / curve ?
          if just a line then
          https://www.geeksforgeeks.org/program-find-line-passing-2-points/

          but since you asked for help i assume its something more complicated ?

          P 1 Reply Last reply 28 Nov 2019, 00:08
          0
          • M mrjj
            28 Nov 2019, 00:01

            @ParanoidAndroid
            Ok and are those lines straight or more like a spline / curve ?
            if just a line then
            https://www.geeksforgeeks.org/program-find-line-passing-2-points/

            but since you asked for help i assume its something more complicated ?

            P Offline
            P Offline
            ParanoidAndroid
            wrote on 28 Nov 2019, 00:08 last edited by
            #5

            @mrjj They can be any 2D line graph splines, straight, lines curves

            M 1 Reply Last reply 28 Nov 2019, 07:08
            0
            • P ParanoidAndroid
              28 Nov 2019, 00:08

              @mrjj They can be any 2D line graph splines, straight, lines curves

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 28 Nov 2019, 07:08 last edited by
              #6

              @ParanoidAndroid
              Ok. so we need the data these
              2D line graph splines, straight, lines curves are based on if we are to calculate its
              function based on a few points.

              Can i see one images with the drawn curves you wish to calculate ?

              1 Reply Last reply
              0
              • P Offline
                P Offline
                ParanoidAndroid
                wrote on 28 Nov 2019, 09:39 last edited by
                #7

                Here is an example of the splineGraph3.png

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kshegunov
                  Moderators
                  wrote on 28 Nov 2019, 10:30 last edited by
                  #8

                  You need to read math, I'm afraid. Rational B-splines, normal cubic splines or polyharmonic splines could work in your case, however I leave the wikipedia-ing to you. ;)

                  Read and abide by the Qt Code of Conduct

                  P 1 Reply Last reply 28 Nov 2019, 10:38
                  3
                  • K kshegunov
                    28 Nov 2019, 10:30

                    You need to read math, I'm afraid. Rational B-splines, normal cubic splines or polyharmonic splines could work in your case, however I leave the wikipedia-ing to you. ;)

                    P Offline
                    P Offline
                    ParanoidAndroid
                    wrote on 28 Nov 2019, 10:38 last edited by
                    #9

                    @kshegunov
                    Is there no way to say track the colour of the spline and give pixel coordinates

                    K 1 Reply Last reply 28 Nov 2019, 10:51
                    0
                    • P ParanoidAndroid
                      28 Nov 2019, 10:38

                      @kshegunov
                      Is there no way to say track the colour of the spline and give pixel coordinates

                      K Offline
                      K Offline
                      kshegunov
                      Moderators
                      wrote on 28 Nov 2019, 10:51 last edited by
                      #10

                      Sorry, I don't understand the question. Please rephrase.

                      Read and abide by the Qt Code of Conduct

                      P 1 Reply Last reply 28 Nov 2019, 13:25
                      0
                      • K kshegunov
                        28 Nov 2019, 10:51

                        Sorry, I don't understand the question. Please rephrase.

                        P Offline
                        P Offline
                        ParanoidAndroid
                        wrote on 28 Nov 2019, 13:25 last edited by
                        #11

                        @kshegunov instead of using mathematics could you say click to select the colour of the line and then have the application give the coordinates of every pixel connected with that colour

                        M 1 Reply Last reply 28 Nov 2019, 14:16
                        0
                        • P ParanoidAndroid
                          28 Nov 2019, 13:25

                          @kshegunov instead of using mathematics could you say click to select the colour of the line and then have the application give the coordinates of every pixel connected with that colour

                          M Offline
                          M Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on 28 Nov 2019, 14:16 last edited by
                          #12

                          @ParanoidAndroid
                          Hi
                          If all images are as clean as this, you can easily scan to find the blue color and hence the Y coordinate.
                          https://doc.qt.io/qt-5/qimage.html#pixel-1
                          or the faster way
                          https://doc.qt.io/qt-5/qimage.html#scanLine

                          But it wont be fast as such but unless
                          tiny mini board it should be fine:)

                          P 1 Reply Last reply 28 Nov 2019, 15:32
                          1
                          • M mrjj
                            28 Nov 2019, 14:16

                            @ParanoidAndroid
                            Hi
                            If all images are as clean as this, you can easily scan to find the blue color and hence the Y coordinate.
                            https://doc.qt.io/qt-5/qimage.html#pixel-1
                            or the faster way
                            https://doc.qt.io/qt-5/qimage.html#scanLine

                            But it wont be fast as such but unless
                            tiny mini board it should be fine:)

                            P Offline
                            P Offline
                            ParanoidAndroid
                            wrote on 28 Nov 2019, 15:32 last edited by
                            #13

                            @mrjj thankyou for your help. Will this give an x coordinate aswell

                            J 1 Reply Last reply 29 Nov 2019, 06:08
                            0
                            • P ParanoidAndroid
                              28 Nov 2019, 15:32

                              @mrjj thankyou for your help. Will this give an x coordinate aswell

                              J Offline
                              J Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on 29 Nov 2019, 06:08 last edited by
                              #14

                              @ParanoidAndroid said in Line Tracer/Digitizer:

                              Will this give an x coordinate aswell

                              Just iterate over all x coordinates and search for y like @mrjj suggested. Or iterate over y and get x...

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

                              1 Reply Last reply
                              0

                              4/14

                              28 Nov 2019, 00:01

                              topic:navigator.unread, 10
                              • Login

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