sac_model.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2009 Radu Bogdan Rusu <rusu -=- cs.tum.edu>
3  *
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25  * POSSIBILITY OF SUCH DAMAGE.
26  *
27  * $Id: sac_model.cpp 16379 2009-05-29 19:20:46Z hsujohnhsu $
28  *
29  */
30 
33 #include <algorithm>
34 #include <sac_model.h>
35 
36 namespace sample_consensus
37 {
39 
40  int
42  {
43  // The point indices used for computing the current model are in indices_
44  // What we need to do is subtract the Inliers
45  std::vector<int> remaining_indices;
46 
47  // Sort the inliers and the point cloud indices
48  std::sort (best_inliers_.begin (), best_inliers_.end ());
49  std::sort (indices_.begin (), indices_.end ());
50 
51  set_difference (indices_.begin (), indices_.end (), best_inliers_.begin (), best_inliers_.end (),
52  inserter (remaining_indices, remaining_indices.begin ()));
53 
54  indices_ = remaining_indices;
55 
56 
57  return indices_.size ();
58  }
59 }
virtual int removeInliers()
Remove the inliers found from the initial set of given point indices.
Definition: sac_model.cpp:41
std::vector< int > indices_
The list of internal point indices used.
Definition: sac_model.h:194
std::vector< int > best_inliers_
The indices of the points that were chosen as inliers after the last computeModel () call...
Definition: sac_model.h:202


semantic_point_annotator
Author(s): Radu Bogdan Rusu
autogenerated on Mon Jun 10 2019 14:29:03