⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 common.cpp

📁 vc++数字图像识别技术典型案例
💻 CPP
字号:
/****************************************************************************** * 光学字符识别程序 * 文件名:common.cpp * 功能  :共用文件实现 * modified by PRTsinghua@hotmail.com******************************************************************************/#include "common.h"/****************************************************************************** * 经过的时间 * 参数:curtime   当前时间 * 返回:时间******************************************************************************/double seconds_passed(struct timeval &curtime){	struct timeval last=curtime;	gettimeofday(&curtime, 0);	return curtime.tv_sec-last.tv_sec+static_cast<double>(curtime.tv_usec-last.tv_usec)/1000000.0;}/****************************************************************************** * 获得下一个令牌 * 参数:is    输入流 * 返回:字符串******************************************************************************/string get_next_token(istream &is){	string result;	while( is.good() )	{		int ch=is.get();		if( ch==EOF )			break;		if( static_cast<char>(ch)=='\n' || static_cast<char>(ch)=='\r' )		{			if( result!="" )				is.unget();			else				result+='\n';			break;		}		if( static_cast<char>(ch)==' ' || static_cast<char>(ch)=='\t' )		{			if( result!="" )				break;			else				continue;		}		if( static_cast<char>(ch)==',' || static_cast<char>(ch)==';' )		{			if( result!="" )				is.unget();			else				result+=static_cast<char>(ch);			break;		}		result+=static_cast<char>(ch);	}	return result;}

⌨️ 快捷键说明

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