Skip to content

Instantly share code, notes, and snippets.

@smartium
Created April 19, 2022 21:26
Show Gist options
  • Select an option

  • Save smartium/8007c5fcae92d8e54fe8ce9f0152185f to your computer and use it in GitHub Desktop.

Select an option

Save smartium/8007c5fcae92d8e54fe8ce9f0152185f to your computer and use it in GitHub Desktop.
WebCamTexture webCamTexture;
WebCamDevice[] devices;
// List devices
devices = WebCamTexture.devices;
for (int i = 0; i < devices.Length; i++)
Debug.Log(devices[i].name);
// Configure WebCam
webCamTexture = new WebCamTexture(1280, 720, 30);
// Set device
webCamTexture.deviceName = devices[1].name;
// Start webcam
webCamTexture.Play();
// Create and display the destination segmentation image
while (webCamTexture.width == 16 || webCamTexture.height == 16)
await Task.Yield();
// Display webcam
visualizer.Render(webCamTexture);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment