浏览代码

Add camera projection information to metadata

/orthographic-camera-metadata/additions
leopoldo-zugasti 3 年前
当前提交
864e2bfa
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. 2
      com.unity.perception/Runtime/GroundTruth/DatasetJsonUtility.cs
  2. 3
      com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs

2
com.unity.perception/Runtime/GroundTruth/DatasetJsonUtility.cs


case double v:
return new JValue(v);
case string v:
return new JValue($"\"{v}\"");
return new JValue(v);
case uint v:
return new JValue(v);
}

3
com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs


// Record the camera's projection matrix
SetPersistentSensorData("camera_intrinsic", ToProjectionMatrix3x3(cam.projectionMatrix));
// Record the camera's projection type (orthographic or perspective)
SetPersistentSensorData("projection", cam.orthographic ? "orthographic" : "perspective");
var captureFilename = $"{Manager.Instance.GetDirectoryFor(rgbDirectory)}/{k_RgbFilePrefix}{Time.frameCount}.png";
var dxRootPath = $"{rgbDirectory}/{k_RgbFilePrefix}{Time.frameCount}.png";
SensorHandle.ReportCapture(dxRootPath, SensorSpatialData.FromGameObjects(

正在加载...
取消
保存