[Jderobot-admin] jderobot-r1016 - trunk/src/stable/components/rgbdCalibrator

rocapal en jderobot.org rocapal en jderobot.org
Lun Oct 7 16:46:44 CEST 2013


Author: rocapal
Date: 2013-10-07 16:45:43 +0200 (Mon, 07 Oct 2013)
New Revision: 1016

Modified:
   trunk/src/stable/components/rgbdCalibrator/viewer.cpp
Log:
#27 added control if the directory doesn't exist


Modified: trunk/src/stable/components/rgbdCalibrator/viewer.cpp
===================================================================
--- trunk/src/stable/components/rgbdCalibrator/viewer.cpp	2013-10-07 14:25:04 UTC (rev 1015)
+++ trunk/src/stable/components/rgbdCalibrator/viewer.cpp	2013-10-07 14:45:43 UTC (rev 1016)
@@ -38,7 +38,7 @@
 const std::string gladepath = std::string(GLADE_DIR) +
 		std::string("/rgbdCalibrator.glade");
 
-const std::string pathImage = "./images/";
+const std::string pathImage = "./images2/";
 
 
 Viewer::Viewer()
@@ -422,6 +422,7 @@
 			boost::filesystem::path dir(pathImage);
 			if (!boost::filesystem::create_directory(dir))
 				std::cout << "Error to create directory" << std::endl;
+
 		}
 
 
@@ -478,6 +479,13 @@
 	flag |= CV_CALIB_ZERO_TANGENT_DIST;
 	flag |= CV_CALIB_FIX_ASPECT_RATIO;
 
+
+	if ( !boost::filesystem::exists(pathImage))
+	{
+		std::cerr << "[E] Images calibration directory doesn't exist: " << pathImage << std::endl;
+		return;
+	}
+
 	// List of images
 	boost::filesystem::directory_iterator end_itr;
 	for ( boost::filesystem::directory_iterator itr( pathImage ); itr != end_itr; ++itr )



More information about the Jderobot-admin mailing list