From bea177ba0ba4a6c55d67df1b1d3523579e70f107 Mon Sep 17 00:00:00 2001 From: damian Date: Thu, 28 Jan 2010 13:15:45 +0100 Subject: [PATCH] - writing out stable_keypoints stuff modified: artvertiser/calibmodel.cpp new file: artvertiser/camparams_HF10/camera_c.txt new file: artvertiser/camparams_HF10/camera_r_t.txt new file: artvertiser/camparams_HF10/view_r_t.txt modified: garfeild/keypoints/yape.cpp modified: garfeild/viewsets/planar_object_recognizer.cpp modified: garfeild/viewsets/planar_object_recognizer.h --- artvertiser/calibmodel.cpp | 9 + artvertiser/camparams_HF10/camera_c.txt | 7 + artvertiser/camparams_HF10/camera_r_t.txt | 7 + artvertiser/camparams_HF10/view_r_t.txt | 245 +++++++++++++++++++++++++ garfeild/keypoints/yape.cpp | 3 - garfeild/viewsets/planar_object_recognizer.cpp | 3 +- garfeild/viewsets/planar_object_recognizer.h | 2 +- 7 files changed, 271 insertions(+), 5 deletions(-) create mode 100644 artvertiser/camparams_HF10/camera_c.txt create mode 100644 artvertiser/camparams_HF10/camera_r_t.txt create mode 100644 artvertiser/camparams_HF10/view_r_t.txt diff --git a/artvertiser/calibmodel.cpp b/artvertiser/calibmodel.cpp index 710c6a0..7af960d 100644 --- a/artvertiser/calibmodel.cpp +++ b/artvertiser/calibmodel.cpp @@ -195,6 +195,15 @@ bool CalibModel::buildCached(int nbcam, CvCapture *capture, bool cache, planar_o // and the trained classifier detector.save(string(modelfile)+".classifier"); + + string stable_points_filename = string(modelfile)+"_stable_points.bmp"; + printf("saving stable points to %s\n", stable_points_filename.c_str()); + detector.save_image_of_model_points(PATCH_SIZE, stable_points_filename.c_str() ); + + const char* initial_points_filename = "initial_model_points.bmp"; + string initial_points_new_filename = string(modelfile)+"_initial_points.bmp"; + printf("renaming %s to %s\n", initial_points_filename, initial_points_new_filename.c_str() ); + rename(initial_points_filename, initial_points_new_filename.c_str() ); } detector.unlock(); diff --git a/artvertiser/camparams_HF10/camera_c.txt b/artvertiser/camparams_HF10/camera_c.txt new file mode 100644 index 0000000..6b1c85a --- /dev/null +++ b/artvertiser/camparams_HF10/camera_c.txt @@ -0,0 +1,7 @@ +no: 0 +width: 1024 +height: 576 + 1663.054493 0.000000 365.877185 + 0.000000 1651.604937 -711.725202 + 0.000000 0.000000 1.000000 + diff --git a/artvertiser/camparams_HF10/camera_r_t.txt b/artvertiser/camparams_HF10/camera_r_t.txt new file mode 100644 index 0000000..1953269 --- /dev/null +++ b/artvertiser/camparams_HF10/camera_r_t.txt @@ -0,0 +1,7 @@ +no: 0 +width: 1024 +height: 576 + 0.999999 -0.000854 -0.001013 -366.636598 + 0.000865 0.999941 0.010824 717.708606 + 0.001003 -0.010825 0.999941 1665.234448 + diff --git a/artvertiser/camparams_HF10/view_r_t.txt b/artvertiser/camparams_HF10/view_r_t.txt new file mode 100644 index 0000000..7b5d10c --- /dev/null +++ b/artvertiser/camparams_HF10/view_r_t.txt @@ -0,0 +1,245 @@ +no: 0 + 1.000000 -0.000000 -0.000000 -0.000000 + -0.000000 1.000000 0.000000 0.000000 + -0.000000 0.000000 1.000000 0.000000 + +no: 1 + 0.999999 0.001138 0.000770 -0.910557 + -0.001137 0.999998 -0.001685 0.864369 + -0.000772 0.001684 0.999998 0.586314 + +no: 2 + 0.999989 0.003800 0.002917 -3.192755 + -0.003811 0.999986 0.003610 1.934034 + -0.002903 -0.003621 0.999989 3.828911 + +no: 3 + 0.999997 0.002131 0.000918 -3.276471 + -0.002128 0.999992 -0.003512 0.260798 + -0.000926 0.003510 0.999993 -0.052766 + +no: 6 + 0.999999 0.000616 -0.000788 -4.883312 + -0.000619 0.999994 -0.003387 -0.778140 + 0.000786 0.003388 0.999994 -0.703087 + +no: 16 + 0.999340 -0.013227 -0.033818 -1.388214 + 0.012838 0.999849 -0.011702 18.904569 + 0.033968 0.011260 0.999359 -5.016866 + +no: 20 + 0.998094 -0.015827 -0.059647 -7.755010 + 0.016295 0.999840 0.007373 25.205348 + 0.059521 -0.008331 0.998192 -7.772643 + +no: 32 + 0.999974 -0.002133 -0.006817 -46.260688 + 0.001198 0.990931 -0.134368 93.940286 + 0.007042 0.134356 0.990908 33.537700 + +no: 38 + 0.999999 -0.000922 0.001448 -59.861281 + 0.001192 0.979829 -0.199832 101.609175 + -0.001235 0.199833 0.979829 38.580933 + +no: 39 + 0.999996 -0.000660 0.002805 -60.855028 + 0.001231 0.977910 -0.209024 95.798089 + -0.002605 0.209027 0.977906 37.778177 + +no: 41 + 0.999954 0.002290 0.009310 -61.046657 + -0.000171 0.975155 -0.221522 92.004981 + -0.009586 0.221511 0.975111 40.140673 + +no: 42 + 0.999960 0.001142 0.008904 -58.364434 + 0.000892 0.974311 -0.225205 93.758504 + -0.008932 0.225204 0.974271 39.975279 + +no: 45 + 0.999970 -0.001233 0.007671 -46.673246 + 0.003098 0.968699 -0.248219 117.794839 + -0.007125 0.248236 0.968674 44.244991 + +no: 46 + 0.999959 -0.005233 0.007325 -44.913700 + 0.006918 0.967366 -0.253289 128.399922 + -0.005760 0.253330 0.967363 45.190219 + +no: 49 + 0.999912 -0.011061 0.007285 -44.421417 + 0.012643 0.961019 -0.276193 164.503720 + -0.003946 0.276261 0.961075 51.188990 + +no: 54 + 0.999686 -0.024649 0.004605 -38.442427 + 0.024883 0.952364 -0.303947 216.433856 + 0.003106 0.303966 0.952678 63.883333 + +no: 58 + 0.999407 -0.034408 -0.001230 -27.247778 + 0.032215 0.947104 -0.319305 219.273154 + 0.012152 0.319076 0.947651 60.870614 + +no: 62 + 0.999289 -0.037679 0.001118 -19.482398 + 0.035934 0.943200 -0.330276 216.468995 + 0.011390 0.330081 0.943884 55.106870 + +no: 70 + 0.999593 -0.027594 0.007185 -19.912678 + 0.028430 0.945200 -0.325252 239.385624 + 0.002184 0.325324 0.945600 43.397508 + +no: 71 + 0.999678 -0.025096 0.003868 -22.820775 + 0.025016 0.947286 -0.319410 236.434596 + 0.004352 0.319404 0.947609 36.752430 + +no: 73 + 0.999821 -0.018586 0.003447 -30.686398 + 0.018726 0.949030 -0.314630 225.470286 + 0.002576 0.314638 0.949208 21.003778 + +no: 74 + 0.999871 -0.015665 0.003518 -34.960356 + 0.015993 0.952503 -0.304108 218.835543 + 0.001413 0.304125 0.952631 12.224456 + +no: 76 + 0.999912 -0.012059 -0.005541 -60.180323 + 0.009907 0.956059 -0.293006 208.176577 + 0.008831 0.292926 0.956094 -13.527959 + +no: 79 + 0.999978 0.006688 -0.000434 -84.048794 + -0.006548 0.961219 -0.275707 167.488002 + -0.001427 0.275704 0.961242 -38.480517 + +no: 81 + 0.999976 0.006263 0.002961 -79.610149 + -0.005299 0.966784 -0.255539 122.276438 + -0.004463 0.255518 0.966794 -57.426380 + +no: 86 + 0.999906 0.012861 0.004757 -99.004491 + -0.011602 0.978405 -0.206369 70.793766 + -0.007308 0.206295 0.978463 -91.193333 + +no: 88 + 0.999728 0.022322 0.006805 -102.739900 + -0.020733 0.983450 -0.179988 52.765726 + -0.010710 0.179798 0.983645 -97.113872 + +no: 89 + 0.999512 0.028104 0.013657 -106.142647 + -0.025325 0.984633 -0.172792 37.310162 + -0.018304 0.172362 0.984864 -105.094357 + +no: 92 + 0.999648 0.025732 0.006385 -126.548738 + -0.024648 0.990718 -0.133679 -17.147271 + -0.009766 0.133475 0.991004 -119.660084 + +no: 95 + 0.999499 0.027196 0.016162 -139.959443 + -0.025543 0.995162 -0.094874 -79.680248 + -0.018664 0.094413 0.995358 -130.379957 + +no: 97 + 0.999504 0.022683 0.021846 -143.417085 + -0.021269 0.997792 -0.062915 -107.509311 + -0.023225 0.062419 0.997780 -125.470718 + +no: 100 + 0.999939 0.011009 -0.000016 -136.052711 + -0.011005 0.999531 -0.028579 -128.613017 + -0.000299 0.028577 0.999592 -131.614644 + +no: 101 + 0.999976 0.006005 -0.003405 -131.989026 + -0.006022 0.999969 -0.004974 -132.257506 + 0.003375 0.004994 0.999982 -121.226010 + +no: 104 + 0.999875 0.007657 0.013852 -109.309978 + -0.007532 0.999930 -0.009074 -90.995691 + -0.013920 0.008969 0.999863 -43.755608 + +no: 105 + 0.999537 0.016507 0.025544 -124.494225 + -0.014662 0.997384 -0.070777 -109.817744 + -0.026646 0.070369 0.997165 -105.694695 + +no: 109 + 0.996024 0.018772 0.087082 -84.730919 + -0.018118 0.999801 -0.008294 -14.097828 + -0.087221 0.006684 0.996167 85.062130 + +no: 115 + 0.999900 -0.005803 -0.012900 -83.768108 + 0.006772 0.997056 0.076375 -97.714544 + 0.012418 -0.076455 0.996996 -90.901691 + +no: 117 + 0.999767 -0.006133 -0.020698 -73.099840 + 0.008113 0.995252 0.096995 -96.160445 + 0.020005 -0.097141 0.995070 -81.369662 + +no: 119 + 0.999234 -0.014249 -0.036449 -60.028989 + 0.018688 0.992045 0.124490 -95.088828 + 0.034385 -0.125076 0.991551 -71.080602 + +no: 125 + 0.997467 -0.023301 -0.067204 -30.366302 + 0.034706 0.984154 0.173884 -78.295644 + 0.062087 -0.175776 0.982470 -31.777556 + +no: 127 + 0.996418 -0.021489 -0.081790 -24.851977 + 0.037221 0.979898 0.195998 -71.634932 + 0.075934 -0.198340 0.977187 -21.302772 + +no: 129 + 0.997064 -0.012988 -0.075464 -24.713586 + 0.029326 0.975139 0.219644 -48.886304 + 0.070736 -0.221212 0.972657 6.363855 + +no: 130 + 0.981588 0.023827 -0.189518 -40.038334 + -0.016387 0.999036 0.040731 -73.178036 + 0.190306 -0.036875 0.981032 -215.055934 + +no: 133 + 0.997843 0.002838 -0.065588 -26.528603 + 0.014460 0.965027 0.261750 -13.847482 + 0.064037 -0.262134 0.962904 61.493485 + +no: 135 + 0.996312 0.003012 -0.085750 -24.521989 + 0.024091 0.949361 0.313262 -20.499970 + 0.082351 -0.314173 0.945787 75.406423 + +no: 136 + 0.997258 0.007825 -0.073584 -25.214442 + 0.016023 0.947968 0.317962 -14.421514 + 0.072244 -0.318269 0.945244 94.285100 + +no: 139 + 0.996261 0.006814 -0.086125 -27.122450 + 0.024879 0.932025 0.361538 -26.827627 + 0.082734 -0.362329 0.928371 110.006936 + +no: 142 + 0.993267 0.012037 -0.115221 -33.376628 + 0.040362 0.896312 0.441584 -34.244337 + 0.108589 -0.443261 0.889791 133.120311 + +no: 149 + 0.979176 0.036575 -0.199693 -53.190212 + 0.072925 0.854619 0.514110 -45.861714 + 0.189465 -0.517967 0.834154 116.642590 + diff --git a/garfeild/keypoints/yape.cpp b/garfeild/keypoints/yape.cpp index 3b5816b..380d02c 100644 --- a/garfeild/keypoints/yape.cpp +++ b/garfeild/keypoints/yape.cpp @@ -728,10 +728,7 @@ void* yape::raw_detect_thread_func( void* _data ) else { //perform_one_point(I, x, Scores, Im, Ip, dirs, opposite, dirs_nb); - //int old_score = Scores[x]; perform_one_point_2( img, x, Scores, tau, dirs, opposite, dirs_nb ); - //int new_score = Scores[x]; - //printf("%3i %3i: %i %i\n", x, y, old_score, new_score ); } } } diff --git a/garfeild/viewsets/planar_object_recognizer.cpp b/garfeild/viewsets/planar_object_recognizer.cpp index 6a3bc55..6173fde 100644 --- a/garfeild/viewsets/planar_object_recognizer.cpp +++ b/garfeild/viewsets/planar_object_recognizer.cpp @@ -175,6 +175,7 @@ bool planar_object_recognizer::build(IplImage *model_image, learn(max_point_number_on_model, patch_size, yape_radius, tree_number, nbLev, LearnProgress); + ready = true; printf("**~ detector now ready\n"); @@ -1568,7 +1569,7 @@ void planar_object_recognizer::detect_most_stable_model_points(int max_point_num // VISUALIZATION: The following functions are useful for visualization only !!! -void planar_object_recognizer::save_image_of_model_points(int patch_size, char * filename) +void planar_object_recognizer::save_image_of_model_points(int patch_size, const char * filename) { IplImage* model_image = mcvGrayToColor(new_images_generator.original_image); diff --git a/garfeild/viewsets/planar_object_recognizer.h b/garfeild/viewsets/planar_object_recognizer.h index fef8e7d..fab8efc 100644 --- a/garfeild/viewsets/planar_object_recognizer.h +++ b/garfeild/viewsets/planar_object_recognizer.h @@ -224,7 +224,7 @@ public: int patch_size, int view_number, double min_view_rate, LEARNPROGRESSION LearnProgress=0); - void save_image_of_model_points(int patch_size, char * filename = 0); + void save_image_of_model_points(int patch_size, const char * filename = 0); //! Image classifier image_classification_forest * forest; -- 2.11.4.GIT