diff --git a/Examples/FeatureExtraction/LineSegmentDetectorExample.cxx b/Examples/FeatureExtraction/LineSegmentDetectorExample.cxx
index b6e96789b7b8a72be915c58ebb0e1f0475a73ece..45457bf862564c8d7bd15708a2516e14d18bae06 100644
--- a/Examples/FeatureExtraction/LineSegmentDetectorExample.cxx
+++ b/Examples/FeatureExtraction/LineSegmentDetectorExample.cxx
@@ -46,6 +46,12 @@
 
 int main(int argc, char * argv[])
 {
+  if (argc != 3)
+  {
+    std::cerr << "Usage: ./LineSegmentDetectorExample input output\n";
+    return EXIT_FAILURE;
+  }
+
   const char* infname  = argv[1];
   const char* outfname = argv[2];
 
diff --git a/Examples/FeatureExtraction/RightAngleDetectionExample.cxx b/Examples/FeatureExtraction/RightAngleDetectionExample.cxx
index 3a059bbfb4aa284552795d324289a37a21e55d8d..29c80c5426ceb3aa223f7ed119db54d796c9198e 100644
--- a/Examples/FeatureExtraction/RightAngleDetectionExample.cxx
+++ b/Examples/FeatureExtraction/RightAngleDetectionExample.cxx
@@ -52,11 +52,17 @@
 
 int main(int argc, char * argv[])
 {
+  if (argc != 6)
+  {
+    std::cerr << "Usage: ./RightAngleDetectionExample input lsdOutput rightAngleOutput angleThreshold distanceThreshold\n";
+    return EXIT_FAILURE;
+  }
+
   const char* infname                  = argv[1];
   const char* lsdOutputFilename        = argv[2];
   const char* rightAngleOutputFilename = argv[3];
-  double      angleThreshold           = atof(argv[5]);
-  double      distanceThreshold        = atof(argv[6]);
+  double      angleThreshold           = atof(argv[4]);
+  double      distanceThreshold        = atof(argv[5]);
 
   const unsigned int Dimension = 2;
   typedef unsigned char PixelType;