Invariants are widely used in object recognition due to their good performance under circumstances such as changing viewpoints. Previous methods of calculating invariants from 3-D points and lines have limited success because of computational expense or hard constraints on spatial positions. To overcome these drawbacks, analyses have first been carried out of general situations where the 3-D projective invariants of points and lines can be computed from images. Then numbers of images required under possible situations are determined. Based on the analyses, a novel mathematical model has been extracted to compute 3-D point and line invariants in general positions. The validity of the model has been verified by experiments, where the invariants derived from five points and one line have been adapted. Simulation results on real images show that the invariants remain stable and accurate.