Skip to content

Commit c0bb78f

Browse files
committed
updated readme, added gdal to image.
1 parent 02f9be2 commit c0bb78f

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ MAINTAINER glw <https://github.com/glw/docker-python3-opencv>
33

44
# Thanks to Josip Janzic <josip.janzic@gmail.com> for Opencv installation Dockerfile
55

6+
RUN apt-get update && apt-get install -y software-properties-common python-software-properties
7+
RUN add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
68
RUN apt-get update && \
79
apt-get install -y \
810
build-essential \
@@ -29,6 +31,9 @@ RUN apt-get update && \
2931
libboost-python1.58.0 \
3032
libboost-python-dev \
3133
python-all-dev \
34+
gdal-bin \
35+
libgdal-dev \
36+
python3-gdal \
3237
&& \
3338

3439
wget https://bootstrap.pypa.io/get-pip.py && \
@@ -73,3 +78,9 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
7378

7479
# Externally accessible data is by default put in /data
7580
WORKDIR /data
81+
82+
# dont really need COPY command since the volume command puts it in your containers directory
83+
#copy relevant files for converting tif image to jpg and NDVI calculation
84+
#COPY NDVI-calc.sh tiff_2_jpg_convert.py write_colormap_file.py /data/
85+
86+
CMD ["/bin/bash"]

README.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,38 @@
1-
# docker_python3_opencv_exiv2
1+
# docker_python3_opencv_exiv2
2+
3+
## Latest version 1.1
4+
- added gdal for NDVI
25

36
## Docker image with ubuntu:16.04, python 3.5, opencv 3.4.1, and py3exiv2
47

58
Usage:
69

10+
#### clone this repo.
11+
* build with
12+
```
13+
docker build -t garretw/docker_python3_opencv_exiv2:1.1 .
714
```
8-
docker run -it -v /$(pwd)/:/data garretw/docker_python3_opencv_exiv2:1.0 /bin/bash
15+
16+
* Run with
17+
```
18+
docker run -it --rm -v /$(pwd)/:/data garretw/docker_python3_opencv_exiv2:1.1
919
$ python3
1020
>>> import cv2
1121
>>> import pyexiv2
1222
```
1323

14-
-v connects you to your current directory on your host computer.
24+
``` -v``` connects you to your current directory on your host computer.
25+
26+
- The working directory is set as ```/data``` on the container.
27+
28+
```--rm``` removes the container once you exit.
29+
30+
31+
## Convert TIF to jpg
32+
```
33+
for file in *.TIF; do python3 tiff_2_jpg_convert.py --input $file; done
34+
```
35+
36+
## NDVI Calculation use NDVI-calc.sh
1537

16-
The working directory is set as ```/data``` on the container.
1738

0 commit comments

Comments
 (0)