Merge branch 'release/v2.5.0' of http://gitlab.mynt.com/mynteye/mynt-eye-s-sdk into release/v2.5.0

This commit is contained in:
Messier 2019-10-23 13:42:25 +08:00
commit 7f77847fb7
4 changed files with 68 additions and 51 deletions

View File

@ -195,14 +195,14 @@ enum class Option : std::uint8_t {
* Max exposure time, valid if auto-exposure
* <p>
* range of standard 1: [0,240], default: 240<br>
* range of standard 2: [0,1000], default: 333
* range of standard 2: [0,655], default: 333
* </p>
*/
MAX_EXPOSURE_TIME,
/**
* min exposure time, valid if auto-exposure
* <p>
* range: [0,1000], default: 0<br>
* range: [0,655], default: 0<br>
* </p>
*/
MIN_EXPOSURE_TIME,
@ -576,7 +576,7 @@ struct MYNTEYE_API ImuIntrinsics {
double scale[3][3];
/** Assembly error [3][3] */
double assembly[3][3];
/* Zero-drift: X, Y, Z */
/** Zero-drift: X, Y, Z */
double drift[3];
/** Noise density variances */
double noise[3];

View File

@ -32,6 +32,8 @@ int main(int argc, char *argv[]) {
Model model = api->GetModel();
api->Start(Source::VIDEO_STREAMING);
// Set auto exposure options fo s1030
if (model == Model::STANDARD) {
// auto-exposure: 0
@ -83,8 +85,6 @@ int main(int argc, char *argv[]) {
<< api->GetOptionValue(Option::MIN_EXPOSURE_TIME);
}
api->Start(Source::VIDEO_STREAMING);
CVPainter painter(frame_rate);
cv::namedWindow("frame");

View File

@ -137,8 +137,8 @@ void Dataset::SaveMotionData(const api::MotionData &data) {
<< data.imu->gyro[0] << ", " << data.imu->gyro[1] << ", "
<< data.imu->gyro[2] << ", " << data.imu->temperature
<< std::endl;
++motion_count_;
motion_count_++;
/*
if(motion_count_ != seq) {
LOG(INFO) << "motion_count_ != seq !" << " motion_count_: " << motion_count_
@ -166,6 +166,15 @@ Dataset::writer_t Dataset::GetStreamWriter(const Stream &stream) {
case Stream::DISPARITY: {
writer->outdir = outdir_ + MYNTEYE_OS_SEP "disparity";
} break;
case Stream::RIGHT_RECTIFIED: {
writer->outdir = outdir_ + MYNTEYE_OS_SEP "right_rect";
} break;
case Stream::LEFT_RECTIFIED: {
writer->outdir = outdir_ + MYNTEYE_OS_SEP "left_rect";
} break;
case Stream::DISPARITY_NORMALIZED: {
writer->outdir = outdir_ + MYNTEYE_OS_SEP "disparity_norm";
} break;
default:
LOG(FATAL) << "Unsupported stream: " << stream;
}

View File

@ -42,7 +42,7 @@ int main(int argc, char *argv[]) {
// std::uint16_t fps;
// }
request.fps = 10;
// request.fps = 10;
api->ConfigStreamRequest(request);
api->EnableMotionDatas();
@ -68,18 +68,17 @@ int main(int argc, char *argv[]) {
auto &&left_datas = api->GetStreamDatas(Stream::LEFT);
auto &&right_datas = api->GetStreamDatas(Stream::RIGHT);
auto &&depth_datas = api->GetStreamDatas(Stream::DEPTH);
auto &&disparity_datas = api->GetStreamDatas(Stream::DISPARITY);
auto &&depth_data = api->GetStreamData(Stream::DEPTH);
auto &&disparity_data = api->GetStreamData(Stream::DISPARITY);
img_count += left_datas.size();
auto &&motion_datas = api->GetMotionDatas();
imu_count += motion_datas.size();
cv::Mat img;
if (left_datas.size() > 0 && right_datas.size() > 0) {
auto &&left_frame = left_datas.back().frame_raw;
auto &&right_frame = right_datas.back().frame_raw;
cv::Mat img;
if (right_frame->data() && left_frame->data()) {
if (left_frame->format() == Format::GREY) {
cv::Mat left_img(
left_frame->height(), left_frame->width(), CV_8UC1,
@ -110,18 +109,27 @@ int main(int argc, char *argv[]) {
return -1;
}
cv::imshow("frame", img);
}
}
if (img_count > 10 && imu_count > 50) { // save
// save Stream::LEFT
for (auto &&left : left_datas) {
dataset.SaveStreamData(Stream::LEFT, left);
}
for (auto &&right : right_datas) {
dataset.SaveStreamData(Stream::RIGHT, right);
// save Stream::RIGHT
// for (auto &&right : right_datas) {
// dataset.SaveStreamData(Stream::RIGHT, right);
// }
// save Stream::DEPTH
if (!depth_data.frame.empty()) {
dataset.SaveStreamData(Stream::DEPTH, depth_data);
}
for (auto &&depth : depth_datas) {
dataset.SaveStreamData(Stream::DEPTH, depth);
}
for (auto &&disparity : disparity_datas) {
dataset.SaveStreamData(Stream::DISPARITY, disparity);
// save Stream::DISPARITY
if (!disparity_data.frame.empty()) {
dataset.SaveStreamData(Stream::DISPARITY, disparity_data);
}
for (auto &&motion : motion_datas) {