General Intensity Transformations and Second Order Invariants