浏览代码

Merge pull request #344 from Unity-Technologies/orthographic-camera-metadata-additions

Add camera projection information to metadata
/main
GitHub 3 年前
当前提交
324f4362
共有 6 个文件被更改,包括 888 次插入121 次删除
  1. 2
      com.unity.perception/CHANGELOG.md
  2. 1
      com.unity.perception/Documentation~/Schema/Synthetic_Dataset_Schema.md
  3. 999
      com.unity.perception/Documentation~/Schema/image_0.png
  4. 2
      com.unity.perception/Runtime/GroundTruth/DatasetJsonUtility.cs
  5. 3
      com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs
  6. 2
      com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetJsonUtilityTests.cs

2
com.unity.perception/CHANGELOG.md


User can now choose the base folder location to store their generated data.
Added 'projection' field in the capture.sensor metadata. Values are either "perspective" or "orthographic"
### Changed
Increased color variety in instance segmentation images

1
com.unity.perception/Documentation~/Schema/Synthetic_Dataset_Schema.md


translation: <float, float, float> -- Position in meters: (x, y, z) with respect to the ego coordinate system. This is typically fixed during the simulation, but we can allow small variation for domain randomization.
rotation: <float, float, float, float> -- Orientation as quaternion: (w, x, y, z) with respect to ego coordinate system. This is typically fixed during the simulation, but we can allow small variation for domain randomization.
camera_intrinsic: <3x3 float matrix> [optional] -- Intrinsic camera calibration. Empty for sensors that are not cameras.
projection: <string> -- holds the type of projection the camera used for that capture: Options: "perspective" or "orthographic"
# add arbitrary optional key-value pairs for sensor attributes
}

999
com.unity.perception/Documentation~/Schema/image_0.png
文件差异内容过多而无法显示
查看文件

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();

正在加载...
取消
保存