mirror of
https://github.com/storytold/LiveScan3D.git
synced 2026-10-09 00:09:58 +00:00
Merge branch 'AzureKinect' into Azure_Kinect_Temp_Sync
This commit is contained in:
@@ -3,9 +3,10 @@
|
||||
#include "stdafx.h"
|
||||
#include "ICapture.h"
|
||||
#include <k4a/k4a.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
//#include "utils.h"
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include "utils.h"
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
|
||||
class AzureKinectCapture : public ICapture
|
||||
{
|
||||
@@ -25,17 +26,22 @@ public:
|
||||
int GetDeviceIndex();
|
||||
void SetExposureState(bool enableAutoExposure, int exposureStep);
|
||||
|
||||
|
||||
private:
|
||||
k4a_device_t kinectSensor = NULL;
|
||||
int32_t captureTimeoutMs = 1000;
|
||||
|
||||
k4a_image_t colorImage = NULL;
|
||||
k4a_image_t depthImage = NULL;
|
||||
k4a_image_t depthPointCloudImage = NULL;
|
||||
k4a_image_t pointCloudImage = NULL;
|
||||
k4a_image_t transformedDepthImage = NULL;
|
||||
k4a_image_t colorImageInDepth = NULL;
|
||||
k4a_image_t depthImageInColor = NULL;
|
||||
k4a_transformation_t transformation = NULL;
|
||||
k4a_image_t colorImageDownscaled = NULL;
|
||||
k4a_transformation_t transformationColorDownscaled = NULL;
|
||||
k4a_transformation_t transformation = NULL;
|
||||
|
||||
int colorImageDownscaledWidth;
|
||||
int colorImageDownscaledHeight;
|
||||
|
||||
bool syncInConnected = false;
|
||||
bool syncOutConnected = false;
|
||||
uint64_t currentTimeStamp = 0;
|
||||
@@ -44,6 +50,7 @@ private:
|
||||
int restartAttempts = 0;
|
||||
bool autoExposureEnabled = true;
|
||||
int exposureTimeStep = 0;
|
||||
|
||||
void UpdateDepthPointCloud();
|
||||
|
||||
void UpdateDepthPointCloudForColorFrame();
|
||||
};
|
||||
@@ -86,7 +86,7 @@ private:
|
||||
int frameRecordCounter;
|
||||
|
||||
Point3f* m_pCameraSpaceCoordinates;
|
||||
RGB* m_pColorInDepthSpace;
|
||||
RGB* m_pColorInColorSpace;
|
||||
UINT16* m_pDepthInColorSpace;
|
||||
|
||||
// Direct2D
|
||||
|
||||
@@ -59,16 +59,26 @@ typedef struct Point3f
|
||||
this->X = 0;
|
||||
this->Y = 0;
|
||||
this->Z = 0;
|
||||
this->Invalid = false;
|
||||
}
|
||||
Point3f(float X, float Y, float Z, bool invalid)
|
||||
{
|
||||
this->X = X;
|
||||
this->Y = Y;
|
||||
this->Z = Z;
|
||||
this->Invalid = invalid;
|
||||
}
|
||||
Point3f(float X, float Y, float Z)
|
||||
{
|
||||
this->X = X;
|
||||
this->Y = Y;
|
||||
this->Z = Z;
|
||||
this->Invalid = false;
|
||||
}
|
||||
float X;
|
||||
float Y;
|
||||
float Z;
|
||||
bool Invalid = false;
|
||||
} Point3f;
|
||||
|
||||
typedef struct Point3s
|
||||
|
||||
Reference in New Issue
Block a user