Create a pointcloud with a grayscale gradient [closed]

asked 2019-07-19 06:58:43 -0600

Solrac3589 gravatar image

updated 2019-07-19 07:22:37 -0600

Hello everybody, I have been 2 days stuck on this issue and I am not finding easily a solution on that. I am starting to thing that i will have to create my own functionality insice pcl, but befor i would like to ask to the community.

Right now I have managed to create a pointcloud with a grayscale element (using pointXYZI, which I thing it should be the most adient option in this case). I amb doing this with the idea to allow further information about the pointcloud, allowing to recognise elemnts which maybe I shouldn't be able to recognise just using raw depth information.

But the main issue on this approach is that each object i would like to recognise, can have different colous (apart from different light, difference of distance changing the color... etc) so i decided that a "normalised" use of the grayscale colour could be to use a grayscale gradient.

In order to apply this idea, i found that the most similar approach was so using the intensity gradient estimator

This gave me a new pointcloud which each point have 3 gradient elements pointing each of the 3 dimensions, and as it says in the page i included:

"the vector's magnitude indicates the rate of intensity change"

i though that doing something like: point.points[i].intensity = sqrt(pow(g_point.points[i].gradient_x,2)+pow(g_point.points[i].gradient_y,2)+pow(g_point.points[i].gradient_z,2));

If i visualize the pointcloud using the original grayscale using RVIZ (pointcloud colorized based on the intensity), i am able to recognise perfectly certain elements (like letters) but after the mentioned conversion, this elements are not recognised anymore.

I have been aplying a huge set of differents radius (based on pointcloud real distances) and anything changes.

I am starting to think that this "intensity gradient" it is not exactly what i was expecting. I know how to implement what i want by myself (doing the code from 0), but I tought that would be stupid to redo something which maybe has already a solution.

Anyone can help? thank you!

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant. Please see for more details. by Solrac3589
close date 2019-07-23 04:34:29.572406


Can you explain what the overall task you're trying to perform here is. Your explanation is slightly confusing where you mixing 'grayscale' and 'colors' which do not make sense together. The intensity gradient you're calculating can be summarised as the spatial rate of change of the intensity at each point. This is slightly similar to an edge detector, but the radius used will be critical. Can you describe exactly what time of objects you're trying to recognise and what type of sensors you're using.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-07-19 07:31:40 -0600 )edit

Sorry. I close the issue because it was already correct my initial approach, and the only issue was the accuracy of the cammera, but i will respond you anyway. My camera only have grayscale colors (not rgb, only from black to white), thats why i relate grayscale with coulours. And yes, it is similar to edge detectors, but instead of detecting the edge, i detect the difference of black and white color. sorry I i was not enough clear, i will improve :)

Solrac3589 gravatar image Solrac3589  ( 2019-07-23 04:33:51 -0600 )edit

Okay I'm glad you got this working. But to avoid confusion I should point out the word color is specific to perception in RGB and cannot be used to describe the level of a single intensity channel. 'Intensity level' or 'brightness' would be correct.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-07-24 06:29:24 -0600 )edit

Ok! thanks! i will take into account :)

Solrac3589 gravatar image Solrac3589  ( 2019-07-24 09:24:32 -0600 )edit