通过连接数据库,利用opencv自动生成比赛对阵图
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4832 2011-09-27 14:58 matchscheduleCvxText.cpp
文件 5500 2011-09-26 20:42 matchscheduleCvxText.h
文件 58913 2011-10-10 14:53 matchscheduleDebugCvxText.obj
文件 1257547 2011-11-10 19:48 matchscheduleDebugmatchschedule.exe
文件 422724 2011-11-10 19:48 matchscheduleDebugmatchschedule.ilk
文件 71979 2011-11-10 19:48 matchscheduleDebugmatchschedule.obj
文件 5756944 2011-10-10 14:52 matchscheduleDebugmatchschedule.pch
文件 1885184 2011-11-10 19:48 matchscheduleDebugmatchschedule.pdb
文件 224170 2010-11-20 20:19 matchscheduleDebugmsado15.tlh
文件 168940 2010-11-20 20:19 matchscheduleDebugmsado15.tli
文件 119743 2011-10-10 14:52 matchscheduleDebugStdAfx.obj
文件 295936 2011-11-10 19:48 matchscheduleDebugvc60.idb
文件 651264 2011-11-10 19:48 matchscheduleDebugvc60.pdb
文件 2656810 2011-09-27 09:38 matchschedulefreetype246ST_D.lib
文件 3890 2011-09-26 15:49 matchscheduleft2build.h
文件 4920 2011-11-10 19:48 matchschedulematchschedule.cpp
文件 4852 2011-10-10 13:51 matchschedulematchschedule.dsp
文件 532 2011-10-10 13:33 matchschedulematchschedule.dsw
文件 173056 2011-11-10 23:42 matchschedulematchschedule.ncb
文件 50688 2011-11-10 23:42 matchschedulematchschedule.opt
文件 1732 2011-11-10 19:48 matchschedulematchschedule.plg
文件 224088 2010-11-20 20:19 matchschedulemsado15.tlh
文件 168899 2010-11-20 20:19 matchschedulemsado15.tli
文件 1250 2011-10-10 13:33 matchscheduleReadMe.txt
文件 11785184 2009-06-11 05:25 matchschedulesimkai.ttf
文件 300 2011-10-10 13:33 matchscheduleStdAfx.cpp
文件 808 2011-10-10 14:52 matchscheduleStdAfx.h
文件 10808952 2008-06-25 13:32 matchschedulewqy-zenhei.ttf
目录 0 2011-11-10 19:48 matchscheduleDebug
目录 0 2011-11-10 23:42 matchschedule
............此处省略3个文件信息
#include “stdafx.h“
#include
#include
#include
#include
#include “cv.h“
#include “highgui.h“
#include “iostream.h“
#include “CvxText.h“
CvxText::CvxText(const char *freeType)
{
assert(freeType != NULL);
// 打开字库文件 创建一个字体
if(FT_Init_FreeType(&m_library)) throw;
if(FT_New_Face(m_library freeType 0 &m_face)) throw;
// 设置字体输出参数
restoreFont();
// 设置C语言的字符集环境
setlocale(LC_ALL ““);
}
// 释放FreeType资源
CvxText::~CvxText()
{
FT_Done_Face (m_face);
FT_Done_FreeType(m_library);
}
// 设置字体参数:
//
// font - 字体类型 目前不支持
// size - 字体大小/空白比例/间隔比例/旋转角度
// underline - 下画线
// diaphaneity - 透明度
void CvxText::getFont(int *type CvScalar *size bool *underline float *diaphaneity)
{
if(type) *type = m_fontType;
if(size) *size = m_fontSize;
if(underline) *underline = m_fontUnderline;
if(diaphaneity) *diaphaneity = m_fontDiaphaneity;
}
void CvxText::setFont(int *type CvScalar *size bool *underline float *diaphaneity)
{
// 参数合法性检查
if(type)
{
if(type >= 0) m_fontType = *type;
}
if(size)
{
m_fontSize.val[0] = fabs(size->val[0]);
m_fontSize.val[1] = fabs(size->val[1]);
m_fontSize.val[2] = fabs(size->val[2]);
m_fontSize.val[3] = fabs(size->val[3]);
}
if(underline)
{
m_fontUnderline = *underline;
}
if(diaphaneity)
{
m_fontDiaphaneity = *diaphaneity;
}
}
// 恢复原始的字体设置
void CvxText::restoreFont()
{
m_fontType = 0; // 字体类型(不支持)
m_fontSize.val[0] = 20; // 字体大小
m_fontSize.val[1] = 0.5; // 空白字符大小比例
m_fontSize.val[2] = 0.1; // 间隔大小比例
m_fontSize.val[3] = 0; // 旋转角度(不支持)
m_fontUnderline = false; // 下画线(不支持)
m_fontDiaphaneity = 1.0; // 色彩比例(可产生透明效果)
// 设置字符大小
FT_Set_Pixel_Sizes(m_face (int)m_fontSize.val[0] 0);
}
// 输出函数(颜色默认为黑色)
int CvxText::putText(IplImage *img const char *text CvPoint pos)
{
return putText(img text pos CV_RGB(255255255));
}
int CvxText::putText(IplImage *img const wchar_t *text CvPoint pos)
{
return putText(img text pos CV_RGB(255255255));
}
//
int CvxText::putText(IplImage *img const char *text CvPoint pos CvScalar color)
{
if(img == NULL) return -1;
if(text == NULL) return -1;
//
int i;
for(i = 0;text[i] != ‘ ‘; ++i) //注意是 而不是/0
{
wchar_t wc = text[i];
//cout< // 解析双字节符号
//setlocale(LC_ALL““);
if(!isascii(wc))
mbtowc(&wc &text[i++] 2);
// 输出当前的字符
putWChar(img wc pos color);
}
return i;
/*wchar_t wc[30];
mbtowc(&wc &text 30);
return 0;*/
}
int CvxText::putText(IplImage *img const wchar_t *text CvPoint pos CvScalar color)
{
if(img == NULL) return -1;
if(text == NULL) return -1;
//
int i;
for(i = 0; t
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4832 2011-09-27 14:58 matchscheduleCvxText.cpp
文件 5500 2011-09-26 20:42 matchscheduleCvxText.h
文件 58913 2011-10-10 14:53 matchscheduleDebugCvxText.obj
文件 1257547 2011-11-10 19:48 matchscheduleDebugmatchschedule.exe
文件 422724 2011-11-10 19:48 matchscheduleDebugmatchschedule.ilk
文件 71979 2011-11-10 19:48 matchscheduleDebugmatchschedule.obj
文件 5756944 2011-10-10 14:52 matchscheduleDebugmatchschedule.pch
文件 1885184 2011-11-10 19:48 matchscheduleDebugmatchschedule.pdb
文件 224170 2010-11-20 20:19 matchscheduleDebugmsado15.tlh
文件 168940 2010-11-20 20:19 matchscheduleDebugmsado15.tli
文件 119743 2011-10-10 14:52 matchscheduleDebugStdAfx.obj
文件 295936 2011-11-10 19:48 matchscheduleDebugvc60.idb
文件 651264 2011-11-10 19:48 matchscheduleDebugvc60.pdb
文件 2656810 2011-09-27 09:38 matchschedulefreetype246ST_D.lib
文件 3890 2011-09-26 15:49 matchscheduleft2build.h
文件 4920 2011-11-10 19:48 matchschedulematchschedule.cpp
文件 4852 2011-10-10 13:51 matchschedulematchschedule.dsp
文件 532 2011-10-10 13:33 matchschedulematchschedule.dsw
文件 173056 2011-11-10 23:42 matchschedulematchschedule.ncb
文件 50688 2011-11-10 23:42 matchschedulematchschedule.opt
文件 1732 2011-11-10 19:48 matchschedulematchschedule.plg
文件 224088 2010-11-20 20:19 matchschedulemsado15.tlh
文件 168899 2010-11-20 20:19 matchschedulemsado15.tli
文件 1250 2011-10-10 13:33 matchscheduleReadMe.txt
文件 11785184 2009-06-11 05:25 matchschedulesimkai.ttf
文件 300 2011-10-10 13:33 matchscheduleStdAfx.cpp
文件 808 2011-10-10 14:52 matchscheduleStdAfx.h
文件 10808952 2008-06-25 13:32 matchschedulewqy-zenhei.ttf
目录 0 2011-11-10 19:48 matchscheduleDebug
目录 0 2011-11-10 23:42 matchschedule
............此处省略3个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)