CameraSamsung Galaxy S5 - 16-megapixel main camera and 2.0-megapixel front-facing camera
Sony Xperia Z2 - 20.7-megapixel main camera and 2.2-megapixel front-facing camera
The S5 now comes with a 16-megapixel main camera as compared to 13 MP in its predecessor. Samsung says the main camera now offers auto focusing at a blistering-fast 0.3 seconds besides a new Selective Focus mode, so you can shoot photos then change the focal point later. It is a similar technology that used by the Nokia Lumia 1020. Other features include a new HDR Live mode to balance the light and dark portions of photographs.
On the other hand, the Z2 retains the same cameras as that of the Z1. It has 20.7-megapixel main Exmor RS camera with Sony G Lens and Sony Bionz for mobile image processing engine on board. There's an improved 2.2 megapixel front-facing camera and new custom camera modes like TimeShift video to take slow motion footage. Both of these devices can record 4K video.
Winner: The Samsung Galaxy S5 has a slight edge