Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by $$anonymous$$ · Oct 02, 2017 at 06:54 PM · pointdrawcheckoutlinecontour

How to check if you draw/outline a symblol by its contour?

Hello! Im currently making a game, and stuck with making a feature, in which you draw/outline a symbol that you see, main question is, how to determine if you`ve drawn it correctly? So its not gesture recognition, you are drawing a symbol by its contour. Like this.

alt text

Whats the best way to do it?I mean checking if you drew it correctly?

1)Make point along symbol and check if you connected them?

2)Or another way? Every advice is appriciated.

gifka.gif (170.9 kB)
Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TreyH · Oct 02, 2017 at 07:01 PM 0
Share

are you allowing any drawing order, or is it allowed to be a fixed path?

avatar image $$anonymous$$ TreyH · Oct 02, 2017 at 07:42 PM 0
Share

Yes, its allowed to draw from in any path, main thing is to draw it as much correctly as possible.

avatar image hexagonius · Oct 02, 2017 at 07:54 PM 0
Share

Here's an idea, probably naive do it might not be the best one, but, as usual, there might be no best.
First you need an ordered path of your shape as positions, a list of continuous, path-centered positions. Then, when the user starts swiping, his draw positions need to be compared with that path, to what the closest positions are. If you're at a sharp edge, you probably get alternating results, so as long as the result is not clear, in that case you check against two paths. Since the path is continuous, you shouldn't have any backtracking in positions to compare with. Up to a certain point it should be clear which path and which direction the user is about to swipe. If you always check for the shortest position, starting from the left one in both directions, stopping when the distance gets larger, you should be able to generate an average for the precision.

avatar image TreyH · Oct 02, 2017 at 08:18 PM 0
Share

Your first goal might be to write a utility function that will give you the distance from a given point to a line segment on the same plane. as outlined here

The next step might be to break that figure down down into just its lines (which is likely already done, given that you're already drawing something on a canvas).

Then, apply your distance-to-a-line function to that collection of lines for each point used in the user's drawing and deter$$anonymous$$e the smallest error / distance from your canvas for each. This will give you "distance" from that point to the original figure, allowing you to use those errors / distances for each drawn point to deter$$anonymous$$e how incorrect the attempt was.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by PSpiroz · Nov 30, 2017 at 01:48 PM

Have no proper answer, but I am in seek of answers to similar problems. A solution maybe "openCV" and "find Contours". In find Contours arguments you choose the represented hierarchy (https://docs.opencv.org/3.1.0/d9/d8b/tutorial_py_contours_hierarchy.html) of contours list so you can choose what you need to combine... I think It is a sophisticated way and really have no idea how you manage and code these, (this is what I am looking for right now). If you have already found another way, please share...

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Danielpunct · Jun 01, 2019 at 02:51 PM

Hey. Have you guys make any progress with this ?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

72 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Shader for Outline Contour Points 0 Answers

Physics.CheckSphere with tag 1 Answer

Draw line from one point to another using mouse 0 Answers

Temperature map shader 0 Answers

Draw point with time function 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges