Forum

Author Topic: Question about camera calibration and alignment (and realignment)  (Read 13521 times)

andyroo

  • Sr. Member
  • ****
  • Posts: 443
    • View Profile
I've been experimenting with fixed camera models vs letting PS derive the model during alignment and optimization, and I have a few related questions about aligning and realigning and camera model parameters. Mostly the question is due to the time it takes to go through the whole alignment process, since I have to re-match images and the like.

1) is it necessary to re-align the images if I change the camera model, or can I accomplish the same results just by changing the model, then optimizing the alignment? I am curious both for the case where I start with a default model, and where I start with a pre-calibrated model and forget to check "fixed"

2) - mostly if the answer to (1) is "No" - if I start with the default camera model, align the images, then import a fixed model and optimize, I don't have to re-align everything. Is there a way to "Save" the points that are picked, or in other words, remember the pairs that are analyzed, from alignment to alignment?

3) I noticed when I forget to check "fixed" on my pre-calibrated model, that k1,k2,k3,f(x),f(y),c(x),c(y) all changed, but k4, p1,p2 did not - during the initial alignment. Is this desired behavior, or should k4,p1,p2 also change?

Ron

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Question about camera calibration and alignment (and realignment)
« Reply #1 on: July 16, 2014, 02:23:38 AM »
Hi Andyroo,

I can give you what I know from my very limited knowledge of Photogrammetry and Structure from motion. Hopefully someone can correct me if I am wrong.

1. I believe that the "fixed Calibration" check box is for Metric Cameras rather than domestic grade cameras.

2. When optimizing checking the Fit scew and fit k4 boxes allows PS to calculate individual values for scew, k4,p1 and p2 for each . I have seen different matrices for the "Camera Calibration Matrix" so I don't really know how the values for scew, k1, p1 and p2 affect the final point cloud however, I do end up with different error values for my markers.

3. I don't know what you mean by changing the camera model.

4. I assume you align photos, import calibration and then split image groups. The next steps I usually take are place ground control markers and Align Photos. This seems to give me the best result.

5. As regards aligning photos I find that any changes I make regarding the position of markers say requires a redo of align photos. My method these days is to align photos at low setting, place markers, add calibration,  uncheck cameras, align photos at high. Optimizing alone does not seem to be enough. My results generally improve by doing this especially when my cameras do not have rough GPS co-ords.

andyroo

  • Sr. Member
  • ****
  • Posts: 443
    • View Profile
Re: Question about camera calibration and alignment (and realignment)
« Reply #2 on: July 17, 2014, 04:35:46 AM »
Hi Ron,

Thanks for your reply. I tried to respond to your comments below, but they didn't really pertain to my question. I was looking for more specific information regarding how PS handles alignment and realignment when I alter camera calibration settings under Tools/Camera Calibration, particularly when moving from a camera model with parameters derived from PS to one with parameters derived from another source (lens calibration report, Agisoft Lens, etc).

1. I believe that the "fixed Calibration" check box is for Metric Cameras rather than domestic grade cameras.
Actually there is some interesting research that shows that some consumer-grade cameras have relatively robust lens stability - for example the Wackrow et al (2007) paper I reference in this post. I described in another post in the Agisoft Lens topic how I've been using Agisoft Lens to develop a fixed calibration for my D10, and because my error is dropping the more images I introduce, even though they are from multiple power cycles, that implies that my lens calibration is relatively stable (I am also seeing better coherence when comparing those DEMSs to lidar data, but that's another story).

2. When optimizing checking the Fit scew and fit k4 boxes allows PS to calculate individual values for scew, k4,p1 and p2 for each . I have seen different matrices for the "Camera Calibration Matrix" so I don't really know how the values for scew, k1, p1 and p2 affect the final point cloud however, I do end up with different error values for my markers.
My comment re k4, p1, and p2 was more that I noticed they remained static during initial alignment when I loaded a camera model (calibration data), while the other variables were refined.

3. I don't know what you mean by changing the camera model.
I just mean inputting (loading) a different calibration under Tools/Camera Calibration.

4. I assume you align photos, import calibration and then split image groups. The next steps I usually take are place ground control markers and Align Photos. This seems to give me the best result.
Actually I have been importing calibration, fixing it, then aligning, then entering GCP, then optimizing. I don't even bother splitting anymore, but that's one of the benefits of 192GB RAM :)

5. As regards aligning photos I find that any changes I make regarding the position of markers say requires a redo of align photos. My method these days is to align photos at low setting, place markers, add calibration,  uncheck cameras, align photos at high. Optimizing alone does not seem to be enough. My results generally improve by doing this especially when my cameras do not have rough GPS co-ords.
You might try adding camera calibration data before aligning - that should improve the initial alignment. Even before I started using a fixed camera model, pre-calibrating before alignment made placing GCPs waaay easier, because my initial model was less warped since my lens distortion parameters (k1, k2, k3, k4) were more accurate.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15067
    • View Profile
Re: Question about camera calibration and alignment (and realignment)
« Reply #3 on: July 17, 2014, 11:28:26 AM »
Hello Andy,

1-2) Feature points extraction and matching steps do not depend on the camera calibration, so you can re-run alignment phase from Console using the following command: PhotoScan.app.document.activeChunk.alignPhotos()
It allows to skip long image matching procedure.

3) k4 and p1,p2 parameters are not adjusted during Align Photos stage, they could be only refined during optimization.
Best regards,
Alexey Pasumansky,
Agisoft LLC

andyroo

  • Sr. Member
  • ****
  • Posts: 443
    • View Profile
Re: Question about camera calibration and alignment (and realignment)
« Reply #4 on: July 17, 2014, 09:11:06 PM »
Thankyou Alexey! This will save me a lot of time.

Ron

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Question about camera calibration and alignment (and realignment)
« Reply #5 on: July 19, 2014, 01:32:10 PM »
Hi Andy,

Thank you for your comments.
Quote
Actually I have been importing calibration, fixing it, then aligning, then entering GCP, then optimizing.
I plan to update my procedure manual as suggested.

I will be looking into your other comments too.

Ron

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Question about camera calibration and alignment (and realignment)
« Reply #6 on: July 28, 2014, 05:31:10 AM »
Hi Andy,

Thank you for the reference to those papers.

Though there may be good consistency between lenses in the manufacturing process, I would calibrate each lens individually. The consistency of systematic errors across the lens especially towards the edge is a good thing as it allows software like agisoft lens to predict the lens distortion  with good result using consumer grade cameras. I think the papers are dealing mainly with k1 values, we have moved forward since 2007.

For further reading, a recent paper, is worth looking at as it deals with methods of reducing the domed distortion and possibly (hopefully) a reduction of the number of ground control points.

Mike R. James and Stuart Robson 2014 Mitigating systematic error in topographic models derived from UAV and ground-based image networks, Letters to ESEX, EARTH SURFACE PROCESSES AND LANDFORMS

sjharwin

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Question about camera calibration and alignment (and realignment)
« Reply #7 on: July 30, 2014, 04:29:09 AM »
Hi,

That realign command will also save me a lot of time. Thanks.

I have a related issue. I am doing research into calibration options. When I started I created chunks for different flights and then merged the chunks (so that I could do an initial alignment on a small set prior to locating markers and doing the proper align of the merged set which then became my seed project for all subsequent testing). Now when I look at the camera calibration dialog it shows a camera calibration for each of the original chunks (as though those photos were taken with a different camera). The problem with that is that the derived camera calibrations are based on the original chunks instead of the entire photo set.  I need the calibration to be based on the whole set, ie I need the software to see one camera not multiple. Is there a way to tell the project that the merged chunk is one camera? If not I fear I will need to redo close to 30 projects since my research relies on a single calibration and I mistakenly assumed that the self-calibration would derive the camera model for the camera used not on chunk by chunk (within the merged chunk).

If I cannot tell the project that the merged chunk is a single camera then I assume I need to export all my masks and all my markers, create a new project with a single chunk from the start and then import the masks and markers... correct? It would be nice if I could avoid that since I have so many projects that are effectively the same set of photos and all these would need to be recreated.

Thanks
Steve
« Last Edit: August 07, 2014, 04:59:28 AM by sjharwin »

ThomasVD

  • Full Member
  • ***
  • Posts: 107
    • View Profile
Re: Question about camera calibration and alignment (and realignment)
« Reply #8 on: April 05, 2017, 11:55:41 AM »
1-2) Feature points extraction and matching steps do not depend on the camera calibration, so you can re-run alignment phase from Console using the following command: PhotoScan.app.document.activeChunk.alignPhotos()
It allows to skip long image matching procedure.

Would selecting all cameras, choosing 'reset camera alignment' and then selecting all cameras (all unaligned by now), and choosing 'align selected cameras' achieve the same result, or is there a difference?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15067
    • View Profile
Re: Question about camera calibration and alignment (and realignment)
« Reply #9 on: April 05, 2017, 03:23:17 PM »
Hello ThomasVD,

Align Selected Cameras is actually the same operation: in GUI you need to select NA (Not Aligned) cameras that should be re-aligned - that's how it works. If you run Align Selected operation on aligned subset - nothing will change.
Best regards,
Alexey Pasumansky,
Agisoft LLC