How to find corner points of any object in point c

2020-08-05 10:28发布

问题:

We are creating an app which is used for calculating measurements of any a window/door using Project tango Device. For that we need to follow below mentioned steps:
1. Capture Image (normal 2D image). Store this image.
2. Also capture point cloud while capturing the Image. Store the point cloud in a PCD file.
3. Indicate the position of the window/door in the image displayed on a canvas by drawing a rectangle on the image. See Image.
4. As the rectangle is drawn automatically calculate width and height of the window/door using the stored PointCloud data.

We have managed to do 1, 2 and 3.

For 4 we have two issues:
A. Determine the Points in the PointCloud corresponding to the drawn rectangle i.e. the window/door. We believe that this involves determining the plane in which the window/door is located e.g. Assuming that the axis along the depth (i.e. from the camera to the object) is Z-axis then we need to determine the value(s) of Z that correspond to the plane in which the window/door is located in PointCloud. How can this be done? Please can someone suggest a feasible and an efficient way of doing so?

B. Once we determine the sub-PointCloud corresponding to the drawn rectangle find the distance between the minimum and maximum points along the X & Y axis to determine the width and height respectively. How can this be done?

Any help with demo code or app reference is appreciated.enter image description here

enter image description here

回答1:

find contour of the point cloud. Use iterative ransac to fit lines to the contour. Intersect the lines and get the corner points

for 3d, compute the surface normals. Then compute the curvature which is a differential of the surface normal. These are corner points.

PCL (Point Cloud Library) has all of these functions.