How to calculate scene depth

I use (pixel*view projection matrix) to get the depth for compare to scene depth,but it’s always has bias.And the deviation increases with distance .

Does anyone know the correct way to calculate it.

Guys,halp me,please XD.

I got it,use ConvertFromDeviceZ