Closed thearchitect closed 5 years ago
May I suggest using Vagrant on your Mac to test it on of different systems?
brew cask install virtualbox
brew cask install vagrant
@kali can you provide a list of things needed to be done to have OpenCV 3 support? Maybe there is stuff where others can lend a hand.
Well, thing is, the pkg-config script from the official opencv distribution is in a very sorry state. The --libs options forgets things, does not include 3rdparty libs install by opencv, etc.
Last time I tried, I got discouraged when I realized I would probably have to craft the -l / -L myself from build.rs. To be honsest, after a few attempts, I was not even able to find by hand a working combination on Ubuntu: https://travis-ci.org/kali/opencv-rust/jobs/108554127
So yeah. Fixing pkg-config, or finding what I do wrong with it would help, and it may be the last major hurdle to get opencv 3 bindings usable or testable.
Is this the error in question?:
note: /usr/bin/ld: /tmp/opencv/opencv-3.1.0/install/lib/libopencv_imgcodecs.a(grfmt_exr.cpp.o): undefined reference to symbol '_ZN4half5_eLutE'
//usr/lib/x86_64-linux-gnu/libHalf.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
I am afraid that I never had to venture quite that deep into the nitty gritty details of how to link to OpenCV 3 so I can't really help you there.
However if it would help to have this on a different linux distribution other than the Ubuntu from Travis I could certainly help by setting up a couple machines to do testing on there.
I've not used OpenCV before but would handling your tests via a docker image work? [Here] is one that you could pull to test opencv-rust?
I just tried branch cv3 on ubuntu 14. Rust v1.10 and Clang v3.5.
But i got some trouble on it. I hope this information can make some help for this project.
Here is the information .
(There is something wrong with the encode. But it is actually what i have got on the terminal.)
(At first i used GCC as the complier . But there is the same error before changed to Clang v3.5 except the encode error . )
====================== Seperator ========================
ho@ho:~/rust-opencv3-gen/opencv-rust$ RUST_BACKTRACE=1 cargo build
Compiling opencv v0.2.0 (file:///home/hosinokakera/rust-opencv3-gen/opencv-rust)
error: failed to run custom build command for opencv v0.2.0 (file:///home/hosinokakera/rust-opencv3-gen/opencv-rust)
Process didn't exit successfully: /home/hosinokakera/rust-opencv3-gen/opencv-rust/target/debug/build/opencv-6d5895f3f368618d/build-script-build
(exit code: 101)
--- stdout
cargo:rustc-link-search=native=/usr/local/lib
cargo:rustc-link-lib=opencv_calib3d
cargo:rustc-link-lib=opencv_core
cargo:rustc-link-lib=opencv_features2d
cargo:rustc-link-lib=opencv_flann
cargo:rustc-link-lib=opencv_highgui
cargo:rustc-link-lib=opencv_imgcodecs
cargo:rustc-link-lib=opencv_imgproc
cargo:rustc-link-lib=opencv_ml
cargo:rustc-link-lib=opencv_objdetect
cargo:rustc-link-lib=opencv_photo
cargo:rustc-link-lib=opencv_shape
cargo:rustc-link-lib=opencv_stitching
cargo:rustc-link-lib=opencv_superres
cargo:rustc-link-lib=opencv_video
cargo:rustc-link-lib=opencv_videoio
cargo:rustc-link-lib=opencv_videostab
cargo:rustc-link-search=native=/usr/local/share/OpenCV/3rdparty/lib
OpenCV lives in "/usr/local/include/opencv2"
Generating code in "/home/hosinokakera/rust-opencv3-gen/opencv-rust/target/debug/build/opencv-6d5895f3f368618d/out"
Generating module 'calib3d' from headers:
/usr/local/include/opencv2/calib3d.hpp
/usr/local/include/opencv2/calib3d/calib3d.hpp
/usr/local/include/opencv2/calib3d/calib3d_c.h
Generating module 'core' from headers:
/usr/local/include/opencv2/core.hpp
/usr/local/include/opencv2/core/affine.hpp
/usr/local/include/opencv2/core/base.hpp
/usr/local/include/opencv2/core/bufferpool.hpp
/usr/local/include/opencv2/core/core.hpp
/usr/local/include/opencv2/core/core_c.h
/usr/local/include/opencv2/core/cvdef.h
/usr/local/include/opencv2/core/devmem2d.hpp
/usr/local/include/opencv2/core/directx.hpp
/usr/local/include/opencv2/core/fast_math.hpp
/usr/local/include/opencv2/core/gpumat.hpp
/usr/local/include/opencv2/core/hal/hal.hpp
/usr/local/include/opencv2/core/hal/interface.h
/usr/local/include/opencv2/core/hal/intrin.hpp
/usr/local/include/opencv2/core/internal.hpp
/usr/local/include/opencv2/core/mat.hpp
/usr/local/include/opencv2/core/matx.hpp
/usr/local/include/opencv2/core/neon_utils.hpp
/usr/local/include/opencv2/core/opengl_interop.hpp
/usr/local/include/opencv2/core/opengl_interop_deprecated.hpp
/usr/local/include/opencv2/core/optim.hpp
/usr/local/include/opencv2/core/ptr.inl.hpp
/usr/local/include/opencv2/core/saturate.hpp
/usr/local/include/opencv2/core/sse_utils.hpp
/usr/local/include/opencv2/core/traits.hpp
/usr/local/include/opencv2/core/types.hpp
/usr/local/include/opencv2/core/types_c.h
/usr/local/include/opencv2/core/utility.hpp
/usr/local/include/opencv2/core/va_intel.hpp
/usr/local/include/opencv2/core/version.hpp
/usr/local/include/opencv2/core/wimage.hpp
Generating module 'features2d' from headers:
/usr/local/include/opencv2/features2d.hpp
/usr/local/include/opencv2/features2d/features2d.hpp
Generating module 'highgui' from headers:
/usr/local/include/opencv2/highgui.hpp
/usr/local/include/opencv2/highgui/highgui.hpp
/usr/local/include/opencv2/highgui/highgui_c.h
Generating module 'imgcodecs' from headers:
/usr/local/include/opencv2/imgcodecs.hpp
/usr/local/include/opencv2/imgcodecs/imgcodecs.hpp
/usr/local/include/opencv2/imgcodecs/imgcodecs_c.h
Generating module 'imgproc' from headers:
/usr/local/include/opencv2/imgproc.hpp
/usr/local/include/opencv2/imgproc/imgproc.hpp
/usr/local/include/opencv2/imgproc/imgproc_c.h
/usr/local/include/opencv2/imgproc/types_c.h
Generating module 'ml' from headers:
/usr/local/include/opencv2/ml.hpp
/usr/local/include/opencv2/ml/ml.hpp
Generating module 'objdetect' from headers:
/usr/local/include/opencv2/objdetect.hpp
/usr/local/include/opencv2/objdetect/detection_based_tracker.hpp
/usr/local/include/opencv2/objdetect/objdetect.hpp
/usr/local/include/opencv2/objdetect/objdetect_c.h
Generating module 'photo' from headers:
/usr/local/include/opencv2/photo.hpp
/usr/local/include/opencv2/photo/photo.hpp
/usr/local/include/opencv2/photo/photo_c.h
Generating module 'shape' from headers:
/usr/local/include/opencv2/shape.hpp
/usr/local/include/opencv2/shape/emdL1.hpp
/usr/local/include/opencv2/shape/hist_cost.hpp
/usr/local/include/opencv2/shape/shape.hpp
/usr/local/include/opencv2/shape/shape_distance.hpp
/usr/local/include/opencv2/shape/shape_transformer.hpp
Generating module 'stitching' from headers:
/usr/local/include/opencv2/stitching.hpp
/usr/local/include/opencv2/stitching/stitcher.hpp
/usr/local/include/opencv2/stitching/warpers.hpp
Generating module 'superres' from headers:
/usr/local/include/opencv2/superres.hpp
Generating module 'video' from headers:
/usr/local/include/opencv2/video.hpp
/usr/local/include/opencv2/video/background_segm.hpp
/usr/local/include/opencv2/video/tracking.hpp
/usr/local/include/opencv2/video/tracking_c.h
/usr/local/include/opencv2/video/video.hpp
Generating module 'videoio' from headers:
/usr/local/include/opencv2/videoio.hpp
/usr/local/include/opencv2/videoio/videoio.hpp
/usr/local/include/opencv2/videoio/videoio_c.h
Generating module 'videostab' from headers:
/usr/local/include/opencv2/videostab.hpp
/usr/local/include/opencv2/videostab/deblurring.hpp
/usr/local/include/opencv2/videostab/fast_marching.hpp
/usr/local/include/opencv2/videostab/fast_marching_inl.hpp
/usr/local/include/opencv2/videostab/frame_source.hpp
/usr/local/include/opencv2/videostab/global_motion.hpp
/usr/local/include/opencv2/videostab/inpainting.hpp
/usr/local/include/opencv2/videostab/log.hpp
/usr/local/include/opencv2/videostab/motion_core.hpp
/usr/local/include/opencv2/videostab/motion_stabilizing.hpp
/usr/local/include/opencv2/videostab/optical_flow.hpp
/usr/local/include/opencv2/videostab/outlier_rejection.hpp
/usr/local/include/opencv2/videostab/ring_buffer.hpp
/usr/local/include/opencv2/videostab/stabilizer.hpp
/usr/local/include/opencv2/videostab/videostab.hpp
/usr/local/include/opencv2/videostab/wobble_suppression.hpp
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("0")
PROFILE = Some("debug")
TARGET = Some("x86_64-unknown-linux-gnu")
debug=true opt-level=0
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CXX_x86_64-unknown-linux-gnu = None
CXX_x86_64_unknown_linux_gnu = None
HOST_CXX = None
CXX = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CXXFLAGS_x86_64-unknown-linux-gnu = None
CXXFLAGS_x86_64_unknown_linux_gnu = None
HOST_CXXFLAGS = None
CXXFLAGS = None
running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-m64" "-fPIC" "-I" "/usr/local/include/opencv" "-I" "/usr/local/include" "-I" "." "-I" "/home/hosinokakera/rust-opencv3-gen/opencv-rust/target/debug/build/opencv-6d5895f3f368618d/out" "-std=c++0x" "-Wno-c++11-extensions" "-o" "/home/hosinokakera/rust-opencv3-gen/opencv-rust/target/debug/build/opencv-6d5895f3f368618d/out/calib3d.o" "-c" "/home/hosinokakera/rust-opencv3-gen/opencv-rust/target/debug/build/opencv-6d5895f3f368618d/out/calib3d.cpp"
ExitStatus(ExitStatus(0))
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("0")
PROFILE = Some("debug")
TARGET = Some("x86_64-unknown-linux-gnu")
debug=true opt-level=0
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CXX_x86_64-unknown-linux-gnu = None
CXX_x86_64_unknown_linux_gnu = None
HOST_CXX = None
CXX = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CXXFLAGS_x86_64-unknown-linux-gnu = None
CXXFLAGS_x86_64_unknown_linux_gnu = None
HOST_CXXFLAGS = None
CXXFLAGS = None
running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-m64" "-fPIC" "-I" "/usr/local/include/opencv" "-I" "/usr/local/include" "-I" "." "-I" "/home/hosinokakera/rust-opencv3-gen/opencv-rust/target/debug/build/opencv-6d5895f3f368618d/out" "-std=c++0x" "-Wno-c++11-extensions" "-o" "/home/hosinokakera/rust-opencv3-gen/opencv-rust/target/debug/build/opencv-6d5895f3f368618d/out/core.o" "-c" "/home/hosinokakera/rust-opencv3-gen/opencv-rust/target/debug/build/opencv-6d5895f3f368618d/out/core.cpp"
ExitStatus(ExitStatus(256))
command did not execute successfully, got: exit code: 1
--- stderr
In file included from /usr/local/include/opencv2/core/opengl_interop.hpp:49:0,
from /home/hosinokakera/rust-opencv3-gen/opencv-rust/target/debug/build/opencv-6d5895f3f368618d/out/core.cpp:36:
/usr/local/include/opencv2/core/opengl_interop_deprecated.hpp:116:61: error: no member function ���delete_obj��� declared in ���cv::Ptrcv::GlBuffer::Impl���
template <> CV_EXPORTS void PtrGlBuffer::Impl::delete_obj();
^
/usr/local/include/opencv2/core/opengl_interop_deprecated.hpp:163:62: error: no member function ���delete_obj��� declared in ���cv::Ptrcv::GlTexture::Impl���
template <> CV_EXPORTS void PtrGlTexture::Impl::delete_obj();
^
In file included from /home/hosinokakera/rust-opencv3-gen/opencv-rust/target/debug/build/opencv-6d5895f3f368618d/out/core.cpp:36:0:
/usr/local/include/opencv2/core/opengl_interop.hpp:277:68: error: no member function ���delete_obj��� declared in ���cv::Ptrcv::ogl::Buffer::Impl���
template <> CV_EXPORTS void Ptrcv::ogl::Buffer::Impl::delete_obj();
^
/usr/local/include/opencv2/core/opengl_interop.hpp:278:71: error: no member function ���delete_obj��� declared in ���cv::Ptrcv::ogl::Texture2D::Impl���
template <> CV_EXPORTS void Ptrcv::ogl::Texture2D::Impl::delete_obj();
^
cc1plus: warning: unrecognized command line option "-Wno-c++11-extensions" [enabled by default]
thread '
ho@ho:~/rust-opencv3-gen/opencv-rust$ ====================== End ========================
@kali has the situation changed? Is there any way in which I could help you releasing opencv3 support? I'm quite interested in it.
@fuine I have given up. I don't think it is worth trying to provide systematically a clean, rusty, and safe interface for opencv. The C++ interface is too feature rich, and each different module of opencv uses its own different subset of features in its interface.
On top of that, I no longer have any use for the bindings, the project I had in mind at the time is gone.
To be honest, if I needed to use opencv in a rust project today, I would just bind exactly what I need in an ad-hoc fashion. Note that the cpp crate offers an enhanced workflow for the tedious work of writting C functions that both languages will understand.
@kali so we can call this a dead project?
Well, that, or dormant, yeah. I have no more time to devote to it, and honestly grew sick of it.
On Thu, Jan 4, 2018, at 17:11, Mengu Kagan wrote:
@kali[1] so we can call this a dead project?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub[2], or mute the thread[3].>
Links:
@kali , would you consider adding @fuine as an owner on the crate so that they could continue development on their own?
edit: confused fuine with mengu
I will definitely consider sharing the project ownership, or even giving it away to anybody showing interest and motivation through actual code and PRs :)
I've implemented opencv-3.4.5 support and it's been merged to master, also crate version 0.3.0 has been published, please test.
Yeah, certainly. Most of it is actually done, and is already working quite well on osx. The reason I have not released it yet is, I can't get it to work on the current travis setup because they still use 12.04, and I don't want to release something that does not at least build on two different computers :)
I am waiting for 3.0.1 to maybe fix some of the issues, or travis to bump their linux version.
Switching to 3.0 is actually very good for the bindings, as the way opencv uses c++ features has been made much more consistent across the library. Some of the peculiarities I have struggled with in 2.0 are no longer there, or are no longer the only way to get things done. And the doc is entirely switched to doxygen, so we also get a better documentation.
Feel free to try the cv3 branch of the project and tell me how it works for you and your preferred platform.