Forum

Author Topic: Agisoft lens  (Read 14956 times)

Shovelhead

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Agisoft lens
« on: May 28, 2017, 01:04:06 AM »
Has anyone here used agisoft lens? I cant seem to get good results with it. I tried it with my phantom 4 pro and for 10 pixels radial distortion at 2500 and 5 tangential.
I tried with my handheld prime lens camera and get 35 pixels radial distortion at 2500 but only .4 pixels tangential. I swapped lens' and get similar results
I thought I want sub pixel distortion in both.
I'm taking a series of photos from different angles of the chessboard. Ive tried focusing each photo and leaving the focus alone.

Yoann Courtois

  • Sr. Member
  • ****
  • Posts: 316
  • Engineer in Geodesy, Cartography and Surveying
    • View Profile
Re: Agisoft lens
« Reply #1 on: May 29, 2017, 10:13:08 AM »
Hi !

I would invite you to go check if this topic has been discussed in the "Lens" part of the forum (here is the "PhotoScan" part).

By the way, how would you get sud pixel distortions if your lens has indeed distortions ? Camera calibration is used to know the most accurately the distortions of your camera to be able to correct them during photogrammetric process and get more accurate results.

Agisoft Lens actually is dedicated to camera calibration so it will give you results (distortions values) with less RMS errors than direct process through PhotoScan. But you have to remember your camera has to keep the exact same configuration between calibration and survey...and it's also the case for focusing.
If your focus changes, you camera parameters change ! So if you have focused each photo on the chess board, each picture has a slight different focal length and distortions values... So an accurate calibration can't be calculate.

You may understand now that calibrate a P4P seems to be impossible with a chessboard and Agisoft Lens as you have have you configurate it the same for the survey. So flight at 30m ? Calibration at 30m !
--
Yoann COURTOIS
R&D Engineer in photogrammetric process and mobile application
Lyon, FRANCE
--

Shovelhead

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Agisoft lens
« Reply #2 on: June 03, 2017, 11:03:15 PM »
Hi !

I would invite you to go check if this topic has been discussed in the "Lens" part of the forum (here is the "PhotoScan" part).

By the way, how would you get sud pixel distortions if your lens has indeed distortions ? Camera calibration is used to know the most accurately the distortions of your camera to be able to correct them during photogrammetric process and get more accurate results.

Agisoft Lens actually is dedicated to camera calibration so it will give you results (distortions values) with less RMS errors than direct process through PhotoScan. But you have to remember your camera has to keep the exact same configuration between calibration and survey...and it's also the case for focusing.
If your focus changes, you camera parameters change ! So if you have focused each photo on the chess board, each picture has a slight different focal length and distortions values... So an accurate calibration can't be calculate.

You may understand now that calibrate a P4P seems to be impossible with a chessboard and Agisoft Lens as you have have you configurate it the same for the survey. So flight at 30m ? Calibration at 30m !

What kind of results are people getting for their radial distortion? My photogrammetry teacher told me I should be getting sub pixel as I do for my tangential distortion. Is anyone getting this?

So I cant focus my camera between shots on the calibration or between the calibration and the field? Seems pretty useless if that's the case.

Yoann Courtois

  • Sr. Member
  • ****
  • Posts: 316
  • Engineer in Geodesy, Cartography and Surveying
    • View Profile
Re: Agisoft lens
« Reply #3 on: June 04, 2017, 11:12:16 AM »
Hi !

Gonna check on Tuesday at work what distortion values I have. (Tomorrow is public holiday in France)
I will give you some examples at the same time.
But I'm pretty sure radial distortion values can be pretty high, and even more for fisheye lens.
Whereas tangential distortion values must be low because it's only regarding lens alignment in your camera.

If it's the case ? Of course it is !
So surprising your teacher didn't tell you that, even before saying anything about distortions.
If you change the focus, you change the focal length, which is the main factor that has to be calculated for an accurate photogrammetric measurement.
--
Yoann COURTOIS
R&D Engineer in photogrammetric process and mobile application
Lyon, FRANCE
--

Shovelhead

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Agisoft lens
« Reply #4 on: June 05, 2017, 01:33:47 AM »
Hi !

Gonna check on Tuesday at work what distortion values I have. (Tomorrow is public holiday in France)
I will give you some examples at the same time.
But I'm pretty sure radial distortion values can be pretty high, and even more for fisheye lens.
Whereas tangential distortion values must be low because it's only regarding lens alignment in your camera.

If it's the case ? Of course it is !
So surprising your teacher didn't tell you that, even before saying anything about distortions.
If you change the focus, you change the focal length, which is the main factor that has to be calculated for an accurate photogrammetric measurement.

That would be very much appreciated.

Yea I retried it without changing the focus and got very similar results. Also of note is that I'm using a prime lens.

When in the field should I always keep the same focus? Even though some images will obviously be blurry?

macsurveyr

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: Agisoft lens
« Reply #5 on: June 06, 2017, 02:00:54 AM »
There seems to be confusion about whether PhotoScan is capable of solving a complete and accurate lens calibration. And yes, it is very capable of doing so if proper photos are taken.

The best field practice is to use auto-focus once, make sure the photo is in focus, and then turn off focus entirely. Even better, tape the lens so no accidental change is possible. Sadly, taping some lenses will not actually accomplish anything but it might serve as a reminder. Capture a set of images from the same approximate distance to insure that all photos are in proper focus. By a set, I mean take proper overlapping stereo photos in landscape mode and then take a few additional photos of the same subject area as the landscape photos, with the camera rotated to portrait. It is better to rotate both clockwise and counter-clockwise for additional portrait photos. With all photos captured in a set with no change in focus (or zoom if using a zoom lens), make sure all photos in a set are grouped in a camera calibration group.

You can take another set of photos from a different distance and you should in fact refocus to make sure your images are not blurry. You should take a complete set - with some rotated - and make sure the new set is grouped in a separate camera calibration group. Both sets will be calibrated at the same time if separated into groups - in the camera calibration dialog box.

A high quality lens calibration is not a trivial thing but can be made to seem so if proper images are taken and optimized thoroughly.

Tom

Yoann Courtois

  • Sr. Member
  • ****
  • Posts: 316
  • Engineer in Geodesy, Cartography and Surveying
    • View Profile
Re: Agisoft lens
« Reply #6 on: June 06, 2017, 09:49:30 AM »
Hi !

Thanks Tom, I couldn't explain better than that :D

For Shovelhead, please find attached the two calibration reports for my GoPro Hero 4 and my Phantom 4 Pro.

It looks my previous point of view was wrong.
Radial distortion (K1 to K4) are not higher than 1 even K1 for the GoPro is 5x higher than Phantom's one.
Whereas tangential distortion (P1 to P4) are clearly different (GoPro P1 = -7 !!!)
Affinity and skew (B1, B2) have quite high values, especially for the Phantom, but those parameters have very small influence on the global distortion model.
--
Yoann COURTOIS
R&D Engineer in photogrammetric process and mobile application
Lyon, FRANCE
--

Shovelhead

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Agisoft lens
« Reply #7 on: June 08, 2017, 08:25:13 AM »
Hi !

Thanks Tom, I couldn't explain better than that :D

For Shovelhead, please find attached the two calibration reports for my GoPro Hero 4 and my Phantom 4 Pro.

It looks my previous point of view was wrong.
Radial distortion (K1 to K4) are not higher than 1 even K1 for the GoPro is 5x higher than Phantom's one.
Whereas tangential distortion (P1 to P4) are clearly different (GoPro P1 = -7 !!!)
Affinity and skew (B1, B2) have quite high values, especially for the Phantom, but those parameters have very small influence on the global distortion model.

How do I open the .xml? I usually work with .lnz with lens

Shovelhead

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Agisoft lens
« Reply #8 on: June 08, 2017, 08:52:35 AM »
There seems to be confusion about whether PhotoScan is capable of solving a complete and accurate lens calibration. And yes, it is very capable of doing so if proper photos are taken.

The best field practice is to use auto-focus once, make sure the photo is in focus, and then turn off focus entirely. Even better, tape the lens so no accidental change is possible. Sadly, taping some lenses will not actually accomplish anything but it might serve as a reminder. Capture a set of images from the same approximate distance to insure that all photos are in proper focus. By a set, I mean take proper overlapping stereo photos in landscape mode and then take a few additional photos of the same subject area as the landscape photos, with the camera rotated to portrait. It is better to rotate both clockwise and counter-clockwise for additional portrait photos. With all photos captured in a set with no change in focus (or zoom if using a zoom lens), make sure all photos in a set are grouped in a camera calibration group.

You can take another set of photos from a different distance and you should in fact refocus to make sure your images are not blurry. You should take a complete set - with some rotated - and make sure the new set is grouped in a separate camera calibration group. Both sets will be calibrated at the same time if separated into groups - in the camera calibration dialog box.

A high quality lens calibration is not a trivial thing but can be made to seem so if proper images are taken and optimized thoroughly.

Tom

I followed this procedure twice and got very similar results to all the other calibrations I ran. I attached a screenshot.

Do these numbers look ok for a prime lens? Is it better to upload my calibration file into agisoft for every project or let it determine its own calibration based on the project photos?

Yoann Courtois

  • Sr. Member
  • ****
  • Posts: 316
  • Engineer in Geodesy, Cartography and Surveying
    • View Profile
Re: Agisoft lens
« Reply #9 on: June 09, 2017, 06:23:44 PM »
Hi !

*.xml files can ba opened with a simple text soft, like Notepad++

As I previously said, GoPro and UAVs calibration are almost not really possible with Agisoft Lens:
- GoPro fisheye is too large for having an enough big chessboard.
- UAVs camera has to be calibrate with the same parameter as when it flight. So, focusing on infinity, and for the Phantom4Pro, the chessboard as to be 15-20m far for the camera... again, not possible to have an enough big chessboard.

So I've got those calibrations from PhotoScan autocalibration process of large set of pictures (2000-3000) so that everything is quite well balanced. That's why I often got *.xml files.

Regards

P.S. Your std errors are really high compare to distortion values ! That's not looking so accurate.
Gonna send you some screen shot from my work so that you'll got values and errors when following my workflow.
« Last Edit: June 09, 2017, 06:28:23 PM by Yoann Courtois »
--
Yoann COURTOIS
R&D Engineer in photogrammetric process and mobile application
Lyon, FRANCE
--

jazzyj

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: Agisoft lens
« Reply #10 on: December 21, 2017, 08:12:08 AM »
So I've been reading about camera calibration for a UAV and there seems to be fairly little information out there.

I'm going to be doing a survey flying at 400ft.  I'm going to have ground control points laid out for me by a land surveyor.  With enough ground control points I read you can disable using georeferencing information in the photo EXIF.  Does this also mean camera calibration does not provide significant benefit? The accuracy level I need is just 1-foot or better.  If camera calibration is necessary has someone documented the proper steps for this type of application?

Yoann Courtois

  • Sr. Member
  • ****
  • Posts: 316
  • Engineer in Geodesy, Cartography and Surveying
    • View Profile
Re: Agisoft lens
« Reply #11 on: December 21, 2017, 10:10:21 AM »
Hi Jassyj,

It always depend on your project purpose, but from what you say (1 ft accuracy at 400 ft height), most of UAV won't need any precalibration to reach this accuracy. You will be able to process everything in autocalibration !
Just keep in mind that it will then depend a lot on your GCPs, how many, how accurate and how well distribute they are !

Regards
--
Yoann COURTOIS
R&D Engineer in photogrammetric process and mobile application
Lyon, FRANCE
--