Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2015
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. features the_features;
  2.  
  3. the_extractor->extract_features(padded_image, padded_polygon, the_features);
  4.  
  5. BOOST_LOG_TRIVIAL(trace) << "features rows: " << the_features.m_descriptors.rows << " keypoints: " << the_features.m_keypoints.size();
  6.  
  7. #if 0
  8. std::vector<bool> passed(the_features.m_keypoints.size(), false);
  9. int count = 0;
  10. #endif
  11.  
  12. boost::geometry::model::linestring<ez::point> linestring;
  13. std::copy(padded_polygon.outer().begin(), padded_polygon.outer().end(), std::back_inserter(linestring));
  14. linestring.push_back(padded_polygon.outer()[0]);
  15.  
  16. features the_filtered_features;
  17. the_filtered_features.m_type = the_features.m_type;
  18.  
  19. for (size_t index = 0; index < the_features.m_keypoints.size(); ++index)
  20. {
  21. ez::point p(the_features.m_keypoints[index].pt.x, the_features.m_keypoints[index].pt.y);
  22. if (boost::geometry::distance(p, linestring) > ((float)the_features.m_keypoints[index].size / 2.0f))
  23. {
  24. the_filtered_features.m_descriptors.push_back(the_features.m_descriptors.row((int)index));
  25. the_filtered_features.m_keypoints.push_back(the_features.m_keypoints[index]);
  26. }
  27. }
  28.  
  29. the_filtered_features.m_descriptors.reshape(0, the_features.m_descriptors.cols);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement