Docker image with OpenCV with X11 forwarding for GUI

Hi!
Docker is very cool. You can use it to build applications in isolated environments (e.g. some Ubuntu distro you like, with some specific OpenCV version installed in it), pack the entire OS and app into an “image”, and ship it to a repository, where others can download it, and “deploy” the image into a container.

But, by default, when you run a container, you are doing it via a terminal command (e.g. run docker –rm -ti some_image_name /bin/bash), and as a result, your image don’t have a way to show GUI apps, unless you do something else.

In my case, I sometimes want to see that my code is running, for instance, some OpenCV functions, so I want to see the displayed GUI.

There is a lot of discussion about this topic, but the most simple way to do it is  to not touch the Dockerfile, but, instead, do the trick when running the container:

xhost +
sudo docker run --rm -ti --net=host --ipc=host \
   -e DISPLAY=$DISPLAY \
   -v /tmp/.X11-unix:/tmp/.X11-unix \
   opencv_gui ./sample/build/bin/opencvSample ./sample/docker.png

There is a lot of stuff going on there. Basically, the xhost + allows everybody to use your host x server; while the DISPLAY and X11 commands specify the Docker container to share the X11 socket and host display.
The opencv_gui is the name of a sample Docker image which runs the opencvSample program. You can get it from my public repository at Docker Hub:

docker pull mnieto/opencv_gui

You will see that the Dockerfile is pretty simple and without any specific X11 command:

FROM ubuntu:14.04
MAINTAINER mnieto

# General dependencies
RUN sudo apt-get update && apt-get install -y \	
	build-essential \
	cmake \
	git	

# Eigen and OpenCV
RUN apt-get install -y \
	libopencv-dev

# Project
RUN mkdir /sample
COPY main.cpp CMakeLists.txt /sample/
RUN 	cd /sample && \
	mkdir build && \
	cd build && \
	cmake .. && \
	make -j

COPY docker.png /sample/

If you run that, you should be able to see the following image:

Good luck!
Regards,

Marcos

Advertisements
Posted in Computer vision, OpenCV | Tagged , , , | 2 Comments

Real-time vehicle detection and lane detection for ADAS

This time I bring a new result we have achieved in Vicomtech-IK4: an improved real-time vehicle detection and lane tracking system for ADAS (Advanced Driver Assitance Systems).

It follows the history of developments we’ve been doing in this line, evolving previous approaches (including migration into iOS) into a more reliable and fast solution.

Links to previous videos:

The new developments include real-time performance in Android devices, much more reliable detection and tracking of vehicles (using a multi-thread approach combining different detectors and tracking approaches), and also a holistic model of lanes, which are filtered with a multi-Kalman filter.

Hope you like this video! If you are curious about it or have technical doubts, please, write an entry in this post. Sometimes I am too busy to response quickly, but I try to come back to the blog as often as I can.

See you!

Posted in ADAS, Computer vision, Viulib | Tagged , , , | 19 Comments

ShareLaTeX – Your new tool to create papers

Hi all,
I can’t really believe I have not written about ShareLaTeX before.

ShareLaTeX is an online editor of LaTeX files, with utilities such as previsualization, easy upload/download options, and what is even better, collaborative and free!
ShareLaTeX

I’ve used it for years now successfully for my last papers, and I can say that it is easy, effective and works!

However, there are things I don’t like: there are some premium features not free, such as synchronization with Dropbox, track changes or connection with Github. These are amazing feats I would like to see in my free account. But I understand this is difficult to achieve unless Google comes and buy your site : )

In any case, I recommend it to everyone.

Regards!

Marcos

Posted in Latex | Tagged , , , , | Leave a comment

ITS World Congress – Bordeaux 5-9 october 2015

Hi all!
In two weeks I am attending the ITS World congress in Bordeaux (http://itsworldcongress.com/). I’ll be presenting 3 papers in the scientific and technical sessions, but also be present at the Vicomtech’s booth F2.

We will be demonstrating our latest vision technologies, including the latest road model:

and the person drowsiness detection:

See you there!
Regards,

Marcos

Posted in ADAS | Tagged , | 4 Comments

IET Computer Vision – Special Issue: Video Analytics

Hi all,

This is to inform all of you of the call for papers for the Special Issue on Video Analytics in the IET Computer Vision journal where I am participating as Guest Editor:

http://digital-library.theiet.org/files/IET_CVI_VIDEO.pdf

Important dates
Submission deadline: 1 Jul 2015
Publication date: Apr 2016

IET Computer Vision

 

Text of the call:
================================================================================
IET Computer Vision
Special Issue: Video Analytics

As digital technologies advance, video has become ubiquitous and hence a rich source of information. Video analytics (or video content analysis) is an important area of computer vision which is concerned with the process of making sense of video content in order to ultimately understand video. Video analytics appears in different forms, such as activity recognition, motion detection, object detection and recognition, person detection and recognition, event and scenario recognition, anomaly detection, and identity recognition and verifi cation. Video analytics can be applied in a wide range of domains including healthcare, retail, transport, smart homes, safety and security. Aims and objectives: The aims of the Special Issue are to raise the awareness of the importance of video analytics, to showcase the state of the art in video analytics, and to provide an opportunity to accelerate the advancement of video analytics. Specifi c objectives are (1) reporting the latest developments in video analytics (2) identifying major research challenges in a general framework of video analytics (3) and providing visions for the advancement of the state of the art. The Special Issue is expected to offer a mixture of invited papers and contributed papers, along with an editorial. Prospective authors are invited to submit unpublished, original work to this Special Issue to be peer-reviewed for publication. The submitted papers should address scientifi c challenges in video analytics including but not limited to the following topics:

  • image/video representation
  • feature extraction
  • interest modelling
  • formulation of the problem (e.g., as one-class or two-class machine learning, probabilistic/deep learning, or invariant image comparison)
  • relevant fundamental problems (e.g., similarity, invariance)

The submitted papers may also present novel solutions or report new applications.

All submissions are subject to the journal’s peer-review procedures. The authors should follow the journal’s Author Guide at http://digital-library.theiet.org/journals/author-guide when preparing papers for submission to the Special Issue.

Posted in Call for papers, Computer vision | Tagged , , , | Leave a comment

Driver Drowsiness Detection

Hi,

It’s been a while since my last post. These are being busy times in Vicomtech-IK4.
One of the reasons is our efforts in the field of ADAS (Advanced Driver Assistance Systems).

In that field, we already worked on LDW (Lane Departure Warning), or FCW (Forward Collision Warning) using single cameras.
In this post, I want to show the last results on DDD (Driver Drowsiness Detection).

The main idea is that a camera facing to the driver can be used to detect the eyes, and determines whether they are open or closed. This way, the algorithm can measure the blink time, frequency and other statistics that can be correlated with the fatigue level of the driver, and eventually used to warn the driver through an HMI.

Of course, the implementations are done using C++ and we are currently running in real-time in in-vehicle computers.
This year we will also be showing this technology and others in the ITS World Congress, to be held in Bordeaux (http://itsworldcongress.com/)

Regards!

Marcos

Posted in ADAS, Computer vision | Tagged , , , , | 3 Comments

Call for Participation — Workshop on Video Soft Sensing in Belfast on Tuesday 2 December 2014

——————————————————————————————————————————————–
CALL FOR PARTICIPATION

Video Soft Sensing Workshop, as part of the UCAml/IWAAL conferences, will be held on Tuesday 2 December 2014 in Assembly Buildings Conference Centre, Belfast (2-10 Fisherwick Place, Belfast, BT1 6DW). The workshop details and the program can be found from the pages below:
http://scm.ulster.ac.uk/~scmresearch/SERG/ucamiiwaal2014/workshop-vss.html
http://scm.ulster.ac.uk/~scmresearch/SERG/ucamiiwaal2014/vss-program.html

There will be a keynote talk and some contributed paper presentations on topics related to soft sensing: game-theoretic methods for video analysis, activity recognition, face recognition, person detection/tracking/masking, similarity measure for video analysis, and so on.

You are invited to attend this workshop free of charge. For catering purposes, please inform Workshop Chair (Professor Hui Wang, h.wang@ulster.ac.uk) if you plan to attend.

——————————————————————————————————————————————–

Posted in Other stuff... | Tagged , , , | Leave a comment