diff --git a/bin/ICP.dll b/bin/ICP.dll deleted file mode 100644 index 7da16e1..0000000 Binary files a/bin/ICP.dll and /dev/null differ diff --git a/bin/ICP.exp b/bin/ICP.exp deleted file mode 100644 index eea1010..0000000 Binary files a/bin/ICP.exp and /dev/null differ diff --git a/bin/ICP.iobj b/bin/ICP.iobj deleted file mode 100644 index cfb9743..0000000 Binary files a/bin/ICP.iobj and /dev/null differ diff --git a/bin/ICP.ipdb b/bin/ICP.ipdb deleted file mode 100644 index 544f55e..0000000 Binary files a/bin/ICP.ipdb and /dev/null differ diff --git a/bin/ICP.lib b/bin/ICP.lib deleted file mode 100644 index fb43567..0000000 Binary files a/bin/ICP.lib and /dev/null differ diff --git a/bin/LiveScanClient.exe b/bin/LiveScanClient.exe deleted file mode 100644 index feebbfa..0000000 Binary files a/bin/LiveScanClient.exe and /dev/null differ diff --git a/bin/LiveScanClient.iobj b/bin/LiveScanClient.iobj deleted file mode 100644 index a5a8468..0000000 Binary files a/bin/LiveScanClient.iobj and /dev/null differ diff --git a/bin/LiveScanClient.ipdb b/bin/LiveScanClient.ipdb deleted file mode 100644 index 7eafef1..0000000 Binary files a/bin/LiveScanClient.ipdb and /dev/null differ diff --git a/bin/LiveScanClientD.exe b/bin/LiveScanClientD.exe deleted file mode 100644 index c6fd294..0000000 Binary files a/bin/LiveScanClientD.exe and /dev/null differ diff --git a/bin/LiveScanPlayer.exe b/bin/LiveScanPlayer.exe deleted file mode 100644 index 78bc658..0000000 Binary files a/bin/LiveScanPlayer.exe and /dev/null differ diff --git a/bin/LiveScanPlayer.exe.config b/bin/LiveScanPlayer.exe.config deleted file mode 100644 index 8e15646..0000000 --- a/bin/LiveScanPlayer.exe.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/bin/LiveScanServer.exe b/bin/LiveScanServer.exe deleted file mode 100644 index 5b4d13b..0000000 Binary files a/bin/LiveScanServer.exe and /dev/null differ diff --git a/bin/LiveScanServer.exe.config b/bin/LiveScanServer.exe.config deleted file mode 100644 index 8e15646..0000000 --- a/bin/LiveScanServer.exe.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/bin/depthengine_2_0.dll b/bin/depthengine_2_0.dll deleted file mode 100644 index 7f651e2..0000000 Binary files a/bin/depthengine_2_0.dll and /dev/null differ diff --git a/bin/k4a.dll b/bin/k4a.dll deleted file mode 100644 index 5978a94..0000000 Binary files a/bin/k4a.dll and /dev/null differ diff --git a/bin/k4arecord.dll b/bin/k4arecord.dll deleted file mode 100644 index 73b7ab1..0000000 Binary files a/bin/k4arecord.dll and /dev/null differ diff --git a/bin/settings.bin b/bin/settings.bin deleted file mode 100644 index f1a3eed..0000000 Binary files a/bin/settings.bin and /dev/null differ diff --git a/include/LiveScanClient/azureKinectCapture.h b/include/LiveScanClient/azureKinectCapture.h index 62f0099..e33144c 100644 --- a/include/LiveScanClient/azureKinectCapture.h +++ b/include/LiveScanClient/azureKinectCapture.h @@ -28,15 +28,14 @@ private: k4a_image_t colorImage = NULL; k4a_image_t depthImage = NULL; k4a_image_t pointCloudImage = NULL; - k4a_image_t transformed_depth_image = NULL; + k4a_image_t transformedDepthImage = NULL; k4a_image_t colorImageInDepth = NULL; k4a_image_t depthImageInColor = NULL; - k4a_image_t color_image_downscaled = NULL; - int color_image_downscaled_width; - int color_image_downscaled_height; + k4a_image_t colorImageDownscaled = NULL; + int colorImageDownscaledWidth; + int colorImageDownscaledHeight; k4a_transformation_t transformation = NULL; - k4a_transformation_t transformation_color_downscaled = NULL; - cv::Mat color_to_opencv(const k4a_image_t im); + k4a_transformation_t transformationColorDownscaled = NULL; void UpdateDepthPointCloud(); void UpdateDepthPointCloudForColorFrame(); }; \ No newline at end of file diff --git a/src/LiveScanClient/azureKinectCapture.cpp b/src/LiveScanClient/azureKinectCapture.cpp index ad18044..c9a9da8 100644 --- a/src/LiveScanClient/azureKinectCapture.cpp +++ b/src/LiveScanClient/azureKinectCapture.cpp @@ -16,8 +16,8 @@ AzureKinectCapture::~AzureKinectCapture() k4a_image_release(pointCloudImage); k4a_image_release(colorImageInDepth); k4a_image_release(depthImageInColor); - k4a_image_release(transformed_depth_image); - k4a_image_release(color_image_downscaled); + k4a_image_release(transformedDepthImage); + k4a_image_release(colorImageDownscaled); k4a_transformation_destroy(transformation); k4a_device_close(kinectSensor); } @@ -89,20 +89,20 @@ bool AzureKinectCapture::Initialize() //We calculate the minimum size that the color Image can be, while preserving its aspect ration float rescaleRatio = (float)calibration.color_camera_calibration.resolution_height / (float)depth_camera_height; - color_image_downscaled_height = depth_camera_height; - color_image_downscaled_width = calibration.color_camera_calibration.resolution_width / rescaleRatio; + colorImageDownscaledHeight = depth_camera_height; + colorImageDownscaledWidth = calibration.color_camera_calibration.resolution_width / rescaleRatio; //We don't only need the size in pixels of the downscaled color image, but also a new k4a_calibration_t which fits the new //sizes - k4a_calibration_t calibration_color_downscaled; - memcpy(&calibration_color_downscaled, &calibration, sizeof(k4a_calibration_t)); - calibration_color_downscaled.color_camera_calibration.resolution_width /= rescaleRatio; - calibration_color_downscaled.color_camera_calibration.resolution_height /= rescaleRatio; - calibration_color_downscaled.color_camera_calibration.intrinsics.parameters.param.cx /= rescaleRatio; - calibration_color_downscaled.color_camera_calibration.intrinsics.parameters.param.cy /= rescaleRatio; - calibration_color_downscaled.color_camera_calibration.intrinsics.parameters.param.fx /= rescaleRatio; - calibration_color_downscaled.color_camera_calibration.intrinsics.parameters.param.fy /= rescaleRatio; - transformation_color_downscaled = k4a_transformation_create(&calibration_color_downscaled); + k4a_calibration_t calibrationColorDownscaled; + memcpy(&calibrationColorDownscaled, &calibration, sizeof(k4a_calibration_t)); + calibrationColorDownscaled.color_camera_calibration.resolution_width /= rescaleRatio; + calibrationColorDownscaled.color_camera_calibration.resolution_height /= rescaleRatio; + calibrationColorDownscaled.color_camera_calibration.intrinsics.parameters.param.cx /= rescaleRatio; + calibrationColorDownscaled.color_camera_calibration.intrinsics.parameters.param.cy /= rescaleRatio; + calibrationColorDownscaled.color_camera_calibration.intrinsics.parameters.param.fx /= rescaleRatio; + calibrationColorDownscaled.color_camera_calibration.intrinsics.parameters.param.fy /= rescaleRatio; + transformationColorDownscaled = k4a_transformation_create(&calibrationColorDownscaled); std::chrono::time_point start = std::chrono::system_clock::now(); bool bTemp; @@ -144,7 +144,7 @@ bool AzureKinectCapture::AcquireFrame() } k4a_image_release(colorImage); - k4a_image_release(color_image_downscaled); + k4a_image_release(colorImageDownscaled); k4a_image_release(depthImage); colorImage = k4a_capture_get_color_image(capture); @@ -155,23 +155,23 @@ bool AzureKinectCapture::AcquireFrame() return false; } - //We need to resize the color image, so that it's height fits the depth camera height, while preserving the aspect ratio of the color camera + //We need to resize the color image, so that it's height fits the depth camera height, while preserving the aspect ratio of the color camera: //Convert the k4a_image to an OpenCV Mat cv::Mat cImg = cv::Mat(k4a_image_get_height_pixels(colorImage), k4a_image_get_width_pixels(colorImage), CV_8UC4, k4a_image_get_buffer(colorImage)); //Resize the k4a_image to the precalculated size. Takes quite along time, maybe there is a faster algorithm? - cv::resize(cImg, cImg, cv::Size(color_image_downscaled_width, color_image_downscaled_height), cv::INTER_NEAREST); + cv::resize(cImg, cImg, cv::Size(colorImageDownscaledWidth, colorImageDownscaledHeight), cv::INTER_LINEAR); //Create a k4a_image from the resized OpenCV Mat. Code taken from here: https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/978#issuecomment-566002061 - k4a_image_create(K4A_IMAGE_FORMAT_COLOR_BGRA32, cImg.cols, cImg.rows, cImg.cols * 4 * (int)sizeof(uint8_t), &color_image_downscaled); - memcpy(k4a_image_get_buffer(color_image_downscaled), &cImg.ptr(0)[0], cImg.rows * cImg.cols * sizeof(cv::Vec4b)); + k4a_image_create(K4A_IMAGE_FORMAT_COLOR_BGRA32, cImg.cols, cImg.rows, cImg.cols * 4 * (int)sizeof(uint8_t), &colorImageDownscaled); + memcpy(k4a_image_get_buffer(colorImageDownscaled), &cImg.ptr(0)[0], cImg.rows * cImg.cols * sizeof(cv::Vec4b)); if (pColorRGBX == NULL) { - nColorFrameHeight = k4a_image_get_height_pixels(color_image_downscaled); - nColorFrameWidth = k4a_image_get_width_pixels(color_image_downscaled); + nColorFrameHeight = k4a_image_get_height_pixels(colorImageDownscaled); + nColorFrameWidth = k4a_image_get_width_pixels(colorImageDownscaled); pColorRGBX = new RGB[nColorFrameWidth * nColorFrameHeight]; } @@ -184,7 +184,7 @@ bool AzureKinectCapture::AcquireFrame() - memcpy(pColorRGBX, k4a_image_get_buffer(color_image_downscaled), nColorFrameWidth * nColorFrameHeight * sizeof(RGB)); + memcpy(pColorRGBX, k4a_image_get_buffer(colorImageDownscaled), nColorFrameWidth * nColorFrameHeight * sizeof(RGB)); memcpy(pDepth, k4a_image_get_buffer(depthImage), nDepthFrameHeight * nDepthFrameWidth * sizeof(UINT16)); k4a_capture_release(capture); @@ -194,9 +194,9 @@ bool AzureKinectCapture::AcquireFrame() void AzureKinectCapture::UpdateDepthPointCloudForColorFrame() { - if (transformed_depth_image == NULL) + if (transformedDepthImage == NULL) { - k4a_image_create(K4A_IMAGE_FORMAT_DEPTH16, nColorFrameWidth, nColorFrameHeight, nColorFrameWidth * (int)sizeof(uint16_t), &transformed_depth_image); + k4a_image_create(K4A_IMAGE_FORMAT_DEPTH16, nColorFrameWidth, nColorFrameHeight, nColorFrameWidth * (int)sizeof(uint16_t), &transformedDepthImage); } if (pointCloudImage == NULL) @@ -204,9 +204,9 @@ void AzureKinectCapture::UpdateDepthPointCloudForColorFrame() k4a_image_create(K4A_IMAGE_FORMAT_CUSTOM, nColorFrameWidth, nColorFrameHeight, nColorFrameWidth * 3 * (int)sizeof(int16_t), &pointCloudImage); } - k4a_transformation_depth_image_to_color_camera(transformation_color_downscaled, depthImage, transformed_depth_image); + k4a_transformation_depth_image_to_color_camera(transformationColorDownscaled, depthImage, transformedDepthImage); - k4a_transformation_depth_image_to_point_cloud(transformation_color_downscaled, transformed_depth_image, K4A_CALIBRATION_TYPE_COLOR, pointCloudImage); + k4a_transformation_depth_image_to_point_cloud(transformationColorDownscaled, transformedDepthImage, K4A_CALIBRATION_TYPE_COLOR, pointCloudImage); } void AzureKinectCapture::UpdateDepthPointCloud() @@ -264,7 +264,7 @@ void AzureKinectCapture::MapDepthFrameToColorSpace(UINT16 *pDepthInColorSpace) &depthImageInColor); } - k4a_transformation_depth_image_to_color_camera(transformation_color_downscaled, depthImage, depthImageInColor); + k4a_transformation_depth_image_to_color_camera(transformationColorDownscaled, depthImage, depthImageInColor); memcpy(pDepthInColorSpace, k4a_image_get_buffer(depthImageInColor), nColorFrameHeight * nColorFrameWidth * (int)sizeof(uint16_t)); } @@ -278,19 +278,9 @@ void AzureKinectCapture::MapColorFrameToDepthSpace(RGB* pColorInDepthSpace) &colorImageInDepth); } - k4a_transformation_color_image_to_depth_camera(transformation_color_downscaled, depthImage, colorImage, colorImageInDepth); + k4a_transformation_color_image_to_depth_camera(transformationColorDownscaled, depthImage, colorImage, colorImageInDepth); memcpy(pColorInDepthSpace, k4a_image_get_buffer(colorImageInDepth), nDepthFrameHeight * nDepthFrameWidth * 4 * (int)sizeof(uint8_t)); } - -cv::Mat AzureKinectCapture::color_to_opencv(const k4a_image_t im) -{ - cv::Mat cv_image_with_alpha(k4a_image_get_height_pixels(im), k4a_image_get_width_pixels(im), CV_8UC4, k4a_image_get_buffer(im)); - cv::Mat cv_image_no_alpha; - cv::cvtColor(cv_image_with_alpha, cv_image_no_alpha, cv::COLOR_BGRA2BGR); - return cv_image_no_alpha; -} - -