Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shape recognition #2

Open
danikula opened this issue Aug 4, 2016 · 5 comments
Open

Shape recognition #2

danikula opened this issue Aug 4, 2016 · 5 comments

Comments

@danikula
Copy link

danikula commented Aug 4, 2016

Is it possible to learn SDK to recognize shapes? Circle, Square, Arrow, Line, etc..

@phatware
Copy link
Owner

phatware commented Sep 9, 2016

There is already a basic recognizer of several geometrical shapes in the INK_ API. See Doc.

@alexeysmirnow
Copy link

There is another problem i have met during work with a shape recognition. Documentation says: a function SHAPETYPE INK_RecognizeShape(CGStroke *pStroke, int nStrokeCnt, SHAPETYPE inType) analyzes the stroke. If a geometrical shape is recognized, your pStroke will point on a new array of points representing recognized shape. Also function returns a type of shape.

I may say the function returns a correct type of a recognized shape, but, unfortunately, it doesn't change CGStroke data i have passed as parameter.

By the way, it makes sense to say InkWrapper.h has the same function, but the first parameter is CGStroke stroke, not CGStroke *pStroke.

@phatware
Copy link
Owner

phatware commented Nov 9, 2016

Right, the INK_RecognizeShape will not return the new stroke data only the type if it is recognized shape, if any.
Instead of this method, first use INK_EnableShapeRecognition( ... true ) then use INK_AddStroke(...) it will add a new stroke to INK_DATA object or a shape if it is recognized. To disable ink recognition, use INK_EnableShapeRecognition( ... false )

@alexeysmirnow
Copy link

Thanks. It really works.

@alexeysmirnow
Copy link

Also, i have noticed a shape recognition doesn't work from background threads (INK_RecognizeShape returns SHAPE_UNKNOWN; INK_AddStroke - false). But from the main thread it properly works.
Do I need to make this shape recognition asynchronous at all? Or it doesn't load the main thread too much?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants