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. How can I recognize a specific pattern of points entered by the user ?
Forum Updated to NodeBB v4.3 + New Features

How can I recognize a specific pattern of points entered by the user ?

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 1.8k 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.
  • S Offline
    S Offline
    shahd
    wrote on last edited by
    #1

    Hi,

    I'm working on a qt project. The user should input points to a screen on a mouse click. These points are braille dots, I want to translate these points to real characters. Is there a way in qt to recognize a specific pattern of points and finding relationships between dots entered to the screen ?
    I used qgraphicsitem to perform some calculations is there functions i can use?
    Note: I used a sliding window to recognize characters but I was told that the solution must be more dynamic.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Can you describe more precisely how the user should do that ? Does he have some sort of grid that he must click on to "write" the braille dots ?

      An image of the current widget would be useful

      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
        shahd
        wrote on last edited by
        #3

        Yes, the user clicks on a grid. I tried to use the positions of each point. Braille dots are arranged in 2 columns and 3 rows so I defined a sliding window that has 6 reference points and I calculated the distance from each point to each of the reference points. The points takes a flag that determines its position. But the sliding window is not a dynamic solution because of the fixed width and height.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Wouldn't be simpler to use them as "toggle switches" and map them on a translator class ?
          a f
          0 0 o 0 o 0
          0 0 -> 0 0 -> 0 o
          0 0 0 0 0 0

          You know that you have 6 points in a grid so numbering them e.g. from left to right and top to bottom you can recognize the a pattern when the point 0 is activated and f when the user adds point 3 (if the numbering starts from 0) etc. You are then independent of the size of the widget.

          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
            shahd
            wrote on last edited by
            #5

            I will not have only 6 points. The user will write sentences not only characters. Can you describe more I don't understand you way of recognizing the pattern.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              I thought so, the idea is that you create your braille char item and then re-use it as needed to create sentences. Something like:

              @
              class BrailleCharItem : public QGraphicsObject
              {
              Q_OBJECT
              public:
              BrailleCharItem();

              char toChar() const
              

              {
              // convert active points to char

              }

              signals:
              void charChanged(char brailleChar);

              private:
              void processPoints() {
              // call when a point has been clicked
              char myChar = toChar();
              emit charChanged(myChar);
              }
              };
              @

              Then you can align these items to create complete phrases

              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
                shahd
                wrote on last edited by
                #7

                Thank you. But I need you to describe the “toggle switches” if you have time.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Like a checkable QPushButton: click once on the point, set its "state" to checked and if another click happens state is unchecked. Then based on the checked state of your points you can return the corresponding char.

                  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