Skip to content

Commit

Permalink
Prefer C++ method std::atan/std::atan2 over C method atan/atan2
Browse files Browse the repository at this point in the history
  • Loading branch information
Heiko Thiel committed Jul 20, 2019
1 parent a2bedc9 commit 362d6f1
Show file tree
Hide file tree
Showing 37 changed files with 72 additions and 72 deletions.
8 changes: 4 additions & 4 deletions 2d/include/pcl/2d/impl/edge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pcl::Edge<PointInT, PointOutT>::detectEdgeSobel (
std::sqrt ((*magnitude_x)[i].intensity * (*magnitude_x)[i].intensity +
(*magnitude_y)[i].intensity * (*magnitude_y)[i].intensity);
output[i].direction =
atan2f ((*magnitude_y)[i].intensity, (*magnitude_x)[i].intensity);
std::atan2 ((*magnitude_y)[i].intensity, (*magnitude_x)[i].intensity);
}
}

Expand Down Expand Up @@ -118,7 +118,7 @@ pcl::Edge<PointInT, PointOutT>::sobelMagnitudeDirection (
std::sqrt ((*magnitude_x)[i].intensity * (*magnitude_x)[i].intensity +
(*magnitude_y)[i].intensity * (*magnitude_y)[i].intensity);
output[i].direction =
atan2f ((*magnitude_y)[i].intensity, (*magnitude_x)[i].intensity);
std::atan2 ((*magnitude_y)[i].intensity, (*magnitude_x)[i].intensity);
}
}

Expand Down Expand Up @@ -157,7 +157,7 @@ pcl::Edge<PointInT, PointOutT>::detectEdgePrewitt (pcl::PointCloud<PointOutT> &o
std::sqrt ((*magnitude_x)[i].intensity * (*magnitude_x)[i].intensity +
(*magnitude_y)[i].intensity * (*magnitude_y)[i].intensity);
output[i].direction =
atan2f ((*magnitude_y)[i].intensity, (*magnitude_x)[i].intensity);
std::atan2 ((*magnitude_y)[i].intensity, (*magnitude_x)[i].intensity);
}
}

Expand Down Expand Up @@ -196,7 +196,7 @@ pcl::Edge<PointInT, PointOutT>::detectEdgeRoberts (pcl::PointCloud<PointOutT> &o
std::sqrt ((*magnitude_x)[i].intensity * (*magnitude_x)[i].intensity +
(*magnitude_y)[i].intensity * (*magnitude_y)[i].intensity);
output[i].direction =
atan2f ((*magnitude_y)[i].intensity, (*magnitude_x)[i].intensity);
std::atan2 ((*magnitude_y)[i].intensity, (*magnitude_x)[i].intensity);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,11 @@ pcl::cloud_composer::SelectedTrackballStyleInteractor::Spin ()
disp_obj_center);

double newAngle =
vtkMath::DegreesFromRadians( atan2( rwi->GetEventPosition()[1] - disp_obj_center[1],
vtkMath::DegreesFromRadians( std::atan2( rwi->GetEventPosition()[1] - disp_obj_center[1],
rwi->GetEventPosition()[0] - disp_obj_center[0] ) );

double oldAngle =
vtkMath::DegreesFromRadians( atan2( rwi->GetLastEventPosition()[1] - disp_obj_center[1],
vtkMath::DegreesFromRadians( std::atan2( rwi->GetLastEventPosition()[1] - disp_obj_center[1],
rwi->GetLastEventPosition()[0] - disp_obj_center[0] ) );

double scale[3];
Expand Down
8 changes: 4 additions & 4 deletions common/include/pcl/common/impl/eigen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,9 +663,9 @@ pcl::getTransformationFromTwoUnitVectorsAndOrigin (const Eigen::Vector3f& y_dire
template <typename Scalar> void
pcl::getEulerAngles (const Eigen::Transform<Scalar, 3, Eigen::Affine> &t, Scalar &roll, Scalar &pitch, Scalar &yaw)
{
roll = atan2 (t (2, 1), t (2, 2));
roll = std::atan2 (t (2, 1), t (2, 2));
pitch = asin (-t (2, 0));
yaw = atan2 (t (1, 0), t (0, 0));
yaw = std::atan2 (t (1, 0), t (0, 0));
}

//////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -677,9 +677,9 @@ pcl::getTranslationAndEulerAngles (const Eigen::Transform<Scalar, 3, Eigen::Affi
x = t (0, 3);
y = t (1, 3);
z = t (2, 3);
roll = atan2 (t (2, 1), t (2, 2));
roll = std::atan2 (t (2, 1), t (2, 2));
pitch = asin (-t (2, 0));
yaw = atan2 (t (1, 0), t (0, 0));
yaw = std::atan2 (t (1, 0), t (0, 0));
}

//////////////////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion common/include/pcl/range_image/range_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ namespace pcl
static inline float
asinLookUp (float value);

/** Query the atan2 lookup table */
/** Query the std::atan2 lookup table */
static inline float
atan2LookUp (float y, float x);

Expand Down
2 changes: 1 addition & 1 deletion common/src/range_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ RangeImage::createLookupTables ()
for (int i=0; i<lookup_table_size; ++i)
{
float value = static_cast<float> (i-(lookup_table_size-1)/2)/static_cast<float> ((lookup_table_size-1)/2);
atan_lookup_table[i] = atanf (value);
atan_lookup_table[i] = std::atan (value);
}

cos_lookup_table.resize (lookup_table_size);
Expand Down
2 changes: 1 addition & 1 deletion common/src/range_image_planar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace pcl
//MEASURE_FUNCTION_TIME;
reset ();

float original_angular_resolution = atanf (0.5f * static_cast<float> (di_width) / static_cast<float> (focal_length)) / (0.5f * static_cast<float> (di_width));
float original_angular_resolution = std::atan (0.5f * static_cast<float> (di_width) / static_cast<float> (focal_length)) / (0.5f * static_cast<float> (di_width));
int skip = 1;
if (desired_angular_resolution >= 2.0f*original_angular_resolution)
skip = static_cast<int> (pcl_lrint (std::floor (desired_angular_resolution / original_angular_resolution)));
Expand Down
2 changes: 1 addition & 1 deletion features/include/pcl/features/impl/boundary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pcl::BoundaryEstimation<PointInT, PointNT, PointOutT>::isBoundaryPoint (
if (delta == Eigen::Vector4f::Zero())
continue;

angles[cp++] = atan2f (v.dot (delta), u.dot (delta)); // the angles are fine between -PI and PI too
angles[cp++] = std::atan2 (v.dot (delta), u.dot (delta)); // the angles are fine between -PI and PI too
}
if (cp == 0)
return (false);
Expand Down
4 changes: 2 additions & 2 deletions features/include/pcl/features/impl/brisk_2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ pcl::BRISK2DEstimation<PointInT, PointOutT, KeypointT, IntensityT>::compute (
direction0 += tmp0;
direction1 += tmp1;
}
kp.angle = atan2f (float (direction1), float (direction0)) / float (M_PI) * 180.0f;
kp.angle = std::atan2 (float (direction1), float (direction0)) / float (M_PI) * 180.0f;
theta = static_cast<int> ((float (n_rot_) * kp.angle) / (360.0f) + 0.5f);
if (theta < 0)
theta += n_rot_;
Expand All @@ -604,7 +604,7 @@ pcl::BRISK2DEstimation<PointInT, PointOutT, KeypointT, IntensityT>::compute (
else
{
// figure out the direction:
//int theta=rotationInvariance*round((_n_rot*atan2(direction.at<int>(0,0),direction.at<int>(1,0)))/(2*M_PI));
//int theta=rotationInvariance*round((_n_rot*std::atan2(direction.at<int>(0,0),direction.at<int>(1,0)))/(2*M_PI));
if (!rotation_invariance_enabled_)
theta = 0;
else
Expand Down
2 changes: 1 addition & 1 deletion features/include/pcl/features/impl/cppf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ pcl::CPPFEstimation<PointInT, PointNT, PointOutT>::computeFeature (PointCloudOut
Eigen::Affine3f transform_mg = Eigen::Translation3f ( rotation_mg * ((-1) * model_reference_point)) * rotation_mg;

Eigen::Vector3f model_point_transformed = transform_mg * model_point;
float angle = atan2f ( -model_point_transformed(2), model_point_transformed(1));
float angle = std::atan2 ( -model_point_transformed(2), model_point_transformed(1));
if (std::sin (angle) * model_point_transformed(2) < 0.0f)
angle *= (-1);
p.alpha_m = -angle;
Expand Down
2 changes: 1 addition & 1 deletion features/include/pcl/features/impl/crh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pcl::CRHEstimation<PointInT, PointNT, PointOutT>::computeFeature (PointCloudOut
int bin = 0;
for (const auto &point : grid.points)
{
bin = static_cast<int> ((((atan2 (point.normal_y, point.normal_x) + M_PI) * 180 / M_PI) / bin_angle)) % nbins;
bin = static_cast<int> ((((std::atan2 (point.normal_y, point.normal_x) + M_PI) * 180 / M_PI) / bin_angle)) % nbins;
w = std::sqrt (point.normal_y * point.normal_y + point.normal_x * point.normal_x);
sum_w += w;
spatial_data[bin] += w;
Expand Down
2 changes: 1 addition & 1 deletion features/include/pcl/features/impl/ppf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pcl::PPFEstimation<PointInT, PointNT, PointOutT>::computeFeature (PointCloudOut
Eigen::Affine3f transform_mg (Eigen::Translation3f ( rotation_mg * ((-1) * model_reference_point)) * rotation_mg);

Eigen::Vector3f model_point_transformed = transform_mg * model_point;
float angle = atan2f ( -model_point_transformed(2), model_point_transformed(1));
float angle = std::atan2 ( -model_point_transformed(2), model_point_transformed(1));
if (std::sin (angle) * model_point_transformed(2) < 0.0f)
angle *= (-1);
p.alpha_m = -angle;
Expand Down
2 changes: 1 addition & 1 deletion features/include/pcl/features/impl/ppfrgb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pcl::PPFRGBEstimation<PointInT, PointNT, PointOutT>::computeFeature (PointCloudO
Eigen::Affine3f transform_mg = Eigen::Translation3f ( rotation_mg * ((-1) * model_reference_point)) * rotation_mg;

Eigen::Vector3f model_point_transformed = transform_mg * model_point;
float angle = atan2f ( -model_point_transformed(2), model_point_transformed(1));
float angle = std::atan2 ( -model_point_transformed(2), model_point_transformed(1));
if (std::sin (angle) * model_point_transformed(2) < 0.0f)
angle *= (-1);
p.alpha_m = -angle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ float RangeImageBorderExtractor::getObstacleBorderAngle(const BorderTraits& bord
if (border_traits[BORDER_TRAIT__OBSTACLE_BORDER_BOTTOM])
++y;

return atan2f(y, x);
return std::atan2(y, x);
}

inline std::ostream& operator << (std::ostream& os, const RangeImageBorderExtractor::Parameters& p)
Expand Down
4 changes: 2 additions & 2 deletions features/include/pcl/features/impl/shot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ pcl::SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::interpolateSing
if (yInFeatRef != 0.0 || xInFeatRef != 0.0)
{
//Interpolation on the azimuth (adjacent horizontal volumes)
double azimuth = atan2 (yInFeatRef, xInFeatRef);
double azimuth = std::atan2 (yInFeatRef, xInFeatRef);

int sel = desc_index >> 2;
double angularSectorSpan = PST_RAD_45;
Expand Down Expand Up @@ -602,7 +602,7 @@ pcl::SHOTColorEstimation<PointInT, PointNT, PointOutT, PointRFT>::interpolateDou
if (yInFeatRef != 0.0 || xInFeatRef != 0.0)
{
//Interpolation on the azimuth (adjacent horizontal volumes)
double azimuth = atan2 (yInFeatRef, xInFeatRef);
double azimuth = std::atan2 (yInFeatRef, xInFeatRef);

int sel = desc_index >> 2;
double angularSectorSpan = PST_RAD_45;
Expand Down
2 changes: 1 addition & 1 deletion features/src/narf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Narf::extractDescriptor (int descriptor_size)
current_cell += current_weight * diff;
}
// Scaling for easy descriptor distances:
current_cell = atan2f (current_cell, max_dist) / deg2rad(180.0f); // Scales the result to [-0.5, 0.5]
current_cell = std::atan2 (current_cell, max_dist) / deg2rad(180.0f); // Scales the result to [-0.5, 0.5]
descriptor_value = current_cell;
}
return true;
Expand Down
4 changes: 2 additions & 2 deletions features/src/pfh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pcl::computePairFeatures (const Eigen::Vector4f &p1, const Eigen::Vector4f &n1,
f2 = v.dot (n2_copy);
w[3] = 0.0f;
// Compute f1 = arctan (w * n2, u * n2) i.e. angle of n2 in the x=u, y=w coordinate system
f1 = atan2f (w.dot (n2_copy), n1_copy.dot (n2_copy)); // @todo optimize this
f1 = std::atan2 (w.dot (n2_copy), n1_copy.dot (n2_copy)); // @todo optimize this

return (true);
}
Expand Down Expand Up @@ -147,7 +147,7 @@ pcl::computeRGBPairFeatures (const Eigen::Vector4f &p1, const Eigen::Vector4f &n
f2 = v.dot (n2_copy);
w[3] = 0.0f;
// Compute f1 = arctan (w * n2, u * n2) i.e. angle of n2 in the x=u, y=w coordinate system
f1 = atan2f (w.dot (n2_copy), n1_copy.dot (n2_copy)); // @todo optimize this
f1 = std::atan2 (w.dot (n2_copy), n1_copy.dot (n2_copy)); // @todo optimize this

// everything before was standard 4D-Darboux frame feature pair
// now, for the experimental color stuff
Expand Down
4 changes: 2 additions & 2 deletions features/src/range_image_border_extractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ RangeImageBorderExtractor::getAnglesImageForBorderDirections ()
range_image_->getImagePoint(point.x+tmp_factor*border_direction[0], point.y+tmp_factor*border_direction[1], point.z+tmp_factor*border_direction[2],
border_direction_in_image_x, border_direction_in_image_y);
border_direction_in_image_x -= static_cast<float> (x); border_direction_in_image_y -= static_cast<float> (y);
angle = atan2f (border_direction_in_image_y, border_direction_in_image_x);
angle = std::atan2 (border_direction_in_image_y, border_direction_in_image_x);
}
}
return angles_image;
Expand Down Expand Up @@ -339,7 +339,7 @@ RangeImageBorderExtractor::getAnglesImageForSurfaceChangeDirections ()
range_image_->getImagePoint(point.x+tmp_factor*direction[0], point.y+tmp_factor*direction[1], point.z+tmp_factor*direction[2],
border_direction_in_image_x, border_direction_in_image_y);
border_direction_in_image_x -= static_cast<float> (x); border_direction_in_image_y -= static_cast<float> (y);
angle = atan2f (border_direction_in_image_y, border_direction_in_image_x);
angle = std::atan2 (border_direction_in_image_y, border_direction_in_image_x);
if (angle <= deg2rad (-90.0f))
angle += static_cast<float> (M_PI);
else if (angle > deg2rad (90.0f))
Expand Down
2 changes: 1 addition & 1 deletion filters/include/pcl/filters/impl/conditional_removal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ pcl::PackedHSIComparison<PointT>::evaluate (const PointT &point) const
// definitions taken from http://en.wikipedia.org/wiki/HSL_and_HSI
float hx = (2.0f * r_ - g_ - b_) / 4.0f; // hue x component -127 to 127
float hy = static_cast<float> (g_ - b_) * 111.0f / 255.0f; // hue y component -111 to 111
h_ = static_cast<int8_t> (atan2(hy, hx) * 128.0f / M_PI);
h_ = static_cast<int8_t> (std::atan2(hy, hx) * 128.0f / M_PI);

int32_t i = (r_+g_+b_)/3; // 0 to 255
i_ = static_cast<uint8_t> (i);
Expand Down
2 changes: 1 addition & 1 deletion gpu/features/include/pcl/gpu/features/device/eigen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ namespace pcl

// Compute the eigenvalues by solving for the roots of the polynomial.
float rho = sqrtf(-a_over_3);
float theta = atan2f (sqrtf (-q), half_b)*s_inv3;
float theta = std::atan2 (sqrtf (-q), half_b)*s_inv3;
float cos_theta = __cosf (theta);
float sin_theta = __sinf (theta);
roots.x = c2_over_3 + 2.f * rho * cos_theta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ namespace pcl

float3 w = cross(n1_copy, v);
// Compute f1 = arctan (w * n2, u * n2) i.e. angle of n2 in the x=u, y=w coordinate system
f1 = atan2f (dot(w, n2_copy), dot(n1_copy, n2_copy)); // @todo optimize this
f1 = std::atan2 (dot(w, n2_copy), dot(n1_copy, n2_copy)); // @todo optimize this

return true;
}
Expand Down Expand Up @@ -127,7 +127,7 @@ namespace pcl
f2 = dot(v, n2_copy);

// Compute f1 = arctan (w * n2, u * n2) i.e. angle of n2 in the x=u, y=w coordinate system
f1 = atan2f (dot(w, n2_copy), dot (n1_copy, n2_copy));
f1 = std::atan2 (dot(w, n2_copy), dot (n1_copy, n2_copy));

// everything before was standard 4D-Darboux frame feature pair
// now, for the experimental color stuff
Expand Down Expand Up @@ -202,7 +202,7 @@ namespace pcl
model_point_transformed.z = traslation.z + row3.x * model_point.x + row3.y * model_point.y + row3.z * model_point.z;


float angle = atan2f ( -model_point_transformed.z, model_point_transformed.y);
float angle = std::atan2 ( -model_point_transformed.z, model_point_transformed.y);

if (sinf(angle) * model_point_transformed.z < 0.0f)
//if (angle * model_point_transformed.z < 0.ff)
Expand Down
2 changes: 1 addition & 1 deletion gpu/kinfu/src/cuda/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ namespace pcl

// Compute the eigenvalues by solving for the roots of the polynomial.
float rho = sqrtf(-a_over_3);
float theta = atan2f (sqrtf (-q), half_b)*s_inv3;
float theta = std::atan2 (sqrtf (-q), half_b)*s_inv3;
float cos_theta = __cosf (theta);
float sin_theta = __sinf (theta);
roots.x = c2_over_3 + 2.f * rho * cos_theta;
Expand Down
6 changes: 3 additions & 3 deletions gpu/kinfu/tools/kinfu_app_sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,8 @@ generate_halo(
double x = halo_r*cos(t);
double y = halo_r*sin(t);
double z = halo_dz;
double pitch =atan2( halo_dz,halo_r);
double yaw = atan2(-y,-x);
double pitch =std::atan2( halo_dz,halo_r);
double yaw = std::atan2(-y,-x);

Eigen::Isometry3d pose;
pose.setIdentity();
Expand Down Expand Up @@ -918,7 +918,7 @@ struct KinFuApp
image_view_.viewerDepth_.registerKeyboardCallback (keyboard_callback, (void*)this);

float diag = sqrt ((float)kinfu_.cols () * kinfu_.cols () + kinfu_.rows () * kinfu_.rows ());
scene_cloud_view_.cloud_viewer_.setCameraFieldOfView (2 * atan (diag / (2 * f)) * 1.5);
scene_cloud_view_.cloud_viewer_.setCameraFieldOfView (2 * std::atan (diag / (2 * f)) * 1.5);

scene_cloud_view_.toggleCube(volume_size);
}
Expand Down
2 changes: 1 addition & 1 deletion gpu/kinfu_large_scale/src/cuda/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ namespace pcl

// Compute the eigenvalues by solving for the roots of the polynomial.
float rho = sqrtf(-a_over_3);
float theta = atan2f (sqrtf (-q), half_b)*s_inv3;
float theta = std::atan2 (sqrtf (-q), half_b)*s_inv3;
float cos_theta = __cosf (theta);
float sin_theta = __sinf (theta);
roots.x = c2_over_3 + 2.f * rho * cos_theta;
Expand Down
4 changes: 2 additions & 2 deletions gpu/kinfu_large_scale/tools/kinfuLS_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,9 @@ struct SceneCloudView
p1.x=0; p1.y=0; p1.z=0;
double dist = 0.75;
double minX, minY, maxX, maxY;
maxX = dist*tan (atan (width / (2.0*focal)));
maxX = dist*tan (std::atan (width / (2.0*focal)));
minX = -maxX;
maxY = dist*tan (atan (height / (2.0*focal)));
maxY = dist*tan (std::atan (height / (2.0*focal)));
minY = -maxY;
p2.x=minX; p2.y=minY; p2.z=dist;
p3.x=maxX; p3.y=minY; p3.z=dist;
Expand Down
6 changes: 3 additions & 3 deletions gpu/kinfu_large_scale/tools/kinfu_app_sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ generate_halo(
double x = halo_r*cos(t);
double y = halo_r*sin(t);
double z = halo_dz;
double pitch =atan2( halo_dz,halo_r);
double yaw = atan2(-y,-x);
double pitch =std::atan2( halo_dz,halo_r);
double yaw = std::atan2(-y,-x);

Eigen::Isometry3d pose;
pose.setIdentity();
Expand Down Expand Up @@ -916,7 +916,7 @@ struct KinFuApp
image_view_.viewerDepth_.registerKeyboardCallback (keyboard_callback, (void*)this);

float diag = sqrt ((float)kinfu_.cols () * kinfu_.cols () + kinfu_.rows () * kinfu_.rows ());
scene_cloud_view_.cloud_viewer_.setCameraFieldOfView (2 * atan (diag / (2 * f)) * 1.5);
scene_cloud_view_.cloud_viewer_.setCameraFieldOfView (2 * std::atan (diag / (2 * f)) * 1.5);

scene_cloud_view_.toggleCube(volume_size);
}
Expand Down
4 changes: 2 additions & 2 deletions gpu/kinfu_large_scale/tools/standalone_texture_mapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ void showCameras (pcl::texture_mapping::CameraVector cams, pcl::PointCloud<pcl::
p1.x=0; p1.y=0; p1.z=0;
double dist = 0.75;
double minX, minY, maxX, maxY;
maxX = dist*tan (atan (width / (2.0*focal)));
maxX = dist*tan (std::atan (width / (2.0*focal)));
minX = -maxX;
maxY = dist*tan (atan (height / (2.0*focal)));
maxY = dist*tan (std::atan (height / (2.0*focal)));
minY = -maxY;
p2.x=minX; p2.y=minY; p2.z=dist;
p3.x=maxX; p3.y=minY; p3.z=dist;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,13 @@ computeMaxColorGradients ()
if (sqr_mag_r > sqr_mag_g && sqr_mag_r > sqr_mag_b)
{
gradient.magnitude = sqrt (sqr_mag_r);
gradient.angle = atan2 (r_dy, r_dx) * 180.0f / pi;
gradient.angle = std::atan2 (r_dy, r_dx) * 180.0f / pi;
}
else if (sqr_mag_g > sqr_mag_b)
{
//GradientXY gradient;
gradient.magnitude = sqrt (sqr_mag_g);
gradient.angle = atan2 (g_dy, g_dx) * 180.0f / pi;
gradient.angle = std::atan2 (g_dy, g_dx) * 180.0f / pi;
//gradient.x = col_index;
//gradient.y = row_index;

Expand All @@ -235,7 +235,7 @@ computeMaxColorGradients ()
{
//GradientXY gradient;
gradient.magnitude = sqrt (sqr_mag_b);
gradient.angle = atan2 (b_dy, b_dx) * 180.0f / pi;
gradient.angle = std::atan2 (b_dy, b_dx) * 180.0f / pi;
//gradient.x = col_index;
//gradient.y = row_index;

Expand Down
Loading

0 comments on commit 362d6f1

Please sign in to comment.