3
« on: November 01, 2016, 07:27:08 PM »
Dear Alexey,
Thank you for your response. I have followed your instruction to a T. Below I have copied the code that I used which is in the python file I attached. I have added some comments where I applied your steps (which I had previously done).
def exportDepthRender(savetoPath, savedModel):
doc = PhotoScan.app.document
doc.open(savedModel)
chunk = doc.chunk
camera = chunk.cameras[0] # getting Camera of first camera in chunk
cameraTrans= camera.transform # The camera transform matrix you suggested
cali = camera.sensor.calibration # The calibration you suggested
chunkModel = chunk.model # Getting model
doc.save()
image = chunkModel.renderDepth(transform = cameraTrans, calibration = cali) # Applying depth render as you suggested
image.save(savetoPath + "/depth.png")
Using this method produces a depth map like the "undesired" one that I attached to my post. However when I use the GUI to export depth of the first camera I get a map like the "desired" one that I uploaded. So i fear that this step may not be the problem?
I am curious to also know what you mean by "internal representation" in the last sentence of your response. I would also like to know what you meant when you said the depth map that i am trying to save is not scaled? Does this mean that there is a fault with my steps prior to rendering the depth map?
Thank you for helping with this. Your assistance is much appreciated.
Regards,
Safa