Safe Haskell | None |
---|
Parser for PCD (point cloud data) files. Also provides a facility for converting from ASCII to binary formatted point data.
- data FieldType
- unsafeUnwrap :: PCDType a => FieldType -> a
- loadAllFields :: FilePath -> IO (Text -> Vector FieldType)
- loadXyzw :: (Fractional a, Storable a) => FilePath -> IO (Vector (V4 a))
- loadXyz :: (Fractional a, Storable a) => FilePath -> IO (Vector (V3 a))
- asciiToBinary :: FilePath -> FilePath -> IO ()
- 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
Documentation
unsafeUnwrap :: PCDType a => FieldType -> aSource
loadAllFields :: FilePath -> IO (Text -> Vector FieldType)Source
Parse every field of every point in a PCD file. Returns a function that may be used to project out a named field.
loadXyzw :: (Fractional a, Storable a) => FilePath -> IO (Vector (V4 a))Source
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).
loadXyz :: (Fractional a, Storable a) => FilePath -> IO (Vector (V3 a))Source
Read a PCD file consisting of floating point XYZ coordinates for each point.
asciiToBinary :: FilePath -> FilePath -> IO ()Source
asciiToBinary inputFile outputFile
converts a PCD file from
ASCII to Binary.
saveBinaryPcd :: forall a. Storable a => FilePath -> Header -> Vector a -> IO ()Source
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
set to Binary
.
projectBinaryFields :: [Text] -> FilePath -> FilePath -> IO ()Source
Save a binary PCD file including only the named fields.
mkSimpleHeader :: [Text] -> (DimType, Int) -> Int -> HeaderSource
Make a PCD header for a monotyped vector point
type. mkSimpleHeader fields (type,sz) n
prepares a Header
for
n
points with field names fields
, field type given by type
,
and field size given by sz
. Example to save 1000 3D points:
mkSimpleHeader ["x","y","z"] (F,4) 1000