How to get oriented bounding box of a point cloud using coordinate points
Posted: Tue Apr 14, 2020 7:53 am
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
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
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++;
}
}
}