'Python: Extract r,g,b values from point cloud

I have a point cloud (ply file) with X,Y,Z and r,g,b values only.

Here is my ply header file.

ply
format ascii 1.0
comment generated by pdal
element veryex 624597
property float64 x
property float64 y
property float64 z
property uint16 red
property uint16 green
property unit16 blue
end_header

I want to extract all the points that belongs to one colour. For eg:extract all the points that are white in ply file should be extracted.

I am looking for library or any idea how we can implement extracting points that belongs to one colour in python.

Any leads are appreciated.

Edit: ply header file added



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source