diff --git a/Code/FeatureExtraction/otbLineSegmentDetector.txx b/Code/FeatureExtraction/otbLineSegmentDetector.txx
index 6a0790c2ba72225f5433453c18688b5a580f9084..5ae1b2cde48098281b316957c2287d4d19a0ded7 100644
--- a/Code/FeatureExtraction/otbLineSegmentDetector.txx
+++ b/Code/FeatureExtraction/otbLineSegmentDetector.txx
@@ -158,7 +158,7 @@ LineSegmentDetector<TInputImage, TPrecision>
   RegionType largestRegion = this->GetInput()->GetLargestPossibleRegion();
 
   // Compute the minimum region size
-  double logNT = 5. * vcl_log10( largestRegion.GetNumberOfPixels() ) / 2.;
+  double logNT = 5. * vcl_log10( static_cast<double>(largestRegion.GetNumberOfPixels()) ) / 2.;
   double log1_p = vcl_log10(m_DirectionsAllowed);
   double rapport = logNT / log1_p;
   m_MinimumRegionSize = static_cast<unsigned int>(-rapport);