dakotabenjamin / CameraCalibration

GNU General Public License v3.0
33 stars 19 forks source link

Dockerized #2

Closed mojodna closed 7 years ago

mojodna commented 7 years ago

Relatively straightforward Dockerization. Documentation would be a good addition, specifically the assumptions about mounting /app/config (containing {distortion,matrix}.txt) and /app/images.

It might also be nice to write the output to a different volume (so it can be treated even more like an appliance) and to tell exiftool to not create backups.

dakotabenjamin commented 7 years ago

I'm having trouble getting this to run, what was your process?

dakotabenjamin commented 7 years ago
dmb2@OpenDroneMap:~/CameraCalibration$ docker run -v ~/CameraCalibration/sample/chessboard:/app/config -v ~/CameraCalibration/sample/images:/app/images cameracal
Traceback (most recent call last):
  File "undistort.py", line 37, in <module>
    images_path = os.path.split(img_path[0])[0]
IndexError: list index out of range
mojodna commented 7 years ago

Yup, that was my process. /app/config is assumed to have a matrix.txt and distortion.txt (the default endpoint doesn't create them).

dakotabenjamin commented 7 years ago

oops its img not images :laughing:

dakotabenjamin commented 7 years ago

another error:

DEBUG:/app/images
Traceback (most recent call last):
  File "undistort.py", line 57, in <module>
    os.mkdir(out_path)
OSError: [Errno 13] Permission denied: '/app/images/out'

What does it mean in the Dockerfile when you set the user to nobody?

mojodna commented 7 years ago

It's the user that commands will run as (nobody is a pretty standard system user with no privileges). I try to avoid running stuff as root even though Docker is theoretically containing things. In this case, we probably want to drop that so that undistort.py can create and write to the target directory.

dakotabenjamin commented 7 years ago

Fixed that and added docs. Also reconfigured the sample directory to look nicer

mojodna commented 7 years ago

Woot.