From a49ce775b0f51fd392ea280d31aa48d49f694c9c Mon Sep 17 00:00:00 2001 From: Antoine Villeret Date: Thu, 31 Jan 2013 15:37:59 +0000 Subject: -remove some useless printf -add a TODO file svn path=/trunk/externals/pix_opencv/; revision=17008 --- TODO | 6 ++++++ pix_opencv_warpperspective-help.pd | 4 ++-- pix_opencv_warpperspective.cc | 30 ++---------------------------- 3 files changed, 10 insertions(+), 30 deletions(-) create mode 100644 TODO diff --git a/TODO b/TODO new file mode 100644 index 0000000..b36c38c --- /dev/null +++ b/TODO @@ -0,0 +1,6 @@ +TODO list : + +- improve pix_opencv_warpperspective help patch (and others) +- remove opencv 1.x dependency +- update optical flow tools +... diff --git a/pix_opencv_warpperspective-help.pd b/pix_opencv_warpperspective-help.pd index 339cbb9..d9404bd 100644 --- a/pix_opencv_warpperspective-help.pd +++ b/pix_opencv_warpperspective-help.pd @@ -1,4 +1,4 @@ -#N canvas 624 372 980 660 10; +#N canvas 622 378 980 660 10; #X obj 24 25 gemhead; #X obj 411 543 gemwin; #X msg 411 509 create \, 1; @@ -6,7 +6,7 @@ #X obj 24 565 pix_texture; #X obj 203 571 print; #X obj 24 591 rectangle 4 3; -#X obj 23 -3 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1 +#X obj 24 4 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1 ; #X obj 24 539 pix_opencv_warpperspective; #X msg 96 437 mapMatrix 1 0 0 0 1 0 0 0 1; diff --git a/pix_opencv_warpperspective.cc b/pix_opencv_warpperspective.cc index de020e6..e0f0eba 100644 --- a/pix_opencv_warpperspective.cc +++ b/pix_opencv_warpperspective.cc @@ -73,7 +73,6 @@ pix_opencv_warpperspective :: pix_opencv_warpperspective() flags = CV_WARP_FILL_OUTLIERS; // TODO add a set method findmethod = 0; // TODO add a set method - //~ printf("build on %s at %s\n", __DATE__, __TIME__); post("pix_opencv_warpperspective by Antoine Villeret"); post("build on %s at %s", __DATE__, __TIME__); @@ -203,21 +202,17 @@ void pix_opencv_warpperspective :: mapMatrixMess (int argc, t_atom *argv) void pix_opencv_warpperspective :: srcMatrixMess (int argc, t_atom *argv) { - //~ printf("set srcMatrix\n"); int i,j; float a; - //~ printf("check parity\n"); if ( argc % 2 ) { error("src is should be a list of couple x/y values"); return; } - //~ printf("check size\n"); if ( argc != dstMatrix->rows * dstMatrix->cols ) { error("src matrix should have the same size as dst matrix (which is %d x %d)", dstMatrix->cols, dstMatrix->rows); return; } - //~ printf("check type\n"); for ( i = 0; i < argc ; i++) { if (argv[i].a_type != A_FLOAT) { error("src matrix should be float"); @@ -226,7 +221,6 @@ void pix_opencv_warpperspective :: srcMatrixMess (int argc, t_atom *argv) } // fillin the srcMatrix - //~ printf("fillin srcMatrix\n"); for ( i = 0 ; i < dstMatrix->rows ; i++ ) { CV_MAT_ELEM( *srcMatrix, float, i, 0 ) = argv[i*2].a_w.w_float; @@ -237,21 +231,17 @@ void pix_opencv_warpperspective :: srcMatrixMess (int argc, t_atom *argv) void pix_opencv_warpperspective :: dstMatrixMess (int argc, t_atom *argv) { - //~ printf("set dstMatrix\n"); int i,j; - //~ printf("check parity\n"); if ( argc % 2 ){ error("dstMatrix is should be a list of x/y pairs"); return; } - //~ printf("check type\n"); for ( i = 0; i < argc ; i++) { if (argv[i].a_type != A_FLOAT) { error("dstMatrix should be float"); return; } } - //~ printf("dstMatrix-cols = %d,\t argc = %d\n", dstMatrix->rows, argc); if ( dstMatrix->rows != argc/2 ) { // delete and recreate matrix if needed cvReleaseMat(&dstMatrix); @@ -272,35 +262,19 @@ void pix_opencv_warpperspective :: dstMatrixMess (int argc, t_atom *argv) void pix_opencv_warpperspective :: findhomography( ) { int i,j; - //~ printf("find homography\n"); if ( srcMatrix->cols != dstMatrix->cols || srcMatrix->rows != dstMatrix->rows ) { error("srcMatrix and dstMatrix should have the same size to compute homography !"); return; } - /* - printf("--- srcMatrix ---"); - for ( i = 0 ; i < srcMatrix->rows ; i++ ){ - printf("%.2f\t", CV_MAT_ELEM( *srcMatrix, float, i, 0)); - printf("%.2f\n", CV_MAT_ELEM( *srcMatrix, float, i, 1)); - } - printf("--- dstMatrix ---"); - for ( i = 0 ; i < dstMatrix->rows ; i++ ){ - printf("%.2f\t", CV_MAT_ELEM( *dstMatrix, float, i, 0)); - printf("%.2f\n", CV_MAT_ELEM( *dstMatrix, float, i, 1)); - } - */ cvFindHomography(srcMatrix, dstMatrix, mapMatrix, findmethod, 0, NULL); - /* - printf("---mapMatrix---\n"); + for ( j = 0 ; j < 3 ; j++ ){ for( i=0 ; i<3 ; i++){ SETFLOAT(&mapMatrixList[i+j*3], CV_MAT_ELEM( *mapMatrix, float, i, j)); - printf("%.2f,\t", CV_MAT_ELEM( *mapMatrix, float, i, j)); } - printf("\n"); } - */ + // send out mapMatrix outlet_list( m_dataout, 0, 9, mapMatrixList); } -- cgit v1.2.1