Save PCD Compressed Binary

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Save PCD Compressed Binary

Magician
Hi All,


I'm trying to save my Point Clouds as PCD format.
I'm referring to pcl_openni_io, and this code saves
Compressed Binary format of PCD data.
But if I save PointXYZ Point Clouds with SavePCDFileBinary,
the data includes Uncompressed Binary data section.

Can I save PointXYZ data as PCD Compressed Binary data?


Magician
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Save PCD Compressed Binary

aichim
Administrator
Hi,

savePCDFileBinary saves as binary uncompressed. In order to save in binary compressed, you need to use the PCDWriter class and call its writeBinaryCompressed (...)  method.

I've put a convenience savePCDFileBinaryCompressed (…) in trunk now (r8672)

Thanks for the reminder!


Cheers,
Alex
---
http://www.openperception.org



On Feb 6, 2013, at 8:09 AM, Magician <[hidden email]> wrote:

> Hi All,
>
>
> I'm trying to save my Point Clouds as PCD format.
> I'm referring to pcl_openni_io, and this code saves
> Compressed Binary format of PCD data.
> But if I save PointXYZ Point Clouds with SavePCDFileBinary,
> the data includes Uncompressed Binary data section.
>
> Can I save PointXYZ data as PCD Compressed Binary data?
>
>
> Magician
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Save PCD Compressed Binary

Magician
In reply to this post by Magician
Hi Alex,


Thanks for your advice.
I tried writeBinaryCompressed and succeeded to get good results.

But now I found another problem.
I compared some binary compressed XYZRGBA PCD files,
and there are 2 data types.
Some of them have 'F F F F' data types, and others have 'F F F U'.

Could I set types of values when exporting PCD files?


Magician


On 2013/02/07, at 5:00, [hidden email] wrote:

> Hi,
>
> savePCDFileBinary saves as binary uncompressed. In order to save in binary compressed, you need to use the PCDWriter class and call its writeBinaryCompressed (...)  method.
>
> I've put a convenience savePCDFileBinaryCompressed (?) in trunk now (r8672)
>
> Thanks for the reminder!
>
>
> Cheers,
> Alex
> ---
> http://www.openperception.org
>
>
>
> On Feb 6, 2013, at 8:09 AM, Magician <[hidden email]> wrote:
>
>> Hi All,
>>
>>
>> I'm trying to save my Point Clouds as PCD format.
>> I'm referring to pcl_openni_io, and this code saves
>> Compressed Binary format of PCD data.
>> But if I save PointXYZ Point Clouds with SavePCDFileBinary,
>> the data includes Uncompressed Binary data section.
>>
>> Can I save PointXYZ data as PCD Compressed Binary data?
>>
>>
>> Magician
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Save PCD Compressed Binary

abrichr
This post has NOT been accepted by the mailing list yet.
Hi Magician,

From http://pointclouds.org/documentation/tutorials/pcd_file_format.php:

TYPE - specifies the type of each dimension as a char. The current accepted types are:
I - represents signed types int8 (char), int16 (short), and int32 (int)
U - represents unsigned types uint8 (unsigned char), uint16 (unsigned short), uint32 (unsigned int)
F - represents float types

From /trunk/io/src/pcd_io:1112:

stream << pcl::getFieldType (cloud.fields[d].datatype) << " ";

So it looks like the type is inferred automatically. To change the type in the resulting PCD file, you have to change the type in your code.