From 2e64c95e1ae8aece480ad659e2d73e5c4a10bd31 Mon Sep 17 00:00:00 2001
From: Rainer Kartmann <rainer.kartmann@kit.edu>
Date: Wed, 1 Sep 2021 18:41:38 +0200
Subject: [PATCH] Disable image storing in example client

---
 .../ExampleMemoryClient.cpp                   | 26 ++++++++++---------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/source/RobotAPI/components/armem/client/ExampleMemoryClient/ExampleMemoryClient.cpp b/source/RobotAPI/components/armem/client/ExampleMemoryClient/ExampleMemoryClient.cpp
index 2fc185edc..1db77c2f3 100644
--- a/source/RobotAPI/components/armem/client/ExampleMemoryClient/ExampleMemoryClient.cpp
+++ b/source/RobotAPI/components/armem/client/ExampleMemoryClient/ExampleMemoryClient.cpp
@@ -39,8 +39,12 @@
 
 #include <RobotAPI/components/armem/server/ExampleMemory/aron/ExampleData.aron.generated.h>
 
+#define STORE_IMAGES 0
+
+#if STORE_IMAGES
 #include <opencv2/imgcodecs.hpp>
 #include <opencv2/imgproc.hpp>
+#endif
 
 
 namespace armarx
@@ -415,12 +419,11 @@ namespace armarx
                     pixel.z = color.b;
                 });
 
-                if (true)
-                {
-                    cv::Mat out;
-                    cv::cvtColor(image, out, CV_RGB2BGR);
-                    cv::imwrite("the_rgb24_image.png", out);
-                }
+#if STORE_IMAGES
+                cv::Mat out;
+                cv::cvtColor(image, out, CV_RGB2BGR);
+                cv::imwrite("the_rgb24_image.png", out);
+#endif
             }
             {
                 cv::Mat& image = data.the_depth32_image;
@@ -430,6 +433,7 @@ namespace armarx
                     pixel = 100 * float(position[0] + position[1]) / float(image.rows + image.cols);
                 });
 
+#if STORE_IMAGES
                 cmap.set_vlimits(0, 100);
                 cv::Mat rgb(image.rows, image.cols, CV_8UC3);
                 using Pixel = cv::Point3_<uint8_t>;
@@ -441,12 +445,10 @@ namespace armarx
                     pixel.z = color.b;
                 });
 
-                if (true)
-                {
-                    cv::Mat out;
-                    cv::cvtColor(rgb, out, CV_RGB2BGR);
-                    cv::imwrite("the_depth32_image.png", out);
-                }
+                cv::Mat out;
+                cv::cvtColor(rgb, out, CV_RGB2BGR);
+                cv::imwrite("the_depth32_image.png", out);
+#endif
             }
 
             update.instancesData = { data.toAron() };
-- 
GitLab