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 - FabianN

Pages: [1]
1
Python and Java API / Large mesh texturing
« on: October 12, 2023, 05:19:11 PM »
Hi,

I want to compute a texture map for a large mesh. The following settings are used:

Code: [Select]
chunk.buildUV(mapping_mode=Metashape.MappingMode.GenericMapping, page_count=32, texture_size=8192)
chunk.buildTexture(blending_mode=Metashape.BlendingMode.MosaicBlending, texture_size=8192)

The buildUV runs without problems, whereas the buildTexture crashes. Is there any reason the above does not work?
Smaller models work without problems (though the page_count is typically 1).

Thanks for helping.
Fabian

2
Bug Reports / Re: GLB 3d Model rotated after export
« on: January 17, 2023, 12:33:17 PM »
Hi Alexey,

In my case, it is happening in the geographic/projected CS.


3
Bug Reports / Re: GLB 3d Model rotated after export
« on: January 13, 2023, 02:10:10 PM »
I also report this bug in another reference frame (EPSG 2056).
Hopefully the Agisoft team will fix it soon.

Thanks.

4
Python and Java API / Re: Export Model with Shift and Rotation
« on: November 01, 2022, 03:11:06 PM »
Hi Alexey,

The purpose is to have the models available in a local coordinate frame such that they can be compared to other products / scans. Besides the coordinate shift (to handle the overflow of large coordinates) those local coordinate systems typically are rotated around the vertical axis such that the X-axis is aligned to a given structure (f.e. the principle axis of a building).

My task is to deliver models in such a local coordinate system.


5
Python and Java API / Export Model with Shift and Rotation
« on: October 31, 2022, 01:32:34 PM »
Hi all,

The python function exportModel allows to specify a shift vector for the vertex coordinates. What I need is a shift and a rotation (around the origin along the geographic height axis) for the vertex coordinates.
The rotation should be applied after the shift. What is the best procedure for this?

Thank you!
Fabian

6
Python and Java API / Marker Detection - Image Scale
« on: July 04, 2022, 12:14:45 PM »
Hi Alexey,

I sometimes have problems in detecting coded markers when they are too small in an image. However, when I upsample the images (f.e. by a factor of 2), the detection works well an accurately (visually).
Is it an option for you to implement a user-parameter for internal up- or downsampling of the images prior to marker detection? This would allow to handle coded targets with a larger size difference than what is currently possible.

Or is there another way of dealing with this?

Thank you,
Fabian

7
Python and Java API / Re: DepthMap setImage not working
« on: April 21, 2022, 11:28:43 PM »
Hi Alexey,

Thank you for looking into the issue.
One other effect: After the depth maps were moddified (and the project saved), the original depth maps still show up when overlaying them in the GUI.

I hope you find and fix the bug.

Thanks for your efforts and best regards!

8
Python and Java API / Re: DepthMap setImage not working
« on: April 20, 2022, 12:18:15 PM »
Yes this works, thank you!
Do you know why the image data cannot be replaced directly? There is no hint in the API manual why this should not work.

Thanks again and regards

9
Python and Java API / DepthMap setImage not working
« on: April 11, 2022, 11:33:06 AM »
Hello everyone,

I try to moddify depth maps for all cameras in the chunk. My principle workflow for a given 'camera' is:

Code: [Select]
ddata = numpy array of depth values in local CS as float32
DM = Metashape.Image.fromstring(ddata.tostring(), ddata.shape[1], ddata.shape[0], ' ', 'F32')
chunk.depth_maps[camera].setImage(DM)

There is no error when running the lines above but if I reload the depth map, the original depth map is still present.

Any ideas?
Thank you!

10
Python and Java API / Elevation Data as array
« on: March 24, 2022, 10:21:14 AM »
Hi,

Is there a possibility to extract elevation data (DEM) within a given polygon (shape) - for example as a numpy array?

Thanks

11
Python and Java API / Re: Render Elevation into Camera
« on: September 29, 2021, 02:40:56 PM »
Hi Alexey,

Thanks for answering.
I was afraid you suggest it this way. It is indeed not an option for my task - too many high resolution images.

Maybe there are also other applications that would benefit from having the possibility to render elevation (or even a 3-band image with geographic coordinates) for each pixel in a camera view.

Like:
chunk.model.renderCoordinateImage (for xyz)
chunk.elevation.renderImage (for z)
chunk.orthomosaic.renderImage (for xy)
 :D

12
Python and Java API / Render Elevation into Camera
« on: September 29, 2021, 10:31:55 AM »
What is the most efficient way to render the elevation model (chunk.elevation) into a specific camera view?
I would like to get an absolute elevation value for each pixel in the respective camera(s).

Thank you!

13
General / Re: Object coordinates through image projections
« on: July 16, 2021, 04:01:11 PM »
Hi Paul,

Yes it is clear now. Thanks for the clarification.

Cheers

14
General / Re: Object coordinates through image projections
« on: July 16, 2021, 09:41:51 AM »
Hi Paulo,

Thanks for your answer. Indeed the results now look very good.
I was thinking about scaling the depth value by dividing the cosine of the angle between the camera principal point and the actual image coordinate. Which turns out is equivalent to your expression 'cam.tranform.inv().mulv(ray).z' (that is much more elegant and faster). Could you explain your expression in more detail so that its geometrical meaning is more obvious?

Thank you and best regards,
Fabian
 

15
General / Object coordinates through image projections
« on: July 15, 2021, 04:35:57 PM »
Hi all,

I'd like to get 3D object coordinates (Metashape coordinates are fine) from a set of image coordinates (2D). As far as I can see, there are three options:

1) Use the 'pickPoint' function of the 'model' (or 'denseCloud') class. With 'cam' being on of the cameras in the chunk and image x,y coordinates as 'img_x', img_y':
Code: [Select]
pt_2d = Metashape.Vector([img_x, img_y])
pt_3d = chunk.model.pickPoint(cam.center, cam.unproject(pt_2d))

2) We can use the depth map of the camera:
Code: [Select]
depth = chunk.depth_maps[cam].image()
depth_val = depth[img_y, img_x][0]
pt_2d  = Metashape.Vector([img_x,img_y])
img_3d = cam.unproject(pt_2d)
ray = img_3d - cam.center
ray /= ray.norm()
pt_3d  = cam.center + depth_val* ray

3) Or we can render a depth image from the model and use it as in 2).

I prefere to use either method 2) or 3) as it is considerably faster for a lot of points (the depth map has to be extracted only once for one camera)
The results from 3) and 1) should be identical but they are not. Multiple points on a flat surface are also flat in 3D by method 1). For method 2) or 3) however, they are not.

Questions:
#1: Are the rendered depth images / maps corrected for image distortions or do I have to undistort them?
#2: What is missing in method 2)/3) to get the correct results?

Thank you.

Pages: [1]