HandMesh.fromJson constructor
HandMesh.fromJson(
- Map json
Implementation
factory HandMesh.fromJson(Map json){
List<Hand3D> points = [];
List<double> raw = [];
int j = 0;
for(int i = 0; i < json['mesh'].length;i+=3){
points.add(
Hand3D(
FingerJoint3D.values[j],
HandPoint3D(json['mesh'][i], json['mesh'][i+1], json['mesh'][i+2])
)
);
j++;
raw.addAll([json['mesh'][i], json['mesh'][i+1], json['mesh'][i+2]]);
}
return HandMesh(
poses: points,
confidence: json['confidence'],
raw: raw,
image: HandImage(
croppedImage: json['croppedImage'],
origin: HandPoint3D(json['origin']["x"],json['origin']["y"],0),
size: Size(json['imageSize']["width"],json['imageSize']["height"])
),
);
}