Cameras like the SX50 have an OSD function that shows how level the camera is. So the info for those models is in there somewhere.
Also, IIRC there is a very old post here on the forum (2008?) that has a video of a similar function implemented in CHDK. Of course I can never find it when I want it.....