Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Unity camera as a physical camera?

Discussion in 'AR' started by BtandianusSIT, Jul 21, 2022.

  1. BtandianusSIT

    BtandianusSIT

    Joined:
    Nov 17, 2021
    Posts:
    3
    Hi,
    Does anybody know how to make it such that Unity camera input becomes a 'virtual' camera device so that it can be used by other applications that require a physical camera input?

    The reason is because we want to try using Vuforia and Wikitude but they only accept video stream from an installed physical camera/webcam, whereas our 360 camera is accessible through network only.

    What we are trying to do here is to develop a 360 AR application for a desktop application with the following flow:
    360 camera -> network -> main PC receives the input video stream -> puts the video stream to a texture -> captured by unity camera -> input to AR library.



    Thanks
     
  2. mikeyrafier98

    mikeyrafier98

    Joined:
    May 19, 2022
    Posts:
    37
    I quite understand your idea, though I haven't tried it myself.
    As far I know, AR foundation camera (AR Camera, XR Camera) will not allow to play their system,
    because of certain back-end system that need, or have dependency to the device hardware.
    I think the AR session subsystems need to know what the hardware, the sensor, and the camera specification,
    so it can calculate the camera pose in the world coordinate system.
    That is say, AR foundation which also include the AR Core and AR Kit module from Google and Apple,
    are made for mobile device, so I think it still not possible for out of that solution for general purpose.
    Unless, we develop our own solution that use AR foundation just to use certain feature.
    In addition, it also support Hololens and MagicLeap, but I think some has changes during ver 5.0.

    Anyway, to answer our curiosity, we can build certain solution but out of AR foundation range.
    For example, implement another or self-build technique.
    By this, we have to catch every image from video stream (frames), then calculate by ourselves.
    This calculation include:
    1) where are we, what is the world coordinate system, where is the center (0,0,0)
    2) where I am, where is the camera pose in the world coordinate
    3) what I look, where is the object that targeted to show the virtual image, if we want the AR experiencec

    It seems like, some of the self-built solution that written as research papers also made up this approach.
    Like, they use opencv to process images, ML for pose estimation, etc.
    If we urge to use AR foundation as main library, there are very much limitation for now.
    And one of them, that, it is dependent for mobile device.
     
  3. BtandianusSIT

    BtandianusSIT

    Joined:
    Nov 17, 2021
    Posts:
    3
    Hi Mikey,
    Thanks for the reply. Yeah, we were also considering OpenCV (or EmguCV which is basically OpenCV for C#). But due to time constraint, we tried to test a quick AR solution using AR Core/AR Kit/Vuforia.