Pattern recognition of objects on affinely distorted images based on moments is important task researched for many years. Affine moment invariants are significant tool for it. They can be generated by a few methods. Automated direct solution of the Cayley ? Aronhold differential equation has not been referred yet. It makes possible to generate invariants with much higher weights than other methods, but we must pay more attention to the numerical stability of the computation. The method is demonstrated on examples.