@@ -199,6 +199,41 @@ TEST_CASE("Pano too large") {
199
199
xpano::algorithm::stitcher::Status::kErrPanoTooLarge );
200
200
}
201
201
202
+ const std::vector<std::filesystem::path> kInputsIncomplete = {
203
+ " data/image05.jpg" , // pano 1
204
+ " data/image06.jpg" , // pano 2
205
+ " data/image07.jpg" // pano 2
206
+ };
207
+
208
+ TEST_CASE (" Incomplete pano" ) {
209
+ xpano::pipeline::StitcherPipeline<kReturnFuture > stitcher;
210
+
211
+ auto loading_task = stitcher.RunLoading (kInputsIncomplete , {}, {});
212
+ auto stitch_data = loading_task.future .get ();
213
+ auto progress = loading_task.progress ->Report ();
214
+ CHECK (progress.tasks_done == progress.num_tasks );
215
+
216
+ CHECK (stitch_data.images .size () == 3 );
217
+ REQUIRE (stitch_data.panos .size () == 1 );
218
+ REQUIRE_THAT (stitch_data.panos [0 ].ids , Equals<int >({1 , 2 }));
219
+
220
+ // add an unrelated image to the pano
221
+ stitch_data.panos [0 ].ids = {0 , 1 , 2 };
222
+
223
+ // stitch
224
+ auto stitching_task0 = stitcher.RunStitching (stitch_data, {.pano_id = 0 });
225
+ auto stitch_result0 = stitching_task0.future .get ();
226
+
227
+ // TODO(krupkat): fix, this is currently not equal
228
+ // progress = stitching_task0.progress->Report();
229
+ // CHECK(progress.tasks_done == progress.num_tasks);
230
+
231
+ REQUIRE (stitch_result0.pano .has_value ());
232
+ REQUIRE (stitch_result0.cameras .has_value ());
233
+ CHECK (stitch_result0.cameras ->cameras .size () == 2 );
234
+ CHECK_THAT (stitch_result0.cameras ->component , Equals<int >({1 , 2 }));
235
+ }
236
+
202
237
TEST_CASE (" Stitcher pipeline single pano matching" ) {
203
238
xpano::pipeline::StitcherPipeline<kReturnFuture > stitcher;
204
239
auto loading_task = stitcher.RunLoading (
@@ -657,4 +692,4 @@ TEST_CASE("Stitcher pipeline stack detection") {
657
692
CHECK_THAT (result.panos [0 ].ids , Equals<int >({2 , 3 }));
658
693
}
659
694
660
- // NOLINTEND(readability-function-cognitive-complexity)
695
+ // NOLINTEND(readability-function-cognitive-complexity)
0 commit comments