main.cpp

来自「Visual C++数字图像识别技术典型案例 光盘源码」· C++ 代码 · 共 57 行

CPP
57
字号
/****************************************************************************** * 光学字符识别程序 * 文件名:main.cpp * 功能  :主程序 * modified by PRTsinghua@hotmail.com******************************************************************************/#include <kcmdlineargs.h>#include <kaboutdata.h>#include <klocale.h>#include <kstandarddirs.h>#include "global.h"#include "kognition.h"static const char *description =	I18N_NOOP("OCR");static KCmdLineOptions options[] ={  { "+[File]", I18N_NOOP("file to open"), 0 },  { 0, 0, 0 }};int main(int argc, char *argv[]){	KAboutData aboutData( "kognition", I18N_NOOP("Kognition"),		VERSION, description, KAboutData::License_GPL,		"PRTsinghua@hotmail.com", 0, "^_^", 0);	aboutData.addAuthor("...",0, "...");	aboutData.addAuthor("...",0, "...");	KCmdLineArgs::init( argc, argv, &aboutData );	KCmdLineArgs::addCmdLineOptions( options );	KApplication app;	char_db.read(locate("appdata", "char_data.dat"));	// 加载模式数据库	word_dict.read(locate("appdata", "words_de.dat"));	// 加载词表	if( app.isRestored() )	{		RESTORE(KognitionApp);	}	else 	{		KognitionApp *kognition = new KognitionApp();		kognition->show();		KCmdLineArgs *args = KCmdLineArgs::parsedArgs();		if( args->count() )		{			kognition->openDocumentFile(args->arg(0));		}		args->clear();	}	return app.exec();}  

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?