From ad8658a0a9a259f5bf572e6292db4ebcfff06721 Mon Sep 17 00:00:00 2001 From: Andrews Sobral <andrewssobral@gmail.com> Date: Tue, 18 Oct 2016 18:47:26 +0200 Subject: [PATCH] added Docker images --- README.md | 18 +++++++++++++++--- fet/fet.py | 9 +++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 61e2760..3576b0c 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ BGSLibrary A Background Subtraction Library -Last Page Update: **15/06/2016** +Last Page Update: **18/10/2016** -Latest Library Version: **1.9.2** (see Release Notes for more info) +Latest Library Version: **1.9.2** (see Release Notes for more info) The BGSLibrary was developed by [Andrews Sobral](https://sites.google.com/site/andrewssobral) and provides an easy-to-use C++ framework based on [OpenCV](http://www.opencv.org/) to perform background subtraction (BGS) in videos. The BGSLibrary compiles under Linux, Mac OS X and Windows. Currently the library offers **37**¹ BGS algorithms. A large amount of algorithms were provided by several authors. The source code is available under GNU GPL v3 license, the library is free and open source for academic purposes². @@ -167,9 +167,21 @@ Read instructions in README.txt file. <p align="center"><img src="https://sites.google.com/site/andrewssobral/bgslibrary_ubuntu.png" border="0" /></p> +Docker images +---------------------------------------- +Docker images are available for BGSLibrary with OpenCV 2.4.13 and OpenCV 3.1.0. + +* **Ubuntu 16.04 + VNC + OpenCV 2.4.13 + Python 2.7 + BGSLibrary (master branch)** +https://hub.docker.com/r/andrewssobral/bgslibrary_opencv2/ + +* **Ubuntu 16.04 + VNC + OpenCV 3.1.0 (+ contrib) + Python 2.7 + BGSLibrary (opencv3 branch)** +https://hub.docker.com/r/andrewssobral/bgslibrary_opencv3/ + +<p align="center"><img src="https://sites.google.com/site/andrewssobral/bgslibrary_opencv3_docker.png?width=640" border="0" /></p> + How to use BGS Library in other C++ code ---------------------------------------- -Download latest project source code, copy package_bgs directory to your project and create config folder (bgslibrary use it to store xml configuration files). For Windows users, a demo project for Visual Studio 2010 is provided. +Download latest project source code, copy package_bgs directory to your project and create config folder (bgslibrary use it to store xml configuration files). For Windows users, a demo project for Visual Studio 2010 is provided. See Demo.cpp example source code at: https://github.com/andrewssobral/bgslibrary/blob/master/Demo.cpp diff --git a/fet/fet.py b/fet/fet.py index 021abea..eeccc86 100644 --- a/fet/fet.py +++ b/fet/fet.py @@ -7,6 +7,7 @@ FET - FOREGROUND EVALUATION TOOL import numpy as np import cv2 +import os from os import listdir from os.path import isfile, join @@ -14,6 +15,9 @@ path_gt = 'GT/' path_fg = 'FG/' path_sc = 'SC/' +if not os.path.exists(path_sc): + os.makedirs(path_sc) + files_gt = [ f for f in listdir(path_gt) if isfile(join(path_gt,f)) ] files_fg = [ f for f in listdir(path_gt) if isfile(join(path_gt,f)) ] @@ -42,8 +46,10 @@ for file_gt, file_fg in zip(files_gt, files_fg): print(k, file_gt, file_fg) img_gt = cv2.imread(path_gt + file_gt,cv2.IMREAD_GRAYSCALE) img_fg = cv2.imread(path_fg + file_fg,cv2.IMREAD_GRAYSCALE) - #print(img_gt.shape,img_fg.shape) + # img_gt = cv2.resize(img_gt, (0,0), fx=0.5, fy=0.5) + # print(img_gt.shape,img_fg.shape) rows,cols = img_gt.shape + img_fg = cv2.resize(img_fg,(cols,rows)) img_res = np.zeros((rows,cols,3),np.uint8) for i in xrange(rows): for j in xrange(cols): @@ -85,4 +91,3 @@ print 'Fscore: ', Fscore print '' ##################################################################### - -- GitLab