Skip to content

Commit b37e04f

Browse files
committed
more sensible scale for depth camera
1 parent 958b718 commit b37e04f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Runtime/Scripts/Sensors/RGBDepthCamera/ZORGBDepthCamera.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ private void DoRenderTextureUpdate() {
268268
if (_publishTasks.Count < _maxPublishTaskQueue) {
269269

270270
Task publishTask = Task.Run(() => {
271-
float inverseScale = 1.0f / _depthScale;
272271
float r, g, b, d;
273272
for (int z = 0, c = 0, p = 0; z < (_width * _height); z++, c += 3, p += 4) {
274273
r = rawTextureData[p];
@@ -279,7 +278,7 @@ private void DoRenderTextureUpdate() {
279278
_colorPixels24[c + 0] = (byte)(r * 255.0f);
280279
_colorPixels24[c + 1] = (byte)(g * 255.0f);
281280
_colorPixels24[c + 2] = (byte)(b * 255.0f);
282-
_depthBufferFloat[z] = d * inverseScale;
281+
_depthBufferFloat[z] = d * _depthScale;
283282

284283
_averageDepth = d;
285284

0 commit comments

Comments
 (0)