Forum

Author Topic: Contrast enhancement changes camera positions  (Read 3334 times)

huckw

  • Newbie
  • *
  • Posts: 4
    • View Profile
Contrast enhancement changes camera positions
« on: November 14, 2015, 01:39:21 AM »
I have two versions of a set of images: one set is as it came from the camera while the other has had some contrast enhancement.  Both sets of images produce a good model but I am surprised to see the camera positions/poses so different for the two sets...is this normal?  Or maybe these are considered close?

here is camera 10 from first set
<camera id="10" label="15223208-2015-11-03-160146.jpg" sensor_id="0" enabled="true">
        <transform>8.7604856958468902e-001 3.1752547827018696e-001 -3.6292764344688505e-001 3.9532771096777926e+000 -3.6494470045003591e-001 9.2850052972977926e-001 -6.8572092756111175e-002 8.4841076306859320e-001 3.1520512264564143e-001 1.9252100389518070e-001 9.2929080148096688e-001 8.3161099324315579e-001 0.0000000000000000e+000 0.0000000000000000e+000 0.0000000000000000e+000 1.0000000000000000e+000</transform>
      </camera>

here is camera 10 from second set
<camera id="10" label="15223208-2015-11-03-160146.jpg" sensor_id="0" enabled="true">
        <transform>8.0929981531905448e-001 3.9401736152761885e-001 -4.3564220151330357e-001 6.1546556805826933e+000 -4.0852879431268102e-001 9.1046096441529567e-001 6.4537248883080822e-002 -4.8811891503867582e+000 4.2206401545496774e-001 1.2574239973367482e-001 8.9780332799964901e-001 1.8648129184389368e+000 0.0000000000000000e+000 0.0000000000000000e+000 0.0000000000000000e+000 1.0000000000000000e+000</transform>
      </camera>

What units are x, y and z in?  Is x,y,z the the position of the camera from the model's center?

Thanks in advance

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15029
    • View Profile
Re: Contrast enhancement changes camera positions
« Reply #1 on: November 14, 2015, 12:22:15 PM »
Hello huckw,

Camera transofrmation matrix in the XML file is given in internal coordinate system and it may be different each time your run the alignment for the same set.
Best regards,
Alexey Pasumansky,
Agisoft LLC

huckw

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Contrast enhancement changes camera positions
« Reply #2 on: November 14, 2015, 05:10:14 PM »
Thanks Alexey.  I wondered if that was the case that the absolute camera positions could be different between runs.  So I decided to compare the relative camera positions.  I find all camera positions relative to camera 0 which I place at 0,0,0 with zero rotation.  Here the difference is less obvious but it is still there.  It seems like a scale factor between the 2. 

The purpose for understanding this is, like so many PhotoScan users, we have pretty good measurements of camera position and pose.  We'd like to be able to compare PS's estimated camera positions with our measured ones.

Thanks again

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15029
    • View Profile
Re: Contrast enhancement changes camera positions
« Reply #3 on: November 15, 2015, 01:28:04 AM »
Hello huckw,

If you need to perform measurements, you should use some reference points in scene. Therefore camera center positions will be estimated in the same coordinate space and will be displayed in the Estimated tab of Reference pane.
Best regards,
Alexey Pasumansky,
Agisoft LLC

huckw

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Contrast enhancement changes camera positions
« Reply #4 on: November 17, 2015, 12:10:07 AM »
Alexey,

So is it possible to get camera positions from first set of images using Tools->Export->ExportCameras and grab the X Y and Z from each camera .  For example I'd use X=3.9532771096777926e+000, Y= 8.4841076306859320e-001 and Z=8.3161099324315579e-001 for camera 10...

<camera id="10" label="15223208-2015-11-03-160146.jpg" sensor_id="0" enabled="true">
        <transform>8.7604856958468902e-001 3.1752547827018696e-001 -3.6292764344688505e-001 3.9532771096777926e+000 -3.6494470045003591e-001 9.2850052972977926e-001 -6.8572092756111175e-002 8.4841076306859320e-001 3.1520512264564143e-001 1.9252100389518070e-001 9.2929080148096688e-001 8.3161099324315579e-001 0.0000000000000000e+000 0.0000000000000000e+000 0.0000000000000000e+000 1.0000000000000000e+000</transform>
      </camera>

I then create a .txt file with image file name and the X, Y, Z position  in the method above.  I load in my contrast enhanced images, import the txt file in the ground control pane then run Align Photos.  The X,Y,Z positions measured by PhotoScan during image alignemnt are nothing like those I imported in ground control pane.

Am I misunderstanding how to use the GCPs as camera positions?

huckw

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Contrast enhancement changes camera positions
« Reply #5 on: November 17, 2015, 12:55:37 AM »
I notice now that the exported camera positions XML file also has an entry called <reference> which has my positions from the ground control pane.  How do I use <reference> with <transform>?  And why are the values in the xml <transform> so different than those in the OPK file?  Here is camera 0 in the xml file...

<camera id="0" label="15223208-2015-11-03-155216.jpg" sensor_id="0" enabled="true">
        <transform>9.9257665626629776e-001 -9.9765735464485153e-002 6.9558460753859616e-002 5.0010392794260927e-001 9.6732795775866590e-002 9.9426090980306681e-001 4.5694742136950080e-002 -3.5631390299656531e+000 -7.3718028029786206e-002 -3.8626949980657875e-002 9.9653078782273030e-001 3.8970908676741584e-001 0.0000000000000000e+000 0.0000000000000000e+000 0.0000000000000000e+000 1.0000000000000000e+000</transform>
        <reference x="-1.2732748241840364e+000" y="3.9787106723689770e-002" z="1.5377587140849658e-001" enabled="true"/>
      </camera>

And here is the corresponding line from the OPK file...

15223208-2015-11-03-155216.jpg   -1.2791114147372733   0.0453937767559989   0.1545805856874938   179.2021998046990900   -8.5381219682924936   -8.9133120658687641   0.9769750285542050   0.1528826389375491   -0.1488176477874887   0.1532227712350960   -0.9881484201342355   -0.0092456563451018   -0.1484674238900489   -0.0137694770309293   -0.9888214325881833

I do not see how these two files are related....can you please help?