# 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 - Hugh

Pages: [1]
1
##### Python and Java API / Support for Python 3.9
« on: August 10, 2022, 02:17:36 PM »
Hi,

Do you have a plan to support Python 3.9 for the Metashape module? Right now the module (from its name, anyway) supports 3.5 - 3.8

Thanks

2
##### General / Lens Distortion - Profile curve
« on: August 05, 2022, 07:27:17 PM »
Hi,

I'm trying to understand how the distortion plot is calculated in the Camera Calibration window.

I've got, for example, the attached image.

In this, I'd expect to be able to pass in a pixel radius of 2000 and get a result of just under 12 pixels.

The details of this calibration are:

Code: [Select]
`w : 3840h : 2160f : 7617.05664k1 : 0.052014k2 : 0.689641k3 : -3.7671k4 : 0cx : 0cy : 0p1 : -0.00148237p2 : -0.0018401b1 : 0b2 : 0`
The corner of my image would be considered 0.5, 0.5, which is 1920, 1080 from the center. So the pixel distance to the corner is 2202.907. I'm going to use this point, and expect something around or just above 12.

r2 = r*r
r4 = r*r*r*r
etc...

I've used the formulae from Appendix C of the Metashape Pro documentation, on Frame cameras.

Code: [Select]
`x_prime = (x * (1 + k1*r2 + k2*r4 + k3*r6)) + (p1 * (r2 + (2 * x2))) + (2 * p2 * x * y) = 0.36136245y_prime = (y * (1 + k1*r2 + k2*r4 + k3*r6)) + (p2 * (r2 + (2 * y2))) + (2 * p1 * x * y) = 0.36118359u = w * 0.5 + cx + x_prime * f + x_prime * b1 + x_prime * b2 = 4672.52v = h * 0.5 + cy + y_prime * f = 3831.16`
This position in u,v is much more than 12 pixels away from the corner, so I'm not sure where my maths is going wrong here.

I tried doing this with p1 and p2 set to 0, and I got a similar result:

Code: [Select]
`x_prime = (x * (1 + k1*r2 + k2*r4 + k3*r6)) + (p1 * (r2 + (2 * x2))) + (2 * p2 * x * y) = 0.363764875y_prime = (y * (1 + k1*r2 + k2*r4 + k3*r6)) + (p2 * (r2 + (2 * y2))) + (2 * p1 * x * y) = 0.363764875u = w * 0.5 + cx + x_prime * f + x_prime * b1 + x_prime * b2 = 4690.82v = h * 0.5 + cy + y_prime * f = 3850.82`

Could someone help me as to where I'm going wrong here? I'd like to be able to calculate the same results as the graph is showing.

Thanks

3
##### Python and Java API / Marker pixel error in Python
« on: June 22, 2022, 11:57:19 AM »
Hi,

In the Metashape UI, when I create markers, one of the columns is "Error (pix)". I can see this value in the UI, but I can't figure out how to get it in Python.

For reference, I'm creating the markers using Python:

Code: [Select]
`marker = chunk.addMarker()for projection in projection_cameras:    marker.projections[projection['camera']] = Metashape.Marker.Projection(Metashape.Marker(projection['position']))`
Thanks

4
##### General / Single vs multiple textures on alembic
« on: April 23, 2022, 08:03:25 PM »
If I import an Alembic with multiple nodes in and texture it, when I export the texture I get multiple images, one for each node. If I import the same geometry as an obj I get the texture out in a single image.

Is there a way (through the API, mainly, but also through the UI, to get it to export the texture into a single image when working with al alembic with multiple nodes?

5
##### Feature Requests / Weighted texturing
« on: April 14, 2022, 04:22:53 AM »
Hi,

It would be great to be able to set per-camera weighting for texturing. so we can control the priority that each camera is given.

Currently we can enable or disable cameras, but it would also be good to allow cameras to still be available, but with a lower weighting

6
##### General / Removing chunk transformation without affecting world transforms of cameras
« on: April 04, 2022, 06:17:03 PM »
Hi,

I'd like to adjust my chunk to ensure that there is not chunk transformation, but the cameras are still in the same place in world space. How could I best do this? Is there something that I can in the UI or with an existing function in the Python API, or is it something that I'd need to calculate the maths for myself?

Thanks

7
##### Python and Java API / Redirecting the console output
« on: March 30, 2022, 09:18:57 PM »
Is it possible to redirect the output in Python when using the Metashape python module? Ideally I'd like to be able to hook into it another way, although as I can set Metashape.app.settings.log_path, an alternate solution would be to only have it log to the file and stop output to stdout.

For readability in the terminal, I'd like to just deal with the output myself using the progress callback, and have the raw log go to a file (ideally with timestamps, which is why I was hoping I could redirect it)

If I were running a script with metashape.exe -r, I could redirect the output using the subprocess module, but I'm not sure how I could do this when using the Metashape module directly.

Thanks

8
##### Python and Java API / STMap export through the Python API
« on: March 28, 2022, 06:20:51 PM »
I'm trying to figure out how to export STMaps of the camera calibrations using the Python API.

In the UI, it's in the Camera Calibration window, and when I click the "save" icon, I get a list of optional formats.

In the Python API, there is the Metashape.CalibrationFormat enum, which contains all of the options in the UI except for STMaps.

If there a different way to do this export, or has the enum not been updated in the API to allow this?

Thanks

Pages: [1]