Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • bug/335/nettimeadjust
  • bug/feedrecord
  • bug/mlsdestruct2
  • bug/optflow-disparity
  • calibration
  • censuseval
  • cherry-pick-75b9f6b3
  • chromatest
  • enhancement/235
  • exp/327/colourcor
  • exp/candidatemask
  • exp/labcolours
  • exp/multires-sgm
  • exp/triangleperf-2
  • exp/triangleperf3
  • feature/134/usegroup-nb
  • feature/231/segment
  • feature/274/lossyfilter
  • feature/329/dualoptflow-doffs
  • feature/330/audiocompress
  • feature/375/fullres-fstream
  • feature/SKR
  • feature/aruco
  • feature/autocalibration
  • feature/ceres
  • feature/compiletime
  • feature/corr_smooth
  • feature/depth-touch
  • feature/disconflow
  • feature/fixedres
  • feature/gui2-nanogui-mitsuba
  • feature/gui2-pch
  • feature/multiplexer-pose
  • feature/poses
  • feature/python
  • feature/sdk-python
  • feature/sgm-experimental
  • feature/stereocalib
  • feature/use-new-frame
  • feature/use10bit
  • feature/vr
  • feature/warpcorr-costing
  • feature/web-service/camMover
  • feature/web-service/configurations
  • feature/web-service/vanillaClient
  • feature/websocket-pose
  • guirefactor
  • master
  • v0.0.1
  • v0.0.2
  • v0.0.3
  • v0.0.4
  • v0.0.5
  • v0.0.6
54 results

Target

Select target project
  • nicolaspope/ftl
1 result
Select Git revision
  • bug/335/nettimeadjust
  • bug/feedrecord
  • bug/mlsdestruct2
  • bug/optflow-disparity
  • calibration
  • censuseval
  • cherry-pick-75b9f6b3
  • chromatest
  • enhancement/235
  • exp/327/colourcor
  • exp/candidatemask
  • exp/labcolours
  • exp/multires-sgm
  • exp/triangleperf-2
  • exp/triangleperf3
  • feature/134/usegroup-nb
  • feature/231/segment
  • feature/274/lossyfilter
  • feature/329/dualoptflow-doffs
  • feature/330/audiocompress
  • feature/375/fullres-fstream
  • feature/SKR
  • feature/aruco
  • feature/autocalibration
  • feature/ceres
  • feature/compiletime
  • feature/corr_smooth
  • feature/depth-touch
  • feature/disconflow
  • feature/fixedres
  • feature/gui2-nanogui-mitsuba
  • feature/gui2-pch
  • feature/multiplexer-pose
  • feature/poses
  • feature/python
  • feature/sdk-python
  • feature/sgm-experimental
  • feature/stereocalib
  • feature/use-new-frame
  • feature/use10bit
  • feature/vr
  • feature/warpcorr-costing
  • feature/web-service/camMover
  • feature/web-service/configurations
  • feature/web-service/vanillaClient
  • feature/websocket-pose
  • guirefactor
  • master
  • v0.0.1
  • v0.0.2
  • v0.0.3
  • v0.0.4
  • v0.0.5
  • v0.0.6
54 results
Show changes
Commits on Source (2)
...@@ -35,7 +35,7 @@ static const unsigned int kFrameDropLimit = 5; ...@@ -35,7 +35,7 @@ static const unsigned int kFrameDropLimit = 5;
struct StreamSource { struct StreamSource {
ftl::rgbd::Source *src; ftl::rgbd::Source *src;
std::atomic<unsigned int> jobs; // Busy or ready to swap? std::atomic<int> jobs; // Busy or ready to swap?
std::atomic<unsigned int> clientCount; std::atomic<unsigned int> clientCount;
cv::Mat rgb; // Tx buffer cv::Mat rgb; // Tx buffer
cv::Mat depth; // Tx buffer cv::Mat depth; // Tx buffer
......
...@@ -165,10 +165,10 @@ ftl::rgbd::detail::Source *Source::_createDeviceImpl(const ftl::URI &uri) { ...@@ -165,10 +165,10 @@ ftl::rgbd::detail::Source *Source::_createDeviceImpl(const ftl::URI &uri) {
void Source::getFrames(cv::Mat &rgb, cv::Mat &depth) { void Source::getFrames(cv::Mat &rgb, cv::Mat &depth) {
SHARED_LOCK(mutex_,lk); SHARED_LOCK(mutex_,lk);
//rgb_.copyTo(rgb); rgb_.copyTo(rgb);
//depth_.copyTo(depth); depth_.copyTo(depth);
rgb = rgb_; //rgb = rgb_;
depth = depth_; //depth = depth_;
/*cv::Mat tmp; /*cv::Mat tmp;
tmp = rgb; tmp = rgb;
...@@ -244,7 +244,7 @@ bool Source::compute(int N, int B) { ...@@ -244,7 +244,7 @@ bool Source::compute(int N, int B) {
return true; return true;
} else if (impl_ && impl_->compute(N,B)) { } else if (impl_ && impl_->compute(N,B)) {
timestamp_ = impl_->timestamp_; timestamp_ = impl_->timestamp_;
/*cv::Mat tmp; cv::Mat tmp;
rgb_.create(impl_->rgb_.size(), impl_->rgb_.type()); rgb_.create(impl_->rgb_.size(), impl_->rgb_.type());
depth_.create(impl_->depth_.size(), impl_->depth_.type()); depth_.create(impl_->depth_.size(), impl_->depth_.type());
tmp = rgb_; tmp = rgb_;
...@@ -252,10 +252,10 @@ bool Source::compute(int N, int B) { ...@@ -252,10 +252,10 @@ bool Source::compute(int N, int B) {
impl_->rgb_ = tmp; impl_->rgb_ = tmp;
tmp = depth_; tmp = depth_;
depth_ = impl_->depth_; depth_ = impl_->depth_;
impl_->depth_ = tmp;*/ impl_->depth_ = tmp;
impl_->rgb_.copyTo(rgb_); //impl_->rgb_.copyTo(rgb_);
impl_->depth_.copyTo(depth_); //impl_->depth_.copyTo(depth_);
return true; return true;
} }
return false; return false;
......
...@@ -263,7 +263,7 @@ void Streamer::run(bool block) { ...@@ -263,7 +263,7 @@ void Streamer::run(bool block) {
void Streamer::_swap(StreamSource *src) { void Streamer::_swap(StreamSource *src) {
if (src->jobs == 0) { if (src->jobs == 0) {
UNIQUE_LOCK(src->mutex,lk); UNIQUE_LOCK(src->mutex,lk);
if (src->jobs == 0) {
for (unsigned int b=0; b<10; ++b) { for (unsigned int b=0; b<10; ++b) {
auto i = src->clients[b].begin(); auto i = src->clients[b].begin();
while (i != src->clients[b].end()) { while (i != src->clients[b].end()) {
...@@ -278,17 +278,18 @@ void Streamer::_swap(StreamSource *src) { ...@@ -278,17 +278,18 @@ void Streamer::_swap(StreamSource *src) {
} }
} }
src->src->getFrames(src->rgb, src->depth);
src->src->swap(); src->src->swap();
src->src->getFrames(src->rgb, src->depth);
//if (!src->rgb.empty() && src->prev_depth.empty()) { //if (!src->rgb.empty() && src->prev_depth.empty()) {
//src->prev_depth = cv::Mat(src->rgb.size(), CV_16UC1, cv::Scalar(0)); //src->prev_depth = cv::Mat(src->rgb.size(), CV_16UC1, cv::Scalar(0));
//LOG(INFO) << "Creating prevdepth: " << src->rgb.cols << "," << src->rgb.rows; //LOG(INFO) << "Creating prevdepth: " << src->rgb.cols << "," << src->rgb.rows;
//} //}
src->jobs = 0; src->jobs = -1;
src->frame++; src->frame++;
} }
} }
}
void Streamer::wait() { void Streamer::wait() {
// Do some jobs in this thread, might as well... // Do some jobs in this thread, might as well...
...@@ -310,19 +311,13 @@ void Streamer::wait() { ...@@ -310,19 +311,13 @@ void Streamer::wait() {
} }
void Streamer::_schedule(StreamSource *src) { void Streamer::_schedule(StreamSource *src) {
// There will be two jobs for this source... if (src == nullptr || src->jobs > 0) return;
//UNIQUE_LOCK(job_mtx_,lk);
jobs_ += 2 + kChunkCount;
//lk.unlock();
//StreamSource *src = sources_[uri]; jobs_ += 2 + kChunkCount;
if (src == nullptr || src->jobs != 0) return;
src->jobs = 2 + kChunkCount; src->jobs = 2 + kChunkCount;
// Grab / capture job // Grab / capture job
ftl::pool.push([this,src](int id) { ftl::pool.push([this,src](int id) {
//auto start = std::chrono::high_resolution_clock::now();
auto start = std::chrono::high_resolution_clock::now(); auto start = std::chrono::high_resolution_clock::now();
int64_t now = std::chrono::time_point_cast<std::chrono::milliseconds>(start).time_since_epoch().count()+clock_adjust_; int64_t now = std::chrono::time_point_cast<std::chrono::milliseconds>(start).time_since_epoch().count()+clock_adjust_;
int64_t target = now / mspf_; int64_t target = now / mspf_;
...@@ -374,7 +369,7 @@ void Streamer::_schedule(StreamSource *src) { ...@@ -374,7 +369,7 @@ void Streamer::_schedule(StreamSource *src) {
// Mark job as finished // Mark job as finished
std::unique_lock<std::mutex> lk(job_mtx_); std::unique_lock<std::mutex> lk(job_mtx_);
--jobs_; --jobs_;
job_cv_.notify_one(); if (jobs_ == 0) job_cv_.notify_one();
}); });
// Compute job // Compute job
...@@ -395,7 +390,7 @@ void Streamer::_schedule(StreamSource *src) { ...@@ -395,7 +390,7 @@ void Streamer::_schedule(StreamSource *src) {
// Mark job as finished // Mark job as finished
std::unique_lock<std::mutex> lk(job_mtx_); std::unique_lock<std::mutex> lk(job_mtx_);
--jobs_; --jobs_;
job_cv_.notify_one(); if (jobs_ == 0) job_cv_.notify_one();
}); });
// Create jobs for each chunk // Create jobs for each chunk
...@@ -415,7 +410,7 @@ void Streamer::_schedule(StreamSource *src) { ...@@ -415,7 +410,7 @@ void Streamer::_schedule(StreamSource *src) {
_swap(src); _swap(src);
std::unique_lock<std::mutex> lk(job_mtx_); std::unique_lock<std::mutex> lk(job_mtx_);
--jobs_; --jobs_;
job_cv_.notify_one(); if (jobs_ == 0) job_cv_.notify_one();
}); });
} }
} }
......