The paper describes how the attitude of a sounding rocket, launch vehicle or satellite with respect to the Earth can be estimated from camera images of the Earth horizon. Details about detecting the horizon in the camera image, fitting hyperbolae or ellipses to the detected horizon curve and deriving the Earth nadir vector and the corresponding error covariance from the fitted conic section are given. The presented method works at low heights, where the projected horizon mostly appears to be hyperbolic, as well as at large heights, where the projected horizon mostly appears to be elliptic and it is irrelevant if the Earth is fully or only partially in the field of view of the camera. The method can be universally used to estimate the direction vectors and attitude with respect to any spherical celestial body such as the Sun or Moon. Using the example of a sounding rocket mission with two cameras aboard, it is illustrated how the estimates of the Earth nadir and the Sun direction vectors are fused with the measurements of a strapdown inertial measurement unit and a GPS receiver to obtain an accurate and continuous estimate of the three-dimensional orientation of the sounding rocket with respect to the Earth.