VoxelGrid for color pointcloud

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

VoxelGrid for color pointcloud

Yohei Kakiuchi
Hi, all.

I want to use voxelgrid filter on PointCloud2 with "RGB" field.
But, VoxelGrid couldn't treat "RGB" feild correctly.

Because, It average "RGB" field as float value, not 24-bit RGB.

00345         // Copy all the fields
00346         Eigen3::VectorXf centroid = Eigen3::VectorXf::Zero
(centroid_size);
00347         for (int d = 0; d < centroid_size; ++d)
00348           memcpy (&centroid[d], &input_->data[point_offset +
input_->fields[d].offset], field_sizes_[d]);
00349         leaf.centroid += centroid;
00350       }
00351       ++leaf.nr_points;

I wrote patch for voxel_grid.cpp, but it is not efficient.
Is anyone who have better solution?

_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users

voxcel_grid.diff (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: VoxelGrid for color pointcloud

Radu B. Rusu
Administrator
Yohei,

Thanks a lot for the patch!

We know about this issue and we were debating whether we should keep RGB data packed into floats for PointCloud2 or
simply move to something else.

I could incorporate the patch as it is if we cannot find a better, more optimized solution in the meantime...

Cheers,
Radu.


On 11/22/2010 06:32 AM, Yohei Kakiuchi wrote:

> Hi, all.
>
> I want to use voxelgrid filter on PointCloud2 with "RGB" field.
> But, VoxelGrid couldn't treat "RGB" feild correctly.
>
> Because, It average "RGB" field as float value, not 24-bit RGB.
>
> 00345         // Copy all the fields
> 00346         Eigen3::VectorXf centroid = Eigen3::VectorXf::Zero
> (centroid_size);
> 00347         for (int d = 0; d<  centroid_size; ++d)
> 00348           memcpy (&centroid[d],&input_->data[point_offset +
> input_->fields[d].offset], field_sizes_[d]);
> 00349         leaf.centroid += centroid;
> 00350       }
> 00351       ++leaf.nr_points;
>
> I wrote patch for voxel_grid.cpp, but it is not efficient.
> Is anyone who have better solution?
>
>
>
> _______________________________________________
> [hidden email] / http://pcl.ros.org
> https://code.ros.org/mailman/listinfo/pcl-users
_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: VoxelGrid for color pointcloud

Radu B. Rusu
Administrator
In reply to this post by Yohei Kakiuchi
Yohei-san,

I had a look at your patch and it doesn't seem terribly inefficient, so we would like to include it in the next release
(0.6). Would it be possible to send me a patch for pcl::VoxelGrid<T> (voxel_grid.hpp) please? That would make both
versions of the filter work.

Also, can you make a very small unit test for RGB data in test/test_filters.cpp? Take a few points with some colors that
you know and downsample them and then test for the result. Let us know whether you need any help.

Thanks,
Radu.


On 11/22/2010 06:32 AM, Yohei Kakiuchi wrote:

> Hi, all.
>
> I want to use voxelgrid filter on PointCloud2 with "RGB" field.
> But, VoxelGrid couldn't treat "RGB" feild correctly.
>
> Because, It average "RGB" field as float value, not 24-bit RGB.
>
> 00345         // Copy all the fields
> 00346         Eigen3::VectorXf centroid = Eigen3::VectorXf::Zero
> (centroid_size);
> 00347         for (int d = 0; d<  centroid_size; ++d)
> 00348           memcpy (&centroid[d],&input_->data[point_offset +
> input_->fields[d].offset], field_sizes_[d]);
> 00349         leaf.centroid += centroid;
> 00350       }
> 00351       ++leaf.nr_points;
>
> I wrote patch for voxel_grid.cpp, but it is not efficient.
> Is anyone who have better solution?
>
>
>
> _______________________________________________
> [hidden email] / http://pcl.ros.org
> https://code.ros.org/mailman/listinfo/pcl-users
_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: VoxelGrid for color pointcloud

Dejan Pangercic
Hi there,
we actually wanted to apply the attached patch as soon as Zoli gets some time.
In the patch you'll find an example pointcloud with rgb values.

D.

On Sat, Nov 27, 2010 at 9:58 PM, Radu Bogdan Rusu <[hidden email]> wrote:

> Yohei-san,
>
> I had a look at your patch and it doesn't seem terribly inefficient, so we would like to include it in the next release
> (0.6). Would it be possible to send me a patch for pcl::VoxelGrid<T> (voxel_grid.hpp) please? That would make both
> versions of the filter work.
>
> Also, can you make a very small unit test for RGB data in test/test_filters.cpp? Take a few points with some colors that
> you know and downsample them and then test for the result. Let us know whether you need any help.
>
> Thanks,
> Radu.
>
>
> On 11/22/2010 06:32 AM, Yohei Kakiuchi wrote:
>> Hi, all.
>>
>> I want to use voxelgrid filter on PointCloud2 with "RGB" field.
>> But, VoxelGrid couldn't treat "RGB" feild correctly.
>>
>> Because, It average "RGB" field as float value, not 24-bit RGB.
>>
>> 00345         // Copy all the fields
>> 00346         Eigen3::VectorXf centroid = Eigen3::VectorXf::Zero
>> (centroid_size);
>> 00347         for (int d = 0; d<  centroid_size; ++d)
>> 00348           memcpy (&centroid[d],&input_->data[point_offset +
>> input_->fields[d].offset], field_sizes_[d]);
>> 00349         leaf.centroid += centroid;
>> 00350       }
>> 00351       ++leaf.nr_points;
>>
>> I wrote patch for voxel_grid.cpp, but it is not efficient.
>> Is anyone who have better solution?
>>
>>
>>
>> _______________________________________________
>> [hidden email] / http://pcl.ros.org
>> https://code.ros.org/mailman/listinfo/pcl-users
> _______________________________________________
> [hidden email] / http://pcl.ros.org
> https://code.ros.org/mailman/listinfo/pcl-users
>


--
MSc. Dejan Pangercic
PhD Student/Researcher
Intelligent Autonomous Systems Group
Technische Universität München
Telephone: +49 (89) 289-26908
E-Mail: [hidden email]
WWW: http://ias.cs.tum.edu/people/pangercic

_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users

test_gp3_color.cpp.diff (267K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: VoxelGrid for color pointcloud

Radu B. Rusu
Administrator
Dejan,

Is it me or is there something wrong with the PCD file you sent? Here's how pcd_viewer sees it (see attachment).

Cheers,
Radu.


On 11/27/2010 02:05 PM, Dejan Pangercic wrote:

> Hi there,
> we actually wanted to apply the attached patch as soon as Zoli gets some time.
> In the patch you'll find an example pointcloud with rgb values.
>
> D.
>
> On Sat, Nov 27, 2010 at 9:58 PM, Radu Bogdan Rusu<[hidden email]>  wrote:
>> Yohei-san,
>>
>> I had a look at your patch and it doesn't seem terribly inefficient, so we would like to include it in the next release
>> (0.6). Would it be possible to send me a patch for pcl::VoxelGrid<T>  (voxel_grid.hpp) please? That would make both
>> versions of the filter work.
>>
>> Also, can you make a very small unit test for RGB data in test/test_filters.cpp? Take a few points with some colors that
>> you know and downsample them and then test for the result. Let us know whether you need any help.
>>
>> Thanks,
>> Radu.
>>
>>
>> On 11/22/2010 06:32 AM, Yohei Kakiuchi wrote:
>>> Hi, all.
>>>
>>> I want to use voxelgrid filter on PointCloud2 with "RGB" field.
>>> But, VoxelGrid couldn't treat "RGB" feild correctly.
>>>
>>> Because, It average "RGB" field as float value, not 24-bit RGB.
>>>
>>> 00345         // Copy all the fields
>>> 00346         Eigen3::VectorXf centroid = Eigen3::VectorXf::Zero
>>> (centroid_size);
>>> 00347         for (int d = 0; d<    centroid_size; ++d)
>>> 00348           memcpy (&centroid[d],&input_->data[point_offset +
>>> input_->fields[d].offset], field_sizes_[d]);
>>> 00349         leaf.centroid += centroid;
>>> 00350       }
>>> 00351       ++leaf.nr_points;
>>>
>>> I wrote patch for voxel_grid.cpp, but it is not efficient.
>>> Is anyone who have better solution?
>>>
>>>
>>>
>>> _______________________________________________
>>> [hidden email] / http://pcl.ros.org
>>> https://code.ros.org/mailman/listinfo/pcl-users
>> _______________________________________________
>> [hidden email] / http://pcl.ros.org
>> https://code.ros.org/mailman/listinfo/pcl-users
>>
>
>
>

_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users

screenshot.jpg (50K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: VoxelGrid for color pointcloud

Dejan Pangercic
Hi Radu,

this is what happens if I save it as ASCII on my machine. Has
something to do with the way we are handling rgb value as float. If I
save it as Binary the colors look perfectly normal but then we do not
want to have binary files committed right?

cheers, D.

On Mon, Nov 29, 2010 at 3:49 AM, Radu Bogdan Rusu <[hidden email]> wrote:

> Dejan,
>
> Is it me or is there something wrong with the PCD file you sent? Here's how
> pcd_viewer sees it (see attachment).
>
> Cheers,
> Radu.
>
>
> On 11/27/2010 02:05 PM, Dejan Pangercic wrote:
>>
>> Hi there,
>> we actually wanted to apply the attached patch as soon as Zoli gets some
>> time.
>> In the patch you'll find an example pointcloud with rgb values.
>>
>> D.
>>
>> On Sat, Nov 27, 2010 at 9:58 PM, Radu Bogdan Rusu<[hidden email]>
>>  wrote:
>>>
>>> Yohei-san,
>>>
>>> I had a look at your patch and it doesn't seem terribly inefficient, so
>>> we would like to include it in the next release
>>> (0.6). Would it be possible to send me a patch for pcl::VoxelGrid<T>
>>>  (voxel_grid.hpp) please? That would make both
>>> versions of the filter work.
>>>
>>> Also, can you make a very small unit test for RGB data in
>>> test/test_filters.cpp? Take a few points with some colors that
>>> you know and downsample them and then test for the result. Let us know
>>> whether you need any help.
>>>
>>> Thanks,
>>> Radu.
>>>
>>>
>>> On 11/22/2010 06:32 AM, Yohei Kakiuchi wrote:
>>>>
>>>> Hi, all.
>>>>
>>>> I want to use voxelgrid filter on PointCloud2 with "RGB" field.
>>>> But, VoxelGrid couldn't treat "RGB" feild correctly.
>>>>
>>>> Because, It average "RGB" field as float value, not 24-bit RGB.
>>>>
>>>> 00345         // Copy all the fields
>>>> 00346         Eigen3::VectorXf centroid = Eigen3::VectorXf::Zero
>>>> (centroid_size);
>>>> 00347         for (int d = 0; d<    centroid_size; ++d)
>>>> 00348           memcpy (&centroid[d],&input_->data[point_offset +
>>>> input_->fields[d].offset], field_sizes_[d]);
>>>> 00349         leaf.centroid += centroid;
>>>> 00350       }
>>>> 00351       ++leaf.nr_points;
>>>>
>>>> I wrote patch for voxel_grid.cpp, but it is not efficient.
>>>> Is anyone who have better solution?
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> [hidden email] / http://pcl.ros.org
>>>> https://code.ros.org/mailman/listinfo/pcl-users
>>>
>>> _______________________________________________
>>> [hidden email] / http://pcl.ros.org
>>> https://code.ros.org/mailman/listinfo/pcl-users
>>>
>>
>>
>>
>



--
MSc. Dejan Pangercic
PhD Student/Researcher
Intelligent Autonomous Systems Group
Technische Universität München
Telephone: +49 (89) 289-26908
E-Mail: [hidden email]
WWW: http://ias.cs.tum.edu/people/pangercic
_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: VoxelGrid for color pointcloud

Radu B. Rusu
Administrator
Can you send the file as binary here? I'll try to save it as ASCII and see where those errors come from.

Cheers,
Radu.


On 11/28/2010 11:52 PM, Dejan Pangercic wrote:

> Hi Radu,
>
> this is what happens if I save it as ASCII on my machine. Has
> something to do with the way we are handling rgb value as float. If I
> save it as Binary the colors look perfectly normal but then we do not
> want to have binary files committed right?
>
> cheers, D.
>
> On Mon, Nov 29, 2010 at 3:49 AM, Radu Bogdan Rusu<[hidden email]>  wrote:
>> Dejan,
>>
>> Is it me or is there something wrong with the PCD file you sent? Here's how
>> pcd_viewer sees it (see attachment).
>>
>> Cheers,
>> Radu.
>>
>>
>> On 11/27/2010 02:05 PM, Dejan Pangercic wrote:
>>>
>>> Hi there,
>>> we actually wanted to apply the attached patch as soon as Zoli gets some
>>> time.
>>> In the patch you'll find an example pointcloud with rgb values.
>>>
>>> D.
>>>
>>> On Sat, Nov 27, 2010 at 9:58 PM, Radu Bogdan Rusu<[hidden email]>
>>>   wrote:
>>>>
>>>> Yohei-san,
>>>>
>>>> I had a look at your patch and it doesn't seem terribly inefficient, so
>>>> we would like to include it in the next release
>>>> (0.6). Would it be possible to send me a patch for pcl::VoxelGrid<T>
>>>>   (voxel_grid.hpp) please? That would make both
>>>> versions of the filter work.
>>>>
>>>> Also, can you make a very small unit test for RGB data in
>>>> test/test_filters.cpp? Take a few points with some colors that
>>>> you know and downsample them and then test for the result. Let us know
>>>> whether you need any help.
>>>>
>>>> Thanks,
>>>> Radu.
>>>>
>>>>
>>>> On 11/22/2010 06:32 AM, Yohei Kakiuchi wrote:
>>>>>
>>>>> Hi, all.
>>>>>
>>>>> I want to use voxelgrid filter on PointCloud2 with "RGB" field.
>>>>> But, VoxelGrid couldn't treat "RGB" feild correctly.
>>>>>
>>>>> Because, It average "RGB" field as float value, not 24-bit RGB.
>>>>>
>>>>> 00345         // Copy all the fields
>>>>> 00346         Eigen3::VectorXf centroid = Eigen3::VectorXf::Zero
>>>>> (centroid_size);
>>>>> 00347         for (int d = 0; d<      centroid_size; ++d)
>>>>> 00348           memcpy (&centroid[d],&input_->data[point_offset +
>>>>> input_->fields[d].offset], field_sizes_[d]);
>>>>> 00349         leaf.centroid += centroid;
>>>>> 00350       }
>>>>> 00351       ++leaf.nr_points;
>>>>>
>>>>> I wrote patch for voxel_grid.cpp, but it is not efficient.
>>>>> Is anyone who have better solution?
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> [hidden email] / http://pcl.ros.org
>>>>> https://code.ros.org/mailman/listinfo/pcl-users
>>>>
>>>> _______________________________________________
>>>> [hidden email] / http://pcl.ros.org
>>>> https://code.ros.org/mailman/listinfo/pcl-users
>>>>
>>>
>>>
>>>
>>
>
>
>
_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: VoxelGrid for color pointcloud

Dejan Pangercic
Hi Radu,
I can not find the delimited version in binary anymore (btw box cutter
would come in really handy - shall we port it from old _Clouds repo?),
but I have an original file here:
http://ias.cs.tum.edu/~pangerci/iced-tea.pcd
D.

On Mon, Nov 29, 2010 at 8:55 AM, Radu Bogdan Rusu <[hidden email]> wrote:

> Can you send the file as binary here? I'll try to save it as ASCII and see
> where those errors come from.
>
> Cheers,
> Radu.
>
>
> On 11/28/2010 11:52 PM, Dejan Pangercic wrote:
>>
>> Hi Radu,
>>
>> this is what happens if I save it as ASCII on my machine. Has
>> something to do with the way we are handling rgb value as float. If I
>> save it as Binary the colors look perfectly normal but then we do not
>> want to have binary files committed right?
>>
>> cheers, D.
>>
>> On Mon, Nov 29, 2010 at 3:49 AM, Radu Bogdan Rusu<[hidden email]>
>>  wrote:
>>>
>>> Dejan,
>>>
>>> Is it me or is there something wrong with the PCD file you sent? Here's
>>> how
>>> pcd_viewer sees it (see attachment).
>>>
>>> Cheers,
>>> Radu.
>>>
>>>
>>> On 11/27/2010 02:05 PM, Dejan Pangercic wrote:
>>>>
>>>> Hi there,
>>>> we actually wanted to apply the attached patch as soon as Zoli gets some
>>>> time.
>>>> In the patch you'll find an example pointcloud with rgb values.
>>>>
>>>> D.
>>>>
>>>> On Sat, Nov 27, 2010 at 9:58 PM, Radu Bogdan Rusu<[hidden email]>
>>>>  wrote:
>>>>>
>>>>> Yohei-san,
>>>>>
>>>>> I had a look at your patch and it doesn't seem terribly inefficient, so
>>>>> we would like to include it in the next release
>>>>> (0.6). Would it be possible to send me a patch for pcl::VoxelGrid<T>
>>>>>  (voxel_grid.hpp) please? That would make both
>>>>> versions of the filter work.
>>>>>
>>>>> Also, can you make a very small unit test for RGB data in
>>>>> test/test_filters.cpp? Take a few points with some colors that
>>>>> you know and downsample them and then test for the result. Let us know
>>>>> whether you need any help.
>>>>>
>>>>> Thanks,
>>>>> Radu.
>>>>>
>>>>>
>>>>> On 11/22/2010 06:32 AM, Yohei Kakiuchi wrote:
>>>>>>
>>>>>> Hi, all.
>>>>>>
>>>>>> I want to use voxelgrid filter on PointCloud2 with "RGB" field.
>>>>>> But, VoxelGrid couldn't treat "RGB" feild correctly.
>>>>>>
>>>>>> Because, It average "RGB" field as float value, not 24-bit RGB.
>>>>>>
>>>>>> 00345         // Copy all the fields
>>>>>> 00346         Eigen3::VectorXf centroid = Eigen3::VectorXf::Zero
>>>>>> (centroid_size);
>>>>>> 00347         for (int d = 0; d<      centroid_size; ++d)
>>>>>> 00348           memcpy (&centroid[d],&input_->data[point_offset +
>>>>>> input_->fields[d].offset], field_sizes_[d]);
>>>>>> 00349         leaf.centroid += centroid;
>>>>>> 00350       }
>>>>>> 00351       ++leaf.nr_points;
>>>>>>
>>>>>> I wrote patch for voxel_grid.cpp, but it is not efficient.
>>>>>> Is anyone who have better solution?
>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> [hidden email] / http://pcl.ros.org
>>>>>> https://code.ros.org/mailman/listinfo/pcl-users
>>>>>
>>>>> _______________________________________________
>>>>> [hidden email] / http://pcl.ros.org
>>>>> https://code.ros.org/mailman/listinfo/pcl-users
>>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>



--
MSc. Dejan Pangercic
PhD Student/Researcher
Intelligent Autonomous Systems Group
Technische Universität München
Telephone: +49 (89) 289-26908
E-Mail: [hidden email]
WWW: http://ias.cs.tum.edu/people/pangercic
_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: VoxelGrid for color pointcloud

Yohei Kakiuchi
In reply to this post by Radu B. Rusu
Hi Radu,

I wrote a patch for pcl::VoxelGrid<T>. This does not so differ from
the patch for PointCloud2.

Attached patch also contains former patch and test code added to
test/test_filters.cpp.
Test code is using the pcd file(icedtea_rgb.pcd) which was posted by dejan.

Yohei Kakiuchi.

2010/11/28 Radu Bogdan Rusu <[hidden email]>:

> Yohei-san,
>
> I had a look at your patch and it doesn't seem terribly inefficient, so we
> would like to include it in the next release (0.6). Would it be possible to
> send me a patch for pcl::VoxelGrid<T> (voxel_grid.hpp) please? That would
> make both versions of the filter work.
>
> Also, can you make a very small unit test for RGB data in
> test/test_filters.cpp? Take a few points with some colors that you know and
> downsample them and then test for the result. Let us know whether you need
> any help.
>
> Thanks,
> Radu.
>
>
> On 11/22/2010 06:32 AM, Yohei Kakiuchi wrote:
>>
>> Hi, all.
>>
>> I want to use voxelgrid filter on PointCloud2 with "RGB" field.
>> But, VoxelGrid couldn't treat "RGB" feild correctly.
>>
>> Because, It average "RGB" field as float value, not 24-bit RGB.
>>
>> 00345         // Copy all the fields
>> 00346         Eigen3::VectorXf centroid = Eigen3::VectorXf::Zero
>> (centroid_size);
>> 00347         for (int d = 0; d<  centroid_size; ++d)
>> 00348           memcpy (&centroid[d],&input_->data[point_offset +
>> input_->fields[d].offset], field_sizes_[d]);
>> 00349         leaf.centroid += centroid;
>> 00350       }
>> 00351       ++leaf.nr_points;
>>
>> I wrote patch for voxel_grid.cpp, but it is not efficient.
>> Is anyone who have better solution?
>>
>>
>>
>> _______________________________________________
>> [hidden email] / http://pcl.ros.org
>> https://code.ros.org/mailman/listinfo/pcl-users
>

_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users

voxel_grid.patch (12K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: VoxelGrid for color pointcloud

Radu B. Rusu
Administrator
In reply to this post by Dejan Pangercic
Thanks, I got it to work correctly by bumping up the std precision:

$ convert_pcd_ascii_binary iced-tea.pcd ice.pcd 7

Default is 5. I also changed this in trunk -- though I have to admit it's pretty arbitrary... I'm not sure if it will be
enough to account for all cases.

Cheers,
Radu.


On 11/29/2010 12:52 AM, Dejan Pangercic wrote:

> Hi Radu,
> I can not find the delimited version in binary anymore (btw box cutter
> would come in really handy - shall we port it from old _Clouds repo?),
> but I have an original file here:
> http://ias.cs.tum.edu/~pangerci/iced-tea.pcd
> D.
>
> On Mon, Nov 29, 2010 at 8:55 AM, Radu Bogdan Rusu<[hidden email]>  wrote:
>> Can you send the file as binary here? I'll try to save it as ASCII and see
>> where those errors come from.
>>
>> Cheers,
>> Radu.
>>
>>
>> On 11/28/2010 11:52 PM, Dejan Pangercic wrote:
>>>
>>> Hi Radu,
>>>
>>> this is what happens if I save it as ASCII on my machine. Has
>>> something to do with the way we are handling rgb value as float. If I
>>> save it as Binary the colors look perfectly normal but then we do not
>>> want to have binary files committed right?
>>>
>>> cheers, D.
>>>
>>> On Mon, Nov 29, 2010 at 3:49 AM, Radu Bogdan Rusu<[hidden email]>
>>>   wrote:
>>>>
>>>> Dejan,
>>>>
>>>> Is it me or is there something wrong with the PCD file you sent? Here's
>>>> how
>>>> pcd_viewer sees it (see attachment).
>>>>
>>>> Cheers,
>>>> Radu.
>>>>
>>>>
>>>> On 11/27/2010 02:05 PM, Dejan Pangercic wrote:
>>>>>
>>>>> Hi there,
>>>>> we actually wanted to apply the attached patch as soon as Zoli gets some
>>>>> time.
>>>>> In the patch you'll find an example pointcloud with rgb values.
>>>>>
>>>>> D.
>>>>>
>>>>> On Sat, Nov 27, 2010 at 9:58 PM, Radu Bogdan Rusu<[hidden email]>
>>>>>   wrote:
>>>>>>
>>>>>> Yohei-san,
>>>>>>
>>>>>> I had a look at your patch and it doesn't seem terribly inefficient, so
>>>>>> we would like to include it in the next release
>>>>>> (0.6). Would it be possible to send me a patch for pcl::VoxelGrid<T>
>>>>>>   (voxel_grid.hpp) please? That would make both
>>>>>> versions of the filter work.
>>>>>>
>>>>>> Also, can you make a very small unit test for RGB data in
>>>>>> test/test_filters.cpp? Take a few points with some colors that
>>>>>> you know and downsample them and then test for the result. Let us know
>>>>>> whether you need any help.
>>>>>>
>>>>>> Thanks,
>>>>>> Radu.
>>>>>>
>>>>>>
>>>>>> On 11/22/2010 06:32 AM, Yohei Kakiuchi wrote:
>>>>>>>
>>>>>>> Hi, all.
>>>>>>>
>>>>>>> I want to use voxelgrid filter on PointCloud2 with "RGB" field.
>>>>>>> But, VoxelGrid couldn't treat "RGB" feild correctly.
>>>>>>>
>>>>>>> Because, It average "RGB" field as float value, not 24-bit RGB.
>>>>>>>
>>>>>>> 00345         // Copy all the fields
>>>>>>> 00346         Eigen3::VectorXf centroid = Eigen3::VectorXf::Zero
>>>>>>> (centroid_size);
>>>>>>> 00347         for (int d = 0; d<        centroid_size; ++d)
>>>>>>> 00348           memcpy (&centroid[d],&input_->data[point_offset +
>>>>>>> input_->fields[d].offset], field_sizes_[d]);
>>>>>>> 00349         leaf.centroid += centroid;
>>>>>>> 00350       }
>>>>>>> 00351       ++leaf.nr_points;
>>>>>>>
>>>>>>> I wrote patch for voxel_grid.cpp, but it is not efficient.
>>>>>>> Is anyone who have better solution?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> [hidden email] / http://pcl.ros.org
>>>>>>> https://code.ros.org/mailman/listinfo/pcl-users
>>>>>>
>>>>>> _______________________________________________
>>>>>> [hidden email] / http://pcl.ros.org
>>>>>> https://code.ros.org/mailman/listinfo/pcl-users
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>
>
>
>
_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: VoxelGrid for color pointcloud

Radu B. Rusu
Administrator
In reply to this post by Yohei Kakiuchi
Yohei,

Thanks - can you change the test to something synthetic instead? Like if you create a PointCloud with 10 points inside
test_filters.cpp and populate RGB with some values that are easy to calculate, then downsample, then check for the
downsampled values?

The inital icedtea_rgb.pcd file had bogus values for color due to a precision loss during binary->ascii conversion. In
addition, it would be nice to keep the tests as independent as possible from doing more I/O.

Thanks,
Radu.


On 11/29/2010 02:22 AM, Yohei Kakiuchi wrote:

> Hi Radu,
>
> I wrote a patch for pcl::VoxelGrid<T>. This does not so differ from
> the patch for PointCloud2.
>
> Attached patch also contains former patch and test code added to
> test/test_filters.cpp.
> Test code is using the pcd file(icedtea_rgb.pcd) which was posted by dejan.
>
> Yohei Kakiuchi.
>
> 2010/11/28 Radu Bogdan Rusu<[hidden email]>:
>> Yohei-san,
>>
>> I had a look at your patch and it doesn't seem terribly inefficient, so we
>> would like to include it in the next release (0.6). Would it be possible to
>> send me a patch for pcl::VoxelGrid<T>  (voxel_grid.hpp) please? That would
>> make both versions of the filter work.
>>
>> Also, can you make a very small unit test for RGB data in
>> test/test_filters.cpp? Take a few points with some colors that you know and
>> downsample them and then test for the result. Let us know whether you need
>> any help.
>>
>> Thanks,
>> Radu.
>>
>>
>> On 11/22/2010 06:32 AM, Yohei Kakiuchi wrote:
>>>
>>> Hi, all.
>>>
>>> I want to use voxelgrid filter on PointCloud2 with "RGB" field.
>>> But, VoxelGrid couldn't treat "RGB" feild correctly.
>>>
>>> Because, It average "RGB" field as float value, not 24-bit RGB.
>>>
>>> 00345         // Copy all the fields
>>> 00346         Eigen3::VectorXf centroid = Eigen3::VectorXf::Zero
>>> (centroid_size);
>>> 00347         for (int d = 0; d<    centroid_size; ++d)
>>> 00348           memcpy (&centroid[d],&input_->data[point_offset +
>>> input_->fields[d].offset], field_sizes_[d]);
>>> 00349         leaf.centroid += centroid;
>>> 00350       }
>>> 00351       ++leaf.nr_points;
>>>
>>> I wrote patch for voxel_grid.cpp, but it is not efficient.
>>> Is anyone who have better solution?
>>>
>>>
>>>
>>> _______________________________________________
>>> [hidden email] / http://pcl.ros.org
>>> https://code.ros.org/mailman/listinfo/pcl-users
>>
_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: VoxelGrid for color pointcloud

Yohei Kakiuchi
Radu,

I changed the patch as you suggested,  using 10 points which had
randomly been made.

Yohei Kakiuchi.

2010/11/30 Radu Bogdan Rusu <[hidden email]>:

> Yohei,
>
> Thanks - can you change the test to something synthetic instead? Like if you
> create a PointCloud with 10 points inside test_filters.cpp and populate RGB
> with some values that are easy to calculate, then downsample, then check for
> the downsampled values?
>
> The inital icedtea_rgb.pcd file had bogus values for color due to a
> precision loss during binary->ascii conversion. In addition, it would be
> nice to keep the tests as independent as possible from doing more I/O.
>
> Thanks,
> Radu.
>
>
> On 11/29/2010 02:22 AM, Yohei Kakiuchi wrote:
>>
>> Hi Radu,
>>
>> I wrote a patch for pcl::VoxelGrid<T>. This does not so differ from
>> the patch for PointCloud2.
>>
>> Attached patch also contains former patch and test code added to
>> test/test_filters.cpp.
>> Test code is using the pcd file(icedtea_rgb.pcd) which was posted by
>> dejan.
>>
>> Yohei Kakiuchi.
>>
>> 2010/11/28 Radu Bogdan Rusu<[hidden email]>:
>>>
>>> Yohei-san,
>>>
>>> I had a look at your patch and it doesn't seem terribly inefficient, so
>>> we
>>> would like to include it in the next release (0.6). Would it be possible
>>> to
>>> send me a patch for pcl::VoxelGrid<T>  (voxel_grid.hpp) please? That
>>> would
>>> make both versions of the filter work.
>>>
>>> Also, can you make a very small unit test for RGB data in
>>> test/test_filters.cpp? Take a few points with some colors that you know
>>> and
>>> downsample them and then test for the result. Let us know whether you
>>> need
>>> any help.
>>>
>>> Thanks,
>>> Radu.
>>>
>>>
>>> On 11/22/2010 06:32 AM, Yohei Kakiuchi wrote:
>>>>
>>>> Hi, all.
>>>>
>>>> I want to use voxelgrid filter on PointCloud2 with "RGB" field.
>>>> But, VoxelGrid couldn't treat "RGB" feild correctly.
>>>>
>>>> Because, It average "RGB" field as float value, not 24-bit RGB.
>>>>
>>>> 00345         // Copy all the fields
>>>> 00346         Eigen3::VectorXf centroid = Eigen3::VectorXf::Zero
>>>> (centroid_size);
>>>> 00347         for (int d = 0; d<    centroid_size; ++d)
>>>> 00348           memcpy (&centroid[d],&input_->data[point_offset +
>>>> input_->fields[d].offset], field_sizes_[d]);
>>>> 00349         leaf.centroid += centroid;
>>>> 00350       }
>>>> 00351       ++leaf.nr_points;
>>>>
>>>> I wrote patch for voxel_grid.cpp, but it is not efficient.
>>>> Is anyone who have better solution?
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> [hidden email] / http://pcl.ros.org
>>>> https://code.ros.org/mailman/listinfo/pcl-users
>>>
>

_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users

voxel_grid_r1.patch (12K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: VoxelGrid for color pointcloud

Radu B. Rusu
Administrator
Yohei-san,

Great, thank you! Applied in trunk (34368) and added to the Changelist (http://www.ros.org/wiki/perception_pcl/ChangeList).

Please not that you can check out the new stacks at:

https://code.ros.org/svn/ros-pkg/stacks/perception_pcl/trunk/
https://code.ros.org/svn/ros-pkg/stacks/perception_pcl_addons/trunk/

For example:

$ svn co https://code.ros.org/svn/ros-pkg/stacks/perception_pcl/trunk/ perception_pcl
$ svn co https://code.ros.org/svn/ros-pkg/stacks/perception_pcl_addons/trunk/ perception_pcl_addons

Whenever you will svn up in the current point_cloud_perception stack, all the pcl-related packages will be gone, as we
moved them to the above stacks. Again, once we're ready for PCL 0.6 (hopefully tomorrow), we'll send an e-mail to all
forums (ros-users, pcl-users, ros-kinect, etc) to announce these changes properly.

Cheers,
Radu.


On 11/30/2010 12:01 AM, Yohei Kakiuchi wrote:

> Radu,
>
> I changed the patch as you suggested,  using 10 points which had
> randomly been made.
>
> Yohei Kakiuchi.
>
> 2010/11/30 Radu Bogdan Rusu<[hidden email]>:
>> Yohei,
>>
>> Thanks - can you change the test to something synthetic instead? Like if you
>> create a PointCloud with 10 points inside test_filters.cpp and populate RGB
>> with some values that are easy to calculate, then downsample, then check for
>> the downsampled values?
>>
>> The inital icedtea_rgb.pcd file had bogus values for color due to a
>> precision loss during binary->ascii conversion. In addition, it would be
>> nice to keep the tests as independent as possible from doing more I/O.
>>
>> Thanks,
>> Radu.
>>
>>
>> On 11/29/2010 02:22 AM, Yohei Kakiuchi wrote:
>>>
>>> Hi Radu,
>>>
>>> I wrote a patch for pcl::VoxelGrid<T>. This does not so differ from
>>> the patch for PointCloud2.
>>>
>>> Attached patch also contains former patch and test code added to
>>> test/test_filters.cpp.
>>> Test code is using the pcd file(icedtea_rgb.pcd) which was posted by
>>> dejan.
>>>
>>> Yohei Kakiuchi.
>>>
>>> 2010/11/28 Radu Bogdan Rusu<[hidden email]>:
>>>>
>>>> Yohei-san,
>>>>
>>>> I had a look at your patch and it doesn't seem terribly inefficient, so
>>>> we
>>>> would like to include it in the next release (0.6). Would it be possible
>>>> to
>>>> send me a patch for pcl::VoxelGrid<T>    (voxel_grid.hpp) please? That
>>>> would
>>>> make both versions of the filter work.
>>>>
>>>> Also, can you make a very small unit test for RGB data in
>>>> test/test_filters.cpp? Take a few points with some colors that you know
>>>> and
>>>> downsample them and then test for the result. Let us know whether you
>>>> need
>>>> any help.
>>>>
>>>> Thanks,
>>>> Radu.
>>>>
>>>>
>>>> On 11/22/2010 06:32 AM, Yohei Kakiuchi wrote:
>>>>>
>>>>> Hi, all.
>>>>>
>>>>> I want to use voxelgrid filter on PointCloud2 with "RGB" field.
>>>>> But, VoxelGrid couldn't treat "RGB" feild correctly.
>>>>>
>>>>> Because, It average "RGB" field as float value, not 24-bit RGB.
>>>>>
>>>>> 00345         // Copy all the fields
>>>>> 00346         Eigen3::VectorXf centroid = Eigen3::VectorXf::Zero
>>>>> (centroid_size);
>>>>> 00347         for (int d = 0; d<      centroid_size; ++d)
>>>>> 00348           memcpy (&centroid[d],&input_->data[point_offset +
>>>>> input_->fields[d].offset], field_sizes_[d]);
>>>>> 00349         leaf.centroid += centroid;
>>>>> 00350       }
>>>>> 00351       ++leaf.nr_points;
>>>>>
>>>>> I wrote patch for voxel_grid.cpp, but it is not efficient.
>>>>> Is anyone who have better solution?
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> [hidden email] / http://pcl.ros.org
>>>>> https://code.ros.org/mailman/listinfo/pcl-users
>>>>
>>
_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: VoxelGrid for color pointcloud

Adam Leeper
Thanks a lot for patching voxel grid, it's so much nicer to look at now! (though I sort of miss the Las Vegas-style multicolored light show that resulted ;)

--Adam


Adam Leeper
Stanford University
[hidden email]
719.358.3804


On Tue, Nov 30, 2010 at 12:19 AM, Radu Bogdan Rusu <[hidden email]> wrote:
Yohei-san,

Great, thank you! Applied in trunk (34368) and added to the Changelist (http://www.ros.org/wiki/perception_pcl/ChangeList).

Please not that you can check out the new stacks at:

https://code.ros.org/svn/ros-pkg/stacks/perception_pcl/trunk/
https://code.ros.org/svn/ros-pkg/stacks/perception_pcl_addons/trunk/

For example:

$ svn co https://code.ros.org/svn/ros-pkg/stacks/perception_pcl/trunk/ perception_pcl
$ svn co https://code.ros.org/svn/ros-pkg/stacks/perception_pcl_addons/trunk/ perception_pcl_addons

Whenever you will svn up in the current point_cloud_perception stack, all the pcl-related packages will be gone, as we
moved them to the above stacks. Again, once we're ready for PCL 0.6 (hopefully tomorrow), we'll send an e-mail to all
forums (ros-users, pcl-users, ros-kinect, etc) to announce these changes properly.

Cheers,
Radu.


On 11/30/2010 12:01 AM, Yohei Kakiuchi wrote:
> Radu,
>
> I changed the patch as you suggested,  using 10 points which had
> randomly been made.
>
> Yohei Kakiuchi.
>
> 2010/11/30 Radu Bogdan Rusu<[hidden email]>:
>> Yohei,
>>
>> Thanks - can you change the test to something synthetic instead? Like if you
>> create a PointCloud with 10 points inside test_filters.cpp and populate RGB
>> with some values that are easy to calculate, then downsample, then check for
>> the downsampled values?
>>
>> The inital icedtea_rgb.pcd file had bogus values for color due to a
>> precision loss during binary->ascii conversion. In addition, it would be
>> nice to keep the tests as independent as possible from doing more I/O.
>>
>> Thanks,
>> Radu.
>>
>>
>> On 11/29/2010 02:22 AM, Yohei Kakiuchi wrote:
>>>
>>> Hi Radu,
>>>
>>> I wrote a patch for pcl::VoxelGrid<T>. This does not so differ from
>>> the patch for PointCloud2.
>>>
>>> Attached patch also contains former patch and test code added to
>>> test/test_filters.cpp.
>>> Test code is using the pcd file(icedtea_rgb.pcd) which was posted by
>>> dejan.
>>>
>>> Yohei Kakiuchi.
>>>
>>> 2010/11/28 Radu Bogdan Rusu<[hidden email]>:
>>>>
>>>> Yohei-san,
>>>>
>>>> I had a look at your patch and it doesn't seem terribly inefficient, so
>>>> we
>>>> would like to include it in the next release (0.6). Would it be possible
>>>> to
>>>> send me a patch for pcl::VoxelGrid<T>    (voxel_grid.hpp) please? That
>>>> would
>>>> make both versions of the filter work.
>>>>
>>>> Also, can you make a very small unit test for RGB data in
>>>> test/test_filters.cpp? Take a few points with some colors that you know
>>>> and
>>>> downsample them and then test for the result. Let us know whether you
>>>> need
>>>> any help.
>>>>
>>>> Thanks,
>>>> Radu.
>>>>
>>>>
>>>> On 11/22/2010 06:32 AM, Yohei Kakiuchi wrote:
>>>>>
>>>>> Hi, all.
>>>>>
>>>>> I want to use voxelgrid filter on PointCloud2 with "RGB" field.
>>>>> But, VoxelGrid couldn't treat "RGB" feild correctly.
>>>>>
>>>>> Because, It average "RGB" field as float value, not 24-bit RGB.
>>>>>
>>>>> 00345         // Copy all the fields
>>>>> 00346         Eigen3::VectorXf centroid = Eigen3::VectorXf::Zero
>>>>> (centroid_size);
>>>>> 00347         for (int d = 0; d<      centroid_size; ++d)
>>>>> 00348           memcpy (&centroid[d],&input_->data[point_offset +
>>>>> input_->fields[d].offset], field_sizes_[d]);
>>>>> 00349         leaf.centroid += centroid;
>>>>> 00350       }
>>>>> 00351       ++leaf.nr_points;
>>>>>
>>>>> I wrote patch for voxel_grid.cpp, but it is not efficient.
>>>>> Is anyone who have better solution?
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> [hidden email] / http://pcl.ros.org
>>>>> https://code.ros.org/mailman/listinfo/pcl-users
>>>>
>>
_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users


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

Re: VoxelGrid for color pointcloud

Radu B. Rusu
Administrator
Adam if that's important, we can always provide an user option/parameter to bring the random color frenzy back =)

Cheers,
Radu.

On Dec 1, 2010, at 8:00 PM, Adam Leeper <[hidden email]> wrote:

Thanks a lot for patching voxel grid, it's so much nicer to look at now! (though I sort of miss the Las Vegas-style multicolored light show that resulted ;)

--Adam


Adam Leeper
Stanford University
[hidden email]
719.358.3804


On Tue, Nov 30, 2010 at 12:19 AM, Radu Bogdan Rusu <[hidden email]> wrote:
Yohei-san,

Great, thank you! Applied in trunk (34368) and added to the Changelist (http://www.ros.org/wiki/perception_pcl/ChangeList).

Please not that you can check out the new stacks at:

https://code.ros.org/svn/ros-pkg/stacks/perception_pcl/trunk/
https://code.ros.org/svn/ros-pkg/stacks/perception_pcl_addons/trunk/

For example:

$ svn co https://code.ros.org/svn/ros-pkg/stacks/perception_pcl/trunk/ perception_pcl
$ svn co https://code.ros.org/svn/ros-pkg/stacks/perception_pcl_addons/trunk/ perception_pcl_addons

Whenever you will svn up in the current point_cloud_perception stack, all the pcl-related packages will be gone, as we
moved them to the above stacks. Again, once we're ready for PCL 0.6 (hopefully tomorrow), we'll send an e-mail to all
forums (ros-users, pcl-users, ros-kinect, etc) to announce these changes properly.

Cheers,
Radu.


On 11/30/2010 12:01 AM, Yohei Kakiuchi wrote:
> Radu,
>
> I changed the patch as you suggested,  using 10 points which had
> randomly been made.
>
> Yohei Kakiuchi.
>
> 2010/11/30 Radu Bogdan Rusu<[hidden email]>:
>> Yohei,
>>
>> Thanks - can you change the test to something synthetic instead? Like if you
>> create a PointCloud with 10 points inside test_filters.cpp and populate RGB
>> with some values that are easy to calculate, then downsample, then check for
>> the downsampled values?
>>
>> The inital icedtea_rgb.pcd file had bogus values for color due to a
>> precision loss during binary->ascii conversion. In addition, it would be
>> nice to keep the tests as independent as possible from doing more I/O.
>>
>> Thanks,
>> Radu.
>>
>>
>> On 11/29/2010 02:22 AM, Yohei Kakiuchi wrote:
>>>
>>> Hi Radu,
>>>
>>> I wrote a patch for pcl::VoxelGrid<T>. This does not so differ from
>>> the patch for PointCloud2.
>>>
>>> Attached patch also contains former patch and test code added to
>>> test/test_filters.cpp.
>>> Test code is using the pcd file(icedtea_rgb.pcd) which was posted by
>>> dejan.
>>>
>>> Yohei Kakiuchi.
>>>
>>> 2010/11/28 Radu Bogdan Rusu<[hidden email]>:
>>>>
>>>> Yohei-san,
>>>>
>>>> I had a look at your patch and it doesn't seem terribly inefficient, so
>>>> we
>>>> would like to include it in the next release (0.6). Would it be possible
>>>> to
>>>> send me a patch for pcl::VoxelGrid<T>    (voxel_grid.hpp) please? That
>>>> would
>>>> make both versions of the filter work.
>>>>
>>>> Also, can you make a very small unit test for RGB data in
>>>> test/test_filters.cpp? Take a few points with some colors that you know
>>>> and
>>>> downsample them and then test for the result. Let us know whether you
>>>> need
>>>> any help.
>>>>
>>>> Thanks,
>>>> Radu.
>>>>
>>>>
>>>> On 11/22/2010 06:32 AM, Yohei Kakiuchi wrote:
>>>>>
>>>>> Hi, all.
>>>>>
>>>>> I want to use voxelgrid filter on PointCloud2 with "RGB" field.
>>>>> But, VoxelGrid couldn't treat "RGB" feild correctly.
>>>>>
>>>>> Because, It average "RGB" field as float value, not 24-bit RGB.
>>>>>
>>>>> 00345         // Copy all the fields
>>>>> 00346         Eigen3::VectorXf centroid = Eigen3::VectorXf::Zero
>>>>> (centroid_size);
>>>>> 00347         for (int d = 0; d<      centroid_size; ++d)
>>>>> 00348           memcpy (&centroid[d],&input_->data[point_offset +
>>>>> input_->fields[d].offset], field_sizes_[d]);
>>>>> 00349         leaf.centroid += centroid;
>>>>> 00350       }
>>>>> 00351       ++leaf.nr_points;
>>>>>
>>>>> I wrote patch for voxel_grid.cpp, but it is not efficient.
>>>>> Is anyone who have better solution?
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> [hidden email] / http://pcl.ros.org
>>>>> https://code.ros.org/mailman/listinfo/pcl-users
>>>>
>>
_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users


_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users