Forum

Author Topic: issue with Photoscan.Model  (Read 10129 times)

WickedAndy

  • Newbie
  • *
  • Posts: 18
    • View Profile
issue with Photoscan.Model
« on: March 21, 2012, 10:00:51 PM »

not sure if this is user error or a bug, but if I bring in a model using the "Import Model..." menu vs the python command, the model doesn't import into the proper location in space..

here's the basic way I am bringing in a model..

Code: [Select]
mdl = PhotoScan.Model()
mdl.load("c:/somemodel.obj",'obj')

chnk = doc.activeChunk
chnk.model = mdl

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: issue with Photoscan.Model
« Reply #1 on: March 22, 2012, 04:16:52 PM »
Hello Andy,

Thank you for reporting. We were able to reproduce the problem with referenced chunks (marked by [R]).
We will work on fixing this problem.
Best regards,
Alexey Pasumansky,
Agisoft LLC

cstal

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: issue with Photoscan.Model
« Reply #2 on: September 24, 2013, 06:15:38 PM »
Dear,
The automated model loading still positions my models in a very weird coordinate system. Is there already a way to properly import models in the same coordinate system as the active chunk?
I'm using the Agisoft Pro 1.0.0.
Many thanks in advance!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: issue with Photoscan.Model
« Reply #3 on: September 24, 2013, 06:48:17 PM »
Hello cstal,

Could you please specify what coordinate system you car using so we could try reproduce the problem?
Please also check that export + import model from the same chunk doesn't work correctly (if you are exporting model using Python please provide the script line).
Best regards,
Alexey Pasumansky,
Agisoft LLC

cstal

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: issue with Photoscan.Model
« Reply #4 on: September 25, 2013, 09:05:11 AM »
Dear mister Pasumansky,
The project contains a large number of airborne images with known orientation- and rotation parameters. I'm using the Belgian national coordinate system for this (EPSG:31370), which is explicitly defined in the Ground Control settings.
The idea is to import a third party model, texture it and export it again:

Code: [Select]
model = PhotoScan.Model()
model.load("D:/modelPath_IN/modelName.obj", "obj")
doc.activeChunk.model = model

doc.activeChunk.buildTexture(mapping="adaptive orthophoto", blending="average", size=1000, count=1)
model = doc.activeChunk.model
model.save("D:/modelPath_OUT/modelName.wrl", format="vrml", texture_format="jpg", export_texture=True)

It seems that the model is loaded, but the export returns a black model, transformed in a very strange coordinate system. I double checked the coordinates of the obj-file to be imported, and they are correct. Moreover, when I perform this procedure manually via Tools -> Import -> Import Mesh and after selecting my coordinate system, it works fine.

Re-assigning the (same) coordinate system using Python by
Code: [Select]
cs = PhotoScan.CoordinateSystem()
cs.init("EPSG:31370")
doc.activeChunk.projection = cs
puts the project in a weird viewpoint and still does not load the models correctly.

I hope you have a solution.

Thanks again for your assistance

cstal

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: issue with Photoscan.Model
« Reply #5 on: October 04, 2013, 09:07:08 AM »
Hello,
I would like to give a short update: all data in the project has been transformed from the Belgium coordinate system to UTM31N coordinates, using WGS84 (EPSG::32631). When I run the script again, the loaded models (also converted to UTM) are still not correctly positioned. This procedure did not solve the problem. Do you have a solution yet?
Thanks again!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: issue with Photoscan.Model
« Reply #6 on: November 08, 2013, 05:13:29 PM »
Dear cstal,

Please check the latest build (1768). To import georeferenced model you need to use chunk.importModel() function with the given parameters.
Best regards,
Alexey Pasumansky,
Agisoft LLC

cstal

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: issue with Photoscan.Model
« Reply #7 on: November 25, 2013, 08:47:51 PM »
Dear Mr. Pasumansky,
Thank you very much for the suggestion. It seems to work now!