Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2 src/colmap/controllers/hierarchical_pipeline_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ TEST(HierarchicalPipeline, WithoutNoiseAndNonTrivialFrames) {
synthetic_dataset_options.num_rigs = 2;
synthetic_dataset_options.num_cameras_per_rig = 2;
synthetic_dataset_options.num_frames_per_rig = 10;
synthetic_dataset_options.num_points3D = 100;
synthetic_dataset_options.num_points3D = 200;
synthetic_dataset_options.point2D_stddev = 0;
SynthesizeDataset(synthetic_dataset_options, &gt_reconstruction, &database);

Expand Down
15 changes: 15 additions & 0 deletions 15 src/colmap/scene/synthetic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ void SynthesizeDataset(const SyntheticDatasetOptions& options,
THROW_CHECK_GE(options.num_points3D, 0);
THROW_CHECK_GE(options.num_points2D_without_point3D, 0);
THROW_CHECK_GE(options.sensor_from_rig_translation_stddev, 0.);
THROW_CHECK_GE(options.sensor_from_rig_rotation_stddev, 0.);
THROW_CHECK_GE(options.point2D_stddev, 0.);
THROW_CHECK_GE(options.prior_position_stddev, 0.);

Expand Down Expand Up @@ -215,6 +216,17 @@ void SynthesizeDataset(const SyntheticDatasetOptions& options,
rig.AddRefSensor(camera.SensorId());
} else {
Rigid3d sensor_from_rig;
if (options.sensor_from_rig_rotation_stddev > 0) {
// Generate a random rotation around the Z-axis.
// This is to avoid 2D points fall behind the camera.
const double angle =
std::clamp(RandomGaussian<double>(
0, options.sensor_from_rig_rotation_stddev),
-180.0,
180.0);
sensor_from_rig.rotation = Eigen::Quaterniond(
Eigen::AngleAxisd(DegToRad(angle), Eigen::Vector3d(0, 0, 1)));
}
if (options.sensor_from_rig_translation_stddev > 0) {
sensor_from_rig.translation = Eigen::Vector3d(
RandomGaussian<double>(
Expand Down Expand Up @@ -293,6 +305,9 @@ void SynthesizeDataset(const SyntheticDatasetOptions& options,
Point2D point2D;
const std::optional<Eigen::Vector2d> proj_point2D =
camera.ImgFromCam(cam_from_world * point3D.xyz);
if (!proj_point2D.has_value()) {
continue; // Point is behind the camera.
}
point2D.xy = proj_point2D.value();
if (options.point2D_stddev > 0) {
const Eigen::Vector2d noise(
Expand Down
1 change: 1 addition & 0 deletions 1 src/colmap/scene/synthetic.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ struct SyntheticDatasetOptions {
int num_points3D = 100;

double sensor_from_rig_translation_stddev = 0.05;
double sensor_from_rig_rotation_stddev = 5.; // in degrees

int camera_width = 1024;
int camera_height = 768;
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.