Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Jan Philip Göpfert

Pages: [1]
General / Cameras from PhotoScan to Blender
« on: January 31, 2017, 05:59:20 PM »
PhotoScan not only manages to automagically determine camera positions, it also saves them in an XML format together with some calibration and region info, e.g.:

Code: [Select]
      <sensor id="0" label="EOS 700D (50 mm)" type="frame">
        <resolution width="3476" height="5208"/>
        <property name="focal_length" value="50"/>
        <property name="fixed" value="false"/>
        <calibration type="frame" class="adjusted">
          <resolution width="3476" height="5208"/>
      <camera id="0" label="CAM01.tiff" sensor_id="0" enabled="true">
        <transform>8.6286025325444304e-01 2.2784429461927105e-01 4.5117531045384701e-01 -3.4971964005367551e+00 -1.4353836822127128e-01 9.6634264388175029e-01 -2.1349152550863368e-01 2.1643585846070095e+00 -4.8463276839484676e-01 1.1945238392378640e-01 8.6652305668855178e-01 7.4260627770935783e-01 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000000000e+00</transform>
      <camera id="1" label="CAM02.tiff" sensor_id="0" enabled="true">
        <transform>7.6467032539386148e-01 2.3526678856041383e-01 5.9994069012071138e-01 -4.4155923884498929e+00 -9.9125727675139899e-02 9.6283739634956111e-01 -2.5123343388902708e-01 2.3044878071764003e+00 -6.3675221521006109e-01 1.3264119417159839e-01 7.5957417678184158e-01 1.3527794460798552e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000000000e+00</transform>
      <center>-4.4272670928260860e-01 1.1203212821847490e+00 6.3181234130290411e+00</center>
      <size>2.7849106232325234e+00 1.8806472222010293e+00 1.1353885094324743e+00</size>
      <R>-2.6297166709341913e-01 -9.6314773970068590e-01 -5.6500741725820057e-02 -7.7401942195951801e-01 1.7564821840744785e-01 6.0831047812752914e-01 -5.7596860742193368e-01 2.0370109199449452e-01 -7.9168556156133685e-01</R>

How would one use this information to replicate the camera setup in Blender, in such a way that allows rendering an object exported from PhotoScan from multiple cameras that correspond to the original cameras?

Reading the data into Blender is simple enough, e.g.:

Code: [Select]
for element in root.findall('./chunk/cameras/camera'):
transformation = element.find('transform').text;
matrix = np.reshape(np.matrix(transformation), (4, 4))
transformations.append(matrix * global_transformation)

However, creating cameras in Blender requires explicit positions and Euler angles, e.g.:

Code: [Select]
bpy.ops.object.camera_add(location = (x, y, z), rotation = rot)

How do you figure out that data (and the lens parameters) from the information provided by PhotoScan?

General / Re: Agisoft PhotoScan 1.3.0 pre-release
« on: December 07, 2016, 12:57:15 PM »
After importing an existing camera calibration via the GUI, PhotoScan automatically initiates building of the coarse point cloud. The Python API does not seem to offer this possibility (or does it?), and so, after importing via chunk.importCameras(camera_path), no dense cloud can be constructed. How would you work this using Python?

On a related note -- can you reset the calibration of specific cameras and then recalibrate them via chunk.alignCameras(recal_cams)?

General / Re: Agisoft PhotoScan 1.3.0 pre-release
« on: November 24, 2016, 05:27:37 PM »
Hello Alexey

thank you for your reply.

If the format is not not specified, then PhotoScan will parse the export path and use the extension to identify the format to be used. In case the format is specified but doesn't match the extension, PhotoScan will export the data according to the format use (PointsFormat), but save it under the user-defined path, without changing anything in it.
Great, that's pretty much what one would expect. I don't know about your documentation policy, but that'd be useful information in the reference.

In the current 1.3 pre-release TXT extension is not interpreted as XYZ output, so for such extension you need to specify PointsFormatXYZ explicitly.
If you can reproduce the broken or incomplete export for XYZ format, please let me know.
I'll try to find the time to put together an MWE and get it to you. By the way, if memory serves me right, the format was/is called TXT in 1.2.6 somewhere in the GUI's export dialog.

General / Re: Agisoft PhotoScan 1.3.0 pre-release
« on: November 24, 2016, 04:36:12 PM »
According to the 1.3.0 Python Reference exportPoints has changed and now requires format to be of type PhotoScan.PointsFormat, in contrast to the old behavior where  exportPoints expected a string.

What exactly does the new exportPoints do when format is not specified explicitly? I assume that, like the old exportPoints, it tries to guess the format from the file ending of path. What happens when format does not match the file ending? I believe that the old behavior was buggy (should I still report this?) and produced broken files when the file ending was txt or xyz.

Pages: [1]