Do you advise zinnia for handwriting recognition? I searched and find some libraries but some of them requires training for every different person's hand writing. Does zinnia require training for every different hand writing? I read its site but could not find out.
Also i need a library in C++, i can find some can be accessed using C or Java.
One more question, there is no answer in docs:
character->add(0, 51, 29);
what is defined above line, what is 51 and 29.
And can i use zinnia for a latin alphabet like english, i saw on google only Japanese usage examples. Here is sample code that is on zinnia's site:
#include <iostream>
#include "zinnia.h"
int main(int argc, char **argv) {
zinnia::Recognizer *recognizer = zinnia::Recognizer::create();
if (!recognizer->open("/usr/local/lib/zinnia/model/tomoe/handwriting-ja.model")) {
std::cerr << recognizer->what() << std::endl;
return -1;
}
zinnia::Character *character = zinnia::Character::create();
character->clear();
character->set_width(300);
character->set_height(300);
character->add(0, 51, 29);
character->add(0, 117, 41);
character->add(1, 99, 65);
character->add(1, 219, 77);
character->add(2, 27, 131);
character->add(2, 261, 131);
character->add(3, 129, 17);
character->add(3, 57, 203);
character->add(4, 111, 71);
character->add(4, 219, 173);
character->add(5, 81, 161);
character->add(5, 93, 281);
character->add(6, 99, 167);
character->add(6, 207, 167);
character->add(6, 189, 245);
character->add(7, 99, 227);
character->add(7, 189, 227);
character->add(8, 111, 257);
character->add(8, 189, 245);
zinnia::Result *result = recognizer->classify(*character, 10);
if (!result) {
std::cerr << recognizer->what() << std::endl;
return -1;
}
for (size_t i = 0; i < result->size(); ++i) {
std::cout << result->value(i) << "\t" << result->score(i) << std::endl;
}
delete result;
delete character;
delete recognizer;
return 0;
}
Thanks.
Zinnia doesn't generally require individual training. However, it performs better for characters with more strokes, so using it for Latin-based alphabets might not give you the best results. It is also dependent on correct stroke order, so if you train it with one way to write 'A', and the person using it writes it in another way, it might not get recognized.
The parameters to add()
are point number, x, y. It has bindings for Perl, Ruby and Python as well as the native C/C++ interfaces. It is trivial to write a JNI wrapper, so it can be used from Java as well.
The sample training set has, I believe, Latin letters and numbers, so you could just remove all the Japanese characters and train it to conduct your tests. (it will be much faster with a smaller model file).