use of boofcv.factory.disparity.ConfigDisparityBMBest5 in project BoofCV by lessthanoptimal.
the class TestMultiBaselineStereoIndependent method handleOneCameraManyViews.
/**
* In this scene there is only one camera for several views
*/
@Test
void handleOneCameraManyViews() {
var scene = new SceneStructureMetric(true);
scene.initialize(1, 3, 0);
scene.setCamera(0, true, new CameraPinholeBrown().fsetK(30, 30, 0, 25, 25, 50, 50));
for (int i = 0; i < 3; i++) {
scene.setView(i, 0, true, eulerXyz(i, 0, 0, 0, 0, 0, null));
}
var alg = new MultiBaselineStereoIndependent<>(ImageType.SB_F32);
var configDisp = new ConfigDisparityBMBest5();
configDisp.errorType = DisparityError.SAD;
configDisp.disparityRange = 5;
alg.stereoDisparity = FactoryStereoDisparity.blockMatchBest5(configDisp, GrayF32.class, GrayF32.class);
List<GrayF32> images = new ArrayList<>();
TIntObjectMap<String> sbaIndexToViewID = new TIntObjectHashMap<>();
for (int i = 0; i < 3; i++) {
images.add(new GrayF32(50, 50));
sbaIndexToViewID.put(i, i + "");
}
alg.lookUpImages = new MockLookUp(images);
// Override so that it will always be happy
alg.performFusion = new MultiBaselineDisparityMedian() {
@Override
public boolean process(GrayF32 disparity) {
return true;
}
};
// just see if it blows up
assertTrue(alg.process(scene, 0, DogArray_I32.array(1, 2), sbaIndexToViewID::get));
}
Aggregations