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.


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

3
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

4
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!

5
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

6
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!

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