summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/compute_image_mean.cpp4
-rw-r--r--tools/convert_imageset.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/tools/compute_image_mean.cpp b/tools/compute_image_mean.cpp
index b1fc7cae..2035d515 100644
--- a/tools/compute_image_mean.cpp
+++ b/tools/compute_image_mean.cpp
@@ -24,6 +24,7 @@ DEFINE_string(backend, "lmdb",
int main(int argc, char** argv) {
::google::InitGoogleLogging(argv[0]);
+#ifdef USE_OPENCV
#ifndef GFLAGS_GFLAGS_H_
namespace gflags = google;
#endif
@@ -115,5 +116,8 @@ int main(int argc, char** argv) {
}
LOG(INFO) << "mean_value channel [" << c << "]:" << mean_values[c] / dim;
}
+#else
+ LOG(FATAL) << "This tool requires OpenCV; compile with USE_OPENCV.";
+#endif // USE_OPENCV
return 0;
}
diff --git a/tools/convert_imageset.cpp b/tools/convert_imageset.cpp
index aad1f1fe..e51a2631 100644
--- a/tools/convert_imageset.cpp
+++ b/tools/convert_imageset.cpp
@@ -43,6 +43,7 @@ DEFINE_string(encode_type, "",
"Optional: What type should we encode the image as ('png','jpg',...).");
int main(int argc, char** argv) {
+#ifdef USE_OPENCV
::google::InitGoogleLogging(argv[0]);
// Print output to stderr (while still logging)
FLAGS_alsologtostderr = 1;
@@ -150,5 +151,8 @@ int main(int argc, char** argv) {
txn->Commit();
LOG(INFO) << "Processed " << count << " files.";
}
+#else
+ LOG(FATAL) << "This tool requires OpenCV; compile with USE_OPENCV.";
+#endif // USE_OPENCV
return 0;
}