开源中国

我们不支持 IE 10 及以下版本浏览器

It appears you’re using an unsupported browser

为了获得更好的浏览体验,我们强烈建议您使用较新版本的 Chrome、 Firefox、 Safari 等,或者升级到最新版本的IE浏览器。 如果您使用的是 IE 11 或以上版本,请关闭“兼容性视图”。
Zinnia首页、文档和下载 - 手写识别开发包 - 开源中国社区
全部项目分类
我要评价
BSD
C/C++
Windows
分享
收藏
31 人收藏
收录时间:2010-02-01
Zinnia 详细介绍

Zinnia 是一个简单、可定制和可移植的手写识别系统,基于 Support Vector Machines (SVM) 算法。SVM算法简介

实例代码:

#include <stdio.h>
#include "zinnia.h"

int main(int argc, char **argv) {
size_t i;
zinnia_recognizer_t *recognizer;
zinnia_character_t *character;
zinnia_result_t *result;

recognizer = zinnia_recognizer_new();

if (!zinnia_recognizer_open(recognizer, "/usr/local/lib/zinnia/model/tomoe/handwriting-ja.model")) {
fprintf(stderr, "ERROR: %s\n", zinnia_recognizer_strerror(recognizer));
return -1;
}

zinnia_character_t *character = zinnia_character_new();
zinnia_character_clear(character);
zinnia_character_set_width(character, 300);
zinnia_character_set_height(character, 300);
zinnia_character_add(character, 0, 51, 29);
zinnia_character_add(character, 0, 117, 41);
zinnia_character_add(character, 1, 99, 65);
zinnia_character_add(character, 1, 219, 77);
zinnia_character_add(character, 2, 27, 131);
zinnia_character_add(character, 2, 261, 131);
zinnia_character_add(character, 3, 129, 17);
zinnia_character_add(character, 3, 57, 203);
zinnia_character_add(character, 4, 111, 71);
zinnia_character_add(character, 4, 219, 173);
zinnia_character_add(character, 5, 81, 161);
zinnia_character_add(character, 5, 93, 281);
zinnia_character_add(character, 6, 99, 167);
zinnia_character_add(character, 6, 207, 167);
zinnia_character_add(character, 6, 189, 245);
zinnia_character_add(character, 7, 99, 227);
zinnia_character_add(character, 7, 189, 227);
zinnia_character_add(character, 8, 111, 257);
zinnia_character_add(character, 8, 189, 245);

result = zinnia_recognizer_classify(recognizer, character, 10);
if (result == NULL) {
fprintf(stderr, "%s\n", zinnia_recognizer_strerror(recognizer));
return -1;
}


for (i = 0; i < zinnia_result_size(result); ++i) {
fprintf(stdout, "%s\t%f\n",
zinnia_result_value(result, i),
zinnia_result_score(result, i));
}

zinnia_result_destroy(result);
zinnia_character_destroy(character);
zinnia_recognizer_destroy(recognizer);

return 0;
}

大家对 Zinnia 的评论 (全部 0 条评论)
{{repayCom.userName}}
顶部