From a183e1166f2f1c15fb19446dbc61ea6f8d5b6c0c Mon Sep 17 00:00:00 2001 From: Shantanu Chhabra Date: Thu, 5 Sep 2019 17:11:36 -0700 Subject: [PATCH 1/2] Fixed angle plumbing for theta, phi, and gamma. --- .../one_shot_object_detection/util/parameter_sampler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/toolkits/object_detection/one_shot_object_detection/util/parameter_sampler.cpp b/src/toolkits/object_detection/one_shot_object_detection/util/parameter_sampler.cpp index 47f485108c..39783f7477 100644 --- a/src/toolkits/object_detection/one_shot_object_detection/util/parameter_sampler.cpp +++ b/src/toolkits/object_detection/one_shot_object_detection/util/parameter_sampler.cpp @@ -78,11 +78,11 @@ void ParameterSampler::sample(long seed) { std::normal_distribution focal_distribution((double)width_, focal_stdev_); theta_generator_.seed(seed + 3); - theta_ = theta_distribution(theta_generator_); + theta_ = deg_to_rad(theta_distribution(theta_generator_)); phi_generator_.seed(seed + 4); - phi_ = phi_distribution(phi_generator_); + phi_ = deg_to_rad(phi_distribution(phi_generator_)); gamma_generator_.seed(seed + 5); - gamma_ = gamma_distribution(gamma_generator_); + gamma_ = deg_to_rad(gamma_distribution(gamma_generator_)); focal_generator_.seed(seed + 6); focal_ = focal_distribution(focal_generator_); std::uniform_int_distribution dz_distribution(std::max(width_, height_), From 873cce1893ccd328f2157edd15f580a9e2148f21 Mon Sep 17 00:00:00 2001 From: Shantanu Chhabra Date: Thu, 5 Sep 2019 17:23:40 -0700 Subject: [PATCH 2/2] remove deg_to_rad calls in getters --- .../one_shot_object_detection/util/parameter_sampler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/toolkits/object_detection/one_shot_object_detection/util/parameter_sampler.cpp b/src/toolkits/object_detection/one_shot_object_detection/util/parameter_sampler.cpp index 39783f7477..f35af75b73 100644 --- a/src/toolkits/object_detection/one_shot_object_detection/util/parameter_sampler.cpp +++ b/src/toolkits/object_detection/one_shot_object_detection/util/parameter_sampler.cpp @@ -31,11 +31,11 @@ double deg_to_rad(double angle) { return angle * M_PI / 180.0; } * transform: The transformation matrix built from the above parameters * warped_corners: The four corners of the object in the warped image */ -double ParameterSampler::get_theta() { return deg_to_rad(theta_); } +double ParameterSampler::get_theta() { return theta_; } -double ParameterSampler::get_phi() { return deg_to_rad(phi_); } +double ParameterSampler::get_phi() { return phi_; } -double ParameterSampler::get_gamma() { return deg_to_rad(gamma_); } +double ParameterSampler::get_gamma() { return gamma_; } size_t ParameterSampler::get_dz() { return dz_; }