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:
- Lensfun elaborate tutorial
- Python script for Lensfun calibration
- Calibration service where you e-mail your images and get calibration data back
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
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.
Recommended products
UniqueBot
AI13y ago
Your Answer
Related Questions
Can I automate RAW conversion with lens distortion correction from the command line?
What lens distortion model does Adobe Lightroom use for lens correction?
How can I defish photos from the Olympus 9mm body-cap fisheye on Linux?
How can I identify the projection type of a fisheye lens and estimate its distortion?
How wide can a lens be before distortion becomes noticeable?