Skip to content

how to understand draco::EncoderOptions #925

@leviskim17

Description

@leviskim17

Can somebody help me understand the below function?

I am struggling to understand draco::EncoderOptions
This is the function implemented by the former worker. After getting this draco process, the intensity values seem to be different with original value. May I know how to get the original value in cesium side?

        draco::PointCloudBuilder builder;
        draco::EncoderBuffer encoder_buffer;
        draco::PointCloudSequentialEncoder encoder;
        draco::EncoderOptions options = draco::EncoderOptions::CreateDefaultOptions();
    void DPNTSGenerator::finalizePoints()
    {
        const auto point_cloud = builder.Finalize(false);

        options.SetAttributeFloat(point_cloud->GetNamedAttributeId(draco::GeometryAttribute::POSITION), "quantization_bits", 14);
        options.SetAttributeFloat(point_cloud->GetNamedAttributeId(draco::GeometryAttribute::NORMAL), "quantization_bits", 14);
        options.SetAttributeInt(point_cloud->GetNamedAttributeId(draco::GeometryAttribute::COLOR), "quantization_bits", 8);
        options.SetAttributeFloat(intensity_id, "quantization_bits", 14);

        encoder.SetPointCloud(*point_cloud);

        encoder_buffer.Clear();
        const auto status = encoder.Encode(options, &encoder_buffer);
        if (!status.ok())
        {
            // failed to encode
            std::cerr << status << std::endl;
            return;
        }

        const auto& buffer = encoder_buffer;
        writeFeatureTableBinary(buffer.data(), buffer.size());
    }

I have tried to adjust there parameters

        options.SetAttributeFloat(point_cloud->GetNamedAttributeId(draco::GeometryAttribute::POSITION), "quantization_bits", 14);
        options.SetAttributeFloat(point_cloud->GetNamedAttributeId(draco::GeometryAttribute::NORMAL), "quantization_bits", 14);
        options.SetAttributeInt(point_cloud->GetNamedAttributeId(draco::GeometryAttribute::COLOR), "quantization_bits", 8);
        options.SetAttributeFloat(intensity_id, "quantization_bits", 14);

But I can't get satisfactory results.

Is there any mention of the API's comment of SetAttributeFloat?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions