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

📄 segbreakdet.cc

📁 手写识别是模式识别中研究得一个热点
💻 CC
字号:
//// SegBreakDet - detects all the possible segmant breaks (which are//  the freeman bvectors 0,1, and 2.// Input - reads HWRawDataC records from standard in, w/ freeman vect events.// Output - writes HWRawDataC records to standard out w/ seg break events.//// System Include Files.// Local Include Files.#include "HWRawDataC.hh"// Manifest Constants.// Prototypes.void OutputPossSegBreak(HWRawDataC);// Global Variablesint main(int argc, char *argv[]){  // Read off the header and put it back on the output stream.  HWHeaderC Header;  cin >> Header;  cout << Header;  // Process all of the data points.  int PenDown = 0;  HWRawDataC RawData;  while(!!(cin >> RawData))    {      switch(RawData.Type)	{	case PEN_UP:	  // Pass the pen up through.	  cout << RawData;	case FREEMAN_0:		// Strip out the freeman vectors.	case FREEMAN_1:	case FREEMAN_2:	case FREEMAN_3:	case FREEMAN_4:	case FREEMAN_5:	case FREEMAN_6:	case FREEMAN_7:	  // This is a freeman vector event.	  OutputPossSegBreak(RawData);	  break;	default:	  // Just pass the point through.	  cout << RawData;	  break;	}    }}//// OutputPossSegBreak() - checks to see if a ligature is starting (0,1,2).//void OutputPossSegBreak(HWRawDataC RawData){  static InLigature = 0;  static HWRawDataC LastVector;  switch(RawData.Type)    {    case FREEMAN_0:    case FREEMAN_1:    case FREEMAN_2:      if (!InLigature)	{	  // Output the seg break marker with time equal to the end of it.	  InLigature = 1;	  cerr << "Ligature start detected, Freeman " 	    << RawData.Type-FREEMAN_0 << ", from " << LastVector.DataPoint	      << " to " << RawData.DataPoint << " (" << RawData.Time << ")\n";	  HWRawDataC PossSegBreak;	  PossSegBreak.Time = RawData.Time;	  PossSegBreak.Type = POSS_SEG_BREAK;	  cout << PossSegBreak;	// End of vector.	}      // This is in a ligature so set bit.      InLigature = 1;      break;    default:      InLigature = 0;		// May have been a pen up.      break;    }  LastVector = RawData;}

⌨️ 快捷键说明

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