From 1f12d31c0ba8935f42aec589cc2e688d5e911028 Mon Sep 17 00:00:00 2001 From: Tobi Date: Sat, 17 Aug 2019 14:45:12 +0200 Subject: [PATCH] Change Comments --- Assets/Scripts/CannyEdgeDetection/ImageProcessor.cs | 2 +- Assets/Scripts/ML Cozmo/CozmoAgent.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/CannyEdgeDetection/ImageProcessor.cs b/Assets/Scripts/CannyEdgeDetection/ImageProcessor.cs index beb9684..f2cb1eb 100644 --- a/Assets/Scripts/CannyEdgeDetection/ImageProcessor.cs +++ b/Assets/Scripts/CannyEdgeDetection/ImageProcessor.cs @@ -145,7 +145,7 @@ namespace Cozmo // Convert OpenCVSharp Mat object to Unity Texture2D object private void MatToTexture(Mat mat) { - // cannyImageData is byte array, because canny image is grayscale + // cannyImageData is byte array, because canny image is binary mat.GetArray(0, 0, cannyImageData); // create Color32 array that can be assigned to Texture2D directly Color32[] c = new Color32[croppedImHeight * imWidth]; diff --git a/Assets/Scripts/ML Cozmo/CozmoAgent.cs b/Assets/Scripts/ML Cozmo/CozmoAgent.cs index fbbae1a..d8209a0 100644 --- a/Assets/Scripts/ML Cozmo/CozmoAgent.cs +++ b/Assets/Scripts/ML Cozmo/CozmoAgent.cs @@ -152,7 +152,7 @@ namespace Cozmo { float range = centerOfImageX - nearAreaLimit; reward = -(1 - (centerOfGravityX / range)); - // Clamp the reward to max -1 in order to handle rewards if the center of gravity is outside of the image + // Clamp the reward to max -1 and divide it by 2 reward = Mathf.Clamp(reward, -1, 0) / 2; } // Center of gravity is near left of the center