Answered by:
Measurement
Question

Please help.
I am a beginner trying to scan objects using the Kinect v2 for windows.
If i scan a table, for example, is it possible to ascertain the exact measurements of that table in the 3d image collected?
What is the best software to use to do this and are there any tutorials relating to this that you would recommend?
The result i am trying to achieve is to do away with the tapemeasure and use the scanner instead to replicate items in full scale.
Also, how accurate is the kinect? are we talking millimetres or more?
Many Thanks,
I look forward to hearing
Regards
Rupert
rupertcameron
Answers

The depth frame will give you depth values in millimeters:
Knowing the depth for two endpoints on the object you want to measure, and the center point between these endpoints, you can use trigonometry to get the distance (in mm) between these two points. This will assume the object you are measuring has straight edges, different distance calculations will be required for curved surfaces.
pseudo code for this will look something like this:
UInt16[] depthFrameData = UInt16[512 * 424]; depthFrame.CopyFrameDataToArray(depthFrameData); int startPointIndex = 0; int endPointIndex = 10; int midPointIndex = 5; UInt16 startPointDist = depthFrameData[startPointIndex]; UInt16 endPointDist = depthFrameData[endPointIndex]; UInt16 midPointDist = depthFrameData[midPointIndex]; float legthInMM = Math.sqrt( Math.Pow(startPointDist, 2)  Math.Pow(midPointDist, 2) + Math.sqrt( Math.Pow(endPointDist, 2)  Math.Pow(midPointDist, 2));
 Proposed as answer by Jackson Fields [MSFT]Microsoft employee, Moderator Wednesday, June 3, 2015 10:16 PM
 Edited by Jackson Fields [MSFT]Microsoft employee, Moderator Wednesday, June 3, 2015 10:29 PM
 Marked as answer by rupertcameron Thursday, June 4, 2015 11:53 AM
All replies

The depth frame will give you depth values in millimeters:
Knowing the depth for two endpoints on the object you want to measure, and the center point between these endpoints, you can use trigonometry to get the distance (in mm) between these two points. This will assume the object you are measuring has straight edges, different distance calculations will be required for curved surfaces.
pseudo code for this will look something like this:
UInt16[] depthFrameData = UInt16[512 * 424]; depthFrame.CopyFrameDataToArray(depthFrameData); int startPointIndex = 0; int endPointIndex = 10; int midPointIndex = 5; UInt16 startPointDist = depthFrameData[startPointIndex]; UInt16 endPointDist = depthFrameData[endPointIndex]; UInt16 midPointDist = depthFrameData[midPointIndex]; float legthInMM = Math.sqrt( Math.Pow(startPointDist, 2)  Math.Pow(midPointDist, 2) + Math.sqrt( Math.Pow(endPointDist, 2)  Math.Pow(midPointDist, 2));
 Proposed as answer by Jackson Fields [MSFT]Microsoft employee, Moderator Wednesday, June 3, 2015 10:16 PM
 Edited by Jackson Fields [MSFT]Microsoft employee, Moderator Wednesday, June 3, 2015 10:29 PM
 Marked as answer by rupertcameron Thursday, June 4, 2015 11:53 AM

Thanks Jackson.
I am a real beginner so code is a bit advanced for me!
Maybe you could help me answer this...
If i scan something into 3d builder that is larger than the print area eg a table, presumably when it is scaled down it becomes a perfect miniature of the table that i originally scanned. Is there anywhere in the 3d Builder software where i can read its original dimensions (ie before downscaling) without having to read the code? Alternatively, if i upload the scan in to a CAD software programme, will it provide me with the exact dimensions of the scan with measurements included?
Many Thanks and apologies for my lack of experience (sometimes known as ineptness!)
Regards
Rupert
rupertcameron

P.S I add this link as a simplified example of what I am talking about, but have no idea how to achieve this or what software to use and to be honest would rather use a software that had this function/ability built in when i export the scan to it
https://www.youtube.com/watch?v=BxduCRC9VHw
Thanks again
Rupert
rupertcameron