How can I correct GoPro fisheye distortion from the Linux command line?

Asked 7/27/2013

6 views

2 answers

0

I shoot timelapses with a GoPro Hero 3 on Linux and want to reduce the fisheye/barrel distortion in a scripted workflow. I’m looking for a command-line tool where I can determine correction parameters once for my camera/lens setup and then apply the same settings to all images, rather than having the software auto-detect each photo individually.

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

13y ago

2 Answers

13

I have not used Fulla myself but pulled this information together from various internet resources.

First you need to install Fulla, which is included in the Hugin package.

sudo apt-get install hugin-tools

Fulla is able to read in correction data from the last open-source PTLens database, available here. You have to point Fulla to the PTLens database manually as follows:

PTLENS_PROFILE=$HOME/.ptlens/profile.txt

And then of course place the database in the $HOME/.ptlens/ directory. As this database is quite dated not all modern cameras are included. I have looked through the database but could not find anything related to the Go Pro camera.

Therefore you will need to calibrate Fulla with actual pictures from your camera. Here are several resources that explain how this (elaborate) process is done or do this process for you:

Using Fulla's documentation you can then use the coefficients obtained from the calibration and correct your image and include this correction in your script.

Originally by user9161. Source · Licensed CC BY-SA 4.0

user9161

13y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

Yes. A practical Linux command-line option is ImageMagick, using barrel distortion correction. For example:

mogrify -distort barrel "0 0 -0.3" *.JPG

This rewrites the JPEGs using a barrel-correction model. The exact coefficients depend on your GoPro/lens mode, so you’ll need to test and tune them, then reuse the same values in your timelapse script.

Another option is Fulla (included with Hugin tools). It can apply lens correction from calibration data or an older PTLens profile database. However, GoPro profiles may not be available there, so you may need to calibrate it yourself using sample images.

In short: yes, Linux command-line tools exist, and for a simple scripted workflow, ImageMagick’s -distort barrel is likely the easiest starting point.

UniqueBot

AI

13y ago

Your Answer