浏览代码

added projection field to sensor data

/h-i
Mohsen Kamalzadeh 3 年前
当前提交
70d9c69c
共有 3 个文件被更改,包括 5 次插入2 次删除
  1. 2
      com.unity.perception/Runtime/GroundTruth/DatasetJsonUtility.cs
  2. 3
      com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs
  3. 2
      com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetJsonUtilityTests.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(

2
com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetJsonUtilityTests.cs


[TestCase(1u, "1")]
[TestCase(1.0, "1")]
[TestCase(1.0f, "1")]
[TestCase("string", "\"string\"")]
[TestCase("string", "string")]
public void Primitive_ReturnsValue(object o, string jsonExpected)
{
var jsonActual = DatasetJsonUtility.ToJToken(o).ToString();

正在加载...
取消
保存