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

📄 str.cpp

📁 face recognition test source code
💻 CPP
字号:
#include "stdafx.h"

/* Useful strings */
char chr_RT1												= '\n';
char chr_RT2												= '\r';
char chr_BTAG												= '[';
char str_BTAG[]											= "[";
char chr_PROJ_COMMENT									= ';';
char str_RET[]												= "\n\r";
char str_TABRT[]											= "\t\n\r";
char str_DIR[]												= ":";
char chr_DIR												= ':';
char str_EXT_TXT[]										= ".txt";
char str_SAVE_NUM[]										= "%ld char. saved";

/* face file strings */
char str_ERR_FILE_OPEN[]								= "Cannot open the file, (%s)";
char str_ERR_FILE_READ[]								= "Cannot read the file %s";
char str_ERR_FILE_WRITE[]								= "Writing problem: only %ld characters written out of %ld";
char str_ERR_FILE_READPROB[]							= "File read problem : read %ld characters instead of %ld";
char str_ERR_FILE_LOCATE[]								= "Cannot locate the file %s";
char str_ERR_FILE_EXT[]									= "This file has not the extension PPM or PGM, cannot recognise its format";
char str_ERR_FILE_CLOSE[]								= "Could not close the file";
char str_ERR_ASCIIBIN[]									= "Neither ASCII or Binary graphics file format, cannot load the file";
char str_ERR_FILE_UNEXPECTEDEOF[]					= "Unexpected end of file found, cannot open the file";
char str_ERR_NOT255[]									= "The largest grey level must be 255, it is not, cannot open the file";
char str_LOADED[]											= "%i lines loaded";
char str_LOADING[]										= "Loading : %s";
char str_SAVING[]											= "Saving : %s";
char str_SAVED[]											= "Saved";

/* face database */
char str_ERR_DIMENSION[]								= "The face %s has not the same dimensions as the first face (reference face) : it has (%ld, %ld) instead of (%ld, %ld). The face has been deleted from the data base";

/* project file strings */
char str_TRAINING[]										= "TRAINING";
char str_CATEGORIZE_LVQ[]								= "CATEGORIZE";
char str_RECONSTRUCTION[]								= "RECONSTRUCTION";
char str_RECOGNIZE[]										= "RECOGNIZE";
char str_MEET[]											= "MEET";
char str_END[]												= "END";
char str_LOAD_EIGEN[]									= "LOAD_EIGENVECT";
char str_LOAD_MEET[]										= "LOAD_MEET";
char str_SAVE_EIGEN_DB[]								= "SAVE_EIGENFACE";
char str_SAVE_EIGEN[]									= "SAVE_EIGENVECT";
char str_SAVE_CMP_MEET[]								= "SAVE_MEET";
char str_SAVE_CMP_RECONSTRUCTION[]					= "SAVE_RECONSTRUCT";
char str_SAVE_CMP_RECOGNIZE[]							= "SAVE_RECOGNIZE";
char str_SAVE_REPORT[]									= "SAVE_REPORT";
char str_EVAL_FILENAME[]								= "EVal";
char str_PROJECT_LOADING[]								= "Loading project file : %s";
char str_PROJECT_TRAINING[]							= "Loading Training Set";
char str_PROJECT_TRAINING_DONE[]						= "Training Set Loaded (%ld Faces)";
char str_PROJECT_CATEGORIZE[]							= "Loading Categorization Set";
char str_PROJECT_CATEGORIZE_DONE[]					= "Categorization Set Loaded (%ld Faces)";
char str_PROJECT_RECONSTRUCTION[]					= "Loading Reconstruction Set";
char str_PROJECT_RECONSTRUCTION_DONE[]				= "Reconstruction Set Loaded (%ld Faces)";
char str_PROJECT_RECOGNIZE[]							= "Loading Faces to be recognized";
char str_PROJECT_RECOGNIZE_DONE[]					= "Recognition Set Loaded (%ld Faces)";
char str_PROJECT_MEET[]									= "Meeting some new faces";
char str_PROJECT_MEET_DONE[]							= "Meeting Set Loaded (%ld Faces)";
char str_PROJECT_LOAD_EIGEN[]							= "Load the Eigenvectors";
char str_PROJECT_LOAD_EIGEN_DONE[]					= "%ld Eigenvectors loaded";
char str_PROJECT_LOAD_MEET[]							= "Load the Meeting faces";
char str_PROJECT_LOAD_MEET_DONE[]					= "%ld Meetinf faces loaded";
char str_PROJECT_SAVE_EIGEN_DB[]						= "Save the EigenFaces";
char str_PROJECT_SAVE_EIGEN_DB_DONE[]				= "%ld EigenFaces saved";
char str_PROJECT_SAVE_EIGEN[]							= "Save the EigenVectors";
char str_PROJECT_SAVE_EIGEN_DONE[]					= "%ld EigenVectors saved";
char str_PROJECT_SAVE_REPORT[]						= "Save the Report";
char str_PROJECT_SAVE_REPORT_DONE[]					= "Report saved";
char str_PROJECT_SAVE_CMP_MEET[]						= "Save the meeting faces' composants";
char str_PROJECT_SAVE_CMP_MEET_DONE[]				= "Meeting faces' composantssaved";
char str_PROJECT_SAVE_CMP_RECONSTRUCTION[]		= "Save the composants of the faces to reconstruct";
char str_PROJECT_SAVE_CMP_RECONSTRUCTION_DONE[]	= "Recontruction's composants saved";
char str_PROJECT_SAVE_CMP_RECOGNITION[]			= "Save the composants of the faces to recognize";
char str_PROJECT_SAVE_CMP_RECOGNITION_DONE[]		= "Recognition's composants saved";
char str_ALREADY_LOAD_EIGEN[]							= "Inconcistency, you have already defined a LOAD EIGEN section at line %i";
char str_ALREADY_TRAINING[]							= "Inconcistency, you have already defined a TRAINING section at line %i";
char str_ALREADY_MEET[]									= "Inconcistency, you have already defined a MEET section at line %i";
char str_NOTYET_EIGEN[]									= "Inconcistency, you didn't define the principal components (via the [TRAINING] section or .LOAD EIGEN command) at line %i";
char str_NOTYET_MEET[]									= "Inconcistency, you didn't define the [MEET] section at line %i";
char str_NOTYET_RECONSTRUCTION[]						= "Inconcistency, you didn't define the [RECONSTRUCTION] section at line %i";
char str_NOTYET_RECOGNITION[]							= "Inconcistency, you didn't define the [RECOGNITION] section at line %i";
char str_ERR_WRONGARG[]									= "Missing parameter (file name) at line %i";
char str_ERR_TRAINING[]									= "Could not find the [TRAINING] tag";
char str_ERR_TRAINING_ENDTAG[]						= "Cannot find the training face database section end tag";
char str_ERR_CATEGORIZE_ENDTAG[]						= "Cannot find the categorization face database section end tag";
char str_ERR_RECONSTRUCTION_ENDTAG[]				= "Cannot find the reconstruction face database section end tag";
char str_ERR_RECOGNIZE_ENDTAG[]						= "Cannot find the recognition face database section end tag";
char str_ERR_MEET_ENDTAG[]								= "Cannot find the meet face database section end tag";
char str_ERR_LOAD_EIGEN_ENDTAG[]						= "Cannot find the load eigen section end tag";
char str_ERR_MISMATCH[]									= "Type mismatch in the project file : %s";
char str_ERR_AAMNOTCREATE[]							= "You must train your memory before : %s";

/* Memory */
char str_ERR_MEM_ALLOCATE[]							= "Error while allocating memory, probably not enough memory";
char str_ERR_MEM_REALLOCATE[]							= "Error while reallocating memory, probably not enough memory";
char str_ERR_MEM_GETPTR[]								= "Null handle passed to CMemory::GetPtr()";

/* Matrix */
char str_TOOITER[]										= "Too many iterations in tqli (computing the eigenvectors)";
char str_ERR_MAT_COPY[]									= "Cannot copy the matrix into a face database object because the diagonal object is smaller than the matrix";
char str_ERR_MAT_LOAD_ROW[]							= "Cannot find the number of rows of the matrix";
char str_ERR_MAT_LOAD_COL[]							= "Cannot find the number of columns of the matrix";
char str_ERR_MAT_LOAD_HDR[]							= "Bad header in the matrix file (it should be <row number>\t<colnumber>\n)";

/* Auto-Associative Memory */
char str_AAM_BUILD_START[]								= "Building the Eigenvectors of the Auto-Associative Memory";
char str_AAM_BUILD_NORMALIZED[]						= "The training vectors are normalized";
char str_AAM_BUILD_INNER[]								= "The inner product of the training vectors is computed";
char str_AAM_BUILD_EIGEN1[]							= "The eigenvectors of the inner product are computed";
char str_AAM_BUILD_SORT[]								= "The eigenvectors are sorted in decreasing order of their eigenvalues";
char str_AAM_BUILD_DONE[]								= "%ld Eigenvectors computed";
char str_AAM_RECONSTRUCTION_START[]					= "Calculating the reconstruction of specified the faces";
char str_AAM_RECONS_NORMALIZED[]						= "The faces to be reconstructed are normalized";
char str_AAM_RECONSTRUCTION_DONE[]					= "%ld faces have been reconstructed";
char str_AAM_CATEGORIZE_DONE[]						= "%ld faces have been categorized";
char str_AAM_RECOGNIZE_START[]						= "Trying to recognize people";
char str_AAM_CATEGORIZE_START[]						= "Categorization process started";
char str_AAM_RECOG_NORMALIZED[]						= "The faces to be recognized are normalized";
char str_AAM_CATEG_NORMALIZED[]						= "The categorisaation faces are normalized";
char str_AAM_RECOG_CLASS[]								= "The classification process begin...";
char str_AAM_RECOG_CLASS_DONE[]						= "The classification process is completed";
char str_AAM_MEET_NORMALIZED[]						= "The faces to meet are normalized";
char str_AAM_RECOGNIZE_DONE[]							= "The Recognition process has been done on %ld faces";
char str_AAM_CATEGORIZATION_DONE[]					= "The Categorization process has been done on %ld faces";
char str_AAM_RECOGNIZE_PERCENT[]						= "Recognition done, Out of %ld faces, %ld have been correctly recognized (%.4f %%)";
char str_RECOGNITION_RESULT_Y[]						= "Y   %s -> %s, probability = %.1f%";
char str_RECOGNITION_RESULT_N[]						= "WRONG RECOGNITION:   %s -> %s, probability = %.1f%";
char str_RECOGNITION_I[]								= "INDETERMINATE:   %s -> ???";
char str_AAM_F2CMP[]										= "The composants have been computed from the original faces";
char str_AAM_CMP2F[]										= "The faces have been reconstructed from their composants";
char str_AAM_COS_DONE[]									= "The cosine between the original set and the memorized set is computed";

/* LVQ */
char str_LVQ_SAVE[]										= "save";
char str_LVQ_SAMMON[]									= "sammon";
char str_LVQ_NOC[]										= "noc";
char str_LVQ_KNN[]										= "knn";
char str_LVQ_XDIM[]										= "xdim";
char str_LVQ_YDIM[]										= "ydim";
char str_LVQ_NEIGH[]										= "neigh";
char str_LVQ_TOPOL[]										= "topol";
char str_LVQ_SEED[]										= "seed";
char str_LVQ_ALPHA_TYPE[]								= "alpha_type";
char str_LVQ_RADIUS[]									= "radius";
char str_LVQ_ALPHA[]										= "alpha";
char str_LVQ_EVENINIT[]									= "eveninit";
char str_LVQ_PROPINIT[]									= "propinit";
char str_LVQ_BALANCE[]									= "balance";
char str_LVQ_ACCURACY[]									= "accuracy";
char str_LVQ_CLASSIFY[]									= "classify";
char str_LVQ_OLVQ1[]										= "olvq1";
char str_LVQ_LVQ1[]										= "lvq1";
char str_LVQ_LVQ2[]										= "lvq2";
char str_LVQ_LVQ3[]										= "lvq3";
char str_LVQ_ERR_PARAM[]								= "Undefined parameter %s of the command %s";

/* Messages */
char str_MSG_MORE_H[]									= " done in %dh %dm, %s memory free";
char str_MSG_MORE_M[]									= " done in %dm %ds, %s memory free";
char str_MSG_MORE_S[]									= " done in %ds, %s memory free";

⌨️ 快捷键说明

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