Parser for PCD (point cloud data) files.
- data FieldType
- unsafeUnwrap :: PCDType a => FieldType -> a
- loadFieldsByName :: FilePath -> IO (Text -> Vector FieldType)
- loadFlexiblePoints :: Header -> Handle -> IO (Vector (Vector FieldType))
- loadXyzw :: (Fractional a, Storable a) => FilePath -> IO (Vector (V4 a))
- loadXyz :: (Fractional a, Storable a) => FilePath -> IO (Vector (V3 a))
- saveBinaryPcd :: forall a. Storable a => FilePath -> Header -> Vector a -> IO ()
- projectBinaryFields :: [Text] -> FilePath -> FilePath -> IO ()
- mkSimpleHeader :: [Text] -> (DimType, Int) -> Int -> Header
- mkHeaderXYZ :: PCDType a => a -> Int -> Header
Loading PCD data
Parse every field of every point in a PCD file. Returns a function that may be used to project out a named field.
Read a PCD file consisting of floating point XYZW coordinates for each point (where the final "W" field may be an RGB triple encoded as a float).
Read a PCD file consisting of floating point XYZ coordinates for each point.
Saving PCD data
Use an existing PCD header to save binary point data to a
file. The supplied header is used as-is, except that its format is
Save a binary PCD file including only the named fields. This is
useful when you have a PCD file that has more fields for each point
than you care about. For instance, you may wish to extract just the
"x", "y", and "z" fields for each point. This can be
projectBinaryFields ["x", "y", "z"]
PCD header creation
Make a PCD header for a monotyped vector point
mkSimpleHeader fields (type,sz) n prepares a
n points with field names
fields, field type given by
and field size given by
sz. Example to save 1000 3D points using
a single-precision floating point number (4 bytes) for each field:
mkSimpleHeader ["x","y","z"] (F,4) 1000