32 #define TEST_NAME "base/correspondence_graph"
41 BOOST_CHECK_EQUAL(correspondence_graph.
NumImages(), 0);
48 correspondence_graph.
AddImage(0, 10);
49 correspondence_graph.
AddImage(1, 10);
50 BOOST_CHECK_EQUAL(correspondence_graph.
ExistsImage(0),
true);
51 BOOST_CHECK_EQUAL(correspondence_graph.
ExistsImage(1),
true);
52 BOOST_CHECK_EQUAL(correspondence_graph.
ExistsImage(2),
false);
53 BOOST_CHECK_EQUAL(correspondence_graph.
NumImages(), 2);
62 for (
size_t i = 0; i < 10; ++i) {
69 matches[0].point2D_idx1 = 0;
70 matches[0].point2D_idx2 = 0;
71 matches[1].point2D_idx1 = 1;
72 matches[1].point2D_idx2 = 2;
73 matches[2].point2D_idx1 = 3;
74 matches[2].point2D_idx2 = 7;
75 matches[3].point2D_idx1 = 4;
76 matches[3].point2D_idx2 = 8;
140 for (
size_t i = 0; i < 10; ++i) {
162 BOOST_CHECK_EQUAL(corrs01.size(), matches.size());
163 BOOST_CHECK_EQUAL(corrs10.size(), matches.size());
164 for (
size_t i = 0; i < corrs01.size(); ++i) {
165 BOOST_CHECK_EQUAL(corrs01[i].point2D_idx1, corrs10[i].point2D_idx2);
166 BOOST_CHECK_EQUAL(corrs01[i].point2D_idx2, corrs10[i].point2D_idx1);
167 BOOST_CHECK_EQUAL(matches[i].point2D_idx1, corrs01[i].point2D_idx1);
168 BOOST_CHECK_EQUAL(matches[i].point2D_idx2, corrs01[i].point2D_idx2);
179 correspondence_graph.
AddImage(0, 10);
180 correspondence_graph.
AddImage(1, 10);
181 correspondence_graph.
AddImage(2, 10);
182 BOOST_CHECK_EQUAL(correspondence_graph.
ExistsImage(0),
true);
183 BOOST_CHECK_EQUAL(correspondence_graph.
ExistsImage(1),
true);
184 BOOST_CHECK_EQUAL(correspondence_graph.
ExistsImage(2),
true);
185 BOOST_CHECK_EQUAL(correspondence_graph.
ExistsImage(3),
false);
186 BOOST_CHECK_EQUAL(correspondence_graph.
NumImages(), 3);
195 for (
size_t i = 0; i < 10; ++i) {
204 matches01[0].point2D_idx1 = 0;
205 matches01[0].point2D_idx2 = 0;
214 matches02[0].point2D_idx1 = 0;
215 matches02[0].point2D_idx2 = 0;
224 matches12[0].point2D_idx1 = 0;
225 matches12[0].point2D_idx2 = 0;
226 matches12[1].point2D_idx1 = 5;
227 matches12[1].point2D_idx2 = 5;
283 for (
size_t i = 0; i < 10; ++i) {
313 correspondence_graph.
AddImage(3, 10);
314 BOOST_CHECK_EQUAL(correspondence_graph.
ExistsImage(0),
true);
315 BOOST_CHECK_EQUAL(correspondence_graph.
ExistsImage(1),
true);
316 BOOST_CHECK_EQUAL(correspondence_graph.
ExistsImage(2),
true);
317 BOOST_CHECK_EQUAL(correspondence_graph.
ExistsImage(3),
true);
318 BOOST_CHECK_EQUAL(correspondence_graph.
NumImages(), 4);
320 BOOST_CHECK_EQUAL(correspondence_graph.
ExistsImage(0),
true);
321 BOOST_CHECK_EQUAL(correspondence_graph.
ExistsImage(1),
true);
322 BOOST_CHECK_EQUAL(correspondence_graph.
ExistsImage(2),
true);
323 BOOST_CHECK_EQUAL(correspondence_graph.
ExistsImage(3),
false);
324 BOOST_CHECK_EQUAL(correspondence_graph.
NumImages(), 3);
335 correspondence_graph.
AddImage(0, 10);
336 correspondence_graph.
AddImage(1, 4);
338 matches[0].point2D_idx1 = 9;
339 matches[0].point2D_idx2 = 3;
340 matches[1].point2D_idx1 = 10;
341 matches[1].point2D_idx2 = 3;
342 matches[2].point2D_idx1 = 9;
343 matches[2].point2D_idx2 = 4;
354 correspondence_graph.
AddImage(0, 10);
355 correspondence_graph.
AddImage(1, 10);
357 matches[0].point2D_idx1 = 0;
358 matches[0].point2D_idx2 = 0;
359 matches[1].point2D_idx1 = 1;
360 matches[1].point2D_idx2 = 1;
361 matches[2].point2D_idx1 = 1;
362 matches[2].point2D_idx2 = 1;
363 matches[3].point2D_idx1 = 3;
364 matches[3].point2D_idx2 = 3;
365 matches[4].point2D_idx1 = 3;
366 matches[4].point2D_idx2 = 4;
bool HasCorrespondences(const image_t image_id, const point2D_t point2D_idx) const
bool ExistsImage(const image_t image_id) const
const std::vector< Correspondence > & FindCorrespondences(const image_t image_id, const point2D_t point2D_idx) const
void AddImage(const image_t image_id, const size_t num_points2D)
FeatureMatches FindCorrespondencesBetweenImages(const image_t image_id1, const image_t image_id2) const
std::vector< Correspondence > FindTransitiveCorrespondences(const image_t image_id, const point2D_t point2D_idx, const size_t transitivity) const
point2D_t NumCorrespondencesBetweenImages(const image_t image_id1, const image_t image_id2) const
point2D_t NumCorrespondencesForImage(const image_t image_id) const
bool IsTwoViewObservation(const image_t image_id, const point2D_t point2D_idx) const
void AddCorrespondences(const image_t image_id1, const image_t image_id2, const FeatureMatches &matches)
point2D_t NumObservationsForImage(const image_t image_id) const
static image_pair_t ImagePairToPairId(const image_t image_id1, const image_t image_id2)
BOOST_AUTO_TEST_CASE(TestDefault)
std::vector< FeatureMatch > FeatureMatches