mirror of
https://github.com/storytold/LiveScan3D.git
synced 2026-10-09 00:09:58 +00:00
Finished Temporal Sync Feature
This commit is contained in:
@@ -11,12 +11,17 @@ public:
|
||||
AzureKinectCapture();
|
||||
~AzureKinectCapture();
|
||||
|
||||
bool Initialize();
|
||||
bool Initialize(bool asMaster, bool asSubOrdinate, int syncOffset);
|
||||
bool Close();
|
||||
bool AcquireFrame();
|
||||
void MapDepthFrameToCameraSpace(Point3f *pCameraSpacePoints);
|
||||
void MapColorFrameToCameraSpace(Point3f *pCameraSpacePoints);
|
||||
void MapDepthFrameToColorSpace(UINT16 *pDepthInColorSpace);
|
||||
void MapColorFrameToDepthSpace(RGB *pColorInDepthSpace);
|
||||
int GetSyncJackState();
|
||||
uint64_t GetTimeStamp();
|
||||
|
||||
|
||||
private:
|
||||
k4a_device_t kinectSensor = NULL;
|
||||
int32_t captureTimeoutMs = 1000;
|
||||
@@ -27,6 +32,8 @@ private:
|
||||
k4a_image_t colorImageInDepth = NULL;
|
||||
k4a_image_t depthImageInColor = NULL;
|
||||
k4a_transformation_t transformation = NULL;
|
||||
|
||||
bool syncInConnected = false;
|
||||
bool syncOutConnected = false;
|
||||
uint64_t currentTimeStamp;
|
||||
void UpdateDepthPointCloud();
|
||||
};
|
||||
@@ -16,7 +16,7 @@ public:
|
||||
// leave filename blank if you want the filename to be generated from the date
|
||||
void setCurrentFilename(std::string filename = "");
|
||||
|
||||
void writeFrame(std::vector<Point3s> points, std::vector<RGB> colors);
|
||||
void writeFrame(std::vector<Point3s> points, std::vector<RGB> colors, uint64_t timestamp);
|
||||
bool readFrame(std::vector<Point3s> &outPoints, std::vector<RGB> &outColors);
|
||||
|
||||
bool openedForWriting() { return m_bFileOpenedForWriting; }
|
||||
|
||||
@@ -40,12 +40,15 @@ public:
|
||||
ICapture();
|
||||
~ICapture();
|
||||
|
||||
virtual bool Initialize() = 0;
|
||||
virtual bool Initialize(bool asMaster, bool asSubOrdinate, int syncOffset) = 0;
|
||||
virtual bool AcquireFrame() = 0;
|
||||
virtual bool Close() = 0;
|
||||
virtual void MapDepthFrameToCameraSpace(Point3f *pCameraSpacePoints) = 0;
|
||||
virtual void MapColorFrameToCameraSpace(Point3f *pCameraSpacePoints) = 0;
|
||||
virtual void MapDepthFrameToColorSpace(UINT16 *pColorSpacePoints) = 0;
|
||||
virtual void MapColorFrameToDepthSpace(RGB *pDepthSpacePoints) = 0;
|
||||
virtual int GetSyncJackState() = 0;
|
||||
virtual uint64_t GetTimeStamp() = 0;
|
||||
|
||||
bool bInitialized;
|
||||
|
||||
@@ -57,5 +60,7 @@ public:
|
||||
RGB *pColorRGBX;
|
||||
std::vector<Body> vBodies;
|
||||
|
||||
|
||||
|
||||
std::string serialNumber;
|
||||
};
|
||||
@@ -54,13 +54,16 @@ private:
|
||||
bool m_bCaptureFrame;
|
||||
bool m_bConnected;
|
||||
bool m_bConfirmCaptured;
|
||||
bool m_bConfirmMaster;
|
||||
bool m_bConfirmSubOrdinate;
|
||||
bool m_bConfirmTempSyncState;
|
||||
bool m_bConfirmSubOrdinateStarted;
|
||||
bool m_bConfirmCalibrated;
|
||||
bool m_bShowDepth;
|
||||
bool m_bFrameCompression;
|
||||
int m_iCompressionLevel;
|
||||
|
||||
enum tempSyncConfig { MASTER, SUBORDINATE, STANDALONE };
|
||||
tempSyncConfig currentTempSyncState;
|
||||
|
||||
FrameFileWriterReader m_framesFileWriterReader;
|
||||
|
||||
|
||||
@@ -76,6 +79,7 @@ private:
|
||||
double m_fFreq;
|
||||
INT64 m_nNextStatusTime;
|
||||
DWORD m_nFramesSinceUpdate;
|
||||
int frameRecordCounter;
|
||||
|
||||
Point3f* m_pCameraSpaceCoordinates;
|
||||
RGB* m_pColorInDepthSpace;
|
||||
|
||||
@@ -28,8 +28,9 @@ enum INCOMING_MESSAGE_TYPE
|
||||
MSG_REQUEST_LAST_FRAME,
|
||||
MSG_RECEIVE_CALIBRATION,
|
||||
MSG_CLEAR_STORED_FRAMES,
|
||||
MSG_SET_MASTER,
|
||||
MSG_SET_SUBORDINATE
|
||||
MSG_SET_TEMPSYNC_ON,
|
||||
MSG_SET_TEMPSYNC_OFF,
|
||||
MSG_START_MASTER
|
||||
};
|
||||
|
||||
enum OUTGOING_MESSAGE_TYPE
|
||||
|
||||
Reference in New Issue
Block a user