Forum

Author Topic: Adjusting camera extrinsic giving initial cameras config  (Read 3593 times)

Adsh

  • Newbie
  • *
  • Posts: 9
    • View Profile
Adjusting camera extrinsic giving initial cameras config
« on: November 19, 2019, 02:37:09 AM »
We have a camera system to capture objects. But recently we encounter a problem where we have some objects with duplicate texture pattern or textureless patches which causes a completely wrong alignment of the cameras.

So in this case we follow the usual method, where we use the camera configuration that generated from other successfully reconstruction instead of letting the algorithm figures out the alignment. This method works fine generally, but unfortunately we found that our cameras' position/orientation slightly change from time to time due to maintenance, so using a single camera configuration across all the data we captured results in degraded qualities in some of them. We believe an ideal solution will be if we can perform the bundle adjustment & camera calibration with the an old camera configuration as initialization, and the algorithm only slightly adjust the camera position & orientation (extrinsic) as well as the intrinsic based on the initialization. But in the Metashape we found that we can only adjust the camera intrinsic after we load a camera configuration (xml file). And running align photos in Metashape after loading a xml is not working as it will only rerun the entire bundle adjustment without using the information from the xml file.

So we are looking for if Metashape can handle such a process of adjusting the extrinsic and intrinsic based on the initial camera config, and we are also happy to see if there is any python script can do that.

Thanks a lot.

Kiesel

  • Sr. Member
  • ****
  • Posts: 332
    • View Profile
Re: Adjusting camera extrinsic giving initial cameras config
« Reply #1 on: November 19, 2019, 10:30:15 AM »
Hello Adsh,

I have successfully done this by importing camera positions (xml file) and then optimize cameras as normal only (no new alignment).

Best regards,

Kiesel
« Last Edit: November 19, 2019, 10:54:32 AM by Kiesel »

Adsh

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Adjusting camera extrinsic giving initial cameras config
« Reply #2 on: November 19, 2019, 11:07:30 PM »
Hi Kiesel,

Thanks for the reply. I did the same thing but correct me if I was wrong. It seems the  "optimize cameras" only changes the intrinsic of the camera as shown in the UI (you can only choose which intrinsic to be optimized in the UI). I think maybe changing the extrinsic will also help getting the best result in my case.

Other thoughts?

Bests,

Adsh

Kiesel

  • Sr. Member
  • ****
  • Posts: 332
    • View Profile
Re: Adjusting camera extrinsic giving initial cameras config
« Reply #3 on: November 19, 2019, 11:22:35 PM »
Hi Adsh,

in combination with gradual selection, it first optimizes the intrinsic camera parameter and then the extrinsic as well (sometimes you can even see it).

Best,

Kiesel
« Last Edit: November 19, 2019, 11:24:36 PM by Kiesel »

Adsh

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Adjusting camera extrinsic giving initial cameras config
« Reply #4 on: November 20, 2019, 01:10:25 AM »
Hi Kiesel,

Thanks again. I am a little bit confused so would like to know more details. Do you mean I need to use gradual selection first to activate extrinsic optimization? And by "(sometimes you can even see it)" do yo mean the option of adjusting the extrinsic will appear in the UI?

Bests,

Adsh

jnb

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: Adjusting camera extrinsic giving initial cameras config
« Reply #5 on: November 20, 2019, 03:23:28 AM »
Hello,

Maybe you can check the new alignment options in 1.6 beta. You could tried the estimated preselection after importing your camera configuration (xml)

Sequential pre-selection is trying to match the images with a bunch of their neighbors according to the camera labels.

Estimated preselection is based on the estimated camera locations after initial alignment (for example, performed using rough accuracy settings).

One of the possible scenarios of use - when aligning the video sequence frames run Sequential preselection at first and then Estimated preselection, if there are intersecting parts of the image acquisition path.

Kiesel

  • Sr. Member
  • ****
  • Posts: 332
    • View Profile
Re: Adjusting camera extrinsic giving initial cameras config
« Reply #6 on: November 20, 2019, 03:14:34 PM »
Hi Adsh,

sorry that I have not been clear enough.

Meant was, that I
1. import camera positions as xml (a sparse point cloud is generated)
2. then I use 'Gradual Selection' tool to select points with large reprojection error, reconstruction uncertainty or projection inaccuracy and erase them before optimization in 'Optimize Cameras...' in an iterative way to improve intrinsics and extrinsics  as I do with any other project too. First the intrinsics are optimized and then with these optimized intrinsics the extrinsics, it's a combined process, there is no additional menu for extrinsics optimization.

With "sometimes you can even see it" was meant, that you can sometimes see that a camera changes it's position by optimization.

In the hope that it is clearer now

Kiesel
« Last Edit: November 25, 2019, 12:10:20 PM by Kiesel »

Adsh

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Adjusting camera extrinsic giving initial cameras config
« Reply #7 on: November 22, 2019, 04:02:35 AM »
Hi Kiesel,

Thanks a lot. It really helps.

Adsh

Kiesel

  • Sr. Member
  • ****
  • Posts: 332
    • View Profile
Re: Adjusting camera extrinsic giving initial cameras config
« Reply #8 on: November 25, 2019, 12:29:35 PM »
 :)