Forum

Author Topic: Select point cloud by color  (Read 2132 times)

eltama

  • Newbie
  • *
  • Posts: 23
    • View Profile
Select point cloud by color
« 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

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13642
    • View Profile
Re: Select point cloud by color
« Reply #1 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.
Best regards,
Alexey Pasumansky,
Agisoft LLC

eltama

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Select point cloud by color
« Reply #2 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

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13642
    • View Profile
Re: Select point cloud by color
« Reply #3 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")
Best regards,
Alexey Pasumansky,
Agisoft LLC

eltama

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Select point cloud by color
« Reply #4 on: January 27, 2021, 04:58:56 PM »
Thak you Alexey ;)
very usefull script.