Camera control tutorial

This section describes how to control camera with the Unity app.

Preview display

Describes how to display the preview.

  1. Create a Unity project and import the package

    Refer to Create a Unity project for how to create

  2. Drag and drop MoverioCamera into the hierarchy window

  3. Create a Render Texture

  4. Click Moverio Camera in the Hierarchy window

  5. Drag and drop the Render Texture created in 3. to the Camera Preview Render Texture in the Moverio Camera Inspector.

  6. Create a raw image

  7. Drag and drop the Render Texture created in 3. to the Raw Image (Script) Texture in the Raw Image Inspector created in 6.

Capture data acquisition

Describes how to acquire capture data.

  1. Create a Unity project and import the package

    Refer to Create a Unity project for how to create

  2. Drag and drop MoverioCamera into the hierarchy window

  3. Create a script

  4. Create a function to acquire capture data

    public void OnCaptureData(byte[] data)
    {
    }
  5. Attach script to GameObject

  6. Click MoverioCamera in the Hierarchy window

  7. Click the “+” on the Moverio Camera (Script) On Capture Data in the MoverioCamera Inspector to add an event.

  8. Drag and drop the GameObject to which the script was attached in step 5 in the hierarchy window to the event.

  9. Select the function to receive the On Capture Data event notification.

Please refer to API Reference for API specifications.

Still image shooting

Describes how to shoot still image.

  1. Create a Unity project and import the package

    Refer to Create a Unity project for how to create

  2. Drag and drop MoverioCamera into the hierarchy window

  3. Create a script

  4. Add using

    Open the script created in 3 and describe as using MoverioBasicFunctionUnityPlugin;

    using MoverioBasicFunctionUnityPlugin;
  5. Call a function

    Describe the API you want to use like MoverioCamera.TakePicture

    Refer to the following script for the description method of each function

    label

    script

    Take picture

    TakePictureController.cs

  6. Create a function to receive notification of completion of still image shooting

    public void OnPictureCompleted()
    {
    }
  7. Attach script to GameObject

  8. Click Moverio Camera in the Hierarchy window

  9. Click the “+” on Moverio Camera (Script) On Picture Completed in the MoverioCamera Inspector to add an event.

  10. Drag and drop the GameObject to which the script was attached in 7. in the hierarchy window to the event.

  11. Select the function to receive the On Picture Completed event notification.

Please refer to API Reference for API specifications.

Video shooting

Describes how to shoot video.

  1. Create a Unity project and import the package

    Refer to Create a Unity project for how to create

  2. Drag and drop MoverioCamera into the hierarchy window

  3. Create a script

  4. Add using

    Open the script created in 3 and describe as using MoverioBasicFunctionUnityPlugin;

    using MoverioBasicFunctionUnityPlugin;
  5. Call a function

    Describe the API you want to use like MoverioCamera.StartRecord or MoverioCamera.StopRecord

    Refer to the following script for the description method of each function

    label

    script

    Start record

    VideoRecordController.cs

    Stop record

    VideoRecordController.cs

  6. Create a function to be notified of the start and completion of video recording

    public void OnRecordStarted()
    {
    }
    
    public void OnRecordStopped()
    {
    }
  7. Attach script to GameObject

  8. Click MoverioCamera in the Hierarchy window

  9. Click the Moverio Camera (Script) On Rcord Started and On Record Stopped “+” in the MoverioCamera Inspector to add an event.

  10. Drag and drop the GameObject to which the script is attached in 7. in the hierarchy window to each event.

  11. Select the function to receive On Rcord Started and On Record Stopped event notifications.

Please refer to API Reference for API specifications.

Change camera property

Describes how to change camera property.

  1. Create a Unity project and import the package

    Refer to Create a Unity project for how to create

  2. Drag and drop MoverioCamera into the hierarchy window

  3. Create a script

  4. Add using

    Open the script created in 3 and describe as using MoverioBasicFunctionUnityPlugin;

    using MoverioBasicFunctionUnityPlugin;
  5. Call a function

    1. Get MoverioCamera.CameraProperty with ** MoverioCamera.GetProperty **

    2. Describe the property for which you want to change the settings.

      Refer to the following script for the description method of each function

      label script
      Brightness SetPropertyController.cs
      White balance mode SetPropertyController.cs
      Exposure compensation mode SetPropertyController.cs
      Exposure compensation step SetPropertyController.cs
      Resolution SetPropertyController.cs
      Power line frequency SetPropertyController.cs
      Farame rate SetPropertyController.cs
    3. Set the MoverioCamera.CameraProperty whose settings have been changed with ** MoverioCamera.SetProperty **

  6. Create a function to receive notification of camera property setting completion

    public void OnSetPropertyCompleted(bool result)
    {
    }
  7. Attach script to GameObject

  8. Click Moverio Camera in the Hierarchy window

  9. Click the “+” on Moverio Camera (Script) On Set Property Completed in the MoverioCamera Inspector to add an event.

  10. Drag and drop the GameObject to which the script is attached in 7. in the hierarchy window to each event.

  11. Select the function to receive the On Set Property Completed event notification.

Please refer to API Reference for API specifications.