Forum

Author Topic: moving mesh inside Agisoft PhotoScan Pro  (Read 9385 times)

Claude

  • Newbie
  • *
  • Posts: 23
    • View Profile
moving mesh inside Agisoft PhotoScan Pro
« on: June 02, 2014, 04:54:36 PM »
Hello,

I couldn't find this information on forum.

I would like to have possibility to move mesh in certain place in scene.

I have Pro licence so maybe scripting is solution.

Thanks for reply in advance.
Greetings Claude

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 12940
    • View Profile
Re: moving mesh inside Agisoft PhotoScan Pro
« Reply #1 on: June 02, 2014, 04:58:29 PM »
Hello Claude,

Do you wish to move mesh relatively to camera positions? Or to import mesh from external file and move it relatively to the model generated in active chunk?
Best regards,
Alexey Pasumansky,
Agisoft LLC

Claude

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: moving mesh inside Agisoft PhotoScan Pro
« Reply #2 on: June 02, 2014, 05:01:56 PM »
Hello Alex

I would like to move whole scene to match position of scan head to head in 3d application.
I found very tedious work with multiple scans of face expression. If I will set up position of meshes in Agisoft it will speed up my work.

Thank you for answer.
« Last Edit: June 02, 2014, 05:33:56 PM by Claude »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 12940
    • View Profile
Re: moving mesh inside Agisoft PhotoScan Pro
« Reply #3 on: June 02, 2014, 05:17:49 PM »
Hello Claude,

If you have the fixed camera rig and the camera labels are the same across every project. You can load all the projects into the single PhotoScan window as chunks, using Append command in File menu and use Camera based chunk alignment.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Claude

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: moving mesh inside Agisoft PhotoScan Pro
« Reply #4 on: June 02, 2014, 05:39:06 PM »
I have fixed camera rig and consistent file convention.

I use camera matching to match multiple scans. But I don't know how move all those scans in 3d space. I would like to move scanned heads up in y axis on 170 cm to match character in zbrush.

This is possible?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 12940
    • View Profile
Re: moving mesh inside Agisoft PhotoScan Pro
« Reply #5 on: June 02, 2014, 06:01:21 PM »
Hello Claude,

And are these scans referenced and scaled in any coordinate system? In principle it is possible to apply translation vector to the whole scene, but actually it is necessary to know where's "up" and what are the units in the current model scene (or how to convert models' units to cm).
Best regards,
Alexey Pasumansky,
Agisoft LLC

Claude

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: moving mesh inside Agisoft PhotoScan Pro
« Reply #6 on: June 02, 2014, 06:57:14 PM »
Hej Alex

Yes I scale models using mesure, and I orient meshes using rotate tool.
But I don't have method to offset it in space. I tried to do it during export using Shift option, but it not always work, and it not possible use this Shift in Bach.
How to  apply translation vector?


FLuca

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • Another-me
Re: moving mesh inside Agisoft PhotoScan Pro
« Reply #7 on: June 03, 2014, 12:00:15 PM »
Hi Claude
it is possible to move and even scale a low version of the model with the cameras in an external application, you can then extract the transform matrices of the cameras and update them in the original exported cam.xml file
when you re-import the modified cam.xml, you can re-generate a high version of your model, with the desired scale and position
I do it with 3dsmax and it works perfectly
regards
Fred Lucazeau - Body Scan - www.another-me.fr
Sketchfab gallery: https://sketchfab.com/fredlucazeau

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 12940
    • View Profile
Re: moving mesh inside Agisoft PhotoScan Pro
« Reply #8 on: June 03, 2014, 02:46:22 PM »
Hello Claude,

If the suggested way with camera import will not work, let us know and will try to create a Python script. If possible, provide the .psz file to support@agisoft.ru (just with aligned camera positions, dense cloud and mesh are not required).
Best regards,
Alexey Pasumansky,
Agisoft LLC

Claude

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: moving mesh inside Agisoft PhotoScan Pro
« Reply #9 on: June 03, 2014, 02:55:00 PM »
Thanks FLuca and Alexey

I will try this trick with exporting camera to 3d max.

Best Regards Claude

FLuca

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • Another-me
Re: moving mesh inside Agisoft PhotoScan Pro
« Reply #10 on: June 03, 2014, 03:59:37 PM »
claude,
export you low resolution model in FBX format to have cameras in your scene
after moving and scaling, you can then export the camera transform matrices with the attached script
« Last Edit: June 03, 2014, 04:01:11 PM by FLuca »
Fred Lucazeau - Body Scan - www.another-me.fr
Sketchfab gallery: https://sketchfab.com/fredlucazeau

Claude

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: moving mesh inside Agisoft PhotoScan Pro
« Reply #11 on: June 04, 2014, 11:45:11 AM »
claude,
export you low resolution model in FBX format to have cameras in your scene
after moving and scaling, you can then export the camera transform matrices with the attached script

Thank you very much. I just searching how to export xml camera from 3d max!

I get new_cams.txt but I can't import it to agisoft. I tried to change txt to xml but it doesn't work.
« Last Edit: June 04, 2014, 12:03:50 PM by Claude »

FLuca

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • Another-me
Re: moving mesh inside Agisoft PhotoScan Pro
« Reply #12 on: June 04, 2014, 12:28:33 PM »
claude,
you have to edit the original xml file with a text editor and replace each line of the camera transforms matrices by the new ones included in the new_cams.txt
be careful to replace the correct camera transform line

Fred Lucazeau - Body Scan - www.another-me.fr
Sketchfab gallery: https://sketchfab.com/fredlucazeau

Claude

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: moving mesh inside Agisoft PhotoScan Pro
« Reply #13 on: June 20, 2014, 06:48:38 PM »

I tried few times do it but after import cameras to agisoft cameras are in very distant wrong position. I do something wrong, but I don't know what.
I copy
<transform>1.4535398781299591e-001 -8.4727078676223755e-001 -9.5061463117599487e-001 1.0651415039062500e+004 1.2526946067810059e+000 2.6695787906646729e-001 -4.6392451971769333e-002 1.9347880859375000e+004 2.2867216169834137e-001 -9.2386651039123535e-001 8.5839575529098511e-001 -1.0023635742187500e+004 0.0000000000000000e+000 0.0000000000000000e+000 0.0000000000000000e+000 1.0000000000000000e+000</transform>

past on
in orginal xml file where was
<transform>9.8857689535876303e-001 1.5034484634082798e-001 1.0590049177519024e-002 -2.0465390763710439e-001 7.2704452685543042e-002 -4.1415184985272741e-001 -9.0729945873634221e-001 4.4242032606167578e+000 -1.3202190925193091e-001 8.9770522580762380e-001 -4.2035168970179976e-001 6.0012348653741681e+000 0.0000000000000000e+000 0.0000000000000000e+000 0.0000000000000000e+000 1.0000000000000000e+000</transform>

from new_cam.txt to xml file

What I do wrong?

claude,
you have to edit the original xml file with a text editor and replace each line of the camera transforms matrices by the new ones included in the new_cams.txt
be careful to replace the correct camera transform line