fix(thread): ProcessNativeStream
This commit is contained in:
parent
a22eed8c1d
commit
055c6a23d0
|
@ -583,14 +583,12 @@ void Synthetic::InitProcessors() {
|
||||||
void Synthetic::ProcessNativeStream(
|
void Synthetic::ProcessNativeStream(
|
||||||
const Stream &stream, const api::StreamData &data) {
|
const Stream &stream, const api::StreamData &data) {
|
||||||
if (stream == Stream::LEFT || stream == Stream::RIGHT) {
|
if (stream == Stream::LEFT || stream == Stream::RIGHT) {
|
||||||
|
std::unique_lock<std::mutex> lk(mtx_left_right_ready_);
|
||||||
static api::StreamData left_data, right_data;
|
static api::StreamData left_data, right_data;
|
||||||
cv::Mat tmp1, tmp2;
|
|
||||||
if (stream == Stream::LEFT) {
|
if (stream == Stream::LEFT) {
|
||||||
left_data = data;
|
left_data = data;
|
||||||
tmp1 = left_data.frame.clone();
|
|
||||||
} else if (stream == Stream::RIGHT) {
|
} else if (stream == Stream::RIGHT) {
|
||||||
right_data = data;
|
right_data = data;
|
||||||
tmp2 = right_data.frame.clone();
|
|
||||||
}
|
}
|
||||||
if (left_data.img && right_data.img &&
|
if (left_data.img && right_data.img &&
|
||||||
left_data.img->frame_id == right_data.img->frame_id) {
|
left_data.img->frame_id == right_data.img->frame_id) {
|
||||||
|
@ -607,8 +605,8 @@ void Synthetic::ProcessNativeStream(
|
||||||
processor = find_processor<RectifyProcessorOCV>(processor_);
|
processor = find_processor<RectifyProcessorOCV>(processor_);
|
||||||
}
|
}
|
||||||
processor->Process(ObjMat2{
|
processor->Process(ObjMat2{
|
||||||
tmp1, left_data.frame_id, left_data.img,
|
left_data.frame, left_data.frame_id, left_data.img,
|
||||||
tmp2, right_data.frame_id, right_data.img});
|
right_data.frame, right_data.frame_id, right_data.img});
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
#include "mynteye/api/api.h"
|
#include "mynteye/api/api.h"
|
||||||
#include "mynteye/api/config.h"
|
#include "mynteye/api/config.h"
|
||||||
|
@ -132,6 +133,7 @@ class Synthetic {
|
||||||
std::shared_ptr<Plugin> plugin_;
|
std::shared_ptr<Plugin> plugin_;
|
||||||
|
|
||||||
CalibrationModel calib_model_;
|
CalibrationModel calib_model_;
|
||||||
|
std::mutex mtx_left_right_ready_;
|
||||||
|
|
||||||
std::shared_ptr<IntrinsicsBase> intr_left_;
|
std::shared_ptr<IntrinsicsBase> intr_left_;
|
||||||
std::shared_ptr<IntrinsicsBase> intr_right_;
|
std::shared_ptr<IntrinsicsBase> intr_right_;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user