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

Add missing refactor of vision

parent 7d887a98
No related branches found
No related tags found
No related merge requests found
Pipeline #9755 passed
......@@ -10,7 +10,6 @@ set(CVNODESRC
src/calibrate.cpp
src/local.cpp
src/sync.cpp
src/display.cpp
src/disparity.cpp
src/streamer.cpp
src/middlebury.cpp
......@@ -40,6 +39,7 @@ endif (CUDA_FOUND)
add_executable(ftl-vision ${CVNODESRC})
add_dependencies(ftl-vision ftlnet)
add_dependencies(ftl-vision ftlrender)
add_dependencies(ftl-vision libelas)
if (CUDA_FOUND)
......@@ -47,6 +47,6 @@ set_property(TARGET ftl-vision PROPERTY CUDA_SEPARABLE_COMPILATION ON)
endif()
#target_include_directories(cv-node PUBLIC ${PROJECT_SOURCE_DIR}/include)
target_link_libraries(ftl-vision Threads::Threads ZLIB::ZLIB libelas ${OpenCV_LIBS} ${LIBSGM_LIBRARIES} ${CUDA_LIBRARIES} glog::glog ftlnet)
target_link_libraries(ftl-vision ftlrender Threads::Threads ZLIB::ZLIB libelas ${OpenCV_LIBS} ${LIBSGM_LIBRARIES} ${CUDA_LIBRARIES} glog::glog ftlnet)
......@@ -140,12 +140,12 @@ static void run(const string &file) {
if (config["calibrate"]) calibrate.recalibrate();
if (!calibrate.isCalibrated()) LOG(WARNING) << "Cameras are not calibrated!";
cv::Mat Q_32F;
calibrate.getQ().convertTo(Q_32F, CV_32F);
// Allow remote users to access camera calibration matrix
net.bind(string("ftl://utu.fi/")+(string)config["stream"]["name"]+string("/rgb-d/calibration"), [&calibrate]() -> vector<unsigned char> {
net.bind(string("ftl://utu.fi/")+(string)config["stream"]["name"]+string("/rgb-d/calibration"), [&calibrate,Q_32F]() -> vector<unsigned char> {
vector<unsigned char> buf;
cv::Mat Q_32F;
calibrate.getQ().convertTo(Q_32F, CV_32F);
buf.resize(Q_32F.step*Q_32F.rows);
memcpy(Q_32F.data, buf.data(), buf.size());
return buf;
......@@ -157,7 +157,9 @@ static void run(const string &file) {
Mat l, r, disp;
Display display(calibrate, config["display"]);
Display display(config["display"]);
display.setCalibration(Q_32F);
Streamer stream(net, config["stream"]);
while (display.active()) {
......@@ -179,6 +181,7 @@ static void run(const string &file) {
display.render(l, disp);
stream.send(l, disp);
display.wait(1);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment