From: Evgeniy Kozinov Date: Mon, 11 Oct 2010 07:59:13 +0000 (+0000) Subject: Russian comments was removed. Error code was added as returned value inLatentSVM... X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~8622 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1cf405d8a46bea006bc76568b478075b3d39bd20;p=platform%2Fupstream%2Fopencv.git Russian comments was removed. Error code was added as returned value inLatentSVM parser. --- diff --git a/modules/objdetect/src/_lsvmparser.h b/modules/objdetect/src/_lsvmparser.h index 3d5cf56..4136b21 100644 --- a/modules/objdetect/src/_lsvmparser.h +++ b/modules/objdetect/src/_lsvmparser.h @@ -47,20 +47,19 @@ #define EBTAG (STEP_END + BTAG) //extern "C" { - void LSVMparser(const char * filename, filterObject *** model, int *last, int *max, int **comp, float **b, int *count, float * score); + int LSVMparser(const char * filename, filterObject *** model, int *last, int *max, int **comp, float **b, int *count, float * score); #ifdef __cplusplus extern "C" #endif int loadModel( - // Âõîäíûå ïàðàìåòðû - const char *modelPath,// - ïóòü äî ôàéëà ñ ìîäåëüþ - // Âûõîäíûå ïàðàìåòðû - filterObject ***filters,// - ìàññèâ óêàçàòåëåé íà ôèëüòðû êîìïîíåíò - int *kFilters, //- îáùåå êîëè÷åñòâî ôèëüòðîâ âî âñåõ ìîäåëÿõ - int *kComponents, //- êîëè÷åñòâî êîìïîíåíò - int **kPartFilters, //- ìàññèâ, ñîäåðæàùèé êîëè÷åñòâî òî÷íûõ ôèëüòðîâ â êàæäîé êîìïîíåíòå - float **b, //- ìàññèâ ëèíåéíûõ ÷ëåíîâ â îöåíî÷íîé ôóíêöèè - float *scoreThreshold); //- ïîðîã äëÿ score) + const char *modelPath, + + filterObject ***filters, + int *kFilters, + int *kComponents, + int **kPartFilters, + float **b, + float *scoreThreshold); //}; #endif \ No newline at end of file diff --git a/modules/objdetect/src/lsvmparser.cpp b/modules/objdetect/src/lsvmparser.cpp index a9eeac6..0b0d8cf 100644 --- a/modules/objdetect/src/lsvmparser.cpp +++ b/modules/objdetect/src/lsvmparser.cpp @@ -718,7 +718,7 @@ void parserModel(FILE * xmlf, filterObject *** model, int *last, int *max, int * } } -void LSVMparser(const char * filename, filterObject *** model, int *last, int *max, int **comp, float **b, int *count, float * score){ +int LSVMparser(const char * filename, filterObject *** model, int *last, int *max, int **comp, float **b, int *count, float * score){ int st = 0; int tag; char ch; @@ -732,7 +732,11 @@ void LSVMparser(const char * filename, filterObject *** model, int *last, int *m (*model) = (filterObject ** )malloc((sizeof(filterObject * )) * (*max)); //printf("parse : %s\n", filename); + xmlf = fopen(filename, "rb"); + if(xmlf == NULL){ + return -1; + } i = 0; j = 0; @@ -762,28 +766,31 @@ void LSVMparser(const char * filename, filterObject *** model, int *last, int *m } } } + return 0; } int loadModel( - // Âõîäíûå ïàðàìåòðû - const char *modelPath,// - ïóòü äî ôàéëà ñ ìîäåëüþ + const char *modelPath, - // Âûõîäíûå ïàðàìåòðû - filterObject ***filters,// - ìàññèâ óêàçàòåëåé íà ôèëüòðû êîìïîíåíò - int *kFilters, //- îáùåå êîëè÷åñòâî ôèëüòðîâ âî âñåõ ìîäåëÿõ - int *kComponents, //- êîëè÷åñòâî êîìïîíåíò - int **kPartFilters, //- ìàññèâ, ñîäåðæàùèé êîëè÷åñòâî òî÷íûõ ôèëüòðîâ â êàæäîé êîìïîíåíòå - float **b, //- ìàññèâ ëèíåéíûõ ÷ëåíîâ â îöåíî÷íîé ôóíêöèè - float *scoreThreshold){ //- ïîðîã äëÿ score) + filterObject ***filters, + int *kFilters, + int *kComponents, + int **kPartFilters, + float **b, + float *scoreThreshold){ int last; int max; int *comp; int count; int i; + int err; float score; //printf("start_parse\n\n"); - LSVMparser(modelPath, filters, &last, &max, &comp, b, &count, &score); + err = LSVMparser(modelPath, filters, &last, &max, &comp, b, &count, &score); + if(err != 0){ + return -1; + } (*kFilters) = last + 1; (*kComponents) = count; (*scoreThreshold) = (float) score;