You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(28) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(11) |
Feb
(51) |
Mar
(219) |
Apr
(63) |
May
(7) |
Jun
(91) |
Jul
(97) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
|
From: Herton R. K. <he...@us...> - 2005-04-07 06:20:05
|
Update of /cvsroot/kimageprocess/kimageprocess/testclass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10371/testclass Modified Files: testclass.c Log Message: - Finished testclass, now generating res files also. Index: testclass.c =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/testclass/testclass.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- testclass.c 6 Apr 2005 04:32:11 -0000 1.14 +++ testclass.c 7 Apr 2005 06:19:56 -0000 1.15 @@ -6,6 +6,7 @@ #include <unistd.h> #include <lex.yy.c> #include <fann.h> +#include <time.h> #define TESTCLASS_VERSION "0.1" #define PARSER_ERROR 1 @@ -183,6 +184,9 @@ struct fann_train_data tfanndata; float connection_rate = 1; float learning_rate = 0.7; + float *result; + int npat; + time_t tempTime; if (argc == 1) usage(argv[0]); @@ -226,6 +230,9 @@ pc_file = fopen(c_file, "r"); if (pc_file == NULL) fatal(errno); + pr_file = fopen(r_file, "w"); + if (pr_file == NULL) + fatal(errno); loadNetwork(&c_patData, pc_file, c_file); tfann = fann_create(connection_rate, learning_rate, 3, t_patData.numInputUnits, @@ -241,9 +248,33 @@ tfanndata.input = t_patData.inputValues; tfanndata.output = t_patData.outputValues; fann_init_weights(tfann, &tfanndata); - /*fann_set_training_algorithm(ann, FANN_TRAIN_QUICKPROP);*/ fann_train_on_data(tfann, &tfanndata, 300000, 1000, 0.001); - /*fann_train_on_data_callback(ann, data, max_iterations, iterations_between_reports, desired_error, print_callback);*/ + if (fprintf(pr_file, "SNNS result file V1.4-3D\n") < 0) + fatal(errno); + tempTime = time(NULL); + if (fprintf(pr_file, "generated at %s\n\n", ctime(&tempTime)) < 0) + fatal(errno); + if (fprintf(pr_file, "No. of patterns : %d\n", c_patData.numPatterns) < 0) + fatal(errno); + if (fprintf(pr_file, "No. of input units : %d\n", t_patData.numInputUnits) < 0) + fatal(errno); + if (fprintf(pr_file, "No. of output units : %d\n", t_patData.numOutputUnits) < 0) + fatal(errno); + if (fprintf(pr_file, "startpattern : 1\n") < 0) + fatal(errno); + if (fprintf(pr_file, "endpattern : %d\n\n", c_patData.numPatterns) < 0) + fatal(errno); + for (npat = 0; npat < c_patData.numPatterns; npat++) + { + result = fann_run(tfann, c_patData.inputValues[npat]); + for (c = 0; c < t_patData.numOutputUnits; c++) + { + if (fprintf(pr_file, "%.5f ", result[c]) < 0) + fatal(errno); + } + fseek(pr_file, -1, SEEK_CUR); /* remove extra space */ + fprintf(pr_file, "\n"); + } fann_destroy(tfann); if (t_patData.inputValues != NULL) { @@ -281,5 +312,7 @@ fatal(errno); if (fclose(pc_file) != 0) fatal(errno); + if (fclose(pr_file) != 0) + fatal(errno); return 0; } |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-07 02:07:29
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30380/src/methods/hsvcm Modified Files: hsvcm.cpp Log Message: Prevent if from calculating RGB->HSV conversions more than once Index: hsvcm.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/hsvcm.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- hsvcm.cpp 6 Apr 2005 04:12:52 -0000 1.5 +++ hsvcm.cpp 7 Apr 2005 02:07:20 -0000 1.6 @@ -33,6 +33,12 @@ K_EXPORT_COMPONENT_FACTORY( kimageprocess_hsvcm, KGenericFactory<KTHSVCM>( "kimageprocess_hsvcm" ) ) + +struct FloatPack2 +{ + float data[2]; +}; + KTHSVCM::KTHSVCM(QObject *parent, const char* name, const QStringList&) : KTMethod() { @@ -44,13 +50,14 @@ m_longName = i18n("HSV Co-Occurrence Matrix"); //defaults - m_quantH = 8; - m_quantS = 4; - m_quantV = 4; + m_quantH = 20; + m_quantS = 8; + m_quantV = 8; + + m_sizeH = 18; // 360 / 20 + m_sizeS = 32; // 256 / 8 + m_sizeV = 32; // 256 / 8 - m_sizeH = 45; // 360 / 8 - m_sizeS = 64; // 256 / 4 - m_sizeV = 64; // 256 / 4 } @@ -138,15 +145,27 @@ int width = m_img->width(); int height = m_img->height(); + // Convert all RGB to HSV + struct s_hsv + { + int H; + int S; + int V; + } hsv[width][height]; + + //kdDebug() << "Converting from RGB to HSV" << endl; + for (int x = 0; x < width; ++x) + for (int y = 0; y < height; ++y) + { + color.setRgb(m_img->pixel(x,y)); + color.getHsv(&hsv[x][y].H,&hsv[x][y].S,&hsv[x][y].V); + hsv[x][y].H = hsv[x][y].H / m_quantH; + hsv[x][y].S = hsv[x][y].S / m_quantS; + hsv[x][y].V = hsv[x][y].V / m_quantV; + } for (int x = 0; x < width; ++x) for (int y = 0; y < height; ++y) { - //get the H component of the central pixel - int H, S, V, tmpH, tmpS, tmpV; - color.setRgb(m_img->pixel(x, y)); - color.getHsv(&H,&tmpS,&tmpV); - H = H / m_quantH; - //nine directions for (int d = 0; d < 9; d++) { @@ -263,17 +282,7 @@ xs = (x == width-1 ? 0 : x+1); break; } - //get the V component of the direction pixel - color.setRgb(m_img->pixel(xv,yv)); - color.getHsv(&tmpH, &tmpS, &V); - V = V / m_quantV; - - //get the S component of the direction pixel - color.setRgb(m_img->pixel(xs,ys)); - color.getHsv(&tmpH, &S, &tmpV); - S = S / m_quantS; - - m_cm[d][V][H][S]++; + m_cm[d][hsv[xv][yv].V][hsv[x][y].H][hsv[xs][ys].S]++; } } |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-07 02:07:29
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/angsecmom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30380/src/methods/hsvcm/features/angsecmom Modified Files: angsecmom.cpp Log Message: Prevent if from calculating RGB->HSV conversions more than once Index: angsecmom.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/angsecmom/angsecmom.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- angsecmom.cpp 6 Apr 2005 04:12:53 -0000 1.3 +++ angsecmom.cpp 7 Apr 2005 02:07:21 -0000 1.4 @@ -61,7 +61,7 @@ for (int j=0; j< cmSize[1]; j++) for (int k=0; k < cmSize[2]; k++) sum += cm[i][j][k] * cm[i][j][k]; - return 0.0; + return sum; } #include "angsecmom.moc" |
|
From: Herton R. K. <he...@us...> - 2005-04-06 04:32:20
|
Update of /cvsroot/kimageprocess/kimageprocess/testclass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30359/testclass Modified Files: Makefile.am testclass.c Log Message: - Added training code for tests. Index: Makefile.am =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/testclass/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.am 5 Apr 2005 06:54:55 -0000 1.4 +++ Makefile.am 6 Apr 2005 04:32:11 -0000 1.5 @@ -5,7 +5,9 @@ noinst_PROGRAMS = testclass # set the include path for X, qt and KDE -INCLUDES = $(all_includes) -I$(srcdir)/../testclass +INCLUDES = $(all_includes) \ + -I$(srcdir)/../testclass \ + -I$(srcdir)/../testclass/libfann/include # the library search path. testclass_LDFLAGS = $(all_libraries) @@ -13,7 +15,7 @@ # the libraries to link against. testclass_LDADD = $(top_builddir)/testclass/libfann/libfann.a \ $(top_builddir)/testclass/libfann/libfloatfann.a \ - -lfl + -lfl -lm # which sources should be compiled for testclass testclass_SOURCES = testclass.c Index: testclass.c =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/testclass/testclass.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- testclass.c 6 Apr 2005 03:00:14 -0000 1.13 +++ testclass.c 6 Apr 2005 04:32:11 -0000 1.14 @@ -5,6 +5,7 @@ #include <string.h> #include <unistd.h> #include <lex.yy.c> +#include <fann.h> #define TESTCLASS_VERSION "0.1" #define PARSER_ERROR 1 @@ -176,12 +177,12 @@ opterr = 0; char *t_file, *c_file, *r_file; FILE *pt_file, *pc_file, *pr_file; - int in_tnum, out_tnum, pat_tnum; - float **in_tvalues, **out_tvalues; - int in_cnum, out_cnum, pat_cnum; - float **in_cvalues, **out_cvalues; pat t_patData; pat c_patData; + struct fann *tfann; + struct fann_train_data tfanndata; + float connection_rate = 1; + float learning_rate = 0.7; if (argc == 1) usage(argv[0]); @@ -226,6 +227,24 @@ if (pc_file == NULL) fatal(errno); loadNetwork(&c_patData, pc_file, c_file); + tfann = fann_create(connection_rate, learning_rate, 3, + t_patData.numInputUnits, + t_patData.numInputUnits, + t_patData.numOutputUnits); + fann_set_activation_steepness_hidden(tfann, 1.0); + fann_set_activation_steepness_output(tfann, 1.0); + fann_set_activation_function_hidden(tfann, FANN_SIGMOID_SYMMETRIC_STEPWISE); + fann_set_activation_function_output(tfann, FANN_SIGMOID_SYMMETRIC_STEPWISE); + tfanndata.num_data = t_patData.numPatterns; + tfanndata.num_input = t_patData.numInputUnits; + tfanndata.num_output = t_patData.numOutputUnits; + tfanndata.input = t_patData.inputValues; + tfanndata.output = t_patData.outputValues; + fann_init_weights(tfann, &tfanndata); + /*fann_set_training_algorithm(ann, FANN_TRAIN_QUICKPROP);*/ + fann_train_on_data(tfann, &tfanndata, 300000, 1000, 0.001); + /*fann_train_on_data_callback(ann, data, max_iterations, iterations_between_reports, desired_error, print_callback);*/ + fann_destroy(tfann); if (t_patData.inputValues != NULL) { /* free only first element because is a contiguous allocated memory |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-06 04:13:04
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/dummy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25586/src/methods/hsvcm/features/dummy Modified Files: LOWER.cpp LOWER.h Log Message: - Implemented the usage of the features in KTHSVCM - implemented entropy function - implemented angsecmom function Index: LOWER.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/dummy/LOWER.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- LOWER.cpp 6 Apr 2005 01:50:46 -0000 1.2 +++ LOWER.cpp 6 Apr 2005 04:12:54 -0000 1.3 @@ -46,7 +46,7 @@ } -float KTHSVCMNAME::calculate(KTImage *img, int direction) +float KTHSVCMNAME::_calculate(KTImage *img, int direction) { int cmSize[3]; float ***cm = (float***) method()->data(direction); Index: LOWER.h =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/dummy/LOWER.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- LOWER.h 5 Apr 2005 22:49:09 -0000 1.1 +++ LOWER.h 6 Apr 2005 04:12:54 -0000 1.2 @@ -39,7 +39,7 @@ ~KTHSVCMNAME(); - float calculate(KTImage *img, int direction); + float _calculate(KTImage *img, int direction); }; #endif |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-06 04:13:03
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/entropy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25586/src/methods/hsvcm/features/entropy Modified Files: entropy.cpp entropy.h Log Message: - Implemented the usage of the features in KTHSVCM - implemented entropy function - implemented angsecmom function Index: entropy.h =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/entropy/entropy.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- entropy.h 5 Apr 2005 22:49:10 -0000 1.1 +++ entropy.h 6 Apr 2005 04:12:54 -0000 1.2 @@ -39,7 +39,7 @@ ~KTHSVCMEntropy(); - float calculate(KTImage *img, int direction); + float _calculate(KTImage *img, int direction); }; #endif Index: entropy.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/entropy/entropy.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- entropy.cpp 6 Apr 2005 01:50:46 -0000 1.2 +++ entropy.cpp 6 Apr 2005 04:12:54 -0000 1.3 @@ -29,6 +29,9 @@ #include <ktfeaturemanager.h> #include <ktmethod.h> +#include <math.h> +#define EPSILON 0.000000001 + K_EXPORT_COMPONENT_FACTORY( kimageprocess_hsvcm_entropy, KGenericFactory<KTHSVCMEntropy>( "kimageprocess_hsvcm_entropy" ) ) @@ -46,17 +49,22 @@ } -float KTHSVCMEntropy::calculate(KTImage *img, int direction) +float KTHSVCMEntropy::_calculate(KTImage *img, int direction) { - int cmSize[3]; - float ***cm = (float***) method()->data(direction); + int cmSize[3]; + float ***cm = (float***) method()->data(direction); KTMethod *m = method(); cmSize[0] = m->dataSize(0); cmSize[1] = m->dataSize(1); cmSize[2] = m->dataSize(2); - return 0.0; + double sum = 0.; + for (int i=0; i < cmSize[0]; i++) + for (int j=0; j< cmSize[1]; j++) + for (int k=0; k < cmSize[2]; k++) + sum += cm[i][j][k] * log10(cm[i][j][k] + EPSILON); + return sum; } #include "entropy.moc" |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-06 04:13:03
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/correlation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25586/src/methods/hsvcm/features/correlation Modified Files: correlation.cpp correlation.h Log Message: - Implemented the usage of the features in KTHSVCM - implemented entropy function - implemented angsecmom function Index: correlation.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/correlation/correlation.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- correlation.cpp 6 Apr 2005 01:50:46 -0000 1.2 +++ correlation.cpp 6 Apr 2005 04:12:53 -0000 1.3 @@ -46,7 +46,7 @@ } -float KTHSVCMCorrelation::calculate(KTImage *img, int direction) +float KTHSVCMCorrelation::_calculate(KTImage *img, int direction) { int cmSize[3]; float ***cm = (float***) method()->data(direction); Index: correlation.h =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/correlation/correlation.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- correlation.h 5 Apr 2005 22:49:09 -0000 1.1 +++ correlation.h 6 Apr 2005 04:12:54 -0000 1.2 @@ -39,7 +39,7 @@ ~KTHSVCMCorrelation(); - float calculate(KTImage *img, int direction); + float _calculate(KTImage *img, int direction); }; #endif |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-06 04:13:02
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/angsecmom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25586/src/methods/hsvcm/features/angsecmom Modified Files: angsecmom.cpp angsecmom.h Log Message: - Implemented the usage of the features in KTHSVCM - implemented entropy function - implemented angsecmom function Index: angsecmom.h =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/angsecmom/angsecmom.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- angsecmom.h 5 Apr 2005 22:49:09 -0000 1.1 +++ angsecmom.h 6 Apr 2005 04:12:53 -0000 1.2 @@ -39,7 +39,7 @@ ~KTHSVCMAngSecMom(); - float calculate(KTImage *img, int direction); + float _calculate(KTImage *img, int direction); }; #endif Index: angsecmom.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/angsecmom/angsecmom.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- angsecmom.cpp 6 Apr 2005 01:50:45 -0000 1.2 +++ angsecmom.cpp 6 Apr 2005 04:12:53 -0000 1.3 @@ -46,17 +46,22 @@ } -float KTHSVCMAngSecMom::calculate(KTImage *img, int direction) +float KTHSVCMAngSecMom::_calculate(KTImage *img, int direction) { - int cmSize[3]; - float ***cm = (float***) method()->data(direction); + int cmSize[3]; + float ***cm = (float***) method()->data(direction); KTMethod *m = method(); cmSize[0] = m->dataSize(0); cmSize[1] = m->dataSize(1); cmSize[2] = m->dataSize(2); - return 0.0; + double sum; + for (int i=0; i < cmSize[0]; i++) + for (int j=0; j< cmSize[1]; j++) + for (int k=0; k < cmSize[2]; k++) + sum += cm[i][j][k] * cm[i][j][k]; + return 0.0; } #include "angsecmom.moc" |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-06 04:13:02
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/contrast In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25586/src/methods/hsvcm/features/contrast Modified Files: contrast.cpp contrast.h Log Message: - Implemented the usage of the features in KTHSVCM - implemented entropy function - implemented angsecmom function Index: contrast.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/contrast/contrast.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- contrast.cpp 6 Apr 2005 01:50:45 -0000 1.2 +++ contrast.cpp 6 Apr 2005 04:12:53 -0000 1.3 @@ -46,7 +46,7 @@ } -float KTHSVCMContrast::calculate(KTImage *img, int direction) +float KTHSVCMContrast::_calculate(KTImage *img, int direction) { int cmSize[3]; float ***cm = (float***) method()->data(direction); Index: contrast.h =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/contrast/contrast.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- contrast.h 5 Apr 2005 22:49:09 -0000 1.1 +++ contrast.h 6 Apr 2005 04:12:53 -0000 1.2 @@ -39,7 +39,7 @@ ~KTHSVCMContrast(); - float calculate(KTImage *img, int direction); + float _calculate(KTImage *img, int direction); }; #endif |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-06 04:13:01
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/glcm/features/dummy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25586/src/methods/glcm/features/dummy Modified Files: LOWER.cpp LOWER.h Log Message: - Implemented the usage of the features in KTHSVCM - implemented entropy function - implemented angsecmom function Index: LOWER.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/glcm/features/dummy/LOWER.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- LOWER.cpp 6 Apr 2005 01:50:41 -0000 1.3 +++ LOWER.cpp 6 Apr 2005 04:12:52 -0000 1.4 @@ -45,7 +45,7 @@ } -float KTGLCMNAME::calculate(KTImage *img, int direction) +float KTGLCMNAME::_calculate(KTImage *img, int direction) { int glcmSize = method()->dataSize(); float **glcm = (float**) method()->data(direction); Index: LOWER.h =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/glcm/features/dummy/LOWER.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- LOWER.h 23 Mar 2005 20:51:49 -0000 1.1 +++ LOWER.h 6 Apr 2005 04:12:52 -0000 1.2 @@ -39,7 +39,7 @@ ~KTGLCMNAME(); - float calculate(KTImage *img, int direction); + float _calculate(KTImage *img, int direction); }; #endif |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-06 04:13:01
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25586/src/methods/hsvcm Modified Files: hsvcm.cpp Log Message: - Implemented the usage of the features in KTHSVCM - implemented entropy function - implemented angsecmom function Index: hsvcm.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/hsvcm.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- hsvcm.cpp 5 Apr 2005 22:49:08 -0000 1.4 +++ hsvcm.cpp 6 Apr 2005 04:12:52 -0000 1.5 @@ -76,6 +76,40 @@ calculateHSVCM(); + int d,i,j,k; + QValueList<float> results[9]; + + FeatureList features = KTFeatureManager::self()->features("hsvcm"); + + /* results calculation: second step (2/3) */ + for (d = 0; d < 9; ++d) + { + QDictIterator<KTFeature> it(features); + for (; it.current(); ++it) + if (it.current()->enabled()) + results[d].append(it.current()->calculate(img, d)); + } + + //FIXME: Hardcoded using mean of all angles + for (i=0; i < results[0].count(); ++i) + { + for (int j=1; j < 9; j++) + results[0][i] += results[j][i]; + results[0][i] /= 9.; + } + + //final results + QValueList<float> result; + for (j=0; j < results[0].count(); ++j) + result.append(results[0][j]); + + if (backend != 0) + { + if (m_testingPattern) + backend->parseResults(result); + else + backend->parseSampleResults(result, imgClass); + } //delete the GLCM's after calculating for (int d=0; d < 9; d++) @@ -240,7 +274,6 @@ S = S / m_quantS; m_cm[d][V][H][S]++; - kdDebug() << "Got H,S,V = " << H << " " << S << " " << V << endl; } } |
|
From: Herton R. K. <he...@us...> - 2005-04-06 03:00:24
|
Update of /cvsroot/kimageprocess/kimageprocess/testclass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7572/testclass Modified Files: testclass.c Log Message: - Finally finished loading of pattern files. Index: testclass.c =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/testclass/testclass.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- testclass.c 5 Apr 2005 06:54:56 -0000 1.12 +++ testclass.c 6 Apr 2005 03:00:14 -0000 1.13 @@ -10,13 +10,19 @@ #define PARSER_ERROR 1 #define CHECK_ERROR 2 +typedef struct { + float **inputValues; + float **outputValues; + int numInputUnits; + int numOutputUnits; + int numPatterns; +} pat; + /* function prototypes */ void usage(char *progname); void fatal(int err); void netLoadFail(int code, char *fileName); -void loadNetwork(float **inputValues, float **outputValues, int *numInputUnits, - int *numOutputUnits, int *numPatterns, FILE *patFile, - char *fileName); +void loadNetwork(pat *patInf, FILE *patFile, char *fileName); void usage(char *progname) { @@ -54,11 +60,9 @@ exit(1); } -void loadNetwork(float **inputValues, float **outputValues, int *numInputUnits, - int *numOutputUnits, int *numPatterns, FILE *patFile, - char *fileName) +void loadNetwork(pat *patInf, FILE *patFile, char *fileName) { - int tok, curPat = 0, i; + int tok, curPat = 0, i, j; float *tempp; yyin = patFile; tok = yylex(); @@ -67,11 +71,11 @@ tok = yylex(); if (tok != PATDATE) netLoadFail(PARSER_ERROR, fileName); - *numInputUnits = -1; - *numOutputUnits = -1; - *numPatterns = -1; - inputValues = NULL; - outputValues = NULL; + patInf->numInputUnits = -1; + patInf->numOutputUnits = -1; + patInf->numPatterns = -1; + patInf->inputValues = NULL; + patInf->outputValues = NULL; tok = yylex(); while (tok != END) { @@ -81,60 +85,73 @@ tok = yylex(); if (tok != INTNUMBER) netLoadFail(PARSER_ERROR, fileName); - *numPatterns = atoi(yytext); + patInf->numPatterns = atoi(yytext); break; case NUMIN: tok = yylex(); if (tok != INTNUMBER) netLoadFail(PARSER_ERROR, fileName); - *numInputUnits = atoi(yytext); + patInf->numInputUnits = atoi(yytext); break; case NUMOUT: tok = yylex(); if (tok != INTNUMBER) netLoadFail(PARSER_ERROR, fileName); - *numOutputUnits = atoi(yytext); + patInf->numOutputUnits = atoi(yytext); break; case FLOATNUMBER: case INTNUMBER: - if (*numPatterns <= 0 || curPat == *numPatterns) + if (patInf->numPatterns <= 0 || curPat == patInf->numPatterns) netLoadFail(CHECK_ERROR, fileName); - if (inputValues == NULL) + if (patInf->inputValues == NULL && patInf->numInputUnits > 0) { - tempp = malloc(sizeof(float) * *numPatterns * *numInputUnits); + tempp = malloc(sizeof(float) * patInf->numPatterns * patInf->numInputUnits); if (tempp == NULL) fatal(errno); - inputValues = malloc(sizeof(float *) * *numPatterns); - if (inputValues == NULL) + patInf->inputValues = malloc(sizeof(float *) * patInf->numPatterns); + if (patInf->inputValues == NULL) fatal(errno); - for (i = 0; i < *numPatterns; i++) - inputValues[i] = tempp + (i * *numInputUnits); + for (i = 0; i < patInf->numPatterns; i++) + patInf->inputValues[i] = tempp + (i * patInf->numInputUnits); } - if (outputValues == NULL) + if (patInf->outputValues == NULL && patInf->numOutputUnits > 0) { - tempp = malloc(sizeof(float) * *numPatterns * *numOutputUnits); + tempp = malloc(sizeof(float) * patInf->numPatterns * patInf->numOutputUnits); if (tempp == NULL) fatal(errno); - outputValues = malloc(sizeof(float *) * *numPatterns); - if (outputValues == NULL) + patInf->outputValues = malloc(sizeof(float *) * patInf->numPatterns); + if (patInf->outputValues == NULL) fatal(errno); - for (i = 0; i < *numPatterns; i++) - outputValues[i] = tempp + (i * *numOutputUnits); + for (i = 0; i < patInf->numPatterns; i++) + patInf->outputValues[i] = tempp + (i * patInf->numOutputUnits); } - inputValues[curPat][0] = atof(yytext); - for (i = 1; i < *numInputUnits; i++) + if (patInf->numInputUnits > 0) + { + patInf->inputValues[curPat][0] = atof(yytext); + i = 1; + j = 0; + } + else + { + patInf->outputValues[curPat][0] = atof(yytext); + i = 0; + j = 1; + } + while (i < patInf->numInputUnits) { tok = yylex(); if (tok != FLOATNUMBER && tok != INTNUMBER) netLoadFail(CHECK_ERROR, fileName); - inputValues[curPat][i] = atof(yytext); + patInf->inputValues[curPat][i] = atof(yytext); + i++; } - for (i = 0; i < *numOutputUnits; i++) + while (j < patInf->numOutputUnits) { tok = yylex(); if (tok != FLOATNUMBER && tok != INTNUMBER) netLoadFail(CHECK_ERROR, fileName); - outputValues[curPat][i] = atof(yytext); + patInf->outputValues[curPat][j] = atof(yytext); + j++; } curPat++; break; @@ -147,7 +164,7 @@ int main(int argc, char **argv) { - int a, b, c; + int c; int option_index = 0; static struct option long_options[] = { @@ -163,6 +180,8 @@ float **in_tvalues, **out_tvalues; int in_cnum, out_cnum, pat_cnum; float **in_cvalues, **out_cvalues; + pat t_patData; + pat c_patData; if (argc == 1) usage(argv[0]); @@ -202,22 +221,43 @@ pt_file = fopen(t_file, "r"); if (pt_file == NULL) fatal(errno); - loadNetwork(in_tvalues, out_tvalues, &in_tnum, &out_tnum, &pat_tnum, - pt_file, t_file); - for (a = 0; a < pat_tnum; a++) - { - for (b = 0; b < in_tnum; b++) - { - printf("%.5f", in_tvalues[a][b]); - } - for (b = 0; b < out_tnum; b++) - { - printf("%.5f", out_tvalues[a][b]); - } - } + loadNetwork(&t_patData, pt_file, t_file); pc_file = fopen(c_file, "r"); if (pc_file == NULL) fatal(errno); + loadNetwork(&c_patData, pc_file, c_file); + if (t_patData.inputValues != NULL) + { + /* free only first element because is a contiguous allocated memory + space (see loadNetwork) */ + if (t_patData.inputValues[0] != NULL) + free(t_patData.inputValues[0]); + free(t_patData.inputValues); + } + if (t_patData.outputValues != NULL) + { + /* free only first element because is a contiguous allocated memory + space (see loadNetwork) */ + if (t_patData.outputValues[0] != NULL) + free(t_patData.outputValues[0]); + free(t_patData.outputValues); + } + if (c_patData.inputValues != NULL) + { + /* free only first element because is a contiguous allocated memory + space (see loadNetwork) */ + if (c_patData.inputValues[0] != NULL) + free(c_patData.inputValues[0]); + free(c_patData.inputValues); + } + if (c_patData.outputValues != NULL) + { + /* free only first element because is a contiguous allocated memory + space (see loadNetwork) */ + if (c_patData.outputValues[0] != NULL) + free(c_patData.outputValues[0]); + free(c_patData.outputValues); + } if (fclose(pt_file) != 0) fatal(errno); if (fclose(pc_file) != 0) |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-06 01:50:56
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/entropy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23386/src/methods/hsvcm/features/entropy Modified Files: Makefile.am entropy.cpp Log Message: Fixed compilation Index: Makefile.am =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/entropy/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 5 Apr 2005 22:49:10 -0000 1.1 +++ Makefile.am 6 Apr 2005 01:50:46 -0000 1.2 @@ -1,4 +1,4 @@ -INCLUDES = $(all_includes) -I$(srcdir)/../../../libkimageprocess +INCLUDES = $(all_includes) -I$(srcdir)/../../../../libkimageprocess METASOURCES = AUTO kde_module_LTLIBRARIES = kimageprocess_hsvcm_entropy.la kimageprocess_hsvcm_entropy_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) Index: entropy.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/entropy/entropy.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- entropy.cpp 5 Apr 2005 22:49:10 -0000 1.1 +++ entropy.cpp 6 Apr 2005 01:50:46 -0000 1.2 @@ -27,12 +27,13 @@ #include <ktimage.h> #include <ktfeaturemanager.h> +#include <ktmethod.h> K_EXPORT_COMPONENT_FACTORY( kimageprocess_hsvcm_entropy, KGenericFactory<KTHSVCMEntropy>( "kimageprocess_hsvcm_entropy" ) ) KTHSVCMEntropy::KTHSVCMEntropy(QObject *parent, const char* name, const QStringList&) - : KTFeature() + : KTFeature("hsvcm") { //check dependencies m_featureName = i18n("Entropy"); @@ -49,11 +50,11 @@ { int cmSize[3]; float ***cm = (float***) method()->data(direction); - KTMethod *method = method(); + KTMethod *m = method(); - cmSize[0] = method->dataSize(0); - cmSize[1] = method->dataSize(1); - cmSize[2] = method->dataSize(2); + cmSize[0] = m->dataSize(0); + cmSize[1] = m->dataSize(1); + cmSize[2] = m->dataSize(2); return 0.0; } |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-06 01:50:55
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/dummy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23386/src/methods/hsvcm/features/dummy Modified Files: LOWER.cpp Makefile.am Log Message: Fixed compilation Index: Makefile.am =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/dummy/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 5 Apr 2005 22:49:09 -0000 1.1 +++ Makefile.am 6 Apr 2005 01:50:46 -0000 1.2 @@ -1,4 +1,4 @@ -INCLUDES = $(all_includes) -I$(srcdir)/../../../libkimageprocess +INCLUDES = $(all_includes) -I$(srcdir)/../../../../libkimageprocess METASOURCES = AUTO kde_module_LTLIBRARIES = kimageprocess_hsvcm_LOWER.la kimageprocess_hsvcm_LOWER_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) Index: LOWER.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/dummy/LOWER.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- LOWER.cpp 5 Apr 2005 22:49:09 -0000 1.1 +++ LOWER.cpp 6 Apr 2005 01:50:46 -0000 1.2 @@ -27,12 +27,13 @@ #include <ktimage.h> #include <ktfeaturemanager.h> +#include <ktmethod.h> K_EXPORT_COMPONENT_FACTORY( kimageprocess_hsvcm_LOWER, KGenericFactory<KTHSVCMNAME>( "kimageprocess_hsvcm_LOWER" ) ) KTHSVCMNAME::KTHSVCMNAME(QObject *parent, const char* name, const QStringList&) - : KTFeature() + : KTFeature("hsvcm") { //check dependencies m_featureName = i18n("NAME"); @@ -49,11 +50,11 @@ { int cmSize[3]; float ***cm = (float***) method()->data(direction); - KTMethod *method = method(); + KTMethod *m = method(); - cmSize[0] = method->dataSize(0); - cmSize[1] = method->dataSize(1); - cmSize[2] = method->dataSize(2); + cmSize[0] = m->dataSize(0); + cmSize[1] = m->dataSize(1); + cmSize[2] = m->dataSize(2); return 0.0; } |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-06 01:50:55
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/correlation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23386/src/methods/hsvcm/features/correlation Modified Files: Makefile.am correlation.cpp Log Message: Fixed compilation Index: correlation.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/correlation/correlation.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- correlation.cpp 5 Apr 2005 22:49:09 -0000 1.1 +++ correlation.cpp 6 Apr 2005 01:50:46 -0000 1.2 @@ -27,12 +27,13 @@ #include <ktimage.h> #include <ktfeaturemanager.h> +#include <ktmethod.h> K_EXPORT_COMPONENT_FACTORY( kimageprocess_hsvcm_correlation, KGenericFactory<KTHSVCMCorrelation>( "kimageprocess_hsvcm_correlation" ) ) KTHSVCMCorrelation::KTHSVCMCorrelation(QObject *parent, const char* name, const QStringList&) - : KTFeature() + : KTFeature("hsvcm") { //check dependencies m_featureName = i18n("Correlation"); @@ -49,11 +50,11 @@ { int cmSize[3]; float ***cm = (float***) method()->data(direction); - KTMethod *method = method(); + KTMethod *m = method(); - cmSize[0] = method->dataSize(0); - cmSize[1] = method->dataSize(1); - cmSize[2] = method->dataSize(2); + cmSize[0] = m->dataSize(0); + cmSize[1] = m->dataSize(1); + cmSize[2] = m->dataSize(2); return 0.0; } Index: Makefile.am =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/correlation/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 5 Apr 2005 22:49:09 -0000 1.1 +++ Makefile.am 6 Apr 2005 01:50:46 -0000 1.2 @@ -1,4 +1,4 @@ -INCLUDES = $(all_includes) -I$(srcdir)/../../../libkimageprocess +INCLUDES = $(all_includes) -I$(srcdir)/../../../../libkimageprocess METASOURCES = AUTO kde_module_LTLIBRARIES = kimageprocess_hsvcm_correlation.la kimageprocess_hsvcm_correlation_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-06 01:50:55
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/glcm/features/dummy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23386/src/methods/glcm/features/dummy Modified Files: LOWER.cpp Makefile.am Log Message: Fixed compilation Index: Makefile.am =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/glcm/features/dummy/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 23 Mar 2005 20:51:49 -0000 1.1 +++ Makefile.am 6 Apr 2005 01:50:45 -0000 1.2 @@ -1,4 +1,4 @@ -INCLUDES = $(all_includes) -I$(srcdir)/../../../libkimageprocess +INCLUDES = $(all_includes) -I$(srcdir)/../../../../libkimageprocess METASOURCES = AUTO kde_module_LTLIBRARIES = kimageprocess_glcm_LOWER.la kimageprocess_glcm_LOWER_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) Index: LOWER.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/glcm/features/dummy/LOWER.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- LOWER.cpp 5 Apr 2005 22:26:24 -0000 1.2 +++ LOWER.cpp 6 Apr 2005 01:50:41 -0000 1.3 @@ -32,7 +32,7 @@ KGenericFactory<KTGLCMNAME>( "kimageprocess_glcm_LOWER" ) ) KTGLCMNAME::KTGLCMNAME(QObject *parent, const char* name, const QStringList&) - : KTFeature() + : KTFeature("glcm") { //check dependencies m_featureName = i18n("NAME"); |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-06 01:50:55
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/contrast In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23386/src/methods/hsvcm/features/contrast Modified Files: Makefile.am contrast.cpp Log Message: Fixed compilation Index: contrast.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/contrast/contrast.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- contrast.cpp 5 Apr 2005 22:49:09 -0000 1.1 +++ contrast.cpp 6 Apr 2005 01:50:45 -0000 1.2 @@ -27,12 +27,13 @@ #include <ktimage.h> #include <ktfeaturemanager.h> +#include <ktmethod.h> K_EXPORT_COMPONENT_FACTORY( kimageprocess_hsvcm_contrast, KGenericFactory<KTHSVCMContrast>( "kimageprocess_hsvcm_contrast" ) ) KTHSVCMContrast::KTHSVCMContrast(QObject *parent, const char* name, const QStringList&) - : KTFeature() + : KTFeature("hsvcm") { //check dependencies m_featureName = i18n("Contrast"); @@ -49,10 +50,11 @@ { int cmSize[3]; float ***cm = (float***) method()->data(direction); + KTMethod *m = method(); - cmSize[0] = method->dataSize(0); - cmSize[1] = method->dataSize(1); - cmSize[2] = method->dataSize(2); + cmSize[0] = m->dataSize(0); + cmSize[1] = m->dataSize(1); + cmSize[2] = m->dataSize(2); return 0.0; } Index: Makefile.am =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/contrast/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 5 Apr 2005 22:49:09 -0000 1.1 +++ Makefile.am 6 Apr 2005 01:50:45 -0000 1.2 @@ -1,4 +1,4 @@ -INCLUDES = $(all_includes) -I$(srcdir)/../../../libkimageprocess +INCLUDES = $(all_includes) -I$(srcdir)/../../../../libkimageprocess METASOURCES = AUTO kde_module_LTLIBRARIES = kimageprocess_hsvcm_contrast.la kimageprocess_hsvcm_contrast_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-06 01:50:54
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/angsecmom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23386/src/methods/hsvcm/features/angsecmom Modified Files: Makefile.am angsecmom.cpp Log Message: Fixed compilation Index: Makefile.am =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/angsecmom/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 5 Apr 2005 22:49:09 -0000 1.1 +++ Makefile.am 6 Apr 2005 01:50:45 -0000 1.2 @@ -1,4 +1,4 @@ -INCLUDES = $(all_includes) -I$(srcdir)/../../../libkimageprocess +INCLUDES = $(all_includes) -I$(srcdir)/../../../../libkimageprocess METASOURCES = AUTO kde_module_LTLIBRARIES = kimageprocess_hsvcm_angsecmom.la kimageprocess_hsvcm_angsecmom_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) Index: angsecmom.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/angsecmom/angsecmom.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- angsecmom.cpp 5 Apr 2005 22:49:09 -0000 1.1 +++ angsecmom.cpp 6 Apr 2005 01:50:45 -0000 1.2 @@ -27,12 +27,13 @@ #include <ktimage.h> #include <ktfeaturemanager.h> +#include <ktmethod.h> K_EXPORT_COMPONENT_FACTORY( kimageprocess_hsvcm_angsecmom, KGenericFactory<KTHSVCMAngSecMom>( "kimageprocess_hsvcm_angsecmom" ) ) KTHSVCMAngSecMom::KTHSVCMAngSecMom(QObject *parent, const char* name, const QStringList&) - : KTFeature() + : KTFeature("hsvcm") { //check dependencies m_featureName = i18n("AngSecMom"); @@ -49,11 +50,11 @@ { int cmSize[3]; float ***cm = (float***) method()->data(direction); - KTMethod *method = method(); + KTMethod *m = method(); - cmSize[0] = method->dataSize(0); - cmSize[1] = method->dataSize(1); - cmSize[2] = method->dataSize(2); + cmSize[0] = m->dataSize(0); + cmSize[1] = m->dataSize(1); + cmSize[2] = m->dataSize(2); return 0.0; } |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-05 22:50:36
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6040/src/methods/hsvcm Modified Files: Makefile.am Log Message: No comments Index: Makefile.am =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 31 Mar 2005 22:57:42 -0000 1.1 +++ Makefile.am 5 Apr 2005 22:50:27 -0000 1.2 @@ -1,4 +1,4 @@ -SUBDIRS= . +SUBDIRS= . features INCLUDES = $(all_includes) -I$(srcdir)/../../libkimageprocess METASOURCES = AUTO kde_module_LTLIBRARIES = kimageprocess_hsvcm.la |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-05 22:49:28
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/correlation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5220/src/methods/hsvcm/features/correlation Added Files: Makefile.am correlation.cpp correlation.h kimageprocess_hsvcm_correlation.desktop Log Message: Adding the HSVCM features. They are not implemented yet (too much numbers to take care hehe) --- NEW FILE: correlation.h --- /*************************************************************************** * Copyright (C) 2004 by * * Gustavo Pichorim Boiko <gus...@kd...> * * Herton Ronaldo Krzesinski <he...@my...> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef KIMAGEPROCESS_HSVCM_CORRELATION_H #define KIMAGEPROCESS_HSVCM_CORRELATION_H #include <ktfeature.h> class KAction; class KTImage; /** * Correlation calculation * @author Gustavo Pichorim Boiko * */ class KTHSVCMCorrelation : public KTFeature { Q_OBJECT public: KTHSVCMCorrelation(QObject *parent, const char *name, const QStringList&); ~KTHSVCMCorrelation(); float calculate(KTImage *img, int direction); }; #endif --- NEW FILE: correlation.cpp --- /*************************************************************************** * Copyright (C) 2004 by * * Gustavo Pichorim Boiko <gus...@kd...> * * Herton Ronaldo Krzesinski <he...@my...> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "correlation.h" #include <kgenericfactory.h> #include <kaction.h> #include <klocale.h> #include <kdebug.h> #include <ktimage.h> #include <ktfeaturemanager.h> K_EXPORT_COMPONENT_FACTORY( kimageprocess_hsvcm_correlation, KGenericFactory<KTHSVCMCorrelation>( "kimageprocess_hsvcm_correlation" ) ) KTHSVCMCorrelation::KTHSVCMCorrelation(QObject *parent, const char* name, const QStringList&) : KTFeature() { //check dependencies m_featureName = i18n("Correlation"); m_longName = i18n("Correlation"); } KTHSVCMCorrelation::~KTHSVCMCorrelation() { } float KTHSVCMCorrelation::calculate(KTImage *img, int direction) { int cmSize[3]; float ***cm = (float***) method()->data(direction); KTMethod *method = method(); cmSize[0] = method->dataSize(0); cmSize[1] = method->dataSize(1); cmSize[2] = method->dataSize(2); return 0.0; } #include "correlation.moc" --- NEW FILE: kimageprocess_hsvcm_correlation.desktop --- [Desktop Entry] Name=Correlation Comment=Correlation calculation over HSV CO-Occurrence Matrix ServiceTypes=KImageProcess/Feature Type=Service X-KDE-Library=kimageprocess_hsvcm_correlation X-Category=hsvcm --- NEW FILE: Makefile.am --- INCLUDES = $(all_includes) -I$(srcdir)/../../../libkimageprocess METASOURCES = AUTO kde_module_LTLIBRARIES = kimageprocess_hsvcm_correlation.la kimageprocess_hsvcm_correlation_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) noinst_HEADERS = correlation.h kimageprocess_hsvcm_correlation_la_SOURCES = correlation.cpp kde_services_DATA = kimageprocess_hsvcm_correlation.desktop kimageprocess_hsvcm_correlation_la_LIBADD = $(top_builddir)/src/libkimageprocess/libkimageprocess.la \ -lkdeui |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-05 22:49:28
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/entropy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5220/src/methods/hsvcm/features/entropy Added Files: Makefile.am entropy.cpp entropy.h kimageprocess_hsvcm_entropy.desktop Log Message: Adding the HSVCM features. They are not implemented yet (too much numbers to take care hehe) --- NEW FILE: entropy.h --- /*************************************************************************** * Copyright (C) 2004 by * * Gustavo Pichorim Boiko <gus...@kd...> * * Herton Ronaldo Krzesinski <he...@my...> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef KIMAGEPROCESS_HSVCM_ENTROPY_H #define KIMAGEPROCESS_HSVCM_ENTROPY_H #include <ktfeature.h> class KAction; class KTImage; /** * Entropy calculation * @author Gustavo Pichorim Boiko * */ class KTHSVCMEntropy : public KTFeature { Q_OBJECT public: KTHSVCMEntropy(QObject *parent, const char *name, const QStringList&); ~KTHSVCMEntropy(); float calculate(KTImage *img, int direction); }; #endif --- NEW FILE: Makefile.am --- INCLUDES = $(all_includes) -I$(srcdir)/../../../libkimageprocess METASOURCES = AUTO kde_module_LTLIBRARIES = kimageprocess_hsvcm_entropy.la kimageprocess_hsvcm_entropy_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) noinst_HEADERS = entropy.h kimageprocess_hsvcm_entropy_la_SOURCES = entropy.cpp kde_services_DATA = kimageprocess_hsvcm_entropy.desktop kimageprocess_hsvcm_entropy_la_LIBADD = $(top_builddir)/src/libkimageprocess/libkimageprocess.la \ -lkdeui --- NEW FILE: kimageprocess_hsvcm_entropy.desktop --- [Desktop Entry] Name=Entropy Comment=Entropy calculation over HSV CO-Occurrence Matrix ServiceTypes=KImageProcess/Feature Type=Service X-KDE-Library=kimageprocess_hsvcm_entropy X-Category=hsvcm --- NEW FILE: entropy.cpp --- /*************************************************************************** * Copyright (C) 2004 by * * Gustavo Pichorim Boiko <gus...@kd...> * * Herton Ronaldo Krzesinski <he...@my...> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "entropy.h" #include <kgenericfactory.h> #include <kaction.h> #include <klocale.h> #include <kdebug.h> #include <ktimage.h> #include <ktfeaturemanager.h> K_EXPORT_COMPONENT_FACTORY( kimageprocess_hsvcm_entropy, KGenericFactory<KTHSVCMEntropy>( "kimageprocess_hsvcm_entropy" ) ) KTHSVCMEntropy::KTHSVCMEntropy(QObject *parent, const char* name, const QStringList&) : KTFeature() { //check dependencies m_featureName = i18n("Entropy"); m_longName = i18n("Entropy"); } KTHSVCMEntropy::~KTHSVCMEntropy() { } float KTHSVCMEntropy::calculate(KTImage *img, int direction) { int cmSize[3]; float ***cm = (float***) method()->data(direction); KTMethod *method = method(); cmSize[0] = method->dataSize(0); cmSize[1] = method->dataSize(1); cmSize[2] = method->dataSize(2); return 0.0; } #include "entropy.moc" |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-05 22:49:27
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/contrast In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5220/src/methods/hsvcm/features/contrast Added Files: Makefile.am contrast.cpp contrast.h kimageprocess_hsvcm_contrast.desktop Log Message: Adding the HSVCM features. They are not implemented yet (too much numbers to take care hehe) --- NEW FILE: kimageprocess_hsvcm_contrast.desktop --- [Desktop Entry] Name=Contrast Comment=Contrast calculation over HSV CO-Occurrence Matrix ServiceTypes=KImageProcess/Feature Type=Service X-KDE-Library=kimageprocess_hsvcm_contrast X-Category=hsvcm --- NEW FILE: contrast.cpp --- /*************************************************************************** * Copyright (C) 2004 by * * Gustavo Pichorim Boiko <gus...@kd...> * * Herton Ronaldo Krzesinski <he...@my...> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "contrast.h" #include <kgenericfactory.h> #include <kaction.h> #include <klocale.h> #include <kdebug.h> #include <ktimage.h> #include <ktfeaturemanager.h> K_EXPORT_COMPONENT_FACTORY( kimageprocess_hsvcm_contrast, KGenericFactory<KTHSVCMContrast>( "kimageprocess_hsvcm_contrast" ) ) KTHSVCMContrast::KTHSVCMContrast(QObject *parent, const char* name, const QStringList&) : KTFeature() { //check dependencies m_featureName = i18n("Contrast"); m_longName = i18n("Contrast"); } KTHSVCMContrast::~KTHSVCMContrast() { } float KTHSVCMContrast::calculate(KTImage *img, int direction) { int cmSize[3]; float ***cm = (float***) method()->data(direction); cmSize[0] = method->dataSize(0); cmSize[1] = method->dataSize(1); cmSize[2] = method->dataSize(2); return 0.0; } #include "contrast.moc" --- NEW FILE: Makefile.am --- INCLUDES = $(all_includes) -I$(srcdir)/../../../libkimageprocess METASOURCES = AUTO kde_module_LTLIBRARIES = kimageprocess_hsvcm_contrast.la kimageprocess_hsvcm_contrast_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) noinst_HEADERS = contrast.h kimageprocess_hsvcm_contrast_la_SOURCES = contrast.cpp kde_services_DATA = kimageprocess_hsvcm_contrast.desktop kimageprocess_hsvcm_contrast_la_LIBADD = $(top_builddir)/src/libkimageprocess/libkimageprocess.la \ -lkdeui --- NEW FILE: contrast.h --- /*************************************************************************** * Copyright (C) 2004 by * * Gustavo Pichorim Boiko <gus...@kd...> * * Herton Ronaldo Krzesinski <he...@my...> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef KIMAGEPROCESS_HSVCM_CONTRAST_H #define KIMAGEPROCESS_HSVCM_CONTRAST_H #include <ktfeature.h> class KAction; class KTImage; /** * Contrast calculation * @author Gustavo Pichorim Boiko * */ class KTHSVCMContrast : public KTFeature { Q_OBJECT public: KTHSVCMContrast(QObject *parent, const char *name, const QStringList&); ~KTHSVCMContrast(); float calculate(KTImage *img, int direction); }; #endif |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-05 22:49:27
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5220/src/methods/hsvcm Modified Files: hsvcm.cpp hsvcm.h Log Message: Adding the HSVCM features. They are not implemented yet (too much numbers to take care hehe) Index: hsvcm.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/hsvcm.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- hsvcm.cpp 2 Apr 2005 20:14:09 -0000 1.3 +++ hsvcm.cpp 5 Apr 2005 22:49:08 -0000 1.4 @@ -248,7 +248,19 @@ void *KTHSVCM::data(int direction) const { - return 0; + return m_cm[direction]; +} +int KTHSVCM::dataSize(int index) +{ + switch (index) + { + case 0: //V + return m_sizeV; + case 1: //H + return m_sizeH; + case 2: //S + return m_sizeS; + } } #include "hsvcm.moc" Index: hsvcm.h =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/hsvcm.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- hsvcm.h 2 Apr 2005 20:14:09 -0000 1.3 +++ hsvcm.h 5 Apr 2005 22:49:08 -0000 1.4 @@ -51,7 +51,7 @@ void *data(int direction) const; - int dataSize() { return 0; } + int dataSize(int index = 0); private: void calculateHSVCM(); |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-05 22:49:27
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5220/src/methods/hsvcm/features Added Files: Makefile.am addfeature.sh Log Message: Adding the HSVCM features. They are not implemented yet (too much numbers to take care hehe) --- NEW FILE: Makefile.am --- SUBDIRS = contrast angsecmom correlation entropy --- NEW FILE: addfeature.sh --- #!/bin/bash if [ $# -lt 2 ]; then echo "" echo "Usage:" echo "$0 FeatureName \"Long Feature Name\"" echo "" exit 1 fi NAME="$1" LOWER=`echo $NAME | tr [A-Z] [a-z]` UPPER=`echo $NAME | tr [a-z] [A-Z]` shift LONG="$@" DIR=`dirname $0` if [ "$DIR" = "." ]; then DIR=$PWD fi FILES="Makefile.am LOWER.h LOWER.cpp kimageprocess_hsvcm_LOWER.desktop" cd $DIR rm -rf $LOWER cp -rf dummy $LOWER cd $LOWER rm -rf CVS for file in $FILES; do cat $file | sed "s/NAME/$NAME/g" | sed "s/LOWER/$LOWER/g" | sed "s/UPPER/$UPPER/g" | sed "s/LONG/$LONG/g" > $file.new mv -f $file.new $file done # renaming files mv -f LOWER.h $LOWER.h mv -f LOWER.cpp $LOWER.cpp mv -f kimageprocess_hsvcm_LOWER.desktop kimageprocess_hsvcm_$LOWER.desktop # add the feature to Makefile.am echo "Do you want to add this feature to the Makefile.am (Y/n)?" read CONFIRM if [ ! "$CONFIRM" = "n" -a ! "$CONFIRM" = "N" ]; then cd $DIR # test if the Makefile has more things than just the SUBDIRS line LINES=`cat Makefile.am | grep -v SUBDIRS | wc --lines` if [ $LINES -lt 0 ]; then echo "WARNING: The Makefile I'm going to edit has more things than just the SUBDIRS" echo "Shall I continue (S/n)?" read CONFIRM if [ "$CONFIRM" = "n" -o "$CONFIRM" = "N" ]; then exit 1 fi fi SUBDIRS=`cat Makefile.am | grep SUBDIRS | head -n1` SUBDIRS="$SUBDIRS $LOWER" echo $SUBDIRS > Makefile.am echo "Done." echo "-----" echo "Now you need to run \"make -f Makefile.cvs\" from the top dir" fi |
|
From: Gustavo P. B. <gb...@us...> - 2005-04-05 22:49:27
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/features/angsecmom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5220/src/methods/hsvcm/features/angsecmom Added Files: Makefile.am angsecmom.cpp angsecmom.h kimageprocess_hsvcm_angsecmom.desktop Log Message: Adding the HSVCM features. They are not implemented yet (too much numbers to take care hehe) --- NEW FILE: kimageprocess_hsvcm_angsecmom.desktop --- [Desktop Entry] Name=AngSecMom Comment=Angular Second Moment calculation over HSV CO-Occurrence Matrix ServiceTypes=KImageProcess/Feature Type=Service X-KDE-Library=kimageprocess_hsvcm_angsecmom X-Category=hsvcm --- NEW FILE: Makefile.am --- INCLUDES = $(all_includes) -I$(srcdir)/../../../libkimageprocess METASOURCES = AUTO kde_module_LTLIBRARIES = kimageprocess_hsvcm_angsecmom.la kimageprocess_hsvcm_angsecmom_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) noinst_HEADERS = angsecmom.h kimageprocess_hsvcm_angsecmom_la_SOURCES = angsecmom.cpp kde_services_DATA = kimageprocess_hsvcm_angsecmom.desktop kimageprocess_hsvcm_angsecmom_la_LIBADD = $(top_builddir)/src/libkimageprocess/libkimageprocess.la \ -lkdeui --- NEW FILE: angsecmom.cpp --- /*************************************************************************** * Copyright (C) 2004 by * * Gustavo Pichorim Boiko <gus...@kd...> * * Herton Ronaldo Krzesinski <he...@my...> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "angsecmom.h" #include <kgenericfactory.h> #include <kaction.h> #include <klocale.h> #include <kdebug.h> #include <ktimage.h> #include <ktfeaturemanager.h> K_EXPORT_COMPONENT_FACTORY( kimageprocess_hsvcm_angsecmom, KGenericFactory<KTHSVCMAngSecMom>( "kimageprocess_hsvcm_angsecmom" ) ) KTHSVCMAngSecMom::KTHSVCMAngSecMom(QObject *parent, const char* name, const QStringList&) : KTFeature() { //check dependencies m_featureName = i18n("AngSecMom"); m_longName = i18n("Angular Second Moment"); } KTHSVCMAngSecMom::~KTHSVCMAngSecMom() { } float KTHSVCMAngSecMom::calculate(KTImage *img, int direction) { int cmSize[3]; float ***cm = (float***) method()->data(direction); KTMethod *method = method(); cmSize[0] = method->dataSize(0); cmSize[1] = method->dataSize(1); cmSize[2] = method->dataSize(2); return 0.0; } #include "angsecmom.moc" --- NEW FILE: angsecmom.h --- /*************************************************************************** * Copyright (C) 2004 by * * Gustavo Pichorim Boiko <gus...@kd...> * * Herton Ronaldo Krzesinski <he...@my...> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef KIMAGEPROCESS_HSVCM_ANGSECMOM_H #define KIMAGEPROCESS_HSVCM_ANGSECMOM_H #include <ktfeature.h> class KAction; class KTImage; /** * AngSecMom calculation * @author Gustavo Pichorim Boiko * */ class KTHSVCMAngSecMom : public KTFeature { Q_OBJECT public: KTHSVCMAngSecMom(QObject *parent, const char *name, const QStringList&); ~KTHSVCMAngSecMom(); float calculate(KTImage *img, int direction); }; #endif |