mirror of https://github.com/vladmandic/human
minor rotation calculation fix
parent
a836113aa8
commit
6b516ee72d
|
@ -9,8 +9,10 @@ Repository: **<git+https://github.com/vladmandic/human.git>**
|
|||
|
||||
## Changelog
|
||||
|
||||
### **HEAD -> main** 2021/03/28 animethemegadget@gmail.com
|
||||
### **HEAD -> main** 2021/03/28 mandic00@live.com
|
||||
|
||||
- new face rotation calculations
|
||||
- cleanup
|
||||
- rotationmatrixtoeulerangle, and fixes
|
||||
- experimental: add efficientpose
|
||||
- implement nanodet
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -39,24 +39,18 @@ const calculateFaceAngle = (face, image_size): { angle: { pitch: number, yaw: nu
|
|||
if (r10 < 1) { // YZX calculation
|
||||
if (r10 > -1) {
|
||||
thetaZ = Math.asin(r10);
|
||||
thetaY = Math.atan2(-r20, r00);
|
||||
thetaX = Math.atan2(-r12, r11);
|
||||
} else {
|
||||
thetaZ = -Math.PI / 2;
|
||||
thetaY = -Math.atan2(r21, r22);
|
||||
thetaX = 0;
|
||||
}
|
||||
} else {
|
||||
thetaZ = Math.PI / 2;
|
||||
thetaY = Math.atan2(r21, r22);
|
||||
thetaX = 0;
|
||||
}
|
||||
if (r02 < 1) { // compensate Y rotation which is not accurate and too small in YZX calculation
|
||||
if (r02 > -1) {
|
||||
thetaY = Math.asin(r02);
|
||||
} else {
|
||||
thetaY = -Math.PI / 2;
|
||||
}
|
||||
} else {
|
||||
thetaY = Math.PI / 2;
|
||||
}
|
||||
return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };
|
||||
};
|
||||
// simple Euler angle calculation based existing 3D mesh
|
||||
|
|
Loading…
Reference in New Issue