00001 /*!@file Vgames/app-nfsu-speed-extract.C */ 00002 00003 // //////////////////////////////////////////////////////////////////// // 00004 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2000-2005 // 00005 // by the University of Southern California (USC) and the iLab at USC. // 00006 // See http://iLab.usc.edu for information about this project. // 00007 // //////////////////////////////////////////////////////////////////// // 00008 // Major portions of the iLab Neuromorphic Vision Toolkit are protected // 00009 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency // 00010 // in Visual Environments, and Applications'' by Christof Koch and // 00011 // Laurent Itti, California Institute of Technology, 2001 (patent // 00012 // pending; application number 09/912,225 filed July 23, 2001; see // 00013 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status). // 00014 // //////////////////////////////////////////////////////////////////// // 00015 // This file is part of the iLab Neuromorphic Vision C++ Toolkit. // 00016 // // 00017 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can // 00018 // redistribute it and/or modify it under the terms of the GNU General // 00019 // Public License as published by the Free Software Foundation; either // 00020 // version 2 of the License, or (at your option) any later version. // 00021 // // 00022 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope // 00023 // that it will be useful, but WITHOUT ANY WARRANTY; without even the // 00024 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // 00025 // PURPOSE. See the GNU General Public License for more details. // 00026 // // 00027 // You should have received a copy of the GNU General Public License // 00028 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write // 00029 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, // 00030 // Boston, MA 02111-1307 USA. // 00031 // //////////////////////////////////////////////////////////////////// // 00032 // 00033 // Primary maintainer for this file: Rob Peters <rjpeters at usc dot edu> 00034 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Vgames/app-nfsu-speed-extract.C $ 00035 // $Id: app-nfsu-speed-extract.C 9412 2008-03-10 23:10:15Z farhan $ 00036 // 00037 00038 #ifndef VGAMES_APP_NFSU_SPEED_EXTRACT_C_DEFINED 00039 #define VGAMES_APP_NFSU_SPEED_EXTRACT_C_DEFINED 00040 00041 #include "Component/ModelManager.H" 00042 #include "GUI/XWinManaged.H" 00043 #include "Image/ColorOps.H" 00044 #include "Image/CutPaste.H" 00045 #include "Image/DrawOps.H" 00046 #include "Image/FilterOps.H" 00047 #include "Image/Image.H" 00048 #include "Image/Layout.H" 00049 #include "Image/MathOps.H" 00050 #include "Image/Pixels.H" 00051 #include "Image/ShapeOps.H" 00052 #include "Image/SimpleFont.H" 00053 #include "Media/FrameSeries.H" 00054 #include "Raster/GenericFrame.H" 00055 #include "Raster/Raster.H" 00056 #include "Raster/PfmParser.H" 00057 #include "Raster/PfmWriter.H" 00058 #include "Transport/FrameInfo.H" 00059 #include "Util/Pause.H" 00060 #include "Util/StringUtil.H" 00061 #include "Util/csignals.H" 00062 #include "Util/sformat.H" 00063 #include "rutz/shared_ptr.h" 00064 00065 #include <algorithm> 00066 #include <deque> 00067 #include <fstream> 00068 #include <iomanip> 00069 #include <iterator> 00070 #include <limits> 00071 #include <map> 00072 #include <sstream> 00073 #include <vector> 00074 00075 #include <unistd.h> 00076 00077 int getDigit(XWinManaged& xwin) 00078 { 00079 std::string resp; 00080 while (1) 00081 { 00082 if ((resp = xwin.getLastKeyString()).length() > 0) 00083 { 00084 if (resp[0] == ' ') 00085 return -1; 00086 else if (isdigit(resp[0])) 00087 return resp[0] - '0'; 00088 } 00089 } 00090 ASSERT(false); 00091 return -2; 00092 } 00093 00094 Image<PixRGB<byte> > normC255(const Image<PixRGB<double> >& x) 00095 { 00096 Image<PixRGB<double> > tmp(x); 00097 normalizeC(tmp, 0, 255); 00098 return Image<PixRGB<byte> >(tmp); 00099 } 00100 00101 template <class T, template <class> class Pix> 00102 Image<T> getPixelComponent(const Image<Pix<T> >& in, const size_t i) 00103 { 00104 Image<T> result(in.getDims(), NO_INIT); 00105 00106 typename Image<Pix<T> >::const_iterator sptr = in.begin(); 00107 typename Image<T>::iterator dptr = result.beginw(); 00108 typename Image<T>::iterator stop = result.endw(); 00109 00110 while (dptr != stop) 00111 { 00112 *dptr = sptr->p[i]; 00113 ++dptr; ++sptr; 00114 } 00115 00116 return result; 00117 } 00118 00119 class Patch 00120 { 00121 public: 00122 Patch(const Dims& dims) 00123 : 00124 itsSum(dims, ZEROS), 00125 itsN(0), 00126 itsTouched(false) 00127 {} 00128 00129 void addPatch(const Image<float>& p) 00130 { 00131 ASSERT(p.getDims() == itsSum.getDims()); 00132 itsSum += p; 00133 ++itsN; 00134 itsTouched = true; 00135 } 00136 00137 Image<float> getMean() const { return itsSum / itsN; } 00138 00139 int w() const { return itsSum.getWidth(); } 00140 00141 Dims getDims() const { return itsSum.getDims(); } 00142 00143 void save(const std::string& base) const 00144 { 00145 if (!itsTouched) 00146 return; 00147 00148 std::ofstream ofs(sformat("%s.num", base.c_str()).c_str()); 00149 if (!ofs.is_open()) 00150 LFATAL("couldn't open %s.num for writing", base.c_str()); 00151 ofs << itsN << '\n'; 00152 PfmWriter::writeFloat(itsSum, sformat("%s.pfm", base.c_str())); 00153 PfmWriter::writeFloat(this->getMean(), sformat("%s-mean.pfm", base.c_str())); 00154 } 00155 00156 bool load(const std::string& base) 00157 { 00158 std::ifstream ifs(sformat("%s.num", base.c_str()).c_str()); 00159 if (!ifs.is_open()) 00160 { 00161 LINFO("couldn't open %s.num for reading", base.c_str()); 00162 return false; 00163 } 00164 if (!(ifs >> itsN)) 00165 LFATAL("couldn't read itsN from %s.num", base.c_str()); 00166 00167 const Dims olddims = itsSum.getDims(); 00168 itsSum = PfmParser(sformat("%s.pfm", base.c_str())).getFrame().asFloat(); 00169 if (itsSum.getDims() != olddims) 00170 LFATAL("wrong dims in %s.pfm (expected %dx%d, got %dx%d)", 00171 base.c_str(), olddims.w(), olddims.h(), 00172 itsSum.getWidth(), itsSum.getHeight()); 00173 00174 LINFO("loaded %d samples from %s.num and %s.pfm", 00175 itsN, base.c_str(), base.c_str()); 00176 return true; 00177 } 00178 00179 void loadDefault(const Image<float>& img) 00180 { 00181 itsN = 1; 00182 itsSum = img; 00183 } 00184 00185 double distance(const Image<float>& patch) const 00186 { 00187 ASSERT(patch.getDims() == itsSum.getDims()); 00188 if (itsN == 0) 00189 return std::numeric_limits<double>::max(); 00190 return 100.0 * (1.0 - corrcoef(this->getMean(), patch)); 00191 } 00192 00193 private: 00194 Image<float> itsSum; 00195 int itsN; 00196 bool itsTouched; 00197 }; 00198 00199 class PatchSet 00200 { 00201 public: 00202 PatchSet(int height) 00203 { 00204 const int widths[10] = 00205 { 13, 6, 12, 11, 12, 12, 12, 10, 13, 12 }; 00206 00207 for (int i = 0; i < 10; ++i) 00208 itsPatches.push_back(Patch(Dims(widths[i], height))); 00209 } 00210 00211 Patch& operator[](int i) 00212 { 00213 ASSERT(i >= 0); 00214 ASSERT(i <= 9); 00215 return itsPatches[i]; 00216 } 00217 00218 void save() const 00219 { 00220 for (int i = 0; i < 10; ++i) 00221 itsPatches[i].save(sformat("nfsu-speed-patch-%d", i)); 00222 } 00223 00224 bool load() 00225 { 00226 bool any_loaded = false; 00227 for (int i = 0; i < 10; ++i) 00228 if (itsPatches[i].load(sformat("nfsu-speed-patch-%d", i))) 00229 any_loaded = true; 00230 00231 return any_loaded; 00232 } 00233 00234 void loadDefault() 00235 { 00236 const int w_digit0_C = 13; 00237 const int h_digit0_C = 21; 00238 const float digit0_C[273] = { 00239 /* row 0 */ 1.870305777e+00, 2.117372990e+00, 2.422724962e+00, 2.439984322e+00, 2.433679104e+00, 1.793503404e+00, 1.506169677e+00, 1.501450539e+00, 9.071485996e-01, 1.498622179e+00, 1.193438172e+00, 9.147163033e-01, 1.530450106e+00, 00240 /* row 1 */ 9.321733475e+00, 7.205845833e+00, 7.488436222e+00, 9.112026215e+00, 3.252070236e+01, 9.316902161e+01, 1.369372711e+02, 1.562661133e+02, 1.572765350e+02, 1.246328659e+02, 7.724430084e+01, 2.013733673e+01, 1.387808228e+01, 00241 /* row 2 */ 3.164922905e+01, 1.835928726e+01, 1.874288940e+01, 3.894197845e+01, 1.258514175e+02, 1.733766785e+02, 1.864566345e+02, 1.972059784e+02, 2.042941589e+02, 2.024118500e+02, 1.750323639e+02, 8.021561432e+01, 3.650958252e+01, 00242 /* row 3 */ 4.006607819e+01, 2.149939728e+01, 2.709994888e+01, 9.202788544e+01, 1.518587189e+02, 1.708457794e+02, 1.830121002e+02, 1.937802887e+02, 2.021780396e+02, 2.007609863e+02, 1.831149292e+02, 1.325655212e+02, 5.301642990e+01, 00243 /* row 4 */ 5.154332352e+01, 4.037910461e+01, 8.595194244e+01, 1.529790955e+02, 1.610661163e+02, 1.359155121e+02, 5.520320129e+01, 3.538412476e+01, 8.200156403e+01, 1.496564636e+02, 1.794185181e+02, 1.554119568e+02, 7.305215454e+01, 00244 /* row 5 */ 6.224728012e+01, 5.634580231e+01, 1.274200439e+02, 1.755594788e+02, 1.651378326e+02, 9.105023193e+01, 1.983292580e+01, 1.363175297e+01, 3.564718246e+01, 1.304887848e+02, 1.815312805e+02, 1.818226013e+02, 9.622341919e+01, 00245 /* row 6 */ 7.476343536e+01, 7.696611023e+01, 1.569570465e+02, 1.857561951e+02, 1.641383362e+02, 6.169326019e+01, 1.926684380e+01, 1.575367355e+01, 3.153053474e+01, 1.362353058e+02, 1.812688293e+02, 1.809875336e+02, 9.386958313e+01, 00246 /* row 7 */ 7.781166077e+01, 8.775296783e+01, 1.788339386e+02, 1.944245300e+02, 1.594123383e+02, 3.668602753e+01, 1.966919899e+01, 1.879580879e+01, 3.621611786e+01, 1.526804962e+02, 1.833406219e+02, 1.769396057e+02, 7.676601410e+01, 00247 /* row 8 */ 5.639064789e+01, 8.158573914e+01, 1.692471313e+02, 1.813701324e+02, 1.342369537e+02, 2.794770622e+01, 1.923528481e+01, 2.022482681e+01, 5.079097366e+01, 1.477840729e+02, 1.684321747e+02, 1.281421967e+02, 4.532813644e+01, 00248 /* row 9 */ 3.238868332e+01, 5.965954208e+01, 1.441458282e+02, 1.485010223e+02, 7.922932434e+01, 2.275879097e+01, 1.722335625e+01, 1.789043617e+01, 4.183993530e+01, 1.272503815e+02, 1.349986572e+02, 9.960229492e+01, 2.699600410e+01, 00249 /* row 10 */ 2.191309738e+01, 6.166062927e+01, 1.300458832e+02, 1.261009674e+02, 3.061004448e+01, 1.805384445e+01, 1.593635750e+01, 1.644855881e+01, 3.780875778e+01, 1.168245773e+02, 1.224153824e+02, 6.515602875e+01, 1.731404114e+01, 00250 /* row 11 */ 2.744571877e+01, 9.518328094e+01, 1.342511749e+02, 1.106194077e+02, 2.566280556e+01, 1.814952278e+01, 1.632154846e+01, 1.959346199e+01, 5.635646439e+01, 1.283865967e+02, 1.293305359e+02, 5.638500977e+01, 1.852720833e+01, 00251 /* row 12 */ 5.275376892e+01, 1.420611572e+02, 1.673764343e+02, 1.258178940e+02, 3.405015564e+01, 1.968541145e+01, 1.882896042e+01, 2.745148659e+01, 1.091264877e+02, 1.561589661e+02, 1.577788239e+02, 6.887202454e+01, 2.569300270e+01, 00252 /* row 13 */ 7.291710663e+01, 1.674785767e+02, 1.831304169e+02, 1.470805817e+02, 3.502304459e+01, 2.029174995e+01, 1.904452896e+01, 4.215042496e+01, 1.480916138e+02, 1.752779999e+02, 1.718968811e+02, 7.379546356e+01, 3.301491928e+01, 00253 /* row 14 */ 9.382233429e+01, 1.820380554e+02, 1.931244354e+02, 1.456940765e+02, 3.378955841e+01, 2.055102158e+01, 2.218830872e+01, 7.120536804e+01, 1.648540344e+02, 1.789580688e+02, 1.615941467e+02, 4.724712372e+01, 3.003572273e+01, 00254 /* row 15 */ 1.140407791e+02, 1.949039001e+02, 1.991626892e+02, 1.424076538e+02, 3.423669052e+01, 2.320105171e+01, 2.490546608e+01, 9.754825592e+01, 1.735768127e+02, 1.825256958e+02, 1.504326630e+02, 3.953180313e+01, 3.108602142e+01, 00255 /* row 16 */ 1.117767639e+02, 1.933524475e+02, 2.041711426e+02, 1.670226898e+02, 5.204982758e+01, 3.249206161e+01, 5.700411224e+01, 1.306670074e+02, 1.781840973e+02, 1.747239380e+02, 1.170083008e+02, 3.795109558e+01, 3.224008560e+01, 00256 /* row 17 */ 8.508930206e+01, 1.789068146e+02, 2.110476990e+02, 2.071325684e+02, 1.930166931e+02, 1.828013153e+02, 1.824719238e+02, 1.807858124e+02, 1.740194397e+02, 1.490505524e+02, 8.797656250e+01, 3.498008728e+01, 3.547328568e+01, 00257 /* row 18 */ 5.732773209e+01, 1.518188171e+02, 2.046837616e+02, 2.107012787e+02, 2.022689056e+02, 1.968027039e+02, 1.916281281e+02, 1.830085449e+02, 1.628216553e+02, 9.133598328e+01, 5.319266129e+01, 3.139797783e+01, 3.318361282e+01, 00258 /* row 19 */ 1.880955315e+01, 6.715135956e+01, 1.250787430e+02, 1.504515076e+02, 1.652704620e+02, 1.682274323e+02, 1.572817993e+02, 1.366018372e+02, 8.112863159e+01, 3.123635483e+01, 2.582480431e+01, 1.765554810e+01, 1.792319870e+01, 00259 /* row 20 */ 3.135084867e+00, 3.165635109e+00, 3.481703758e+00, 3.382241488e+00, 4.322377682e+00, 3.921734333e+00, 3.683054686e+00, 3.077805996e+00, 3.981401205e+00, 3.626128197e+00, 3.041235209e+00, 3.261234999e+00, 3.278276205e+00 00260 }; 00261 const int w_digit1_C = 13; 00262 const int h_digit1_C = 21; 00263 const float digit1_C[273] = { 00264 /* row 0 */ 1.360921383e+00, 1.315169573e+00, 1.205365181e+00, 1.093543172e+00, 9.756684303e-01, 8.671172857e-01, 8.611253500e-01, 8.551333547e-01, 9.043533802e-01, 9.585926533e-01, 9.752413630e-01, 9.793598652e-01, 9.810759425e-01, 00265 /* row 1 */ 7.553061485e+00, 1.119324398e+01, 1.992967987e+01, 3.349810028e+01, 6.156248856e+01, 8.828668213e+01, 1.002688522e+02, 1.122510223e+02, 1.033437958e+02, 9.253752899e+01, 7.084380341e+01, 4.552090454e+01, 3.496971512e+01, 00266 /* row 2 */ 1.334245586e+01, 2.051750946e+01, 3.773764038e+01, 6.267989731e+01, 1.107885590e+02, 1.566254272e+02, 1.774728394e+02, 1.983202362e+02, 1.939634399e+02, 1.873153687e+02, 1.605269775e+02, 1.270251236e+02, 1.130660400e+02, 00267 /* row 3 */ 1.368014145e+01, 1.958413315e+01, 3.375371170e+01, 5.708593750e+01, 1.079061356e+02, 1.564669342e+02, 1.801746063e+02, 2.038822784e+02, 2.060424805e+02, 2.062438354e+02, 1.867673035e+02, 1.607314606e+02, 1.498832092e+02, 00268 /* row 4 */ 1.049026203e+01, 1.082005215e+01, 1.161154938e+01, 1.996216011e+01, 5.099013138e+01, 8.324593353e+01, 1.290081787e+02, 1.747704315e+02, 1.863796234e+02, 1.948840179e+02, 1.823310852e+02, 1.627590332e+02, 1.546040192e+02, 00269 /* row 5 */ 7.042336464e+00, 7.023936272e+00, 6.979775906e+00, 1.304000473e+01, 3.741341400e+01, 6.388009644e+01, 1.133729706e+02, 1.628658600e+02, 1.756718445e+02, 1.851426697e+02, 1.765758972e+02, 1.619965668e+02, 1.559218597e+02, 00270 /* row 6 */ 6.899986267e+00, 6.958978176e+00, 7.100558758e+00, 1.402799988e+01, 4.131303406e+01, 7.021913147e+01, 1.169571533e+02, 1.636951752e+02, 1.754540253e+02, 1.840329590e+02, 1.704756622e+02, 1.495395966e+02, 1.408162537e+02, 00271 /* row 7 */ 6.417622089e+00, 6.501431465e+00, 6.702574730e+00, 1.490708065e+01, 4.712169266e+01, 8.028846741e+01, 1.239292450e+02, 1.675700378e+02, 1.768073578e+02, 1.829170990e+02, 1.640965424e+02, 1.369658661e+02, 1.256614304e+02, 00272 /* row 8 */ 7.165993690e+00, 7.434634686e+00, 8.079372406e+00, 1.585613346e+01, 4.502898026e+01, 7.498849487e+01, 1.136016083e+02, 1.522147217e+02, 1.562303467e+02, 1.571007385e+02, 1.332689209e+02, 1.012029800e+02, 8.784220123e+01, 00273 /* row 9 */ 6.486180782e+00, 6.928678513e+00, 7.990673542e+00, 1.435985470e+01, 3.665060806e+01, 5.970068741e+01, 9.110350037e+01, 1.225063019e+02, 1.251207504e+02, 1.251180801e+02, 9.977256012e+01, 6.597940063e+01, 5.189894485e+01, 00274 /* row 10 */ 5.345476151e+00, 6.261189461e+00, 8.458901405e+00, 1.561142540e+01, 3.762839508e+01, 5.990668106e+01, 8.505959320e+01, 1.102125092e+02, 1.026135025e+02, 9.203704834e+01, 6.589958954e+01, 3.457509613e+01, 2.152324677e+01, 00275 /* row 11 */ 6.568379402e+00, 8.662418365e+00, 1.368811321e+01, 2.583784294e+01, 5.935969925e+01, 9.129193115e+01, 1.057384338e+02, 1.201849442e+02, 1.040368958e+02, 8.510752106e+01, 5.967816925e+01, 3.208212280e+01, 2.058379364e+01, 00276 /* row 12 */ 7.969554424e+00, 1.430735111e+01, 2.951806259e+01, 5.203660202e+01, 9.647865295e+01, 1.380193329e+02, 1.476452332e+02, 1.572711487e+02, 1.342892151e+02, 1.083429184e+02, 7.944190216e+01, 4.955594254e+01, 3.710348129e+01, 00277 /* row 13 */ 7.563422203e+00, 1.800831413e+01, 4.307605362e+01, 7.381970978e+01, 1.215911255e+02, 1.658551178e+02, 1.715376282e+02, 1.772201538e+02, 1.536346283e+02, 1.273883667e+02, 9.695305634e+01, 6.512135315e+01, 5.185816574e+01, 00278 /* row 14 */ 1.036739159e+01, 2.577047920e+01, 6.273788834e+01, 1.000094452e+02, 1.381934509e+02, 1.734971466e+02, 1.771176147e+02, 1.807380981e+02, 1.489553375e+02, 1.139540863e+02, 8.758898926e+01, 6.410256958e+01, 5.431657791e+01, 00279 /* row 15 */ 1.375808430e+01, 3.306990814e+01, 7.941828918e+01, 1.220618515e+02, 1.535909882e+02, 1.825733032e+02, 1.835408020e+02, 1.845082855e+02, 1.474696808e+02, 1.069759521e+02, 8.408513641e+01, 6.706193542e+01, 5.996895218e+01, 00280 /* row 16 */ 2.037394714e+01, 3.992588806e+01, 8.685054016e+01, 1.279805832e+02, 1.517268066e+02, 1.733200226e+02, 1.712301941e+02, 1.691403656e+02, 1.276440811e+02, 8.256536865e+01, 6.361519241e+01, 5.337450027e+01, 4.910755539e+01, 00281 /* row 17 */ 2.408734322e+01, 4.314127731e+01, 8.887071991e+01, 1.277794266e+02, 1.462259369e+02, 1.627489319e+02, 1.581132507e+02, 1.534775543e+02, 1.106113052e+02, 6.426952362e+01, 4.598950577e+01, 3.706338120e+01, 3.334416962e+01, 00282 /* row 18 */ 2.094436836e+01, 3.549980927e+01, 7.043286133e+01, 1.001882477e+02, 1.144106293e+02, 1.263334351e+02, 1.129608002e+02, 9.958815765e+01, 7.041421509e+01, 3.980376816e+01, 2.897635841e+01, 2.474328232e+01, 2.297950363e+01, 00283 /* row 19 */ 5.241731644e+00, 7.583303928e+00, 1.320307732e+01, 1.842788506e+01, 2.246779251e+01, 2.589995575e+01, 2.264692307e+01, 1.939388847e+01, 1.436963558e+01, 9.184360504e+00, 7.785930634e+00, 7.649782181e+00, 7.593053818e+00, 00284 /* row 20 */ 6.649265885e-01, 6.617417932e-01, 6.540982127e-01, 6.484016180e-01, 6.485458612e-01, 6.529651880e-01, 7.044109106e-01, 7.558565736e-01, 8.204900026e-01, 8.863223791e-01, 9.092739820e-01, 9.179320335e-01, 9.215395451e-01 00285 }; 00286 const int w_digit2_C = 13; 00287 const int h_digit2_C = 21; 00288 const float digit2_C[273] = { 00289 /* row 0 */ 4.115942419e-01, 4.146943688e-01, 4.150987267e-01, 3.896032274e-01, 1.316111684e-01, 0.000000000e+00, 1.999374032e-01, 4.015281200e-01, 4.132901132e-01, 4.301891327e-01, 4.303450882e-01, 4.394477904e-01, 4.116105735e-01, 00290 /* row 1 */ 1.286009121e+01, 8.591117859e+00, 7.767005444e+00, 1.275042343e+01, 4.913651657e+01, 1.033673935e+02, 1.418818359e+02, 1.591840820e+02, 1.650222931e+02, 1.575644073e+02, 1.269347458e+02, 5.343654251e+01, 2.055980492e+01, 00291 /* row 2 */ 3.308557510e+01, 1.672390747e+01, 1.497099018e+01, 2.744247818e+01, 7.951344299e+01, 1.409777679e+02, 1.782981110e+02, 1.950637054e+02, 2.080057526e+02, 2.156197052e+02, 2.025405731e+02, 1.518121033e+02, 8.034458923e+01, 00292 /* row 3 */ 4.843927002e+01, 1.950613785e+01, 1.616358185e+01, 2.414266777e+01, 7.301273346e+01, 1.367680969e+02, 1.780923462e+02, 1.968876953e+02, 2.095688782e+02, 2.162264709e+02, 2.079011841e+02, 1.769602203e+02, 1.321274567e+02, 00293 /* row 4 */ 4.997118378e+01, 1.912900734e+01, 1.497545433e+01, 1.519985485e+01, 1.760124207e+01, 1.609700584e+01, 1.204715157e+01, 1.162248802e+01, 3.714334488e+01, 1.039362183e+02, 1.701356659e+02, 1.856893005e+02, 1.639165955e+02, 00294 /* row 5 */ 5.914497757e+01, 1.911823463e+01, 1.184780312e+01, 9.350792885e+00, 8.083599091e+00, 6.136300564e+00, 4.168298721e+00, 3.760723114e+00, 1.530837822e+01, 6.820635223e+01, 1.601692047e+02, 1.815002441e+02, 1.765950775e+02, 00295 /* row 6 */ 5.059488297e+01, 1.660481262e+01, 9.230022430e+00, 7.002650261e+00, 5.136733532e+00, 4.053275108e+00, 3.142541647e+00, 2.701812744e+00, 1.171951294e+01, 6.100260925e+01, 1.544915009e+02, 1.739121704e+02, 1.719311066e+02, 00296 /* row 7 */ 4.538167191e+01, 1.402146816e+01, 8.316429138e+00, 5.724229336e+00, 3.782662153e+00, 2.794941664e+00, 2.004033566e+00, 1.547627926e+00, 8.345958710e+00, 5.520067596e+01, 1.515774689e+02, 1.667810669e+02, 1.636252136e+02, 00297 /* row 8 */ 2.850030327e+01, 1.485297489e+01, 1.127813721e+01, 7.682430267e+00, 5.645952702e+00, 4.044443607e+00, 2.610828876e+00, 2.710969448e+00, 1.930705833e+01, 7.925938416e+01, 1.629802856e+02, 1.648322601e+02, 1.400739288e+02, 00298 /* row 9 */ 2.575082588e+01, 1.690060043e+01, 2.736250114e+01, 6.730427551e+01, 1.140612335e+02, 1.421949615e+02, 1.520840302e+02, 1.565308228e+02, 1.629216003e+02, 1.691121368e+02, 1.648505096e+02, 1.373127441e+02, 7.933074188e+01, 00299 /* row 10 */ 1.857132339e+01, 2.268164253e+01, 7.344274139e+01, 1.564020691e+02, 1.998250732e+02, 2.137076263e+02, 2.221916809e+02, 2.205479279e+02, 1.990251312e+02, 1.699637909e+02, 1.390768433e+02, 6.854225159e+01, 3.848905945e+01, 00300 /* row 11 */ 2.814747429e+01, 6.164754868e+01, 1.223927536e+02, 1.738214111e+02, 2.004863129e+02, 2.126872559e+02, 2.220026093e+02, 2.202888184e+02, 1.961826019e+02, 1.512309875e+02, 8.846867371e+01, 2.296885872e+01, 1.727691460e+01, 00301 /* row 12 */ 8.249069977e+01, 1.358011017e+02, 1.733264008e+02, 1.783802490e+02, 1.630280914e+02, 1.482707825e+02, 1.410267181e+02, 1.342459564e+02, 1.057923355e+02, 5.536399078e+01, 2.783112526e+01, 1.245850658e+01, 9.264159203e+00, 00302 /* row 13 */ 1.202688675e+02, 1.738282166e+02, 1.886302490e+02, 1.631140442e+02, 9.433547974e+01, 5.152036285e+01, 4.050345230e+01, 3.638568497e+01, 2.817626572e+01, 1.509124374e+01, 8.948887825e+00, 5.558664322e+00, 3.545074463e+00, 00303 /* row 14 */ 1.408247986e+02, 1.865094910e+02, 1.949750366e+02, 1.467576141e+02, 6.703816986e+01, 2.721531677e+01, 1.997709846e+01, 1.581637478e+01, 1.033936501e+01, 5.311111927e+00, 4.279281616e+00, 2.625066519e+00, 2.047560215e+00, 00304 /* row 15 */ 1.498570862e+02, 1.938312683e+02, 1.987652588e+02, 1.323151245e+02, 5.279324722e+01, 2.079395676e+01, 1.703989410e+01, 1.273804092e+01, 7.917348862e+00, 5.300536156e+00, 4.155077934e+00, 2.487833977e+00, 4.337764263e+00, 00305 /* row 16 */ 1.475796509e+02, 1.975959625e+02, 2.065434113e+02, 1.504779205e+02, 7.091629791e+01, 3.318186951e+01, 2.641540146e+01, 2.231994247e+01, 1.546976280e+01, 7.461651325e+00, 5.177683353e+00, 5.183517456e+00, 1.131072617e+01, 00306 /* row 17 */ 1.355495300e+02, 2.007449341e+02, 2.224629517e+02, 2.144701996e+02, 2.026873474e+02, 1.937670135e+02, 1.857611084e+02, 1.594503326e+02, 1.008310928e+02, 4.068645859e+01, 2.393263435e+01, 1.916443062e+01, 2.051022148e+01, 00307 /* row 18 */ 1.218274765e+02, 1.905705261e+02, 2.205314178e+02, 2.192400055e+02, 2.122948456e+02, 2.041262054e+02, 1.934367828e+02, 1.661259460e+02, 1.074298172e+02, 4.407793045e+01, 2.632240105e+01, 2.177618980e+01, 2.586194420e+01, 00308 /* row 19 */ 4.904540634e+01, 1.060954437e+02, 1.501290131e+02, 1.694489136e+02, 1.764194794e+02, 1.791810760e+02, 1.749866028e+02, 1.505902405e+02, 9.739810944e+01, 4.200295258e+01, 2.741028976e+01, 2.095706749e+01, 2.162877274e+01, 00309 /* row 20 */ 0.000000000e+00, 0.000000000e+00, 2.903993428e-01, 3.595420420e-01, 6.528158188e-01, 1.534511209e+00, 1.904240608e+00, 1.560324073e+00, 1.422835231e+00, 1.520661235e+00, 1.230992675e+00, 1.198830485e+00, 7.967017889e-01 00310 }; 00311 const int w_digit3_C = 13; 00312 const int h_digit3_C = 21; 00313 const float digit3_C[273] = { 00314 /* row 0 */ 0.000000000e+00, 0.000000000e+00, 0.000000000e+00, 0.000000000e+00, 0.000000000e+00, 1.051341295e-01, 6.833713651e-01, 7.052445412e-01, 7.316927314e-01, 7.416799664e-01, 9.872797132e-01, 1.381014705e+00, 1.383602262e+00, 00315 /* row 1 */ 7.492902756e+00, 7.171443939e+00, 2.550024414e+01, 6.168922424e+01, 1.090317535e+02, 1.536478271e+02, 1.693917236e+02, 1.728754578e+02, 1.512798767e+02, 1.164640121e+02, 6.563602448e+01, 1.622793388e+01, 8.621910095e+00, 00316 /* row 2 */ 9.913987160e+00, 8.616592407e+00, 3.907187271e+01, 1.021948395e+02, 1.645820160e+02, 1.930346985e+02, 2.104973145e+02, 2.145298462e+02, 2.201150665e+02, 2.130331879e+02, 1.598528595e+02, 7.342753601e+01, 2.673876381e+01, 00317 /* row 3 */ 1.150558758e+01, 8.353253365e+00, 2.854233170e+01, 9.185906219e+01, 1.618569336e+02, 1.914998627e+02, 2.117387543e+02, 2.154401703e+02, 2.210492554e+02, 2.170384674e+02, 1.906497040e+02, 1.306603851e+02, 4.307187653e+01, 00318 /* row 4 */ 1.882653618e+01, 1.256216240e+01, 1.540400887e+01, 2.213226509e+01, 2.323905563e+01, 1.474064064e+01, 8.840924263e+00, 3.379790497e+01, 1.133666000e+02, 1.727560883e+02, 1.867423553e+02, 1.582695770e+02, 1.078176651e+02, 00319 /* row 5 */ 1.608726501e+01, 7.676918983e+00, 6.437152863e+00, 7.821197033e+00, 6.909781456e+00, 3.284573317e+00, 3.026715994e+00, 6.047901154e+00, 8.269485474e+01, 1.550453796e+02, 1.885897064e+02, 1.745852966e+02, 1.251351318e+02, 00320 /* row 6 */ 1.064035130e+01, 6.676759720e+00, 4.206766129e+00, 2.726352215e+00, 2.324975491e+00, 3.065575361e+00, 2.290713787e+00, 3.500742912e+00, 7.404481506e+01, 1.489031982e+02, 1.866264343e+02, 1.697699127e+02, 1.117200699e+02, 00321 /* row 7 */ 8.163223267e+00, 3.878150702e+00, 2.149071932e+00, 1.849209547e+00, 1.570654392e+00, 9.839208126e-01, 8.771539330e-01, 2.180113554e+00, 7.906694031e+01, 1.470739746e+02, 1.761372375e+02, 1.535372620e+02, 7.835606384e+01, 00322 /* row 8 */ 1.307587433e+01, 5.554557323e+00, 3.362043619e+00, 3.707890272e+00, 3.170172930e+00, 1.120610833e+00, 9.190037847e-01, 2.320874214e+01, 1.088911972e+02, 1.659240570e+02, 1.580080719e+02, 1.016788864e+02, 5.100395203e+01, 00323 /* row 9 */ 1.970890808e+01, 5.841479874e+01, 1.127704773e+02, 1.487496796e+02, 1.603721161e+02, 1.620506439e+02, 1.612073822e+02, 1.700684204e+02, 1.809766235e+02, 1.799277802e+02, 1.479763489e+02, 8.596577454e+01, 2.598721695e+01, 00324 /* row 10 */ 2.428278923e+01, 9.337634277e+01, 1.654283905e+02, 2.080415802e+02, 2.237491150e+02, 2.315785217e+02, 2.323686523e+02, 2.280485535e+02, 2.057372589e+02, 1.812130890e+02, 1.345559998e+02, 6.563418579e+01, 1.635660172e+01, 00325 /* row 11 */ 2.145085716e+01, 9.544840240e+01, 1.665343781e+02, 2.075596924e+02, 2.233424377e+02, 2.315315399e+02, 2.324366913e+02, 2.286222534e+02, 2.155222168e+02, 1.921083984e+02, 1.377742615e+02, 6.197575378e+01, 1.726804352e+01, 00326 /* row 12 */ 1.228862572e+01, 3.412585449e+01, 9.208439636e+01, 1.285398102e+02, 1.352869415e+02, 1.403569183e+02, 1.471998596e+02, 1.740416412e+02, 2.067133942e+02, 2.077104034e+02, 1.531135864e+02, 6.776589203e+01, 2.254883194e+01, 00327 /* row 13 */ 7.728832245e+00, 1.604226303e+01, 2.354776573e+01, 2.815624809e+01, 3.308109283e+01, 4.693816376e+01, 8.352127075e+01, 1.561403503e+02, 1.912700958e+02, 2.003606110e+02, 1.547842712e+02, 6.824637604e+01, 1.986809921e+01, 00328 /* row 14 */ 7.469045162e+00, 8.046178818e+00, 9.129737854e+00, 9.187375069e+00, 1.109278297e+01, 2.317844009e+01, 5.868713379e+01, 1.483327026e+02, 1.831557159e+02, 1.905080566e+02, 1.372948914e+02, 4.449634552e+01, 1.494586182e+01, 00329 /* row 15 */ 5.265812874e+00, 6.983538151e+00, 8.357357979e+00, 8.073056221e+00, 8.583292007e+00, 2.063559723e+01, 6.875781250e+01, 1.511099091e+02, 1.752123108e+02, 1.739339600e+02, 1.139938507e+02, 2.241775703e+01, 1.245185757e+01, 00330 /* row 16 */ 9.928882599e+00, 1.432231522e+01, 1.904359818e+01, 2.117985535e+01, 2.639234734e+01, 5.023678970e+01, 1.170097046e+02, 1.720220642e+02, 1.848006744e+02, 1.532070923e+02, 8.460752106e+01, 1.856864738e+01, 1.423438454e+01, 00331 /* row 17 */ 1.175462418e+02, 1.553675385e+02, 1.826034851e+02, 1.933665466e+02, 1.961893616e+02, 2.004231415e+02, 2.007898865e+02, 1.925345306e+02, 1.767595062e+02, 1.295484619e+02, 6.545021820e+01, 1.904188347e+01, 1.938381767e+01, 00332 /* row 18 */ 1.335612335e+02, 1.684482422e+02, 1.909094849e+02, 2.001137695e+02, 2.023673706e+02, 2.026788330e+02, 2.011531982e+02, 1.847975311e+02, 1.386733093e+02, 7.874349976e+01, 3.436370087e+01, 1.909330368e+01, 1.859010887e+01, 00333 /* row 19 */ 1.134496841e+02, 1.534537811e+02, 1.745102234e+02, 1.821977844e+02, 1.797324066e+02, 1.666438599e+02, 1.544456940e+02, 1.031870193e+02, 4.985403824e+01, 2.457741165e+01, 1.619128799e+01, 9.746634483e+00, 6.863718987e+00, 00334 /* row 20 */ 1.582739830e+00, 1.597032428e+00, 2.424268961e+00, 2.666262627e+00, 2.127778769e+00, 1.628196239e+00, 1.612186313e+00, 2.108970404e+00, 2.221335649e+00, 2.226398230e+00, 2.236337662e+00, 2.270097256e+00, 2.307981253e+00 00335 }; 00336 const int w_digit4_C = 13; 00337 const int h_digit4_C = 21; 00338 const float digit4_C[273] = { 00339 /* row 0 */ 2.559178352e+00, 1.812877297e+00, 1.715533733e+00, 1.679771543e+00, 1.666773200e+00, 1.687840581e+00, 1.703129053e+00, 1.707550406e+00, 1.721142054e+00, 1.735189319e+00, 1.735207319e+00, 1.734080672e+00, 1.724862814e+00, 00340 /* row 1 */ 5.812910080e+00, 4.848203659e+00, 8.039612770e+00, 8.737842560e+00, 6.504604816e+00, 4.281925678e+00, 3.061331987e+00, 2.616788864e+00, 2.951907635e+00, 3.844542742e+00, 4.534400463e+00, 4.366322517e+00, 3.557522774e+00, 00341 /* row 2 */ 1.848569107e+01, 1.681199455e+01, 4.901791000e+01, 5.722308350e+01, 3.012795067e+01, 1.135810375e+01, 7.552698135e+00, 6.539027214e+00, 6.573853970e+00, 1.511842442e+01, 3.575140381e+01, 3.368947220e+01, 8.064681053e+00, 00342 /* row 3 */ 3.995443344e+01, 5.299351120e+01, 1.250875473e+02, 1.431341248e+02, 9.058415985e+01, 3.537038422e+01, 1.331696892e+01, 1.118287373e+01, 1.910732269e+01, 6.313246918e+01, 1.423123932e+02, 1.368025208e+02, 8.788466644e+01, 00343 /* row 4 */ 7.942958069e+01, 1.175718918e+02, 1.792384491e+02, 1.930174866e+02, 1.193623123e+02, 4.290154266e+01, 1.313586044e+01, 1.217748928e+01, 3.781454086e+01, 1.073548355e+02, 1.748376465e+02, 1.722890320e+02, 1.340490875e+02, 00344 /* row 5 */ 1.052566833e+02, 1.514280396e+02, 2.002420502e+02, 2.080450745e+02, 1.360848846e+02, 5.206320572e+01, 1.460039711e+01, 1.145671463e+01, 4.677655029e+01, 1.359710999e+02, 1.991423950e+02, 1.921190643e+02, 1.362605286e+02, 00345 /* row 6 */ 1.168112335e+02, 1.761652832e+02, 2.057797852e+02, 1.948554688e+02, 9.454160309e+01, 2.716540527e+01, 1.195844460e+01, 1.070182514e+01, 5.482748413e+01, 1.515739899e+02, 1.960744934e+02, 1.868423920e+02, 1.195594482e+02, 00346 /* row 7 */ 1.267934952e+02, 1.934957733e+02, 2.078785553e+02, 1.861352234e+02, 7.424533844e+01, 1.298001766e+01, 8.094651222e+00, 9.920740128e+00, 6.075748444e+01, 1.637432098e+02, 1.953790741e+02, 1.789130554e+02, 7.450243378e+01, 00347 /* row 8 */ 1.199494400e+02, 1.820894470e+02, 2.028939514e+02, 1.893400421e+02, 8.466516113e+01, 1.951155853e+01, 9.718198776e+00, 3.721311569e+01, 1.087855911e+02, 1.805944061e+02, 1.872407532e+02, 1.144362564e+02, 5.554624557e+01, 00348 /* row 9 */ 9.254589844e+01, 1.556386108e+02, 2.029939880e+02, 2.122059631e+02, 2.010369415e+02, 1.871206818e+02, 1.743740845e+02, 1.719419098e+02, 1.830987549e+02, 1.903807068e+02, 1.685703430e+02, 9.525399780e+01, 2.743719292e+01, 00349 /* row 10 */ 6.020644379e+01, 1.076929321e+02, 1.788805542e+02, 2.101699524e+02, 2.190056915e+02, 2.286425934e+02, 2.347941284e+02, 2.301341400e+02, 2.135211792e+02, 1.881154175e+02, 1.508489838e+02, 6.443138123e+01, 1.806030464e+01, 00350 /* row 11 */ 1.619983864e+01, 2.989507866e+01, 1.240866547e+02, 1.835954132e+02, 2.102489624e+02, 2.272676239e+02, 2.350574036e+02, 2.308151245e+02, 2.184196320e+02, 1.956256256e+02, 1.466161499e+02, 6.123507309e+01, 1.806099319e+01, 00351 /* row 12 */ 1.228035164e+01, 1.314761829e+01, 4.155881119e+01, 9.166207886e+01, 1.161949921e+02, 1.307476501e+02, 1.438867035e+02, 1.611111603e+02, 1.882356262e+02, 2.034357910e+02, 1.634502716e+02, 6.475796509e+01, 2.059263229e+01, 00352 /* row 13 */ 8.603949547e+00, 1.011975288e+01, 1.457982826e+01, 1.855395126e+01, 2.263600731e+01, 3.310956955e+01, 7.065430450e+01, 1.319954224e+02, 1.804406586e+02, 1.930431213e+02, 1.636865997e+02, 4.595669937e+01, 1.697961426e+01, 00353 /* row 14 */ 9.234013557e+00, 7.523859501e+00, 9.342242241e+00, 7.211202621e+00, 5.690103531e+00, 1.263239384e+01, 4.150220490e+01, 1.089588699e+02, 1.749456635e+02, 1.859301147e+02, 1.548611145e+02, 2.923427582e+01, 1.435436058e+01, 00354 /* row 15 */ 8.452925682e+00, 7.437669754e+00, 7.988306999e+00, 5.438763142e+00, 4.382883549e+00, 7.437112331e+00, 3.393959808e+01, 1.032726746e+02, 1.674102173e+02, 1.698623962e+02, 1.353965454e+02, 1.889706421e+01, 1.270053482e+01, 00355 /* row 16 */ 8.531535149e+00, 7.305055141e+00, 6.533573151e+00, 5.590957165e+00, 4.730500221e+00, 6.430154324e+00, 4.089202499e+01, 1.132310257e+02, 1.679732208e+02, 1.640923157e+02, 1.228354645e+02, 1.666440010e+01, 1.171235371e+01, 00356 /* row 17 */ 9.995470047e+00, 8.319172859e+00, 7.336056232e+00, 5.833676815e+00, 4.825465679e+00, 6.591207981e+00, 4.195544815e+01, 1.131022339e+02, 1.653670044e+02, 1.595283813e+02, 1.130204849e+02, 1.470257664e+01, 1.236864471e+01, 00357 /* row 18 */ 8.325822830e+00, 7.502437115e+00, 6.576190472e+00, 5.626108646e+00, 4.812733173e+00, 5.721535206e+00, 2.679979324e+01, 8.494634247e+01, 1.359069977e+02, 1.196076813e+02, 6.676244354e+01, 1.331676483e+01, 9.246374130e+00, 00358 /* row 19 */ 5.519261837e+00, 5.565120697e+00, 4.845437527e+00, 4.008252621e+00, 3.780873299e+00, 5.294648170e+00, 7.868592262e+00, 2.092434311e+01, 4.260521317e+01, 5.034607697e+01, 3.469604111e+01, 7.289759636e+00, 6.448944092e+00, 00359 /* row 20 */ 4.351445675e+00, 4.368988514e+00, 4.383411407e+00, 3.777171373e+00, 4.080281258e+00, 4.836187840e+00, 5.164539337e+00, 5.178335190e+00, 4.954736233e+00, 4.447919846e+00, 4.620073795e+00, 5.279904842e+00, 5.286080837e+00 00360 }; 00361 const int w_digit5_C = 13; 00362 const int h_digit5_C = 21; 00363 const float digit5_C[273] = { 00364 /* row 0 */ 3.437554359e+00, 4.116212368e+00, 4.203958035e+00, 3.633856773e+00, 4.489492893e+00, 4.604996204e+00, 3.399358034e+00, 2.250467777e+00, 2.649983406e+00, 4.139334679e+00, 4.533825874e+00, 5.723913193e+00, 5.068602562e+00, 00365 /* row 1 */ 1.950943947e+01, 1.319682980e+01, 1.675157928e+01, 6.619887543e+01, 1.205426636e+02, 1.523797607e+02, 1.701096191e+02, 1.793473816e+02, 1.740324249e+02, 1.602507477e+02, 1.389748840e+02, 6.724686432e+01, 2.852785492e+01, 00366 /* row 2 */ 4.494134521e+01, 2.716476822e+01, 6.945572662e+01, 1.587640533e+02, 2.090796204e+02, 2.249523010e+02, 2.270907898e+02, 2.250967560e+02, 2.182527161e+02, 2.043038788e+02, 1.787282867e+02, 9.732141113e+01, 3.371002197e+01, 00367 /* row 3 */ 5.608306885e+01, 4.650132370e+01, 1.065841141e+02, 1.811742859e+02, 2.175135345e+02, 2.265308075e+02, 2.240336456e+02, 2.187836304e+02, 2.111738586e+02, 1.980240479e+02, 1.731463470e+02, 9.540722656e+01, 3.192591286e+01, 00368 /* row 4 */ 8.156595612e+01, 8.201544189e+01, 1.562380524e+02, 1.974310608e+02, 2.095102844e+02, 1.687252045e+02, 9.799290466e+01, 5.058391190e+01, 4.148028183e+01, 4.247298431e+01, 3.358620071e+01, 2.059651947e+01, 1.633757591e+01, 00369 /* row 5 */ 8.683461761e+01, 9.515282440e+01, 1.658408508e+02, 1.945737610e+02, 1.871228485e+02, 1.151039810e+02, 4.482325363e+01, 2.178008461e+01, 2.067670059e+01, 2.071028137e+01, 1.788356018e+01, 9.343614578e+00, 7.422692776e+00, 00370 /* row 6 */ 8.322698212e+01, 9.329957581e+01, 1.731641693e+02, 1.950824280e+02, 1.739241638e+02, 8.422084045e+01, 2.412155151e+01, 1.920404625e+01, 1.545538902e+01, 1.285213757e+01, 1.040504932e+01, 5.457772732e+00, 3.999914646e+00, 00371 /* row 7 */ 7.896585846e+01, 9.118216705e+01, 1.743743286e+02, 1.946781616e+02, 1.508521423e+02, 6.627294159e+01, 1.782639122e+01, 1.208560944e+01, 9.228771210e+00, 8.993648529e+00, 7.656396389e+00, 6.815765381e+00, 3.979901552e+00, 00372 /* row 8 */ 5.854075241e+01, 7.750284576e+01, 1.650519867e+02, 1.924634705e+02, 1.616898956e+02, 7.493513489e+01, 2.086472321e+01, 1.489436054e+01, 1.145396042e+01, 1.113745689e+01, 1.007969189e+01, 9.782138824e+00, 7.967348576e+00, 00373 /* row 9 */ 3.041599083e+01, 4.526819992e+01, 1.343336792e+02, 1.881693573e+02, 1.960262451e+02, 1.879385376e+02, 1.739053497e+02, 1.619960785e+02, 1.320445709e+02, 7.629026794e+01, 5.543772888e+01, 2.063689423e+01, 1.880504417e+01, 00374 /* row 10 */ 2.120926476e+01, 2.820814133e+01, 9.594059753e+01, 1.775175323e+02, 2.063817902e+02, 2.190574951e+02, 2.314678345e+02, 2.348246460e+02, 2.176421509e+02, 1.773272858e+02, 1.247477036e+02, 3.838764954e+01, 2.871365547e+01, 00375 /* row 11 */ 1.705601501e+01, 1.824484634e+01, 4.938283157e+01, 1.295183411e+02, 1.804085846e+02, 2.115624542e+02, 2.302443542e+02, 2.340447083e+02, 2.249399567e+02, 2.051327057e+02, 1.700926971e+02, 8.668447113e+01, 3.548955154e+01, 00376 /* row 12 */ 1.460805798e+01, 1.415893936e+01, 1.548809719e+01, 5.634749985e+01, 8.762674713e+01, 1.164642029e+02, 1.388411865e+02, 1.556064453e+02, 1.842258606e+02, 2.121352997e+02, 1.850514832e+02, 9.236962128e+01, 3.710053635e+01, 00377 /* row 13 */ 1.380495453e+01, 1.199528313e+01, 1.234077930e+01, 1.345362186e+01, 1.386269665e+01, 1.693362045e+01, 2.897278595e+01, 7.434671021e+01, 1.486812286e+02, 1.979896088e+02, 1.913045502e+02, 1.431134491e+02, 3.360649109e+01, 00378 /* row 14 */ 1.085623455e+01, 1.008069801e+01, 7.827013493e+00, 8.483414650e+00, 7.802050591e+00, 5.901718140e+00, 5.894065380e+00, 4.431577301e+01, 1.293589935e+02, 1.930645142e+02, 1.835210419e+02, 1.347698517e+02, 3.120402908e+01, 00379 /* row 15 */ 1.144946575e+01, 9.714325905e+00, 9.739953995e+00, 8.198862076e+00, 6.887493610e+00, 4.737627506e+00, 5.065118313e+00, 4.217902756e+01, 1.231296692e+02, 1.843169861e+02, 1.750550079e+02, 1.262657089e+02, 2.370544815e+01, 00380 /* row 16 */ 1.289643383e+01, 1.342292023e+01, 1.246454239e+01, 1.509706306e+01, 1.295025158e+01, 1.144494724e+01, 1.474927425e+01, 6.594844055e+01, 1.490937347e+02, 1.818726654e+02, 1.603529358e+02, 7.035799408e+01, 2.574352264e+01, 00381 /* row 17 */ 3.010423470e+01, 6.257209396e+01, 1.357653351e+02, 1.744984436e+02, 1.869587402e+02, 1.877952881e+02, 1.864725952e+02, 1.846970825e+02, 1.785262604e+02, 1.648699951e+02, 1.336366425e+02, 6.386922455e+01, 2.554446602e+01, 00382 /* row 18 */ 3.644616318e+01, 7.817662048e+01, 1.460402069e+02, 1.793272095e+02, 1.913578949e+02, 1.950872192e+02, 1.942668762e+02, 1.875436096e+02, 1.672108917e+02, 1.229118729e+02, 6.183097839e+01, 2.466237831e+01, 2.007579041e+01, 00383 /* row 19 */ 3.256136322e+01, 5.658360672e+01, 1.312937775e+02, 1.635067596e+02, 1.756807709e+02, 1.787500610e+02, 1.748642426e+02, 1.551699829e+02, 1.008551941e+02, 3.505436707e+01, 1.985715294e+01, 9.596439362e+00, 8.449734688e+00, 00384 /* row 20 */ 5.317015648e+00, 4.684353828e+00, 5.085326672e+00, 5.379717350e+00, 6.081042290e+00, 6.510445118e+00, 6.479649544e+00, 6.242708683e+00, 6.000650883e+00, 5.685509682e+00, 4.976971626e+00, 4.423185349e+00, 4.369019985e+00 00385 }; 00386 const int w_digit6_C = 13; 00387 const int h_digit6_C = 21; 00388 const float digit6_C[273] = { 00389 /* row 0 */ 3.617584229e+00, 3.052037716e+00, 2.993152857e+00, 2.987431049e+00, 2.519630909e+00, 2.297564745e+00, 2.280378819e+00, 2.255970478e+00, 2.282284737e+00, 2.316820383e+00, 2.221793175e+00, 1.701670289e+00, 1.749051929e+00, 00390 /* row 1 */ 1.197506714e+01, 8.680577278e+00, 8.341773987e+00, 1.324895859e+01, 4.117305374e+01, 1.001386871e+02, 1.460065002e+02, 1.620533142e+02, 1.618348694e+02, 1.455468292e+02, 1.093622131e+02, 3.935340118e+01, 1.824018669e+01, 00391 /* row 2 */ 1.856018448e+01, 1.640002632e+01, 1.730215645e+01, 6.235772705e+01, 1.158029404e+02, 1.678509216e+02, 1.958362427e+02, 2.028129272e+02, 2.027835236e+02, 1.905628510e+02, 1.587144928e+02, 7.520561981e+01, 3.092347908e+01, 00392 /* row 3 */ 2.663059998e+01, 2.721981049e+01, 5.808235550e+01, 1.105980759e+02, 1.449840393e+02, 1.757233887e+02, 1.955849915e+02, 2.023025818e+02, 2.009147949e+02, 1.866571350e+02, 1.548836823e+02, 7.416377258e+01, 2.679388428e+01, 00393 /* row 4 */ 4.686298370e+01, 6.491722107e+01, 1.342601624e+02, 1.571253357e+02, 1.577866058e+02, 1.126757278e+02, 5.493510818e+01, 2.581258583e+01, 2.372464371e+01, 2.880717850e+01, 2.536949921e+01, 1.734718513e+01, 1.556644249e+01, 00394 /* row 5 */ 4.956855011e+01, 7.707900238e+01, 1.571540680e+02, 1.788462982e+02, 1.532378082e+02, 7.074053192e+01, 1.396214676e+01, 6.326961994e+00, 8.161497116e+00, 1.475574970e+01, 1.608879852e+01, 1.248512650e+01, 9.467315674e+00, 00395 /* row 6 */ 4.364072800e+01, 9.072679138e+01, 1.692287903e+02, 1.886419067e+02, 1.351244812e+02, 5.086006165e+01, 7.889916897e+00, 5.446766853e+00, 7.120514870e+00, 1.158092690e+01, 1.351481533e+01, 1.153026962e+01, 7.686642170e+00, 00396 /* row 7 */ 4.214263153e+01, 1.117954102e+02, 1.757701721e+02, 1.897694550e+02, 1.143940887e+02, 3.536109543e+01, 4.933651924e+00, 3.600698709e+00, 6.421057701e+00, 1.074752903e+01, 1.169649029e+01, 1.079640007e+01, 5.936537266e+00, 00397 /* row 8 */ 4.837588882e+01, 1.106311340e+02, 1.700863647e+02, 1.861247101e+02, 1.345592499e+02, 4.975097656e+01, 6.041688919e+00, 4.288068295e+00, 6.806634426e+00, 1.102320862e+01, 1.153644753e+01, 9.597782135e+00, 4.836272240e+00, 00398 /* row 9 */ 4.270043945e+01, 9.547972107e+01, 1.571688843e+02, 1.898897858e+02, 1.864261169e+02, 1.762072296e+02, 1.635679016e+02, 1.502224121e+02, 1.203156967e+02, 6.672261047e+01, 4.086833954e+01, 1.689181709e+01, 8.986316681e+00, 00399 /* row 10 */ 2.991340065e+01, 9.378874969e+01, 1.615949707e+02, 2.036886139e+02, 2.153663788e+02, 2.187650146e+02, 2.207705994e+02, 2.187466125e+02, 2.026357727e+02, 1.642725372e+02, 1.113758392e+02, 3.825288391e+01, 2.043779373e+01, 00400 /* row 11 */ 3.085734940e+01, 1.199922333e+02, 1.746830292e+02, 2.062241821e+02, 2.149858398e+02, 2.180109406e+02, 2.197911377e+02, 2.180640869e+02, 2.085911102e+02, 1.891156006e+02, 1.553899994e+02, 7.394162750e+01, 2.673856354e+01, 00401 /* row 12 */ 9.197119141e+01, 1.646997986e+02, 1.957644806e+02, 1.909114532e+02, 1.678859100e+02, 1.441856079e+02, 1.355827332e+02, 1.558410645e+02, 1.904225159e+02, 2.052218781e+02, 1.794414825e+02, 8.312119293e+01, 3.458250427e+01, 00402 /* row 13 */ 1.197625961e+02, 1.861744690e+02, 1.961458893e+02, 1.635350342e+02, 9.832550049e+01, 5.695964432e+01, 5.213866425e+01, 9.618431091e+01, 1.702055511e+02, 2.097017365e+02, 1.963375092e+02, 1.237434464e+02, 4.046476364e+01, 00403 /* row 14 */ 1.486695099e+02, 1.840989075e+02, 1.869325256e+02, 1.234521713e+02, 5.406507111e+01, 2.651293182e+01, 3.048875046e+01, 8.257601929e+01, 1.667146606e+02, 2.076827850e+02, 1.897738495e+02, 1.051072006e+02, 3.933779907e+01, 00404 /* row 15 */ 1.624248962e+02, 1.780150146e+02, 1.751683044e+02, 9.648342896e+01, 3.767192459e+01, 2.023458099e+01, 2.833364105e+01, 8.548074341e+01, 1.677692261e+02, 1.996262817e+02, 1.819322968e+02, 9.880137634e+01, 3.752193832e+01, 00405 /* row 16 */ 1.623633118e+02, 1.853661804e+02, 1.875964661e+02, 1.132598190e+02, 5.245042038e+01, 3.874470901e+01, 6.751119232e+01, 1.287270813e+02, 1.805736694e+02, 1.857816772e+02, 1.580173645e+02, 5.588668060e+01, 3.216501236e+01, 00406 /* row 17 */ 1.347611694e+02, 1.848305359e+02, 1.994920502e+02, 1.975740051e+02, 1.905118866e+02, 1.883127747e+02, 1.919304047e+02, 1.919857025e+02, 1.816555786e+02, 1.610532684e+02, 1.198347168e+02, 4.524670410e+01, 3.351439667e+01, 00407 /* row 18 */ 1.074008331e+02, 1.620858917e+02, 1.976647644e+02, 2.029784241e+02, 2.001366119e+02, 1.984098816e+02, 1.988232117e+02, 1.920364532e+02, 1.665133514e+02, 1.170933075e+02, 5.523066711e+01, 3.089595795e+01, 2.600537491e+01, 00408 /* row 19 */ 4.391096115e+01, 7.959534454e+01, 1.343577423e+02, 1.601983490e+02, 1.688958893e+02, 1.686121368e+02, 1.624930420e+02, 1.377860260e+02, 8.569678497e+01, 3.564017487e+01, 2.433551788e+01, 1.829158401e+01, 1.674108505e+01, 00409 /* row 20 */ 5.925258160e+00, 5.846498966e+00, 6.272400379e+00, 5.794066429e+00, 6.175084114e+00, 6.934591770e+00, 6.612410069e+00, 5.484694958e+00, 4.916622639e+00, 5.069953442e+00, 5.172536373e+00, 5.786143303e+00, 6.367246151e+00 00410 }; 00411 const int w_digit7_C = 13; 00412 const int h_digit7_C = 21; 00413 const float digit7_C[273] = { 00414 /* row 0 */ 5.609378219e-01, 9.052430391e-01, 1.328101039e+00, 1.655116558e+00, 1.650931120e+00, 9.104406834e-01, 6.094977856e-01, 5.662671924e-01, 5.252973437e-01, 5.214186907e-01, 2.201898247e-01, 0.000000000e+00, 0.000000000e+00, 00415 /* row 1 */ 9.951543808e+00, 2.400962830e+01, 6.172730637e+01, 1.128943787e+02, 1.524254456e+02, 1.639710083e+02, 1.709305420e+02, 1.723119354e+02, 1.663861237e+02, 1.593039856e+02, 1.145426331e+02, 6.281898880e+01, 2.466899490e+01, 00416 /* row 2 */ 2.146764374e+01, 5.478280258e+01, 1.079912567e+02, 1.632353973e+02, 1.901882477e+02, 2.041900177e+02, 2.142817993e+02, 2.247452393e+02, 2.383051300e+02, 2.362453461e+02, 2.078201447e+02, 1.618034515e+02, 1.135439529e+02, 00417 /* row 3 */ 2.443485260e+01, 5.085579681e+01, 1.024155502e+02, 1.602248688e+02, 1.865229340e+02, 2.018080139e+02, 2.114839783e+02, 2.219910126e+02, 2.382187500e+02, 2.382550201e+02, 2.200964508e+02, 1.823423309e+02, 1.361945496e+02, 00418 /* row 4 */ 2.317000961e+01, 2.061864090e+01, 1.800550270e+01, 1.677998734e+01, 1.876383018e+01, 1.642721558e+01, 3.058665276e+01, 7.049256134e+01, 1.401266327e+02, 1.838588409e+02, 1.980758667e+02, 1.811874695e+02, 1.447382812e+02, 00419 /* row 5 */ 1.405069923e+01, 9.933857918e+00, 8.143571854e+00, 8.531435013e+00, 7.959880352e+00, 6.613306999e+00, 9.843982697e+00, 3.824071121e+01, 1.083082428e+02, 1.698619995e+02, 1.869927521e+02, 1.701074982e+02, 1.357997131e+02, 00420 /* row 6 */ 1.259628391e+01, 9.489345551e+00, 7.515948296e+00, 6.535764694e+00, 4.407109261e+00, 4.199159622e+00, 7.328584671e+00, 3.628634644e+01, 1.091899033e+02, 1.671819000e+02, 1.842744598e+02, 1.614837036e+02, 1.148406219e+02, 00421 /* row 7 */ 7.771875381e+00, 6.821542740e+00, 6.044673920e+00, 5.277192593e+00, 3.700455189e+00, 3.619613886e+00, 5.721110344e+00, 3.840571976e+01, 1.234852982e+02, 1.648914490e+02, 1.763536224e+02, 1.472372589e+02, 9.070130157e+01, 00422 /* row 8 */ 9.342149734e+00, 6.172729015e+00, 4.057919502e+00, 3.593616247e+00, 4.119392395e+00, 3.342189312e+00, 8.325213432e+00, 4.382724380e+01, 1.274599609e+02, 1.594385681e+02, 1.566570587e+02, 1.176742554e+02, 5.896714020e+01, 00423 /* row 9 */ 7.991414547e+00, 5.695241451e+00, 4.008290291e+00, 3.051735401e+00, 1.796405792e+00, 1.778378606e+00, 7.939858437e+00, 3.904080200e+01, 1.078543472e+02, 1.293743744e+02, 1.282023163e+02, 9.180694580e+01, 3.213601685e+01, 00424 /* row 10 */ 6.989320755e+00, 4.809151649e+00, 3.354713678e+00, 2.586832285e+00, 1.152930856e+00, 1.992566109e+00, 9.968650818e+00, 4.005034256e+01, 1.017059097e+02, 1.165722733e+02, 1.024842377e+02, 6.405281067e+01, 1.612285805e+01, 00425 /* row 11 */ 4.828388214e+00, 3.792577267e+00, 2.896504164e+00, 2.161214113e+00, 1.116614699e+00, 1.886725545e+00, 1.653977585e+01, 5.483000565e+01, 1.201546326e+02, 1.270397415e+02, 9.096179962e+01, 4.586388779e+01, 1.303785706e+01, 00426 /* row 12 */ 5.879953384e+00, 5.070304394e+00, 4.604268551e+00, 4.105424881e+00, 2.314042807e+00, 3.575991392e+00, 3.933578110e+01, 9.332203674e+01, 1.445575562e+02, 1.528007812e+02, 1.081655579e+02, 5.496397400e+01, 1.915472221e+01, 00427 /* row 13 */ 7.033951759e+00, 6.826670170e+00, 6.200400829e+00, 5.107961655e+00, 3.555653095e+00, 7.334577084e+00, 5.968417740e+01, 1.272622604e+02, 1.724711761e+02, 1.728297882e+02, 1.246444397e+02, 6.632968903e+01, 2.304942513e+01, 00428 /* row 14 */ 7.204808235e+00, 6.943005085e+00, 6.549893856e+00, 6.145622730e+00, 5.916771412e+00, 1.700822449e+01, 7.969583893e+01, 1.474111328e+02, 1.720655365e+02, 1.701650696e+02, 1.034578629e+02, 4.320777130e+01, 2.114568710e+01, 00429 /* row 15 */ 8.373166084e+00, 7.692475319e+00, 6.849948883e+00, 6.948565006e+00, 9.973000526e+00, 3.010571861e+01, 9.427323151e+01, 1.564298401e+02, 1.707637939e+02, 1.669767914e+02, 9.372502899e+01, 3.475241470e+01, 2.351542091e+01, 00430 /* row 16 */ 9.477765083e+00, 7.258650303e+00, 5.826832294e+00, 5.819159031e+00, 7.190245152e+00, 4.122681046e+01, 1.031430664e+02, 1.556639099e+02, 1.634707947e+02, 1.502852020e+02, 7.739511871e+01, 2.404257965e+01, 1.966561699e+01, 00431 /* row 17 */ 9.998796463e+00, 7.869496822e+00, 5.794872284e+00, 5.150816441e+00, 7.741946220e+00, 4.567086411e+01, 1.050753860e+02, 1.528548279e+02, 1.581125946e+02, 1.383568420e+02, 6.882357025e+01, 1.904717636e+01, 1.450012302e+01, 00432 /* row 18 */ 8.039461136e+00, 5.978124142e+00, 4.969293594e+00, 5.448834896e+00, 6.917188644e+00, 3.074213028e+01, 8.114878845e+01, 1.248548813e+02, 1.285687714e+02, 9.156111908e+01, 4.465215302e+01, 1.448483467e+01, 9.664080620e+00, 00433 /* row 19 */ 7.450906754e+00, 5.296478271e+00, 4.677141666e+00, 5.754803181e+00, 7.222306728e+00, 1.103037834e+01, 1.998709488e+01, 3.036460686e+01, 3.745995712e+01, 2.754431915e+01, 1.500610924e+01, 7.788586617e+00, 8.089468956e+00, 00434 /* row 20 */ 5.067918777e+00, 5.057623863e+00, 5.374786854e+00, 5.514371872e+00, 4.313006401e+00, 3.910338640e+00, 4.055840492e+00, 4.168213844e+00, 3.756440401e+00, 4.171408176e+00, 3.655416965e+00, 3.767168999e+00, 4.836698055e+00 00435 }; 00436 const int w_digit8_C = 13; 00437 const int h_digit8_C = 21; 00438 const float digit8_C[273] = { 00439 /* row 0 */ 4.777613640e+00, 4.764687538e+00, 5.093404770e+00, 5.119246960e+00, 4.787107468e+00, 4.777456760e+00, 4.829875469e+00, 4.396806240e+00, 4.019837856e+00, 4.382873535e+00, 3.808043242e+00, 4.718815327e+00, 4.973798275e+00, 00440 /* row 1 */ 9.479578018e+00, 7.044646263e+00, 6.226582050e+00, 8.445973396e+00, 2.527934074e+01, 9.428376007e+01, 1.476529694e+02, 1.666296692e+02, 1.676599731e+02, 1.306515045e+02, 8.800084686e+01, 2.684318542e+01, 1.699489212e+01, 00441 /* row 2 */ 1.517325020e+01, 1.027332878e+01, 1.028355026e+01, 2.225889587e+01, 1.104883881e+02, 1.769809113e+02, 1.947878571e+02, 2.065048828e+02, 2.157245789e+02, 2.179898987e+02, 1.896568604e+02, 8.722425842e+01, 3.325685120e+01, 00442 /* row 3 */ 1.819168663e+01, 1.223799515e+01, 1.743813705e+01, 6.554381561e+01, 1.392566223e+02, 1.758643646e+02, 1.935816193e+02, 2.034746094e+02, 2.118435211e+02, 2.168344116e+02, 2.010992126e+02, 1.429552765e+02, 5.518131256e+01, 00443 /* row 4 */ 2.202099800e+01, 2.402626038e+01, 6.256167984e+01, 1.475469360e+02, 1.597194824e+02, 1.365556641e+02, 4.240672684e+01, 2.727969170e+01, 8.139234161e+01, 1.610196533e+02, 1.961645355e+02, 1.678354797e+02, 7.976760101e+01, 00444 /* row 5 */ 2.547551346e+01, 3.747194672e+01, 1.315825653e+02, 1.729860687e+02, 1.656569214e+02, 8.002491760e+01, 1.460632229e+01, 7.713825226e+00, 3.479315186e+01, 1.411164551e+02, 1.963432159e+02, 1.947506409e+02, 9.940395355e+01, 00445 /* row 6 */ 3.663471985e+01, 6.160971832e+01, 1.603555756e+02, 1.804659729e+02, 1.599899445e+02, 4.686725998e+01, 1.141903400e+01, 7.365352154e+00, 2.970054626e+01, 1.448311310e+02, 1.958401184e+02, 1.933678436e+02, 9.334579468e+01, 00446 /* row 7 */ 4.048141861e+01, 8.355370331e+01, 1.785617828e+02, 1.863100586e+02, 1.492927856e+02, 1.700518608e+01, 4.987213135e+00, 4.958240032e+00, 2.255595016e+01, 1.549203491e+02, 1.950343170e+02, 1.875969543e+02, 7.464566803e+01, 00447 /* row 8 */ 2.726139259e+01, 7.733553314e+01, 1.685478058e+02, 1.859521790e+02, 1.565086060e+02, 3.339677429e+01, 7.040509701e+00, 8.954926491e+00, 7.497825623e+01, 1.720941925e+02, 1.916613617e+02, 1.340715637e+02, 5.257702255e+01, 00448 /* row 9 */ 1.688115311e+01, 5.527591324e+01, 1.500545044e+02, 1.957102509e+02, 1.924725342e+02, 1.801143188e+02, 1.650144806e+02, 1.604551392e+02, 1.741040649e+02, 1.834723511e+02, 1.734454041e+02, 1.031247406e+02, 3.478174973e+01, 00449 /* row 10 */ 1.380062866e+01, 5.809841919e+01, 1.479681244e+02, 1.965535431e+02, 2.128395233e+02, 2.165421143e+02, 2.209693756e+02, 2.255959778e+02, 2.142794647e+02, 1.853638458e+02, 1.577348022e+02, 6.265695572e+01, 2.438037109e+01, 00450 /* row 11 */ 1.840841103e+01, 8.083011627e+01, 1.574649658e+02, 1.950462036e+02, 2.093284607e+02, 2.149573212e+02, 2.205599213e+02, 2.252789764e+02, 2.139091797e+02, 1.938079834e+02, 1.560939941e+02, 5.250906372e+01, 2.230262947e+01, 00451 /* row 12 */ 4.412129593e+01, 1.485391235e+02, 1.747820435e+02, 1.850198517e+02, 1.511861267e+02, 1.322253571e+02, 1.326798248e+02, 1.521501770e+02, 1.876831665e+02, 2.018749237e+02, 1.742780304e+02, 5.999636841e+01, 2.444777298e+01, 00452 /* row 13 */ 6.266588593e+01, 1.685822144e+02, 1.849435272e+02, 1.634625549e+02, 7.811012268e+01, 3.495354462e+01, 4.512061691e+01, 1.079994812e+02, 1.794520874e+02, 1.959109955e+02, 1.844123993e+02, 5.272632599e+01, 2.328556061e+01, 00453 /* row 14 */ 8.705186462e+01, 1.807229462e+02, 1.918248901e+02, 1.510259247e+02, 3.831570435e+01, 1.776937485e+01, 2.655134392e+01, 9.588935089e+01, 1.838317413e+02, 1.973798828e+02, 1.777079010e+02, 3.580952835e+01, 2.032289505e+01, 00454 /* row 15 */ 1.126524200e+02, 1.911150360e+02, 1.937514343e+02, 1.405802917e+02, 2.761536407e+01, 1.496028805e+01, 1.882711792e+01, 1.000520401e+02, 1.892169800e+02, 1.974096222e+02, 1.634897308e+02, 2.977645874e+01, 1.962252235e+01, 00455 /* row 16 */ 1.062917633e+02, 1.933820496e+02, 2.036979218e+02, 1.668601227e+02, 4.165262985e+01, 2.550858879e+01, 6.341130066e+01, 1.439616699e+02, 1.960952454e+02, 1.886062164e+02, 1.186735458e+02, 2.641625214e+01, 2.178131104e+01, 00456 /* row 17 */ 7.559862518e+01, 1.820941162e+02, 2.113155518e+02, 2.104982758e+02, 1.943105011e+02, 1.839347534e+02, 1.926664276e+02, 1.982726288e+02, 1.905545197e+02, 1.623209076e+02, 8.928661346e+01, 2.475717354e+01, 2.670557785e+01, 00457 /* row 18 */ 3.842235947e+01, 1.542467957e+02, 2.072673492e+02, 2.146223602e+02, 2.049272919e+02, 1.992071686e+02, 2.004480133e+02, 1.995252075e+02, 1.744783173e+02, 1.037050323e+02, 4.528313065e+01, 2.109596443e+01, 2.227221680e+01, 00458 /* row 19 */ 1.322523212e+01, 5.849315643e+01, 1.260554962e+02, 1.568650665e+02, 1.737864380e+02, 1.757619781e+02, 1.644594116e+02, 1.479368439e+02, 8.065209961e+01, 2.768663216e+01, 2.210913277e+01, 1.321126175e+01, 1.225705433e+01, 00459 /* row 20 */ 5.489873886e+00, 6.257390499e+00, 6.344527721e+00, 7.140329361e+00, 8.226786613e+00, 8.263930321e+00, 7.207657814e+00, 6.134791851e+00, 6.683714867e+00, 5.419696331e+00, 5.337786198e+00, 4.975027561e+00, 5.039471149e+00 00460 }; 00461 const int w_digit9_C = 13; 00462 const int h_digit9_C = 21; 00463 const float digit9_C[273] = { 00464 /* row 0 */ 1.506105542e+00, 1.770606875e+00, 1.841901660e+00, 1.857074142e+00, 1.856987953e+00, 1.840132475e+00, 1.844995379e+00, 1.853157759e+00, 1.842623115e+00, 1.766294718e+00, 1.559301972e+00, 1.573421478e+00, 1.589048386e+00, 00465 /* row 1 */ 4.687360764e+00, 3.631297350e+00, 3.863223791e+00, 1.295704269e+01, 5.787071228e+01, 1.143945084e+02, 1.502485352e+02, 1.635405426e+02, 1.596750183e+02, 1.309214935e+02, 7.930513763e+01, 2.537242889e+01, 1.582644653e+01, 00466 /* row 2 */ 7.367782593e+00, 7.954114914e+00, 1.940062904e+01, 7.973864746e+01, 1.451252899e+02, 1.822349243e+02, 1.968633118e+02, 2.070687561e+02, 2.172654266e+02, 2.141289673e+02, 1.741131287e+02, 8.954771423e+01, 4.385566711e+01, 00467 /* row 3 */ 8.233408928e+00, 9.892426491e+00, 5.535980988e+01, 1.188343887e+02, 1.607114258e+02, 1.833405151e+02, 1.956827087e+02, 2.049131775e+02, 2.139020538e+02, 2.131375275e+02, 1.896822662e+02, 1.443301697e+02, 7.330405426e+01, 00468 /* row 4 */ 1.580356312e+01, 5.374797440e+01, 1.267029800e+02, 1.564492188e+02, 1.537201233e+02, 9.605155182e+01, 4.335425949e+01, 4.425995636e+01, 9.350884247e+01, 1.606314850e+02, 1.877424774e+02, 1.696042786e+02, 1.153400955e+02, 00469 /* row 5 */ 2.622304726e+01, 9.001470184e+01, 1.514673309e+02, 1.686601715e+02, 1.324075928e+02, 5.909408951e+01, 1.475394058e+01, 1.566242790e+01, 5.794070816e+01, 1.408164825e+02, 1.928722382e+02, 1.874531250e+02, 1.312898560e+02, 00470 /* row 6 */ 4.044424438e+01, 1.161023331e+02, 1.614349213e+02, 1.709862671e+02, 1.129668427e+02, 4.410931778e+01, 1.394127083e+01, 1.682776833e+01, 5.758774185e+01, 1.402135162e+02, 1.923324585e+02, 1.847784271e+02, 1.213250580e+02, 00471 /* row 7 */ 6.082172394e+01, 1.414174957e+02, 1.698067932e+02, 1.694071045e+02, 8.169445801e+01, 2.149837494e+01, 9.963449478e+00, 1.292640781e+01, 5.553184509e+01, 1.431224670e+02, 1.882751617e+02, 1.777421570e+02, 1.070353088e+02, 00472 /* row 8 */ 6.045938492e+01, 1.367576599e+02, 1.709913025e+02, 1.738295135e+02, 1.007539062e+02, 3.419920349e+01, 1.193618965e+01, 2.816645622e+01, 8.727407837e+01, 1.620885162e+02, 1.782437439e+02, 1.401039886e+02, 7.850992584e+01, 00473 /* row 9 */ 4.618619156e+01, 1.144770279e+02, 1.701566315e+02, 1.895589752e+02, 1.847884979e+02, 1.718330841e+02, 1.607847137e+02, 1.613919830e+02, 1.718332214e+02, 1.757200623e+02, 1.586052551e+02, 1.072317734e+02, 4.868937683e+01, 00474 /* row 10 */ 2.155410767e+01, 5.282372665e+01, 1.422340698e+02, 1.881411285e+02, 2.035626373e+02, 2.161405945e+02, 2.251727600e+02, 2.236964111e+02, 2.102713165e+02, 1.865612030e+02, 1.508575745e+02, 8.200824738e+01, 3.484196091e+01, 00475 /* row 11 */ 1.095849609e+01, 1.556486511e+01, 8.776729584e+01, 1.540204315e+02, 1.913557434e+02, 2.136164703e+02, 2.253067017e+02, 2.255359955e+02, 2.169332733e+02, 1.986457367e+02, 1.565825958e+02, 7.366071320e+01, 3.044139481e+01, 00476 /* row 12 */ 1.100714207e+01, 1.337760448e+01, 2.010663605e+01, 6.133866882e+01, 9.967171478e+01, 1.238550339e+02, 1.393537445e+02, 1.587785645e+02, 1.883274231e+02, 2.069731750e+02, 1.717535248e+02, 7.652588654e+01, 3.636279297e+01, 00477 /* row 13 */ 1.003054523e+01, 9.246915817e+00, 9.607544899e+00, 1.049556732e+01, 1.395363140e+01, 2.521341705e+01, 5.212939835e+01, 1.069764557e+02, 1.673015442e+02, 1.909696045e+02, 1.711674194e+02, 8.451857758e+01, 3.697874069e+01, 00478 /* row 14 */ 9.164385796e+00, 8.664002419e+00, 8.385043144e+00, 5.582695007e+00, 4.571530819e+00, 7.750418186e+00, 2.857477379e+01, 8.955247498e+01, 1.597477570e+02, 1.824579773e+02, 1.608936920e+02, 7.091478729e+01, 3.579723358e+01, 00479 /* row 15 */ 8.744666100e+00, 8.898353577e+00, 7.755942822e+00, 5.155239582e+00, 4.292180061e+00, 7.026255131e+00, 3.211557388e+01, 9.488513947e+01, 1.582750092e+02, 1.740638733e+02, 1.490187378e+02, 6.042131042e+01, 3.719749451e+01, 00480 /* row 16 */ 1.209099007e+01, 1.201882076e+01, 1.160757637e+01, 1.041333008e+01, 9.987976074e+00, 2.393167305e+01, 7.225953674e+01, 1.357225494e+02, 1.743145294e+02, 1.702376556e+02, 1.207807083e+02, 4.496759415e+01, 3.981182480e+01, 00481 /* row 17 */ 2.812800026e+01, 8.641082001e+01, 1.430281677e+02, 1.719800873e+02, 1.824223938e+02, 1.910149689e+02, 1.953442993e+02, 1.910574646e+02, 1.780023193e+02, 1.469796906e+02, 9.055367279e+01, 4.059455109e+01, 4.104503250e+01, 00482 /* row 18 */ 4.178616714e+01, 1.018025208e+02, 1.506909790e+02, 1.755902405e+02, 1.859879150e+02, 1.944710388e+02, 1.973843079e+02, 1.869192352e+02, 1.511217194e+02, 9.369715881e+01, 5.409875107e+01, 3.682073212e+01, 3.721878433e+01, 00483 /* row 19 */ 3.235078430e+01, 8.694514465e+01, 1.405949707e+02, 1.650064392e+02, 1.741184540e+02, 1.731352692e+02, 1.626516724e+02, 1.305859222e+02, 7.754481506e+01, 3.651568222e+01, 2.892632484e+01, 2.539501572e+01, 2.528019142e+01, 00484 /* row 20 */ 2.615238667e+00, 2.091187000e+00, 2.053296089e+00, 2.096821547e+00, 2.117980957e+00, 2.314040661e+00, 2.754813433e+00, 3.055267334e+00, 2.941520452e+00, 2.815192938e+00, 2.948195934e+00, 2.482329369e+00, 2.462615490e+00 00485 }; 00486 00487 #define LOAD_DIGIT(n) \ 00488 const Image<float> digit ## n(&digit ## n ## _C[0], \ 00489 w_digit ## n ## _C, \ 00490 h_digit ## n ## _C); \ 00491 itsPatches[n].loadDefault(digit ## n); \ 00492 LINFO("loaded default data for digit %d", n) 00493 00494 LOAD_DIGIT(0); 00495 LOAD_DIGIT(1); 00496 LOAD_DIGIT(2); 00497 LOAD_DIGIT(3); 00498 LOAD_DIGIT(4); 00499 LOAD_DIGIT(5); 00500 LOAD_DIGIT(6); 00501 LOAD_DIGIT(7); 00502 LOAD_DIGIT(8); 00503 LOAD_DIGIT(9); 00504 } 00505 00506 int predictDigit(const Image<float>& area, const Point2D<int>& upperRight, 00507 const bool* digitmask, 00508 double* dist) const 00509 { 00510 *dist = std::numeric_limits<double>::max(); 00511 int result = -1; 00512 for (int i = 0; i < 10; ++i) 00513 { 00514 if (!digitmask[i]) 00515 continue; 00516 00517 const double d = itsPatches[i].distance 00518 (crop(area, Rectangle(Point2D<int>(upperRight.i - itsPatches[i].w(), 00519 upperRight.j), 00520 itsPatches[i].getDims()))); 00521 00522 if (d < *dist) 00523 { 00524 *dist = d; 00525 result = i; 00526 } 00527 } 00528 00529 return result; 00530 } 00531 00532 private: 00533 std::vector<Patch> itsPatches; 00534 }; 00535 00536 int main(const int argc, const char **argv) 00537 { 00538 volatile int signum = 0; 00539 catchsignals(&signum); 00540 00541 ModelManager manager("Streamer"); 00542 00543 nub::soft_ref<InputFrameSeries> ifs(new InputFrameSeries(manager)); 00544 manager.addSubComponent(ifs); 00545 00546 nub::soft_ref<OutputFrameSeries> ofs(new OutputFrameSeries(manager)); 00547 manager.addSubComponent(ofs); 00548 00549 if (manager.parseCommandLine(argc, argv, "outfile interactive?", 2, 2) == false) 00550 return(1); 00551 00552 manager.start(); 00553 00554 ifs->startStream(); 00555 00556 PauseWaiter p; 00557 00558 const Rectangle region(Point2D<int>(500,416), Dims(42,21)); 00559 00560 PatchSet px(region.height()); 00561 if (!px.load()) 00562 px.loadDefault(); 00563 00564 int n = 0; 00565 00566 int ntotal = 0; 00567 int nmiss = 0; 00568 int ncorrect = 0; 00569 int nincorrect = 0; 00570 00571 std::ofstream predictions_outfile(manager.getExtraArg(0).c_str()); 00572 if (!predictions_outfile.is_open()) 00573 LFATAL("couldn't open %s for writing", 00574 manager.getExtraArg(0).c_str()); 00575 00576 const bool interactive = manager.getExtraArgAs<bool>(1); 00577 00578 rutz::shared_ptr<XWinManaged> zoomwin; 00579 00580 if (interactive) 00581 zoomwin.reset(new XWinManaged(Dims(16,16), -1, -1, "zoom")); 00582 00583 std::deque<int> prediction_hist; 00584 00585 while (true) 00586 { 00587 if (signum != 0) 00588 { 00589 LINFO("quitting because %s was caught", signame(signum)); 00590 break; 00591 } 00592 00593 if (p.checkPause()) 00594 continue; 00595 00596 const FrameState is = ifs->updateNext(); 00597 if (is == FRAME_COMPLETE) 00598 break; 00599 00600 const Image<PixRGB<byte> > input = ifs->readRGB(); 00601 if (!input.initialized()) 00602 break; 00603 00604 bool doquit = false; 00605 00606 ofs->writeRGB(input, "main"); 00607 00608 Image<PixRGB<byte> > area = crop(input, region); 00609 00610 Image<PixRGB<byte> > m3area = median3(area); 00611 00612 if (!ofs->isVoid()) 00613 { 00614 ofs->writeRGB(zoomXY(area, 8), "area"); 00615 ofs->writeRGB(zoomXY(m3area, 8), "m3area"); 00616 00617 Layout<byte> digits; 00618 for (int i = 0; i < 10; ++i) 00619 { 00620 digits = hcat(digits, zoomXY(Image<byte>(px[i].getMean()), 4)); 00621 } 00622 ofs->writeGrayLayout(digits, "digits"); 00623 } 00624 00625 Image<float> m3dmap(area.getDims(), ZEROS); 00626 00627 const PixRGB<float> target(40.0f, 140.0f, 180.0f); 00628 00629 for (int i = 0; i < m3dmap.getSize(); ++i) 00630 { 00631 PixRGB<byte> col = m3area.getVal(i); 00632 m3dmap.setVal(i, exp( -0.001 * ( fabs(float(col.p[0]) - target.p[0]) 00633 + fabs(float(col.p[1]) - target.p[1]) 00634 + fabs(float(col.p[2]) - target.p[2])))); 00635 } 00636 00637 inplaceNormalize(m3dmap, 0.0f, 1.0f); 00638 inplaceLowThresh(m3dmap, 0.4f, 0.0f); 00639 00640 Point2D<int> upperRight(region.width()-2,0); 00641 00642 inplaceNormalize(m3dmap, 0.0f, 255.0f); 00643 00644 Image<PixRGB<byte> > cm3dmap; 00645 if (zoomwin.get() != 0) 00646 cm3dmap = Image<PixRGB<byte> > (zoomXY(m3dmap,8)); 00647 00648 double dist; 00649 00650 int prediction = -1; 00651 00652 { 00653 Point2D<int> predUpperRight(region.width()-2,0); 00654 00655 const bool pred1mask[10] = { true, true, true, true, true, 00656 true, true, true, true, true }; 00657 00658 const int pred1 = px.predictDigit(m3dmap, predUpperRight, 00659 &pred1mask[0], &dist); 00660 00661 if (zoomwin.get() != 0) 00662 { 00663 writeText(cm3dmap, predUpperRight*8, sformat("%d", pred1).c_str(), 00664 PixRGB<byte>(255,0,0), PixRGB<byte>(0,0,0), 00665 SimpleFont::FIXED(10), true, ANCHOR_TOP_RIGHT); 00666 writeText(cm3dmap, predUpperRight*8+Point2D<int>(0,16), sformat("%.2f", dist).c_str(), 00667 PixRGB<byte>(255,0,0), PixRGB<byte>(0,0,0), 00668 SimpleFont::FIXED(10), true, ANCHOR_TOP_RIGHT); 00669 } 00670 00671 if (pred1 >= 0 && dist < 58.0f) 00672 { 00673 prediction = pred1; 00674 predUpperRight.i -= px[pred1].w(); 00675 00676 const bool pred2mask[10] = { true, true, true, true, true, 00677 true, true, true, true, true }; 00678 00679 const int pred2 = px.predictDigit(m3dmap, predUpperRight, 00680 &pred2mask[0], &dist); 00681 00682 if (zoomwin.get() != 0) 00683 { 00684 writeText(cm3dmap, predUpperRight*8, sformat("%d", pred2).c_str(), 00685 PixRGB<byte>(0,255,0), PixRGB<byte>(0,0,0), 00686 SimpleFont::FIXED(10), true, ANCHOR_TOP_RIGHT); 00687 writeText(cm3dmap, predUpperRight*8+Point2D<int>(0,16), sformat("%.2f", dist).c_str(), 00688 PixRGB<byte>(0,255,0), PixRGB<byte>(0,0,0), 00689 SimpleFont::FIXED(10), true, ANCHOR_TOP_RIGHT); 00690 } 00691 00692 // if digit1 is 0, then we must have a second digit, so we 00693 // raise the threshold in that case 00694 const float d2thresh = (pred1 == 0) ? 80.0f : 58.0f; 00695 00696 if (pred2 >= 0 && dist < d2thresh) 00697 { 00698 prediction += 10 * pred2; 00699 predUpperRight.i -= px[pred2].w(); 00700 00701 const bool pred3mask[10] = { false, true, false, false, false, 00702 false, false, false, false, false }; 00703 00704 const int pred3 = px.predictDigit(m3dmap, predUpperRight, 00705 &pred3mask[0], &dist); 00706 00707 if (zoomwin.get() != 0) 00708 { 00709 writeText(cm3dmap, predUpperRight*8, sformat("%d", pred3).c_str(), 00710 PixRGB<byte>(0,0,255), PixRGB<byte>(0,0,0), 00711 SimpleFont::FIXED(10), true, ANCHOR_TOP_RIGHT); 00712 writeText(cm3dmap, predUpperRight*8+Point2D<int>(0,16), sformat("%.2f", dist).c_str(), 00713 PixRGB<byte>(0,0,255), PixRGB<byte>(0,0,0), 00714 SimpleFont::FIXED(10), true, ANCHOR_TOP_RIGHT); 00715 } 00716 00717 if (pred2 == 0) // second digit is 0 so third digit must be non-zero 00718 prediction += 100; 00719 else if (pred3 >= 0 && dist < 80.0f) 00720 prediction += 100 * pred3; 00721 } 00722 } 00723 00724 if (zoomwin.get() != 0) 00725 { 00726 writeText(cm3dmap, Point2D<int>(0, cm3dmap.getHeight()-1), 00727 sformat("%d", prediction).c_str(), 00728 PixRGB<byte>(255,255,0), PixRGB<byte>(0,0,0), 00729 SimpleFont::FIXED(10), true, ANCHOR_BOTTOM_LEFT); 00730 } 00731 } 00732 00733 if (zoomwin.get() != 0) 00734 zoomwin->drawImage(cm3dmap,0,0,true); 00735 00736 if (0 && zoomwin.get() != 0) 00737 { 00738 int number = -1; 00739 00740 const int digit1 = getDigit(*zoomwin); 00741 if (digit1 >= 0) 00742 { 00743 number = digit1; 00744 00745 upperRight.i -= px[digit1].w(); 00746 const Rectangle d1box(upperRight, Dims(px[digit1].w(), 21)); 00747 00748 px[digit1].addPatch(crop(m3dmap, d1box)); 00749 00750 drawRectSquareCorners(cm3dmap, d1box * 8, 00751 PixRGB<byte>(255,0,0), 1); 00752 zoomwin->drawImage(cm3dmap,0,0,true); 00753 00754 const int digit2 = getDigit(*zoomwin); 00755 if (digit2 >= 0) 00756 { 00757 number += 10 * digit2; 00758 00759 upperRight.i -= px[digit2].w(); 00760 const Rectangle d2box(upperRight, Dims(px[digit2].w(), 21)); 00761 00762 px[digit2].addPatch(crop(m3dmap, d2box)); 00763 00764 drawRectSquareCorners(cm3dmap, d2box * 8, 00765 PixRGB<byte>(0,255,0), 1); 00766 zoomwin->drawImage(cm3dmap,0,0,true); 00767 00768 const int digit3 = getDigit(*zoomwin); 00769 if (digit3 >= 0) 00770 { 00771 number += 100 * digit3; 00772 00773 upperRight.i -= px[digit3].w(); 00774 const Rectangle d3box(upperRight, Dims(px[digit3].w(), 21)); 00775 00776 px[digit3].addPatch(crop(m3dmap, d3box)); 00777 00778 drawRectSquareCorners(cm3dmap, d3box * 8, 00779 PixRGB<byte>(0,0,255), 1); 00780 zoomwin->drawImage(cm3dmap,0,0,true); 00781 usleep(250000); 00782 } 00783 } 00784 } 00785 00786 if (number >= 0) 00787 { 00788 ++ntotal; 00789 if (prediction == -1) 00790 { 00791 LINFO("miss!"); 00792 ++nmiss; 00793 } 00794 else if (prediction == number) 00795 { 00796 LINFO("correct!"); 00797 ++ncorrect; 00798 } 00799 else 00800 { 00801 LINFO("incorrect"); 00802 ++nincorrect; 00803 } 00804 } 00805 00806 LINFO("stats: n=%d, nmiss=%d, ncorrect=%d, nincorrect=%d", 00807 ntotal, nmiss, ncorrect, nincorrect); 00808 } 00809 00810 if (doquit) 00811 break; 00812 00813 prediction_hist.push_back(prediction); 00814 00815 predictions_outfile << prediction << '\n'; 00816 00817 ++n; 00818 } 00819 00820 px.save(); 00821 00822 std::ofstream median_outfile 00823 (sformat("%s-median", manager.getExtraArg(0).c_str()).c_str()); 00824 00825 if (!median_outfile.is_open()) 00826 LFATAL("couldn't open %s-median for writing", 00827 manager.getExtraArg(0).c_str()); 00828 00829 for (size_t i = 0; i < prediction_hist.size(); ++i) 00830 { 00831 int lo = std::max(int(i)-14,0); 00832 int hi = std::min(int(i)+15,int(prediction_hist.size())); 00833 00834 std::vector<int> sorted(prediction_hist.begin() + lo, 00835 prediction_hist.begin() + hi); 00836 00837 std::sort(sorted.begin(), sorted.end()); 00838 00839 int median = (sorted[sorted.size() / 2] 00840 + sorted[(sorted.size() - 1) / 2]) / 2; 00841 00842 median_outfile << median << '\n'; 00843 } 00844 00845 return 0; 00846 } 00847 00848 // ###################################################################### 00849 /* So things look consistent in everyone's emacs... */ 00850 /* Local Variables: */ 00851 /* mode: c++ */ 00852 /* indent-tabs-mode: nil */ 00853 /* End: */ 00854 00855 #endif // VGAMES_APP_NFSU_SPEED_EXTRACT_C_DEFINED