OpenCV + opencv_contrib + Python {2,3} + Java + GUI + media/video support + HDF5
255
OpenCV 3.4.4 + opencv_contrib + Python {2,3} + Java + GUI + media/video support + HDF5
Enable display so that container could access it
xhost +
Create a new container and mount the home directory. Replace <CONTAINER_NAME> by a name that you love.
docker run -it --name <CONTAINER_NAME> \
--user $(id -u) -e DISPLAY --workdir=$(pwd) \
--volume="/home/$USER:/home/$USER" \
--volume="/etc/group:/etc/group:ro" \
--volume="/etc/passwd:/etc/passwd:ro" \
--volume="/etc/shadow:/etc/shadow:ro" \
--volume="/etc/sudoers.d:/etc/sudoers.d:ro" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix" \
thtung1/opencv
Detach using Ctrl+p->Ctrl+q.
Attach to a running docker container: docker attach --sig-proxy=false <CONTAINER_NAME>
Start an existing docker container: docker start <CONTAINER_NAME>
The original instruction is here
DisplayImage.cpp
#include <stdio.h>
#include <opencv2/opencv.hpp>
using namespace cv;
int main(int argc, char** argv )
{
Mat image;
image = imread( argv[1], 1 );
if ( !image.data )
{
printf("No image data \n");
return -1;
}
namedWindow("Display Image", WINDOW_AUTOSIZE );
imshow("Display Image", image);
waitKey(0);
return 0;
}
cmake_minimum_required(VERSION 2.8)
project( DisplayImage )
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
add_executable( DisplayImage DisplayImage.cpp )
target_link_libraries( DisplayImage ${OpenCV_LIBS} )
mkdir build
cd build
cmake ..
make
./DisplayImage whatever_image.jpgContent type
Image
Digest
Size
1 GB
Last updated
over 7 years ago
docker pull thtung1/opencv