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

Pages: [1] 2 3 ... 5
1
Hi,

I would like to set the capture distance for each camera in a python script. I'm using Metashape 2.1.0, and it seems there is no command for that in the API?

Any solutions or ideas ?

Thanks in advance!

2
Python and Java API / Re: Undo via Python?
« on: December 12, 2021, 01:48:00 PM »
Hello Wojtek,

Try this in your script :

for widget in QtWidgets.QApplication.allWidgets():
    if widget.inherits("QToolBar") and widget.windowTitle() != "Actions":
        if widget.isEnabled():
            widget.actions()[4].trigger()

Please, let me know if it worked.

3
Hi again,

I have another question regarding  the region export option in the export orthomosaic dialog. Please see attachments.

Generated orthomosaic is 48190 * 41393 px.

If 'setup boundaries' is unchecked total pixel size calculated for the export is 48189*41393 px (No_region.jpg).

On the opposite, if it's checked the result is 48190*41392 px (Region.jpg)

My guess is that the difference between generated ortho and export is dealing with the origin of orthomosaic ( I don't remember if it's top-left or bottom-left?) and the origin of pixel (center or top-left?)

If it's right, why only one pixel is added or removed  from orthomosaic.witdth  OR orthomosaic.height and not from orthomosaic.witdth  AND orthomosaic.height , depending on whether setup boundaries is checked or unchecked?

Also,  switching to another CRS sometimes lead to change just the orthomosaic.witdth (otherCRS_NoRegion.jpg & otherCRS_Region.jpg)

Would you mind explaining me how Metashape compute the total pixel size with or without region boundaries,  and how to get the same result by script?

Thanks in advance!

Best regards,

4
Ok Alexey, got it!!

The difference between pixel size and ortmosaic.resolution was quite confusing...

Tank you!

Best regards

5
Python and Java API / Re: Get CoordinateSystem
« on: September 10, 2021, 10:19:03 AM »
Thanks Alexey for your reactivity, as always.

I just meant if you want to trigger the gui of the coordinate system choice by command line in order to change the chunk CRS, locals system ( also geocentric ones) are not here, if you click "more..."

Best regards,

6
Python and Java API / Get CoordinateSystem
« on: September 09, 2021, 09:19:05 PM »
Hi every one,

Another question, on the command line "Metashape.app.getCoordinateSystem" : locals system provided in GUI disappear (see attachments).
Would it be possible to get them in command line?

Thanks in advance,

Best regards

7
Hi everyone, especially our dear Alexey for whom this message is primarily addressed!


I'm currently working on a custom script that allows user to export orthomosaic at desired scale. It takes the  orthomosaic export dialog of Metashape and add a little option for that.

My issue, if it's really one, is that I don't get the same result for the pixel size as the native dialog of Metashape. It can be seen on the attachments (cap1).

This leads me to some questions regarding  how the software calculate pixel size of an orthomosaic, whether to build or to export.

My orthomosaic has been generated with the same CRS's project ( WGS84/UTM 36N with EGM 2008 , see bottom of cap1 in the console pane)

The command line "Metashape.app.document.chunk.orthomsaic.resolution" matches with my custom dialog but not with the native one. Why??

Thanks to this topic https://www.agisoft.com/forum/index.php?topic=8162.0, the result of the coordinates conversion from meter to degree finally matched the Metashape calculation of pixel size (see cap2)

The CRS I used to generate the orthomosaic is not a geographic system, but a projected one (see cap6.png), so why  I need to convert coordinates from meter to degree to get the same result as the one proposed by the software?

On cap3, I used the native dialog, and switched to the geographic WGS84. When checking the conversion button in meters,  this time it gave me the same result as mine. 

Surely  I'm missing something, but it seems to be inverted, no?
Or does Metashape consider orthomosaic built in geographic mode to use only degree for orthomosaic resolution, only Geographic CRS and not Projected ?

You'll  also find my scipt in attachments ; even it's not yet complete, it can helps!

Thanks in advance for your time and your anwer,

Best regards

8
Python and Java API / Re: Reload-Refresh python scripts
« on: June 04, 2021, 08:40:48 AM »
Hey Andrea,

Some time ago, I've made a script for the same purpose.

Have a look here :
https://github.com/Seboon/Metashape_ScriptReloader

Hope it will fill your needs!

Best regards


9
Bug Reports / Can't capture model view
« on: November 09, 2020, 12:19:32 PM »
Hi,

I can't make  a capture of the model view, either in GUI or within a python script, at very high resolution (more than 100000px...).
Here is the error message I get when trying by gui mode, with the higher resolution proposed by the capture view function:

Code: [Select]
2020-11-09 10:57:52 CaptureView: resolution = 99999x63586, path = C:/Users/Administrateur/Desktop/captureTest.jpg
2020-11-09 10:57:52 renderer_qgl.cpp line 457: glViewport(x, y, width, height) failed: Invalid value

I'm using pro version 1.6.5 build 11249(64bit).

Is there any size limit for the image to be captured?

Any idea please?



10
Python and Java API / Re: captureView() return empty Image
« on: September 29, 2020, 01:07:18 PM »
Hello linshuh,

Try this:
Code: [Select]
def main():
    app = Metashape.app
    app.model_view.model_view_mode = Metashape.Application.ModelView.ModelViewSolid  #<--- change view mode. Don't want default colored model
    doc = app.document
    doc.open('test_screenshot_solid.psz')
    image = Metashape.app.model_view.captureView(width = 300, height = 150, transparent = False, hide_items = True)
    cap =  Metashape.Image(image.width, image.height, "RGBA", "U8")
    image.save('cameratest.png')

See  section "Metashape.Image" in Metashape Python API for more information on the arguments.

Best regards,
Sébastien

11
General / Re: 3D DEM generation
« on: September 25, 2020, 06:39:25 PM »
Hello Alexey,

It would be with pleasure!

Best regards,

Sébastien

12
Python and Java API / Convert event.globalPos() to world coordinates
« on: September 25, 2020, 11:09:01 AM »
Hi Alexey and others,
I'm trying to make a script using a Qrubberband on Orthoview in order to select area on orthomosaic.
I'm able to draw the rubberband and create rectangular shape from it.
The problem is that it doesn't fit the rubberband area.
I think the issue comes from reprojecting the event.globalPos() to world coordinates.
so my question : how to reproject mouseclick coordinates to  world coordinates, as it's done when moving mouse and coordinates shown in the Label  bottom right off the screen??

See my code and cap for more details.

Thanks a lot,

Sébastien

13
General / Re: 3D DEM generation
« on: September 23, 2020, 12:45:35 PM »
Glad to read that!

14
Bug Reports / No image data when exporting orthomosaic
« on: September 22, 2020, 03:56:18 PM »
Hey everybody, hey Alexey

When trying  to scale an othomosaic generated with Metashape 1.6.4 in a CAD software, I realized there is no more image data in the properties dialog of the tif.file, as shown in attachment.

The same problem seems to exist on th,e incoming 1.6.5. version.

Could you check on your side if you get the same issue?

By the way, do you plan to add such a feature as mentionned in this topic : https://www.agisoft.com/forum/index.php?topic=6152.msg29792#msg29792

Best regards,

Sébastien


15
Bug Reports / Re: reduce overlap -> empty bbox
« on: September 21, 2020, 05:39:15 PM »

If you install it, please let me know, if the problem is resolved in this version.

Works like a charm, perfect!!!

Best regards,
Sébastien

Pages: [1] 2 3 ... 5