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

Pages: [1]
Python and Java API / Switch to absolute palette
« on: August 31, 2023, 06:29:00 PM »

For a DEM, it is possible to set a palette with a command like that:
chunk.elevation.palette={-0.15: (50, 50, 222),-0.075: (50, 222, 222),0.0: (50, 222, 50),0.075: (222, 222, 50),0.15: (222, 50, 50)}

But I am not able to find the property or command to switch these altitudes values as absolutes values. It is possible in the interface but how to do it with python?



Python and Java API / Filter dense cloud by Z coordinate
« on: August 29, 2023, 06:18:11 PM »

Is it possible to access the dense_cloud data in python API in order to select the points that have a Z coordinate greater than a certain level, and then delete these points?

Best regards,

I want to take a capture of the model_view and of the ortho_view and then export in an image file.

I use the following code:
Code: [Select] #ortho[55,38,-15])
image = = 640, height = 480, transparent = False, hide_items = False),"PointCloudTop.png"))
image = = 640, height = 480, transparent = False, hide_items = False),"DEM.png"))

The problem is Metashape has no time to display the pointcloud or elevation data, and so take a capture of the interface with no data except the markers, cameras positions or bounding box.
Using time.sleep(2) for 2 seconds pause, or 10s change nothing because everything is pausing.

Is it any way to wait for the viewport to display the entire point cloud, or any way to pause a script while Metashape does it's displaying functions?
And then, is it a function to change the ortho_view viewpoint?


Python and Java API / Georeferenced capture of point cloud
« on: April 11, 2022, 01:01:05 PM »
I'm searching for a function to create a georeferenced image of the point cloud?
Something very similar to the orthophoto process, hich create orthophoto, but with the tie point cloud or dense cloud as source data.

Any idea?

Thank you,

In a project, I have markers, created with python, with no projections, just a relative XYZ to the model (center of a cylinder for example)
When I move the chunk with the helps of camera positions, or if i align the chunk with another chunk, the markers are not following and stay at the original place, not longer in the center of the cylinder.

I tried to convert the markers to point shape, successfully, but the shapes are also not following the model, when modifying the transform.

Any idea to keep markers or points shapes linked with the model ?


Python and Java API / importVideo() not stoping at the endpoint?
« on: December 24, 2021, 12:48:31 AM »
Hi, i'm trying to use chunk.importVideo() to convert videos to png images.

I successfully passed parameters to the function, but i'm unable to stop the png's generation at the endpoint: it always generate the entire video with the good step!
With the following code, it starts the capture at 10 seconds succesfully, each 15 frames (30frames/sec), but doesn't stop at 1'44''.
I tried lots of parameters for time_end : (60+44)*1000, (60+44-10)*1000, (60+44)/1000, 60+44, 1, 100, -100, -1000 . All of them goes to the end of the video, or fail.

Any idea of what's wrong?
Under Metashape 2.7.5, using the menu file > import video works well and stops at the good endpoint!

Code: [Select]
image_path="D:/tests/GP1/Images/GP1_{filenum}.png" #this folder must be created before
start= 10 #start time in seconds from beginning
end= 60+44 # 1min44seconds stop time in seconds from beginning


Python and Java API / Deleting keypoints with python
« on: September 23, 2021, 06:53:15 PM »
Is it possible to delete all the keypoints of a chunk or of an image with a python command? (not the tie points)
I'm not able to find the keypoints in the python properties of chunk or images

In the Metashape interface, that's possible with a right click on the tiepoints > Remove Keypoints.


Bug Reports / Holes in point cloud on 1.7 (and not 1.6)
« on: April 16, 2021, 05:48:06 PM »

After generating dense point cloud from the same data with the same parameters, on the same .psx project (already aligned), I've got less points on the dark parts and other parts with not a lot of texture on the 1.7.2 version than on the 1.6.6 version.

These two clouds are generated with Metashape 1.6.6 and 1.7.2 in Medium/Agressive quality/filtering. Same issue with Mild filtering and no filtering.
How can i come back to the very clean results of 1.6.6 version with the 1.7.2 version? Any tweaks or additionnal parameters?

Thanks, Pierre

Python and Java API / Orthophotos impossible to remove
« on: November 26, 2020, 11:39:32 AM »

I am unable to remove orthophotos from a chunk whith python, whereas they are not visible in the chunk treeview:

Out[69]: 2020-11-26 09:35:55 [<Orthomosaic 'Sol, '>, <Orthomosaic 'Cylindre, '>]


Out[71]: 2020-11-26 09:36:08 [<Orthomosaic 'Sol, '>, <Orthomosaic 'Cylindre, '>]



Out[74]: 2020-11-26 09:36:43 [<Orthomosaic 'Sol, '>, <Orthomosaic 'Cylindre, '>]

Any ideal to remove these orthomosaics?

Python and Java API / Orthophoto rotation
« on: November 10, 2020, 06:17:01 PM »

I am trying to export an orthophoto and apply a rotation of 90 degrees.

I use to export a raster. It works fine.

It seems the argument world_transform is made for this. It is a 3x2 matrix (rotation and translation in XY ??)

While applying the next matrix to world_transform, i get a blank very little file:

Someone knows what parameters have to be in this matrix, or is it possible to rotate an orthophoto and shift it before exporting?

Python and Java API / image().save() compression parameters
« on: October 18, 2019, 10:38:06 AM »
While trying to export images from a project with image().save(path), 42 megapixels images which are 30 Mo are exported in the same resolution, but the weight of the file is just 5-10 Mo with jpeg compression

We are loosing informations (maybe not so important, but... ?)

Can we control the jpeg quality with a parameter?

General / TiePoint limit for dense cloud matching between two photos
« on: September 18, 2019, 11:50:33 AM »
I have photos with overlap, but very few Tie Points are linking some photos:
Computing the Tie points with the parameters 40000/4000 gives veru few points, 150000/150000 gives a little more, and 0/0 gives no more than 150000/150000.
The photos are very old photos (film camera) with a lot of overlap but maybe too much angle.

Te resulting matches between two photos of the project with lot of overlap gives sometimes 200-400 points, and sometimes 40.
The dense pointcloud is not generated for the photos with less than 100 points. This gives a big hole in my 3D model.

A partial solution is resizing the bounding box in the area whith no dense cloud, and it works sometimes... it gives a nice point cloud, but it is not the best to do (long work, merging, filtering, and sometimes gives "no resolution" error) and complicated to use with the meshing method based on depth maps.

Is it a tweak option to allow Metashape to compute the depth maps and so, the dense cloud, for the overlapping photos with less than 100 points ? Can we reduce this parameter to 20 or 30 points?

Python and Java API / Commands to control multiplane
« on: July 19, 2019, 04:11:26 PM »
There is a Python command to create a multiplane Chunk (chunk1.addPhotos(patternImg,PhotoScan.MultiplaneLayout)  ).....

But what are the Python command to control the offset between the cameras and to enable the adjustment of angles and locations?

Pages: [1]