HandTracker
Detects hands in an image.
Last updated
// Create an empty Texture2D.
Texture2D texture = new Texture2D(0, 0);
// Load a file to a byte array.
string filename = "path/to/image";
byte[] rawData = System.IO.File.ReadAllBytes(filename);
// Load an byte array to the Texture2D.
texture.LoadImage(rawData);List<Hand> hands = handTracker.Load(texture);// Get the texture as a Color32 array.
Color32[] colors = texture.GetPixels32();
// Detect hands for the specified color array.
List<Hand> hands = handTracker.Load(colors, texture.width, texture.height);// Get the texture as a byte array.
byte[] rawData = texture.GetRawTextureData();
// Detect hands for the specified byte array, width, height and channels.
List<Hand> hands = handTracker.Load(rawData, texture.width, texture.height, 3);// Load byte array from file.
string filename = "Assets/Images/test.png";
byte[] rawData = File.ReadAllBytes(filename);
// Detect hands for the specified byte array, width, height and channels.
List<Hand> hands = handTracker.Load(rawData, 500, 500, 3);handTracker.Dispose();