Diff of /trunk/contrib/brl/bbas/volm/volm_spherical_index_query_matcher.cxx [r36646] .. [r36647] Maximize Restore

  Switch to side-by-side view

--- a/trunk/contrib/brl/bbas/volm/volm_spherical_index_query_matcher.cxx
+++ b/trunk/contrib/brl/bbas/volm/volm_spherical_index_query_matcher.cxx
@@ -1,12 +1,11 @@
 #include <volm/volm_spherical_index_query_matcher.h>
 #include <vsph/vsph_sph_box_2d.h>
 
-volm_spherical_index_query_matcher::volm_spherical_index_query_matcher(volm_spherical_region_index & index, 
-    volm_spherical_region_query & query,
-    volm_camera_space_sptr & cam_space)
-    :index_(index),query_(query), cam_space_(cam_space)
+volm_spherical_index_query_matcher::volm_spherical_index_query_matcher(volm_spherical_region_index & index,
+                                                                       volm_spherical_region_query & query,
+                                                                       volm_camera_space_sptr & cam_space)
+ : index_(index),query_(query), cam_space_(cam_space)
 {
- 
 }
 
 bool volm_spherical_index_query_matcher::match()
@@ -22,38 +21,38 @@
         unsigned tilt_index;
         iter->cam_indices(roll_index,fov_index,head_index,tilt_index);
 
-        double score = 0.0;      
+        double score = 0.0;
         volm_spherical_regions_layer q_regions =query_.query_regions(roll_index);
-        for(unsigned i = 0; i< q_regions.size(); i++)
+        for (unsigned i = 0; i< q_regions.size(); i++)
         {
-            // transform query_region box            
+            // transform query_region box
             volm_spherical_region query_region = q_regions.regions()[i];
             unsigned char qval = 0;
-            if(!query_region.attribute_value(spherical_region_attributes::ORIENTATION,qval))
+            if (!query_region.attribute_value(spherical_region_attributes::ORIENTATION,qval))
                 continue;
             vsph_sph_box_2d qbox = query_region.bbox_ref();
-            //: convert google coordinate axis( z is down and x is north) to spherical coordinate syste( z is up and x is east)
+            // convert google coordinate axis( z is down and x is north) to spherical coordinate system ( z is up and x is east)
             vsph_sph_box_2d qbox_xfomred = qbox.transform(camera.tilt_-cam_space_->tilt_mid(),
                                                           camera.heading_-cam_space_->head_mid(),
                                                           (camera.top_fov_)/cam_space_->top_fov(0),
                                                           180-camera.tilt_,90-camera.heading_,false);
             // match it with index bboxes;
-            vcl_vector<unsigned int> attribute_poly_ids 
+            vcl_vector<unsigned int> attribute_poly_ids
                 = index_layer.attributed_regions(spherical_region_attributes::ORIENTATION);
 
-            for(unsigned j = 0; j< attribute_poly_ids.size(); j++)
+            for (unsigned j = 0; j< attribute_poly_ids.size(); j++)
             {
                 volm_spherical_region index_region = i_regions[attribute_poly_ids[j]];
                 unsigned char ival = 0;
-                if(!index_region.attribute_value(spherical_region_attributes::ORIENTATION,ival))
+                if (!index_region.attribute_value(spherical_region_attributes::ORIENTATION,ival))
                     continue;
-                //: just considering horizontal and vertical
-                if(qval >=1 && ival>=2 && qval <= 3 && ival<=9 )
+                // just considering horizontal and vertical
+                if (qval >=1 && ival>=2 && qval <= 3 && ival<=9 )
                 {
                     vcl_vector<vsph_sph_box_2d> intersection_box ;
-                    if(intersection(qbox_xfomred,index_region.bbox_ref(),intersection_box))
+                    if (intersection(qbox_xfomred,index_region.bbox_ref(),intersection_box))
                     {
-                        for(unsigned k = 0 ; k < intersection_box.size();k++)
+                        for (unsigned k = 0 ; k < intersection_box.size();k++)
                             score+=intersection_box[k].area()/(qbox_xfomred.area());
                     }
                 }
@@ -62,4 +61,4 @@
         scores_.push_back(score);
     }
     return true;
-}+}