Yep, KanjiVG's strokes are just standard SVG paths:
http://www.w3.org/TR/SVG/paths.html#PathData
The graph area size is always 109x109.
By the way, why the title "KanjiVG group broken"?
Alex.
Right, I'm having problems like that too - KanjiVG group is incredibly
slow. And I'm not even sure messages get delivered.
> Thanks for the SVG pointer, I'll check this out now.
If you want an example code for parsing such paths, you can have a
look at Tagaini's code:
Especially the pathFromSVG method. It's pretty simple to render these
paths using Qt. A SVG library would also make it, I guess. Also, if
you can access the KanjiVG group, Ben posted some perl code that
builds a readable SVG image from the paths.
Alex.
Nice! Be careful if you redistribute this file, as KanjiVG's licence
is Creative Commons Attribution-Noncommercial-Share Alike. You may
have a conflict if you are selling your application.
> I checked
> out your SVG references and wrote some iphone code to render the path from
> the SVG data, which seems to work pretty well. I've written a kanji writing
> recognition algorithm that takes kanji path data (vector format) and
> compares it with another path data to give a percentage score. I have the
> code in c# and objective-c, if it would be useful to you I'd be happy to
> post it.
Indeed, I'd be interested to see that code - that could be the start
of a new kanji recognition module. And I know about someone else who
asked for such code not so long ago.
Alex.
Yeah, looks like the NC clause of the licence seems to be creating
problems anybody who wants to use the data. :p You may want to contact
Ulrich (unless he reads the messages here?), it is maybe not
impossible that the licence changes to Attribution-Share Alike, or
maybe you can negotiate special usage terms with him.
> I've attached the c# version of my flash card engine which has the
> KanjiDrawing class. This contains a Compare function that returns a
> percentage of how close your drawing it to that of the kanji. Path data is
> held as a list of strokes, each of which is a starting point plus a list of
> vectors. C# is pretty easy to read, so it should be easy to re-engineer if
> another language if anyone finds it useful. It basically breaks each stroke
> down into a sequence of vectors and compares the angle of each vector and
> then compares the position of the bounding box within the overall character
> bounding box. It then uses these two number to compute the accuracy of the
> stroke. Pretty simple but it works well in practice.
Thanks, I'll have a look - I was interested in such code, but too lazy
to do my own homework. Maybe we can build an input method on top of
KanjiVG, or at least this would be useful to implement kanji drawing
games similar to the ones you can see on Nintendo DS.
Alex.
<Grader.cs>