use of boofcv.alg.geo.bundle.cameras.BundleCameraProjective in project BoofCV by lessthanoptimal.
the class SceneStructureProjective method initialize.
/**
* Initialization with the assumption that a {@link boofcv.alg.geo.bundle.cameras.BundleCameraProjective}
* is used for all views.
*
* @param totalViews Number of views
* @param totalPoints Number of points
*/
public void initialize(int totalViews, int totalPoints) {
this.initialize(1, totalViews, totalPoints);
setCamera(0, true, new BundleCameraProjective());
for (int viewIdx = 0; viewIdx < views.size; viewIdx++) {
connectViewToCamera(viewIdx, 0);
}
}
use of boofcv.alg.geo.bundle.cameras.BundleCameraProjective in project BoofCV by lessthanoptimal.
the class TestCodecSceneStructureProjective method createSceneH.
static SceneStructureProjective createSceneH(Random rand) {
SceneStructureProjective out = new SceneStructureProjective(true);
out.initialize(2, 4, 5);
out.setCamera(0, true, new BundleCameraProjective());
// out.setCamera(1,true,new BundleCameraProjective());
out.setCamera(1, false, new CameraPinhole(100, 110, 0.0001, rand.nextGaussian() / 100, rand.nextGaussian() / 100, 1, 1));
for (int i = 0; i < 5; i++) {
double w = rand.nextDouble() * 0.1;
out.setPoint(i, i + 1, i + 2 * rand.nextGaussian(), 2 * i - 3 * rand.nextGaussian(), 0.9 + w);
}
for (int i = 0; i < 4; i++) {
boolean fixed = i % 2 == 0;
DMatrixRMaj P = new DMatrixRMaj(3, 4);
if (fixed) {
for (int j = 0; j < 12; j++) {
P.data[j] = 10.1 + j * 0.2;
}
} else
RandomMatrices_DDRM.fillUniform(P, rand);
out.setView(i, fixed, P, width, height);
out.views.data[i].camera = i / 2;
}
// Assign first point to all views then the other points to just one view
for (int i = 0; i < 4; i++) {
out.points.data[0].views.add(i);
}
for (int i = 1; i < out.points.size; i++) {
out.points.data[i].views.add(i - 1);
}
return out;
}
use of boofcv.alg.geo.bundle.cameras.BundleCameraProjective in project BoofCV by lessthanoptimal.
the class TestCodecSceneStructureProjective method createScene3D.
static SceneStructureProjective createScene3D(Random rand) {
SceneStructureProjective out = new SceneStructureProjective(false);
out.initialize(2, 4, 5);
out.setCamera(0, true, new BundleCameraProjective());
// out.setCamera(1,true,new BundleCameraProjective());
out.setCamera(1, false, new CameraPinhole(100, 110, 0.0001, rand.nextGaussian() / 100, rand.nextGaussian() / 100, 1, 1));
for (int i = 0; i < 5; i++) {
out.setPoint(i, i + 1, i + 2 * rand.nextGaussian(), 2 * i - 3 * rand.nextGaussian());
}
for (int i = 0; i < 4; i++) {
boolean fixed = i % 2 == 0;
DMatrixRMaj P = new DMatrixRMaj(3, 4);
if (fixed) {
for (int j = 0; j < 12; j++) {
P.data[j] = 0.1 + j * 0.2;
}
} else
RandomMatrices_DDRM.fillUniform(P, rand);
out.setView(i, fixed, P, width, height);
out.views.data[i].camera = i / 2;
}
// Assign first point to all views then the other points to just one view
for (int i = 0; i < 4; i++) {
out.points.data[0].views.add(i);
}
for (int i = 1; i < out.points.size; i++) {
out.points.data[i].views.add(i - 1);
}
return out;
}
Aggregations