Skip to content
Snippets Groups Projects
Commit fcf2a6c3 authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

ENH : add pi variation

parent 0cb3e7b6
No related branches found
No related tags found
No related merge requests found
...@@ -112,7 +112,7 @@ SpectralAngleDistanceImageFilter<TInputImage,TOutputImage> ...@@ -112,7 +112,7 @@ SpectralAngleDistanceImageFilter<TInputImage,TOutputImage>
} }
//------ This part was supressed since the filter must perform only the spectral angle computation --- //------ This part was supressed since the filter must perform only the spectral angle computation ---
// Spectral angle normalisation // Spectral angle normalisation
// dist = dist/(CONST_PI/2); // dist = dist/(CONST_PI_2);
//square ponderation //square ponderation
// dist = vcl_sqrt(dist); // dist = vcl_sqrt(dist);
outputIt.Set(static_cast<OutputPixelType>(dist)); outputIt.Set(static_cast<OutputPixelType>(dist));
......
...@@ -46,8 +46,11 @@ const double CONST_LN10 = 2.30258509299404568402; /* log_e 10 */ ...@@ -46,8 +46,11 @@ const double CONST_LN10 = 2.30258509299404568402; /* log_e 10 */
const double CONST_PI = 3.14159265358979323846; /* pi */ const double CONST_PI = 3.14159265358979323846; /* pi */
const double CONST_PI_2 = 1.57079632679489661923; /* pi/2 */ const double CONST_PI_2 = 1.57079632679489661923; /* pi/2 */
const double CONST_PI_4 = 0.78539816339744830962; /* pi/4 */ const double CONST_PI_4 = 0.78539816339744830962; /* pi/4 */
const double CONST_PI_8 = 0.39269908169872415481; /* pi/8 */
const double CONST_1_PI = 0.31830988618379067154; /* 1/pi */ const double CONST_1_PI = 0.31830988618379067154; /* 1/pi */
const double CONST_2_PI = 0.63661977236758134308; /* 2/pi */ const double CONST_2_PI = 0.63661977236758134308; /* 2/pi */
const double CONST_2PI = 6.28318530717958647693; /* 2*pi */
const double CONST_PI_180 = 0.01745329251994329577; /* pi/180 */
const double CONST_2_SQRTPI = 1.12837916709551257390; /* 2/sqrt(pi) */ const double CONST_2_SQRTPI = 1.12837916709551257390; /* 2/sqrt(pi) */
const double CONST_SQRT2 = 1.41421356237309504880; /* sqrt(2) */ const double CONST_SQRT2 = 1.41421356237309504880; /* sqrt(2) */
const double CONST_SQRT1_2 = 0.70710678118654752440; /* 1/sqrt(2) */ const double CONST_SQRT1_2 = 0.70710678118654752440; /* 1/sqrt(2) */
......
...@@ -109,7 +109,7 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet> ...@@ -109,7 +109,7 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet>
double Angle = this->ComputeAngleFormedBySegments(*itLinesListTest, *itLinesListCur); double Angle = this->ComputeAngleFormedBySegments(*itLinesListTest, *itLinesListCur);
/** Check if the angle is a right one */ /** Check if the angle is a right one */
if(vcl_abs(Angle - CONST_PI/2.) <= m_ThresholdAngle ) if(vcl_abs(Angle - CONST_PI_2) <= m_ThresholdAngle )
{ {
/** Right angle coordinate*/ /** Right angle coordinate*/
PointType RightAngleCoordinate; PointType RightAngleCoordinate;
......
...@@ -248,7 +248,7 @@ void PixelSuppressionByDirectionImageFilter< TInputImage, TOutputImage>::Threade ...@@ -248,7 +248,7 @@ void PixelSuppressionByDirectionImageFilter< TInputImage, TOutputImage>::Threade
while (Thetaxtyt < 0) while (Thetaxtyt < 0)
Thetaxtyt = CONST_PI + Thetaxtyt; // Theta is now [0,PI] as is Thetaxtyt = CONST_PI + Thetaxtyt; // Theta is now [0,PI] as is
// the result of detectors // the result of detectors
while (Thetaxtyt > CONST_PI/2.0) while (Thetaxtyt > CONST_PI_2)
Thetaxtyt = Thetaxtyt-CONST_PI; // Theta is now [-PI/2,PI/2] Thetaxtyt = Thetaxtyt-CONST_PI; // Theta is now [-PI/2,PI/2]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment