If what I'm guessing is correct, then the camera only needs to be able to rotate on a horizontal axis +/-45 degrees from its initial position. If this is the case, then I would recommend not using an IMU as they are rather expensive ($50+). Instead, for what you want to do, I would recommend a
digital compass.
The compass will allow you to always orient your camera in a specific direction (if you so choose), so when you turn it on, it will always try to point for example North. You could also just read the initial position of the compass, and compare the cameras deviation from that position and readjust accordingly with the servo you mentioned you would have the camera mounted on. The digital compass would also be easier to use.