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

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

For a DEM, it is possible to set a palette with a command like that:
Quote
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?


Thanks,

Pierre

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

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,
Pierre

3
Hi,
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]
Metashape.app.model_view.view_mode=Metashape.DataSource.DenseCloudData
Metashape.app.model_view.viewpoint.fov=0 #ortho
Metashape.app.model_view.viewpoint.coo=Metashape.Vector([55,38,-15])
Metashape.app.model_view.viewpoint.mag=5
image = Metashape.app.model_view.captureView(width = 640, height = 480, transparent = False, hide_items = False)
image.save(os.path.join(export_path,"PointCloudTop.png"))

Metashape.app.ortho_view.view_mode=Metashape.DataSource.ElevationData
image = Metashape.app.ortho_view.captureView(width = 640, height = 480, transparent = False, hide_items = False)
image.save(os.path.join(export_path,"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?

Thanks!
Pierre

4
Python and Java API / Georeferenced capture of point cloud
« on: April 11, 2022, 01:01:05 PM »
Hi,
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,
Pierre

5
Hi,
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 ?

regards,
Pierre


6
General / Re: Extra corrections not saved in xml calibration file
« on: March 23, 2022, 05:25:23 PM »
OK. Tried with the 1.8.2
I was not the case with the 1.6.6.

Thanks!

7
General / Re: Extra corrections not saved in xml calibration file
« on: March 23, 2022, 04:16:36 PM »
Hi, I have the same question
How to, export these additionals parameters and import them into a new project?
We use scripts with python so we don't really need to export it to xml, but it would be more comfortable

8
Python and Java API / Re: Orthophoto rotation
« on: January 12, 2022, 07:12:41 PM »
Hi? I finally restarted my tests and find how to export with a rotation:

on your code, juste invert b/l and r/t like that:
Code: [Select]
region.min = Metashape.Vector([b, l])
region.max = Metashape.Vector([t, r])

My problem now is a jpeg is well exported with the rotation, but the georeference informations is not the good one:
tfw or jgw files are like that, so QGIS and ArcGis make a rotation to have the original image "unrotated", like the original!
Code: [Select]
0
0.005
0.005
0
-7.851481764038356
6738.759166666668

whereas it should be like that:
Code: [Select]
0.005
0
0
-0.005
6738.759166666668
-7.851481764038356

Playing with north_up=False or True has no effect on the tfw or jgw file :(
Do you have any final idea to close this subject?

9
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]
path="D:/tests/GP1/GOPR7430.MP4"
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


chunk.importVideo(path,image_path,frame_step=Metashape.FrameStep.CustomFrameStep,custom_frame_step=15,time_start=start*1000,time_end=end*1000)

10
Python and Java API / Re: Saving all chunks
« on: September 28, 2021, 05:46:10 PM »
A very clean method. thanks!  :)

11
Python and Java API / Re: Saving all chunks
« on: September 28, 2021, 10:33:27 AM »
Hi,
The command doc.addChunk does not accept a chunk anymore into its parameters.
Is it another way to save all chunks into separate projects without reloading the full project each time?

12
Python and Java API / Re: Deleting keypoints with python
« on: September 28, 2021, 09:58:05 AM »
Thanks, that's what i was searching for!  :)

13
Python and Java API / Deleting keypoints with python
« on: September 23, 2021, 06:53:15 PM »
Hi,
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.

Thanks,
Pierre

14
Bug Reports / Re: Holes in point cloud on 1.7 (and not 1.6)
« on: April 20, 2021, 09:54:01 PM »
Mail sent! Thank you!

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

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

Pages: [1] 2 3