Forum

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 - Safa.Naraghi

Pages: [1]
1
Dear Alexey,

It worked! Thank you so much for helping out.

Safa

2
Hi Alexey,

Thank you for your reply.

I am not sure how to find the minimal and maximal floating point values. I also don't think I understand how to scale the pixel values once I have this information. Could you provide some detail on these processes.

Thank you for taking the time to looking into this.

Safa

3
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

4
Hi there, I have been using Agisoft PhotoScanPro for the passed few months to reconstruct a close range object and analyse the depth map of the object from a certain camera view. I have been able to do this my following the workflow process (without building the DEM - at takes 15 hours to complete). Once I completely reconstruct the model I can right click on the desired camera (the first one) in the 'workspace pane' and export the  depth map. This works for me and produces a depthmap, diffusion map and a normal map that I then save to a file location. However when I try to do this using python scripting it does not give me the same depth map. It instead gives me a map that shows the object as a uniform depth and the background as black (I have attached the pictures of the desired depthmap and python-produced depth maps to this post.

I have also attached my python script so far. The exportDepthRender function is the one I am having trouble with but maybe I am doing something wrong in the previous steps. I am using the transform matrix of the camera view that I want to produce the render but this isn't working. If anyone could help with this it would be greatly appreciated.

Regards,
Safa

Pages: [1]