-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I got a problem when i make the project! #63
Comments
Hi, @CZH-cpu Maybe CUDA Toolkit is too old to compile. Regards, |
Thanks for answering, after that i succeed in installing ubuntu18.04 , cuda10.0 and the libSGM project. By the way my opencv version is 3.1.4. Then i tried to run the sample execution and i got some new problem. First of all, i want to know the position to put these images, I named my images as left_image_0000 and right_image_0000 and I put them at /libSGM/build/sample/image/ which i think it should be,then i run the code "./stereo_movie left_image_%01d.pgm right_image_%01d.pgm" at /libSGM/build/sample/muvie/ and the terminal told me imread failed.(the photo are colored), I do not know the wrong part. Second since you said the sample images are available in the "Daimler Urban Scene Segmentation Benchmark Dataset 2014" , when i tried to download the images ,it just told me the no found of anything so if you have the images for testing, can you provide for me ? Hope for you answering again , thanks a lot. |
@CZH-cpu Thank you for trying to use libSGM.
I beg your pardon. According to README.md,
A location which has images can be anywhere, but it should be current directory if we use
All samples assume that input image are grayscale ( diff --git a/sample/movie/stereosgm_movie.cpp b/sample/movie/stereosgm_movie.cpp
index 062451b..b4bf6b8 100644
--- a/sample/movie/stereosgm_movie.cpp
+++ b/sample/movie/stereosgm_movie.cpp
@@ -60,8 +60,8 @@ int main(int argc, char* argv[])
const int first_frame = 1;
- cv::Mat I1 = cv::imread(format_string(argv[1], first_frame), -1);
- cv::Mat I2 = cv::imread(format_string(argv[2], first_frame), -1);
+ cv::Mat I1 = cv::imread(format_string(argv[1], first_frame), cv::IMREAD_GRAYSCALE);
+ cv::Mat I2 = cv::imread(format_string(argv[2], first_frame), cv::IMREAD_GRAYSCALE);
const int disp_size = argc >= 4 ? std::stoi(argv[3]) : 128;
ASSERT_MSG(!I1.empty() && !I2.empty(), "imread failed.");
@@ -90,8 +90,8 @@ int main(int argc, char* argv[])
for (int frame_no = first_frame;; frame_no++) {
- I1 = cv::imread(format_string(argv[1], frame_no), -1);
- I2 = cv::imread(format_string(argv[2], frame_no), -1);
+ I1 = cv::imread(format_string(argv[1], frame_no), cv::IMREAD_GRAYSCALE);
+ I2 = cv::imread(format_string(argv[2], frame_no), cv::IMREAD_GRAYSCALE);
if (I1.empty() || I2.empty()) {
frame_no = first_frame;
continue; Therefore, we can run shingo.otsuka@sgm01:~/work/libSGM/build$ make
[ 63%] Built target sgm
[ 72%] Built target stereo_test
[ 81%] Built target stereo_movie
[ 90%] Built target stereo_reprojection
[100%] Built target stereo_benchmark
shingo.otsuka@sgm01:~/work/libSGM/build$ cd sample/image/
shingo.otsuka@sgm01:~/work/libSGM/build/sample/image$ ls
CMakeFiles cmake_install.cmake right_image_0000.pgm
Makefile left_image_0000.pgm stereo_test
shingo.otsuka@sgm01:~/work/libSGM/build/sample/image$ cd ../movie/
shingo.otsuka@sgm01:~/work/libSGM/build/sample/movie$ ./stereo_movie ../image/left_image_0000.pgm ../image/right_image_0000.pgm
There are no description about redistribution in "Daimler Urban Segmentation Dataset 2014", so it is difficult to provide dataset.
|
Thanks for your help! After that I run the sample successfully, but I still be confused by some questions.
Hope for your replying again, thanks a lot! |
The function of libSGM is that fast outputting disparity map from stereo images using NVIDIA GPU.
We can use sample/benchmark to find out how many images do libSGM can processes every second in a configuration.
Tests are mostly prepared for developers.
|
Thanks for replying! After run the sample by the images from http://www.6d-vision.com/scene-labeling , I'm trying to use my own , but some errors happened. At first I try to divide the image and transform them into grayscale , the terminal told me that
so I think maybe the image is to big for my computer , than I compressed my images and run the libSGM successfully , but the depth map is wrong , it's all blue . I don't know how to transform the image correctly , so can you tell me the right way and transform my initial image for me? Thanks a lot , hope for you replying again. |
Hi, @CZH-cpu In stereo matching, an input image pair need to be "rectified" (i.e. corresponding points must be on the same y-axis), but your images are not.
|
Thanks for you answer!
With my best wishes! Expect you replying again! |
Thanks for you answer! After that I tried the codes. When it comes to convert right.i63.png -gravity North -crop 1920x1074+0+6 right.i63.6.png , some errors happened. Since my image didn't be rectified, I was wondering how did you find this point , can you tell me the process ? After so many trying for libSGM, it makes me have more interests in the code. Can you tell me the right way to read and understand a big code project? I want to know how all of these wonderful things achieved by codes. And also, it 's hard for me to use cmake to compile my even simple codes, can you provide me some method for learning? Since cuda and C++ are also applied in this project, can you also guide me the way for learning? With my best wishes! Expect you replying again! |
Try adding
There is a vehicle-like object at the center of image. It seems the right one slightly lower than left.
In my personal opinion, it requires a certain amount of experience of software development.
CMake is difficult for me too 🤣 Hou about reading CMake Tutorial? Good luck. |
Thank you for your reply After obtaining the depth map, we should do 3D reconstruction. Does libsgm have the function of 3D reconstruction? Looking forward to your reply again! |
Though it's not libsgm's function, the sample/reprojection perform 3D reconstruction. See the sample code. |
Thank you for your reply, but now I have a new problem In my recent study, I found that both the formation of disparity map and 3D reconstruction need the internal and external parameters of the camera, so I am very curious. Why can the executable file provided in / sample form disparity map without these parameters? At the same time, I am also curious about how the internal and external parameters of the camera are involved in the calculation and program. If you can, can you provide me with some tutorials? Thank you very much for your busy schedule to answer my question, looking forward to your reply again! |
I have already installed the CUDA 7.5 ,opencv 3.4.1 ,cmake 3.5.1 and all of these is on ubuntu 16.04. when i do the order "make" ,lots of errors happened.
/media/czh/12f4dee2-c297-4aa8-b2e3-455294a518e7/libSGM-master/src/oblique_path_aggregation.cu(38): error: Within a device/global function, only shared variables may be marked "static"
detected during instantiation of "void sgm::path_aggregation::enqueue_aggregate_upleft2downright_path<MAX_DISPARITY>(sgm::cost_type *, const sgm::feature_type *, const sgm::feature_type *, int, int, unsigned int, unsigned int, int, cudaStream_t) [with MAX_DISPARITY=64U]"
(203): here
/media/czh/12f4dee2-c297-4aa8-b2e3-455294a518e7/libSGM-master/src/oblique_path_aggregation.cu(39): error: Within a device/global function, only shared variables may be marked "static"
detected during instantiation of "void sgm::path_aggregation::enqueue_aggregate_upleft2downright_path<MAX_DISPARITY>(sgm::cost_type *, const sgm::feature_type *, const sgm::feature_type *, int, int, unsigned int, unsigned int, int, cudaStream_t) [with MAX_DISPARITY=64U]"
(203): here
/media/czh/12f4dee2-c297-4aa8-b2e3-455294a518e7/libSGM-master/src/oblique_path_aggregation.cu(40): error: Within a device/global function, only shared variables may be marked "static"
detected during instantiation of "void sgm::path_aggregation::enqueue_aggregate_upleft2downright_path<MAX_DISPARITY>(sgm::cost_type *, const sgm::feature_type *, const sgm::feature_type *, int, int, unsigned int, unsigned int, int, cudaStream_t) [with MAX_DISPARITY=64U]"
(203): here
/media/czh/12f4dee2-c297-4aa8-b2e3-455294a518e7/libSGM-master/src/oblique_path_aggregation.cu(42): error: Within a device/global function, only shared variables may be marked "static"
detected during instantiation of "void sgm::path_aggregation::enqueue_aggregate_upleft2downright_path<MAX_DISPARITY>(sgm::cost_type *, const sgm::feature_type *, const sgm::feature_type *, int, int, unsigned int, unsigned int, int, cudaStream_t) [with MAX_DISPARITY=64U]"
(203): here
/media/czh/12f4dee2-c297-4aa8-b2e3-455294a518e7/libSGM-master/src/oblique_path_aggregation.cu(43): error: Within a device/global function, only shared variables may be marked "static"
detected during instantiation of "void sgm::path_aggregation::enqueue_aggregate_upleft2downright_path<MAX_DISPARITY>(sgm::cost_type *, const sgm::feature_type *, const sgm::feature_type *, int, int, unsigned int, unsigned int, int, cudaStream_t) [with MAX_DISPARITY=64U]"
(203): here
5 errors detected in the compilation of "/tmp/tmpxft_0000230b_00000000-7_oblique_path_aggregation.cpp1.ii".
CMake Error at sgm_generated_oblique_path_aggregation.cu.o.cmake:266 (message):
Error generating file
/media/czh/12f4dee2-c297-4aa8-b2e3-455294a518e7/libSGM-master/src/CMakeFiles/sgm.dir//./sgm_generated_oblique_path_aggregation.cu.o
src/CMakeFiles/sgm.dir/build.make:133: recipe for target 'src/CMakeFiles/sgm.dir/sgm_generated_oblique_path_aggregation.cu.o' failed
make[2]: *** [src/CMakeFiles/sgm.dir/sgm_generated_oblique_path_aggregation.cu.o] Error 1
CMakeFiles/Makefile2:85: recipe for target 'src/CMakeFiles/sgm.dir/all' failed
make[1]: *** [src/CMakeFiles/sgm.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Please help me.
The text was updated successfully, but these errors were encountered: