From 19f69bebb0cb2a1645a1480b77dbc428f3c2bfcb Mon Sep 17 00:00:00 2001 From: Marisa Schmidt Date: Mon, 17 Apr 2023 14:54:38 +0200 Subject: [PATCH 1/3] switched to royale 5 --- sampleOpenCV.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sampleOpenCV.cpp b/sampleOpenCV.cpp index 15eae6b..f5e0f19 100644 --- a/sampleOpenCV.cpp +++ b/sampleOpenCV.cpp @@ -67,13 +67,17 @@ public : float *grayRowPtr = grayImage.ptr (y); for (int x = 0; x < zImage.cols; x++, k++) { - auto curPoint = data->points.at (k); - if (curPoint.depthConfidence > 0) + auto curX = data->getX(k); + auto curY = data->getY(k); + auto curZ = data->getZ(k); + auto curConf = data->getDepthConfidence(k); + auto curGray = data->getGrayValue(k); + if (curConf > 0) { // if the point is valid, map the pixel from 3D world // coordinates to a 2D plane (this will distort the image) - zRowPtr[x] = adjustZValue (curPoint.z); - grayRowPtr[x] = static_cast (curPoint.grayValue); + zRowPtr[x] = adjustZValue (curZ); + grayRowPtr[x] = static_cast (curGray); } } } From ca3f73dff6968a9714a6c05e400ccf0863150017 Mon Sep 17 00:00:00 2001 From: Marisa Schmidt Date: Fri, 16 Jun 2023 16:14:57 +0200 Subject: [PATCH 2/3] added for std::min to resolve error --- sampleOpenCV.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sampleOpenCV.cpp b/sampleOpenCV.cpp index f5e0f19..dfbf0ab 100644 --- a/sampleOpenCV.cpp +++ b/sampleOpenCV.cpp @@ -7,7 +7,6 @@ * PARTICULAR PURPOSE. * \****************************************************************************/ - #include #include #include @@ -173,7 +172,7 @@ public : // the max dist here is used as an example and can be modified float adjustZValue (float zValue) { - float clampedDist = std::min (2.5f, zValue); + float clampedDist = std::min (2.5f, zValue); float newZValue = clampedDist / 2.5f * 255.0f; return newZValue; } From 760f09d3a0c9aa2e1f7e4c2da4bb5ed8e07cedf7 Mon Sep 17 00:00:00 2001 From: Marisa Schmidt Date: Mon, 19 Jun 2023 08:13:48 +0200 Subject: [PATCH 3/3] updated path to royale installation in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ac26e2..06ad1f3 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This tutorial explains the "sampleOpenCV" which shows how you can use [OpenCV](h To run this sample you need to install a Royale binary version and additionaly the OpenCV library. This sample was tested with OpenCV version 4.6.0. After installing everything, you can start CMake. There you have to set the OpenCV_DIR to your OpenCV installation (e.g. C:/projects/opencv-4.6.0/opencv/build) -and the royale_DIR to the share folder of your Royale binary installation (e.g. D:\Program Files\royale\4.23.0.1062\share) and click **Generate**. +and the royale_DIR to the share folder of your Royale binary installation (e.g. D:\Program Files\royale\5.4.0.2112\lib\cmake) and click **Generate**. ## Code explanation In the beginning we declare a data listener and a camera device. We also declare the platform resources as this will call the CoInitializeEx function on Windows. Otherwise