feat: add disparity params load file.

This commit is contained in:
TinyOh
2019-03-27 14:40:35 +08:00
parent 092b98ca42
commit c5c795feb0
9 changed files with 127 additions and 36 deletions

View File

@@ -14,6 +14,7 @@
#include <opencv2/highgui/highgui.hpp>
#include "mynteye/api/api.h"
#include "mynteye/logger.h"
MYNTEYE_USE_NAMESPACE
@@ -29,6 +30,21 @@ int main(int argc, char *argv[]) {
// api->EnableStreamData(Stream::DISPARITY);
api->EnableStreamData(Stream::DISPARITY_NORMALIZED);
if (argc == 2) {
std::string config_path(argv[1]);
if (api->ConfigDisparityFromFile(config_path)) {
LOG(INFO) << "load disparity file: "
<< config_path
<< " success."
<< std::endl;
} else {
LOG(INFO) << "load disparity file: "
<< config_path
<< " failed."
<< std::endl;
}
}
api->SetDisparityComputingMethodType(DisparityComputingMethod::BM);
api->Start(Source::VIDEO_STREAMING);