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

Pages: 1 2 3 [4] 5 6 7
46
Python and Java API / Re: Get Shape coordinates in python
« on: April 17, 2020, 12:50:39 AM »
What are the steps to de-project my vertex coordinates back to the chunk crs?

i.e. the reverse of

Code: [Select]
[utmCrs.project(chunk.transform.matrix.mulp(i.position))

47
Python and Java API / Re: Get Shape coordinates in python
« on: April 16, 2020, 01:30:00 AM »
What would be the steps to then re-transform my output into the format needed to create a new shape?

So, if I did some math on my end and have a new list of Vector([x,y,z]), and want to use that to make a shape in the same chunk?

48
Python and Java API / Re: Get Shape coordinates in python
« on: April 16, 2020, 01:28:29 AM »
Worked perfectly. Would be helpful if this was explained more in the next python API manual. I think the section for "Vertex" doesn't lead anywhere right now.

49
Python and Java API / Get Shape coordinates in python
« on: April 16, 2020, 12:36:44 AM »
I'm trying to extract the coordinates of the Points/Vertices of a Shape in python. Using 1.6.2 Pro

I can access the individual shape (Polygon). From here, I'm not sure how to get useful data from this.


Code: [Select]
In [119]: chunk.shapes.shapes[0].vertex_ids
Out[119]: 2020-04-15 17:34:31 Shape.Vertices([95, 96, 97, 98, 99, 100, 101, 102])

In [120]: chunk.shapes.shapes[0].vertices

In [121]:

What do I do with the vertex id to access the data in that vertex?

My goal is to be able to draw a bounding rectangle around the shapes that I drew in. So I need to get the contents of my shape and be able to pull the values. I know there is the exportShape option that will then export it as geoJson which I can later read, but I'd rather skip that in between step.

50
Hi,

I sent that in to tech support but haven't heard back yet. Ticket #137052

51
Metashape Pro 1.6.2 build 10247 (64 bit)

OS = CentOS Linux 7 (Core)
CPU = Intel(R) Xeon(R) CPU E5-2695 v4 @ 2.10GHz 72
RAM = 750GB (i think)

52
I'm importing a DEM from a .tif file. It looks good visually in the Ortho preview window area overlaid on the map, as expected. The 'no-data' area is showing as black. The chunk has 27 images in it, not a large area.

When I try to run build orthomosaic using it DEM as the source, it crashes in the GUI, and if trying to run this from python it shows this:

Code: [Select]
BuildOrthomosaic: projection = WGS 84 / UTM zone 19N, surface = DEM, blending mode = Mosaic, refine seamlines = 0, resolution = 0
initializing...
estimating tile boundaries... done in 25.7475 sec
generating 44591x35324 orthomosaic (10 levels, 0.0286791 resolution)
selected 26 cameras
saved orthomosaic data in 0.004399 sec
saved camera partition in 0.00308 sec
scheduled 2 orthophoto groups
loaded camera partition in 3.3e-05 sec
loaded orthomosaic data in 0.000608 sec
Orthorectifying 13 images
Segmentation fault

Any ideas? I want to load in my LiDAR derived DEMs in order to remove the distortion that is showing up in my orthomosaics, especially warping of buildings.


53
Do you have any guidelines for which General parameters to check for the Optimize Camera Alignment option?

I have been using all except "k3" and "k4"....no real reason why though, I just selected a lot of them.

Can someone explain why you pick certain ones or not?

54
Feature Requests / On-line searchable Python API
« on: March 19, 2020, 06:40:40 AM »
The pdf is clunky and hard to search. Would be great to have a python API that is easier to navigate (hiearchy for class methods, etc)

55
Python and Java API / Re: 1.6 mergeChunks API is confusing
« on: March 13, 2020, 10:05:58 PM »
Hi, I finally got around to trying this and it did not solve the issue.

Attached is a screenshot of what's happening, and the code. Even when i use an array of "curChunk.key" items as the input, it merges all of my items.

Code: [Select]
c=[doc.chunks[-2],doc.chunks[-1]]

c
Out[16]: 2020-03-13 14:58:43 [<Chunk 'l0s4_merged'>, <Chunk 'l0s10__7610_7619'>]

keys = [x.key for x in c]

keys
Out[18]: 2020-03-13 14:58:54 [27, 28]

doc.mergeChunks(keys)
2020-03-13 14:58:59 MergeChunks: merge_markers = on
2020-03-13 14:58:59 Merging chunks...
2020-03-13 14:59:00 Finished processing in 0.166039 sec (exit code 1)


This is merging a chunk with 10 cameras and one with 15 cameras, but the output is a merged chunk with all 465 cameras in my project. In the attached photo you can see the last two chunks, and the new chunk which is created after running doc.MergeChunks(k)


56
In the reference panel, I've set the accuracy (m) and (deg) for a set of cameras, along with my own reference information.

If I then select a set of cameras from this chunk, and move them into a new chunk, the accuracy information is reset (to 10m and 10deg), although the rest of my reference information is saved.

57
Python and Java API / 1.6 mergeChunks API is confusing
« on: February 28, 2020, 08:33:47 PM »
Hi, How can I recreate this behavior from 1.5 in 1.6 (in GUI python console)?

Code: [Select]
doc = Metashape.app.document
doc.mergeChunks([doc.chunks[0],doc.chunks[2]],merge_models = True)

As far as I can tell, in 1.6 I need to name to have chunks as a named parameter, and instead of the chunk itself, I pass its index?
If I don't name the chunk, it pulls in all my cameras and merges them.
If I name them, it will only use the first chunk in the list. I'm so confused, I really hope you can revise the python manual for 1.6 soon as it is not very clear. Sample code with each function would be great.

58
General / Re: Agisoft Metashape 1.6.0 pre-release
« on: February 28, 2020, 07:33:12 PM »
Hi,

I like a lot of the new features in 1.6, especially the basemap (for quick sanity check on orthomosaics) and the code preview in the console.

However, it's been very frustrating having some of the parameters completely change how they work, without any sort of warning. Please keep this in mind with future API changes, for example 'mergeChunks' no longer takes chunks as input, but the chunk index, so it would be good if the function raised an Exception in 1.6 if a list of chunks was given in the first parameter (since clearly the user is thinking of 1.5 API).

The new API python manual also seems to be lacking some instructions that are critical for using the changed parameters.

59
How does the region BBox argument get created? Looks like the old format: (xmin,ymin,xmax,max) does not work anymore.

60
I'm also having trouble understanding hwat happened to jpeg_compression.

Could you translate this 1.5 code into 1.6 please?

Code: [Select]
curChunk.exportOrthomosaic(path=orthoDirAndFilename,
                             region=regionBounds,
                             format=Metashape.RasterFormat.RasterFormatTiles,
                             image_format=Metashape.ImageFormat.ImageFormatTIFF,
                             projection=Metashape.CoordinateSystem("EPSG::"+str(epsgCode)),
                             tiff_compression=Metashape.TiffCompressionJPEG,
                             jpeg_quality=20)

Pages: 1 2 3 [4] 5 6 7