From 6fc555f8d80f741f2c2b8eaa3fadc5c1fe2b7a72 Mon Sep 17 00:00:00 2001 From: Alexander Munch-Hansen Date: Wed, 24 Apr 2019 09:41:11 +0200 Subject: [PATCH] Cleanup --- AR-3/Assets/python_test.cs | 43 +++----------------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/AR-3/Assets/python_test.cs b/AR-3/Assets/python_test.cs index da860ec..3b27970 100644 --- a/AR-3/Assets/python_test.cs +++ b/AR-3/Assets/python_test.cs @@ -96,15 +96,15 @@ public class python_test : MonoBehaviour if (Input.GetKeyDown("space")) { + // TODO: We should clone camImageMat again, instead of the loadedImage I use now /* var camImgCopy = camImageMat.clone(); outputMat = camImageMat.clone(); */ print("------------------------------------"); - print(loadedImage.size()); - outputMat = camImgCopy.clone(); + print(loadedImage.size()); camImageMat = loadedImage.clone(); print("------------------------------------"); @@ -128,11 +128,6 @@ public class python_test : MonoBehaviour } } - - Imgproc.warpPerspective(camImgCopy, outputMat, homography, new Size(baselineWidth, baselineHeight)); - - - //List points = new List(); MatOfPoint2f points = new MatOfPoint2f(); points.alloc(64); @@ -143,27 +138,12 @@ public class python_test : MonoBehaviour for (int x = 1; x < 9; x++) { var cur_pos = board[x - 1][y - 1]; - points.put(indexer, 0, (cur_pos != 6 ? 1 : 0) * y * 165, (cur_pos != 6 ? 1 : 0) * x * 165); + points.put(indexer, 0, (cur_pos != 6 ? 1 : -200) * y * 165, (cur_pos != 6 ? 1 : -200) * x * 165); indexer += 1; } } - /* - int cur_level = 0; - int index = 0; - for (int x = 0; x < 8; x++) - { - cur_level += 165; - foreach (int y in new List { 150, 315 }) - { - - points.put(index, 0, cur_level, y); - index += 1; - //Imgproc.circle(outputMat, new Point(cur_level, y), 50, new Scalar(255, 0, 0), -1); - } - }*/ - MatOfPoint2f dstPoints = new MatOfPoint2f(); Core.perspectiveTransform(points, dstPoints, homography.inv()); @@ -177,23 +157,6 @@ public class python_test : MonoBehaviour MatDisplay.DisplayMat(loadedImage, MatDisplaySettings.FULL_BACKGROUND); displayWarped = true; - - /* - if (displayWarped) - { - camImgCopy = loadedImage.clone(); - Mat tmpCopy = camImgCopy.clone(); - Imgproc.warpPerspective(outputMat,tmpCopy, homography.inv(), camImgCopy.size()); - Core.addWeighted(tmpCopy, 0.80f, camImgCopy, 0.7f, 0.0f, camImgCopy); - displayWarped = false; - } - else - { - displayWarped = true; - MatDisplay.DisplayMat(outputMat, MatDisplaySettings.FULL_BACKGROUND); - - } - */ }