docs.unity3d.com
    Show / Hide Table of Contents

    Lenses

    SensorSDK can emulate camera lenses in the Unity editor. Lenses use a LensComponent and bind to a compatible SystemGraph node, such as PhotoSensorArray.

    Thin lens

    The thin lens implements a lens component that reproduces a thin lens model. This lens is commonly used in game development.

    Brown-Conrady lens

    This lens applies a post processing effect on the camera. It renders at a higher resolution and higher field of view to support distortion without creating artifacts or black borders around the image.

    The implementation is a Brown-Conrady model used to calculate the distorted pixels from undistorted pixels. The lens uses the following formula:

    $$x_u = x_d + (x_d-x_c)[k_1r^2 + k_2r^4 + k_3r^6 + k_4r^8] + T(x_d, x_c; p_1.., p_4)$$

    with the following variables:

    • $x_c$ is the center of distortion.
    • $k_1-k_4$ are the radial distortion parameters and $x_d, x_u$ are the distorted and undistorted points respectively.
    • $r = \lVert x_d - x_c \rVert$ is a tangential distortion parameter.
    • $p_1-p_4$ is a tangential distortion parameter.
    • $T$ represents the following function:

    $$T^{0}(x_d, x_c) = [p_1 [r^2 + 2(x_d^0 - x_c^0)^2] + 2p_2(x_d^0 - x_c^0)(x_d^1 - x_c^1)](1 + p_3r^2 + p_4r^4)$$

    $$T^{1}(x_d, x_c) = [p_2 [r^2 + 2(x_d^1 - x_c^1)^2] + 2p_1(x_d^0 - x_c^0)(x_d^1 - x_c^1)](1 + p_3r^2 + p_4r^4)$$

    • $\bullet^{n}$ refers to the nth coordinate of the corresponding vector

    Segmentation lens

    This lens generates a label value for each object in the scene, instead of an intensity or color image. This lens is solely used as a ground truth. For example, you can use this to train a machine learning algorithm that segments a scene into objects.

    For an example of how to use the segmentation lens, see the segmentation camera page.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023