How to get oriented bounding box of a point cloud using coordinate points

Feel free to ask any question here
Post Reply
astronaut
Posts: 1
Joined: Tue Apr 14, 2020 7:37 am

How to get oriented bounding box of a point cloud using coordinate points

Post by astronaut »

I have create a C++ function that get the coordinate points of the rectangle box(not oriented box) of the detected object. I like to use this 8 points to create a Centroid and perform clustering with region growing algorithm in order to get the orientation of the object(quaternion). Here is my C++ function to get the Box coordinate

Code: Select all

void chatterCallback(const darknet_ros_3d_msgs::BoundingBoxes3d::ConstPtr& msg)
{ 
	if (!msg->bounding_boxes.empty())
		{
		    int inc = 1;
			if(msg->bounding_boxes[0].Class == "box")
				{
				std::vector<float> array_xmin(inc);
				std::vector<float> array_ymin(inc);
				std::vector<float> array_zmin(inc);
                                std::vector<float> array_xmax(inc);
				std::vector<float> array_ymax(inc);
				std::vector<float> array_zmax(inc);

				array_xmin[inc] = msg->bounding_boxes[0].xmin; 
				array_xmax[inc] = msg->bounding_boxes[0].xmax; 
			        array_ymin[inc] = msg->bounding_boxes[0].ymin;
				array_ymax[inc] = msg->bounding_boxes[0].ymax; 
				array_zmin[inc] = msg->bounding_boxes[0].zmin; 
				array_zmax[inc] = msg->bounding_boxes[0].zmax;  
					
				inc++;
							
				       }			
						
				}
	}
So how to feed this xmin, xmax, ymin, ymax, zmin, zmax in the point cloud to create Centroid and then segmentation combined with region growing algorithm. Then the background segments should be separated from the foreground target segments using a Gaussian Mixture Model (GMMand then get the orientation of the object? Thanks
daniel
Site Admin
Posts: 7712
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How to get oriented bounding box of a point cloud using coordinate points

Post by daniel »

Not sure to clearly understand your question...
Daniel, CloudCompare admin
Post Reply