MaskΒΆ
Properties:
Methods:
Note: This class is an experimental API for internal use only.
It may be removed without warning.
A bitmap mask defining areas of an image in which a finger or part of a hand is in front of the tracked quad. The mask is a subset of the camera image containing a the region including the quad. Pixels in the mask representing the hand have the value 255. Pixels in the rest of the mask have the value 0.
Two masks are provided for every Leap Motion frame. The mask with the id of 0 is for the left image. The right image has id 1.
The mask corresponds to the uncorrected image from the camera sensor. If you correct the image for distortion before displaying it, you should also correct the mask.
Public Functions
- Since
- 2.2.6
Propertybool Equals(Mask arg0)Compares two Mask objects for equality.
- Since
- 2.2.6
Mask()Constructs a new Mask object.
Do not use. Get Mask objects from TrackedQuad.
Leap.Controller controller = new Leap.Controller(); Leap.TrackedQuad quad = controller.TrackedQuad; Leap.Mask leftMask = quad.Masks[0]; Leap.Mask rightMask = quad.Masks[1];Leap.Controller controller = new Leap.Controller(); Leap.Frame frame = controller.Frame(); Leap.TrackedQuad quad = frame.TrackedQuad; Leap.Mask leftMask = quad.Masks[0]; Leap.Mask rightMask = quad.Masks[1];
- Since
- 2.2.6
Public Static Functionsbyte[] Data
The mask data.
The mask data is a set of 8-bit intensity values. The buffer is mask.Width * mask.Height bytes long. Areas of the mask which contain part of a hand or finger covering the quad are assigned the value 255. The rest of the mask is assigned the value 0.
Leap.Mask leftMask = quad.Masks[0]; byte[] maskPixels = leftMask.Data;
- Since
- 2.2.5
int Height
int Id
bool IsValid
Reports whether this is a valid Mask object.
- Since
- 2.2.6
int OffsetX
int OffsetY
long SequenceId
An id value based on the sequence in which the mask is produced.
Corresponds to the Image sequence id.
Leap.Mask leftMask = quad.Masks[0]; float sequenceID = leftMask.SequenceId;
- Since
- 2.2.6
int Width