Visualise 3D Object Models using Colour in Halcon 12

It is possible to add “extended attributes” to an object model. These attributes can then be used to colour the visualisation of the 3D object model. For linking new information to the points of an object model we use the following operator:

|set_object_model_3d_attrib_mod (ObjectModel3D, ‘&dist’, ‘points’, Distance)|

The only constraint for the names of these attributes is that they start with the prefix ‘&’. Now this new attribute can be used to set the intensity of the object model in a 3D scene.

|GenParamName := [‘intensity’,’lut’]|

|GenParamValue := [‘&dist’,’rainbow’]|

|set_scene_3d_instance_param (Scene3D, InstIdx, GenParamName, GenParamValue)|

 

3D-colour-model-300x242It is also possible to define more than one extended attribute for each point of the object model. For example, we could link three RGB values to each point and then use the generic parameters intensity_red, intensity_green, and intensity_blue in order to define the colourisation of the object model manually.

|set_object_model_3d_attrib_mod (ObjectModel3D, ‘&red’, ‘points’, Red)|

|set_object_model_3d_attrib_mod (ObjectModel3D, ‘&green’, ‘points’, Green)|

|set_object_model_3d_attrib_mod (ObjectModel3D, ‘&blue’, ‘points’, Blue)|

|GenParamName := [‘intensity_red’,’intensity_green’,’intensity_blue’]|

|GenParamValue := [‘&red’,’&green’,’&blue’]|

|set_scene_3d_instance_param (Scene3D, InstanceIndex, GenParamName, GenParamValue)|

3D-colour-bunny-300x242Some 3D sensors provide intensity values for each point of the three dimensional data. This information can also be used as an attribute to colourise the object model as it is seen by the sensor.