Skip to content
Snippets Groups Projects
Commit 052a9154 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Move frameset

parent ff2b59dc
No related branches found
No related tags found
1 merge request!104Implements #174 to use new Frame class
This commit is part of merge request !104. Comments created here will be created in the context of that merge request.
......@@ -12,6 +12,7 @@ namespace rgbd {
typedef unsigned int channel_t;
static const channel_t kChanNone = 0;
static const channel_t kChanColour = 0x0001;
static const channel_t kChanLeft = 0x0001; // CV_8UC3
static const channel_t kChanDepth = 0x0002; // CV_32FC1
static const channel_t kChanRight = 0x0004; // CV_8UC3
......
#ifndef _FTL_RGBD_FRAMESET_HPP_
#define _FTL_RGBD_FRAMESET_HPP_
#include <ftl/rgbd/frame.hpp>
#include <opencv2/opencv.hpp>
#include <vector>
namespace ftl {
namespace rgbd {
class Source;
/**
* Represents a set of synchronised frames, each with two channels. This is
* used to collect all frames from multiple computers that have the same
* timestamp.
*/
struct FrameSet {
int64_t timestamp; // Millisecond timestamp of all frames
std::vector<Source*> sources; // All source objects involved.
std::vector<ftl::rgbd::Frame> frames;
std::atomic<int> count; // Number of valid frames
std::atomic<unsigned int> mask; // Mask of all sources that contributed
bool stale; // True if buffers have been invalidated
SHARED_MUTEX mtx;
};
}
}
#endif // _FTL_RGBD_FRAMESET_HPP_
......@@ -3,6 +3,8 @@
#include <ftl/threads.hpp>
#include <ftl/timer.hpp>
#include <ftl/rgbd/frame.hpp>
#include <ftl/rgbd/frameset.hpp>
#include <opencv2/opencv.hpp>
#include <vector>
......@@ -12,22 +14,6 @@ namespace rgbd {
class Source;
/**
* Represents a set of synchronised frames, each with two channels. This is
* used to collect all frames from multiple computers that have the same
* timestamp.
*/
struct FrameSet {
int64_t timestamp; // Millisecond timestamp of all frames
std::vector<Source*> sources; // All source objects involved.
std::vector<cv::Mat> channel1; // RGB
std::vector<cv::Mat> channel2; // Depth (usually)
std::atomic<int> count; // Number of valid frames
std::atomic<unsigned int> mask; // Mask of all sources that contributed
bool stale; // True if buffers have been invalidated
SHARED_MUTEX mtx;
};
// Allows a latency of 20 frames maximum
static const size_t kFrameBufferSize = 20;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment