Agisoft Metashape

Agisoft Metashape => Feature Requests => Topic started by: eltama on December 23, 2020, 01:55:11 PM

Title: Select point cloud by color
Post by: eltama on December 23, 2020, 01:55:11 PM
Hi all
It will be great to select every point cloud by specific color or selection with that color, like select - silmilar in Photoshop.
Have a nice day.
Elmar
Title: Re: Select point cloud by color
Post by: Alexey Pasumansky on December 23, 2020, 04:38:01 PM
Hello Elmar,

If you are speaking about dense point cloud, then you can use Tools Menu -> Dense Cloud -> Select Points by Color option in the Model view mode.
Title: Re: Select point cloud by color
Post by: eltama on December 25, 2020, 04:29:17 PM
Hello Alexey
I mean sparse point, but thanks for the tip, I always create mesh from depth map, is much better for my works.
Marry Xmas
Title: Re: Select point cloud by color
Post by: Alexey Pasumansky on January 08, 2021, 07:58:46 PM
Hello Elmar,

The following script example shows how to select the tie points according to the RGB color values and tolerance:
Code: [Select]
import Metashape, sys

doc = Metashape.app.document
chunk = doc.chunk #active chunk
point_cloud = chunk.point_cloud
points = point_cloud.points
tracks = point_cloud.tracks

r = 217 #int(sys.argv[1])
g = 175 #int(sys.argv[2])
b = 164 #int(sys.argv[3])
tolerance = 10 #int(sys.argv[4])

for point in points:
color = tracks[point.track_id].color
if ((abs(color[0] - r) < tolerance) or (abs(color[1] - g) < tolerance) or (abs(color[2] - b) < tolerance)):
point.selected = True
Metashape.app.update()
print("Selected.\n")
Title: Re: Select point cloud by color
Post by: eltama on January 27, 2021, 04:58:56 PM
Thak you Alexey ;)
very usefull script.