We are trying to use the Oak-D S2 to make some highly accurate depth measurements. We are using the gen2-record-replay experiment to handle the recording since we need both color and depth at the same time. We also decided it would be best for our application to calculate depth from disparity on the host, thus we encode disparity. Encoding at 720P, we are using the following equation to calculate depth:
FOV = 71.86
Baseline = 75mm
Width = 1280
Focus = .5Width/tan(.5FOVpi/180)
depth = FocusBaseline/disparity
We have an optical test stand setup pictured below:
We know the distance to be 433mm from the front glass of the camera to the front of the target. We even double checked it with a tape measure (seen below):
However, when we take the recording and process the disparity into depth we get around a 50mm error.
As you can see the calculated depth of the target is 490mm.
We have extended disparity set to true for close up viewing. We have tried encoding at 400P and get the same result. Are we doing something wrong in the calculation? Is the target too close to the camera?
At this stage we are not actually using the color image for anything.
Another question is: where is the reference point for the camera depth? Is it the front glass of the camera?