I am using the RGB and XYZ data from an ROS PointCloud2 to identify white lines and publish them in a point cloud. I read the RGB and XYZ with the PreserveStructureOnRead as true to get a mxnx3 image. I would like to then convert then to a dx3 matrix so I can publish a point cloud to my ROS environment. What is the mapping to a point in the mxnx3 matrix to the dx3? I notice that d = m*n, but do not know how the two relate to each other. In other words, I would like to convert my image from the PreserveStructureOnRead = true for to the PreserveStructureOnRead = false form.
Thank you!