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

Pages: [1] 2
1
Python and Java API / Pyarmor - script obfuscation
« on: April 27, 2024, 02:51:16 PM »
Hello everybody,

i was loading obfuscated scripts into metashape for years until the obf.-software "pyarmor" did an update.
Now, when loading the script, Metashape console says:

Traceback (most recent call last):
2024-04-27 13:44:52   File "C:/Users/XXXXX/AppData/Local/Agisoft/Metashape Pro/scripts/XXXXX.py", line 3, in <module>
2024-04-27 13:44:52     from pyarmor_runtime_00XXXX import __pyarmor__
2024-04-27 13:44:52   File "C:\Users\XXXXX\AppData\Local\Agisoft\Metashape Pro\scripts\pyarmor_runtime_00XXXX\__init__.py", line 2, in <module>
2024-04-27 13:44:52     from .pyarmor_runtime import __pyarmor__
2024-04-27 13:44:52 ImportError: DLL load failed while importing pyarmor_runtime: Das angegebene Modul wurde nicht gefunden. (module not found)


What is the correct version of python in Metashape? 3.8? 3.8.10? ...

Please help  :)

2
Python and Java API / Manipulate photo exif data with python
« on: March 06, 2024, 03:21:36 PM »
Hello Alexey and everybody else,

I'd like to manipulate exif data of my photo set. Is this possible via python script?

I'm able to read data in a for loop. But how can I wrtie new data to the .jpg file?

If I do it like this, the data is overwritten in Metashape. But the original file doesn't change...
Code: [Select]
cameras[0].photo.meta["Exif/Make"]="test"

3
General / FOV in model view & distance to object
« on: August 23, 2023, 10:24:05 AM »
Hello Alexey!

Hope you're doing well!

Would you please explain how  the perspective "FOV" in the model view is calculated?
I'm trying to suggest the distance from a scanned object in a photograph...

For example:
  • if you have a face scan...
  • FOV 70: you can see the ears from the front
  • FOV 30 to 0 : you can't see them

It's the same then stepping back and forth - changing the distance to the object. Hopefully you can help me out!

THANK YOU VERY MUCH!

 

4
Hello Alexey,

for a code that
  • duplicates a chunk for
  • testing several match and
  • alignment parameters
I need your help.

I'm duplicating a chunk to use my photos and masks again in some other chunks to test different parameters. But  I recognized, that the alignment results of my code are worse than using the same parameters in a new chunk (or via GUI), where I load the photos and masks manually.
So what am I doing wrong?

To make it short:   
Code: [Select]
chunk = chunk.copy(keypoints=False)
for camera in chunk.cameras:
                camera.transform = None
chunk.point_cloud.removeKeypoints()
chunk.point_cloud = None
chunk.remove(chunk.markers)
Then I match and align photos (reset matches = True).


Thank you!!!  :)
 

5
Python and Java API / Show a picture in PySide2 Qt Gui
« on: August 26, 2021, 07:36:16 AM »
Hello everybody,

can someone please tell me how to show a small picture in a GUI?
I made some GUIs with PySide2 but I don't know how to load a fixed picture to them.

It must have to do with QPixmap ?!

Code: [Select]
from PySide2 import QtCore, QtGui, QtWidgets

class ref_korr_gui(QtWidgets.QDialog):

    def __init__ (self, parent):
        QtWidgets.QDialog.__init__(self, parent)
        doc = Metashape.app.document
        chunk = doc.chunk   
        self.setWindowTitle("Ref.-Korr.")
               
        image_path = "D:\Dropbox\Showreel\16 Markerplatten\Zusatzsoftware\Korrektur.jpg"

        picture = QtGui.QPixmap(image_path)
        self.label = QtWidgets.QLabel()
        self.label.setPixmap(picture)
        self.label.setGeometry(QtCore.QRect(10, 40, picture.width(), picture.height()))
        ...
        layout = QtWidgets.QGridLayout()
        layout.addWidget(self.label,           11,1)
        self.setLayout(layout)
        self.exec()

If I print(picture.width()) it is "0" ... But why?

6
Python and Java API / Metashape.Viepoint not writeable
« on: July 25, 2021, 03:36:29 PM »
Hello Alexey!

After rotating and scaling my model I calculate the middle of my model (vector "c") because I want to set the viewpoint there.
But the console tells me it is not writeable:

Metashape.app.model_view.viewpoint.center = c
2021-07-25 14:29:55 AttributeError: attribute 'center' of 'Metashape.Viewpoint' objects is not writable
2021-07-25 14:29:55 Error: attribute 'center' of 'Metashape.Viewpoint' objects is not writable   


Can you please tell me how to change the viewpoint?
Thank you very much!

7
Bug Reports / Error starting Metashape with USB-docking station
« on: September 29, 2020, 08:41:59 PM »
Hello everybody!

Whenever I start Metashape a little console pane opens and immediately disappears.
Then an error message pops up. Metashape doesnt start.

When I disconnect my USB 3.0 - docking station (2 monitors, mic, speakers) Metashape starts correctly.

Do you have any solution for that?

THANK YOU VERY MUCH! 

Edit: The docking station is an "i-tec USB 3.0 Dual docking station" with DisplayLink 

8
Hello everybody!

Can someone please tell me how to calculate a ground sample resolution (mm/px)?
I have noticed, that Metashape gives out a resolution in the "build orthomosaic"-GUI, where it is called Pixel size (m).

The report of the model says "Ground resolution", but the calculated value is different.

I'm looking for the value to calculate an orthomosaic. Would be very nice if someone could help.

THANK YOU!  ;D

9
Bug Reports / Build model 1.6.3. seems to stop after loading kernels
« on: July 19, 2020, 04:05:25 PM »
Hello,
as the header says...Seems to stop at this point for hours now.
Any suggestions? Thank you!


10
Python and Java API / duplicate model in one chunk
« on: July 10, 2020, 03:37:42 PM »
Hello everybody,

does anybody know how to duplicate model within one chunk?
I want to calculate the mesh with high face count and automatically build a duplication of it, where mesh is decimated without loosing the original one.

THANK YOU!  ;D

11
Python and Java API / import and start python code from dropbox
« on: June 04, 2020, 10:02:35 AM »
Hello Alexey,
hello everybody!

Is it possible to start a script in Metashape that looks for python script update that is accessible somewhere online (lets say dropbox or any link)?
I'd like to place the newest version of my scripts online, so everyone in my company automatically downloads and imports it when Metashape starts.

Any suggestions?
THANK YOU!
 ;D

12
Hello Alexey!

Is it possible to read the exposure value / exposure compensation of a photo with python?
Can't find it under camera.photo.meta ...

Thank you!

13
Python and Java API / capture model view 1.6.3
« on: May 17, 2020, 04:19:05 PM »
Hello everybody!

the Python API in 1.6.3 seems to be wrong.
Which arguments needs the function captureView to work?

Thank you!  ;)

14
Python and Java API / Align coordinate system to marker, point or camera
« on: December 24, 2019, 09:54:15 AM »
Hello,

I try to rotate a model a given amount of degrees around x and y axis. 
The python script for rotation around any axis is already working.

The Problem is, that the second rotation will result in an unwanted change of the first angle.

Example:
- We have 3 given Markers on a flat surface. 1 & 2 are horizontal and position 3 is anywhere on the surface.
- We also know the real angle between markers 1-2 and 2-3 because we measured them ... -20 degrees and +30 degrees.

If I rotate -20 degrees around vertical axis, 1-2 are perfectly matching -20 degrees.
How can I rotate the model now to reach a +30 degree angle between 2-3?

Thanks a lot!!!!!

15
Hello Alexey!  :)

For a python script I am searching the following functions for "build" and "export" orthomosaic:
I really tried to find them out but without success. So please tell me how I can (screenshots below):

build orthomosaic...
- projection plane: marker (e.g. hor points 2 - 3; vert points 3 - 4)
- projection plane: Top XY
- estimate the region size
- set the max dimension (pix)

export ortho...
- with max dimension (e.g. 8000)
- split by 4000 x 6662
- jpg 90%

rotate model by points
- It also would be very helpful to rotate the model by the given points, so that the orientation (projection plane top XY) is the same for ortho export and the mesh. Can you help with that too?

Thank you very much for your replies in the past!  :D
Best regards

Pages: [1] 2