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