Skip to content
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

OpenCV3 Make #1

Open
blgnksy opened this issue Apr 17, 2017 · 19 comments
Open

OpenCV3 Make #1

blgnksy opened this issue Apr 17, 2017 · 19 comments

Comments

@blgnksy
Copy link

blgnksy commented Apr 17, 2017

Hi,

My computer's setup is Ubuntu 14.04, Cuda 8, CuDNN 5 and OpenCV 3.2.0. I faced a problem while compiling compute_flow.cpp. I think after OpenCv 2.4 the gpu module had been changed to cuda module. Is there any way to compensate this issue?

Thanks.

@pfabreu
Copy link
Contributor

pfabreu commented Apr 28, 2018

I have the same issue and it's a bit annoying.

@jkuh626
Copy link

jkuh626 commented Jan 15, 2019

+1

@blgnksy
Copy link
Author

blgnksy commented Jan 17, 2019

@Pedro-Abreu @jkuh626 You should change the source code and adapt to new OpenCv versions.

@KT27-A
Copy link

KT27-A commented Jan 21, 2019

@blgnksy But how to adapt this to a new version, man?

@blgnksy
Copy link
Author

blgnksy commented Jan 21, 2019

@Katou2 First install the opencv. If you install a newer version than the original gpu_flow used, than search the opencv api documentation and change the includes and method names. You will see class and method prototypes have been changed.

@KT27-A
Copy link

KT27-A commented Jan 21, 2019

@blgnksy Ok, Thanks a lot, man.

@KT27-A
Copy link

KT27-A commented Jan 22, 2019

@blgnksy Hi, man, sorry to bother you again. I've installed opencv 3.4.3 and remake the repository again. I got such problems:

CMakeFiles/compute_flow.dir/compute_flow.o: In function main': /home/katou2/github-home/gpu_flow/compute_flow.cpp:171: undefined reference to cv::gpu::setDevice(int)'
/home/katou2/github-home/gpu_flow/compute_flow.cpp:175: undefined reference to cv::gpu::getDevice()' /home/katou2/github-home/gpu_flow/compute_flow.cpp:175: undefined reference to cv::gpu::printShortCudaDeviceInfo(int)'
/home/katou2/github-home/gpu_flow/compute_flow.cpp:179: undefined reference to cv::gpu::OpticalFlowDual_TVL1_GPU::OpticalFlowDual_TVL1_GPU()' /home/katou2/github-home/gpu_flow/compute_flow.cpp:354: undefined reference to cv::gpu::GpuMat::upload(cv::Mat const&)'
/home/katou2/github-home/gpu_flow/compute_flow.cpp:355: undefined reference to cv::gpu::GpuMat::upload(cv::Mat const&)' /home/katou2/github-home/gpu_flow/compute_flow.cpp:356: undefined reference to cv::gpu::OpticalFlowDual_TVL1_GPU::operator()(cv::gpu::GpuMat const&, cv::gpu::GpuMat const&, cv::gpu::GpuMat&, cv::gpu::GpuMat&)'
/home/katou2/github-home/gpu_flow/compute_flow.cpp:359: undefined reference to cv::gpu::GpuMat::download(cv::Mat&) const' /home/katou2/github-home/gpu_flow/compute_flow.cpp:360: undefined reference to cv::gpu::GpuMat::download(cv::Mat&) const'
/home/katou2/github-home/gpu_flow/compute_flow.cpp:350: undefined reference to cv::gpu::GpuMat::upload(cv::Mat const&)' /home/katou2/github-home/gpu_flow/compute_flow.cpp:351: undefined reference to cv::gpu::GpuMat::upload(cv::Mat const&)'
CMakeFiles/compute_flow.dir/compute_flow.o: In function main': /usr/include/opencv2/gpu/gpu.hpp:1742: undefined reference to cv::gpu::Stream::Null()'
CMakeFiles/compute_flow.dir/compute_flow.o: In function main': /home/katou2/github-home/gpu_flow/compute_flow.cpp:352: undefined reference to cv::gpu::BroxOpticalFlow::operator()(cv::gpu::GpuMat const&, cv::gpu::GpuMat const&, cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::Stream&)'
CMakeFiles/compute_flow.dir/compute_flow.o: In function cv::gpu::GpuMat::~GpuMat()': /usr/include/opencv2/core/gpumat.hpp:374: undefined reference to cv::gpu::GpuMat::release()'
/usr/include/opencv2/core/gpumat.hpp:374: undefined reference to cv::gpu::GpuMat::release()' /usr/include/opencv2/core/gpumat.hpp:374: undefined reference to cv::gpu::GpuMat::release()'
/usr/include/opencv2/core/gpumat.hpp:374: undefined reference to cv::gpu::GpuMat::release()' /usr/include/opencv2/core/gpumat.hpp:374: undefined reference to cv::gpu::GpuMat::release()'
CMakeFiles/compute_flow.dir/compute_flow.o:/usr/include/opencv2/core/gpumat.hpp:374: more undefined references to `cv::gpu::GpuMat::release()' follow
collect2: error: ld returned 1 exit status
CMakeFiles/compute_flow.dir/build.make:140: recipe for target 'compute_flow' failed
make[2]: *** [compute_flow] Error 1
CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/compute_flow.dir/all' failed
make[1]: *** [CMakeFiles/compute_flow.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Are these you said prototypes changes? But I cannot find them in opencv documents. Have you met such problems? Thank you very much.

@blgnksy
Copy link
Author

blgnksy commented Jan 22, 2019

Yes, those are the prototypes changes. OpenCv programmers transferred some methods to another class. Whenever I have spare time, I can check and try to inform you. Can you push your codes to github repo?

@blgnksy
Copy link
Author

blgnksy commented Jan 23, 2019 via email

@KT27-A
Copy link

KT27-A commented Jan 24, 2019

@blgnksy Thank you very much, man. Everything has been settled.

@blgnksy
Copy link
Author

blgnksy commented Jan 24, 2019

@Katou2 I didn't meet that problem. But it seems at least of the command line arguments that you passed is wrong. Since the error indicates the 158th line in command_line_parser of the opencv core module. Try to debug the before 136th line in compute_flow.cpp that all of the arguments are in correctly passed. Or remove that part and handle the arguments as declaring variables in compute_flow.cpp to pass that part.

@blgnksy
Copy link
Author

blgnksy commented Jan 24, 2019

@Katou2 How can you overcome that error?

@KT27-A
Copy link

KT27-A commented Jan 24, 2019

@blgnksy I checked the document of Opencv detailedly, I found the keys form in the code is different from the form in the document. When I adapted it to the document, it worked.

@blgnksy
Copy link
Author

blgnksy commented Jan 24, 2019

@Katou2 Good job. I also think that the problem is about the command_line_parser of OpenCV. And I think you should push your new working codes to your repo. So If anyone meets same problem, will use your codes.

@KT27-A
Copy link

KT27-A commented Jan 24, 2019

@blgnksy Yeah, that's it. Thank you very much for your help indeed.

@blgnksy
Copy link
Author

blgnksy commented Jan 24, 2019

@Katou2 No problem. Unfortunately original developers doesn't answer any issue.

@KT27-A
Copy link

KT27-A commented Jan 24, 2019

@blgnksy Hah, it pushes us to fully understand what their code expresses. Not bad.

@1803643593
Copy link

Hi,
sorry to bother you,i've got same problem,
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to TIFFReadRGBAStrip@LIBTIFF_4.0' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to TIFFIsTiled@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to TIFFWriteScanline@LIBTIFF_4.0' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to TIFFGetField@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to TIFFScanlineSize@LIBTIFF_4.0' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to TIFFReadEncodedTile@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to TIFFReadRGBATile@LIBTIFF_4.0' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to TIFFClose@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to TIFFRGBAImageOK@LIBTIFF_4.0' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to TIFFOpen@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to TIFFReadEncodedStrip@LIBTIFF_4.0' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to TIFFSetField@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to TIFFSetWarningHandler@LIBTIFF_4.0' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to TIFFSetErrorHandler@LIBTIFF_4.0'
could you help me ?Thank you very much.

@KT27-A
Copy link

KT27-A commented Apr 1, 2019

@1803643593 Hello, the prototypes changed a lot between opencv2 and opencv3. I have updated this code to opencv3, if you have interest, just go to https://github.com/Katou2/Optical_Flow_GPU_Opencv3. Hope this can help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants