-
We've created JLL Library OpenCVQt_jll.jl and VideoCaptureWrap_jll.jl, where
- OpenCVQt_jll.jl provides OpenCV shared library. It enables us skip installation of OpenCV manually. See OpenCVBuilder.jl
- VideoCaptureWrap_jll.jl provides shared library named libvideocapture.[so, dll]. It enables us to skip build
videocapture.cpp
manually. See VideoCaptureWrapBuilder.jl
-
Since BinaryBuilder.jl provides compilers for Windows platforms, we can provide/build our
videocapture.cpp
which means our application VideoCaptureWrap.jl runs on your Windows (64 bit system) machine. -
Copy the following commands on your terminal to test out our package.
julia --project=. -e 'using Pkg; Pkg.add(PackageSpec(name="libcxxwrap_julia_jll", rev="libcxxwrap_julia-v0.8.4+0"))'
julia --project=. -e 'using Pkg; pkg"add https://github.com/terasakisatoshi/OpenCVQt_jll.jl.git"'
julia --project=. -e 'using Pkg; pkg"add https://github.com/terasakisatoshi/VideoCaptureWrap_jll.jl.git"'
julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.precompile()'
julia --project=. callcxx.jl gui
-
This repository provides an example of how to wrap OpenCV API via CxxWrap.jl. It also demonstrates a demo that capture image from your Web/USB camera and display its result using ImageInTerminal.jl or OpenCV's API.
-
It is tested on Ubuntu 18.04 (64-bit system), macOS (Catalina), Windows (64-bit system) , Jetson nano (aarch64) and Raspberry Pi4 (armv7l) with
Julia v1.5.3
. -
See also package announcement
Just run:
$ julia --project=. -e 'using Pkg; Pkg.add(PackageSpec(name="libcxxwrap_julia_jll", rev="libcxxwrap_julia-v0.8.4+0"))'
$ julia --project=. -e 'using Pkg; pkg"add https://github.com/terasakisatoshi/OpenCVQt_jll.jl.git"'
$ julia --project=. -e 'using Pkg; pkg"add https://github.com/terasakisatoshi/VideoCaptureWrap_jll.jl.git"'
$ julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.precompile()'
$ julia --project=. callcxx.jl gui
- You can also try:
$ make run cli
$ make run gui
- For those who hasitates to install Julia but knows Docker, try
run.sh
script :D
$ bash run.sh
Enjoy Julia!!!
- Here is a note for those who like to build our application.
- You can build cpp source files by your self
- Download Julia 1.5 from here.
- Install Make, CMake (to run
make
orcmake
) - Install OpenCV e.g.
brew install opencv
,apt-get install libopencv-dev
you know what to do. - If you are macOS user, install iterm2 to run our application with it.
- Clone this repository and run
make build
command.
$ git clone https://github.com/terasakisatoshi/VideoCaptureWrap.jl.git
$ cd VideoCaptureWrap.jl
$ make build
# Start building ... and running our application .
# (See callcxx.jl, videocapture.cpp and src/VideoCaptureWrap.jl to see more details)
- open
src/VideoCaptureWrap.jl
and replaceconst libvideocapture
variable with the following code:
using Libdl
const libvideocapture = joinpath("build", "lib", "libvideocapture.$(Libdl.dlext)")
- By using
BinaryBuilder.jl
you do not have to prepare C++ compiler by your e.g. on your Windows machine.
- Download Julia 1.5 from here.
- Install Docker
- Install BinaryBuilder.jl via
$ julia -e 'using Pkg; Pkg.add("BinaryBuilder")'
Just run:
$ git clone https://github.com/terasakisatoshi/OpenCVBuilder.jl.git
$ cd OpenCVBuilder.jl/qt
$ julia build_tarball.jl --verbose --deploy=local
Just run:
$ git clone https://github.com/terasakisatoshi/VideoCaptureWrapBuilder.jl.git
$ cd VideoCaptureWrapBuilder.jl
$ julia build_tarball.jl --verbose --deploy=local
Finally
$ julia -e 'using Pkg; pkg"add ~/.julia/dev/OpenCV_Jll"'
$ julia -e 'using Pkg; pkg"add ~/.julia/dev/VideoCaptureWrap_Jll"'
That's it. Try to run
$ julia --project=. callcxx.jl gui