Gyro and Accelerometer angles

Not an expert but:

  1. You can calculate where the earth is via gravity sense of accelerometer.
  2. Gyro is needed to detect angular speed mostly, it doesn't need to know where is the zero.
  3. if you ask such questions, diy stabilization could be not for you at this moment, as it involves quite complicated math. Probably you could be better off looking for a working code to adopt.