ANN: VideoCaptureWrap.jl

Hi there, I’m happy to announce the release of VideoCaptureWrap.jl. :tada:

Hope it helps for those who like to utilize Julia, CxxWrap.jl, OpenCV, Image Processing etc… :smiley:

Usage

Running application locally

$ make cli # display image on terminal using ImageInTerminal.jl
$ make gui # display image using OpenCV's API

Running application inside of Docker container (Linux users only)

$ bash run.sh
16 Likes

FYI there’s a Google Summer of Code project which has made excellent progress in a generic OpenCV wrapper, see https://github.com/archit120/opencv_contrib. I think there will be a more expository update on the current state fairly soon.

6 Likes

I’ve updated this package. I’ve created JLL package named OpenCVQt_jll.jl which provide shared library of OpenCV libopencv_xxx (compiled with Qt for Linux). Then, I utilize/call this JLL package from this package. It enable us to use/install VideoCaptureWrap.jl easily even on Windows machine.

6 Likes

Regarding to tim.holy’s comment

I could confirm OpenCV: Introduction to Julia OpenCV Binding works on my Ubuntu 18.04 machine.

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.1 (2020-08-25)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using OpenCV

julia> cap = OpenCV.VideoCapture(Int32(0))
OpenCV.VideoCaptureAllocated(Ptr{Nothing} @0x00000000030e4c90)

julia> OpenCV.read(cap)
(true, UInt8[0x0a 0x0a … 0x0d 0x0c; 0x01 0x01 … 0x1a 0x19; 0x00 0x00 … 0x00 0x00]

UInt8[0x0a 0x0a … 0x12 0x0f; 0x03 0x03 … 0x19 0x15; 0x00 0x00 … 0x00 0x00]

UInt8[0x06 0x06 … 0x10 0x11; 0x04 0x04 … 0x12 0x13; 0x00 0x00 … 0x00 0x00]

a...

UInt8[0x06 0x06 … 0x06 0x06; 0x00 0x00 … 0x01 0x01; 0x00 0x00 … 0x00 0x00]

UInt8[0x06 0x06 … 0x06 0x06; 0x00 0x00 … 0x00 0x00; 0x00 0x00 … 0x00 0x00]

UInt8[0x08 0x08 … 0x06 0x06; 0x00 0x00 … 0x00 0x00; 0x00 0x00 … 0x00 0x00])

(OpenCV) pkg> 

Just to clarify, your OpenCVQt_jll.jl exploits that work, right? If so, this is an awesome contribution, and IMO the big remaining TODO to make that work really pay off. If so, have you thought about registering this package?

I went through this package briefly and this does not seem to use the wrappers I had built but instead repeats the work. There was a discussion some time ago about creating jll for the wrappers but I haven’t been able to devote much time to it because this semester is a bit heavier with the coursework. I have an approximate plan laid out in the discussion over here.

https://github.com/JuliaPackaging/Yggdrasil/pull/1497

2 Likes

OpenCVQt_jll.jl is not related to OpenCV: Introduction to Julia OpenCV Binding.

It is just generated by https://github.com/terasakisatoshi/OpenCVBuilder.jl/blob/main/qt/build_tarball.jl and will be used in [here].(https://github.com/terasakisatoshi/VideoCaptureWrapBuilder.jl/blob/main/build_tarball.jl#L53)

Thank you for your advice. :pray:

I’ve confirmed we could try OpenCV.jl genreated by opencv_contrib/modules/julia with my gist.

https://gist.github.com/terasakisatoshi/77e64396a5546338f606426d8d957706

I was wondering if we can build OpenCV.jl using BinaryBuilder.jl with this script (but still WIP), if so it would be great.

1 Like

I could confirm VideoCaptureWrap.jl works on Raspberry Pi 4 (it also should run RPI3).

Just run make gui is OK

For those who like to use OpenCV.jl, the following gist might be helpful.

https://gist.github.com/terasakisatoshi/4cd7f9f56018355f2f75d0f7da1169fd

2 Likes

This might be help

https://github.com/terasakisatoshi/ImageProcessing.jl