They can take away your camera (i.e. you better not stop them from taking away your camera – but they have to give you a receipt) but they are absolutely not allowed to delete or change anything without a conviction of some sort (and you definitely won’t get any conviction for taking photos in public, no matter what you take photos of – stalking is the only exception but that’s not the case here).
They might even not be allowed to look at your photos without a court order (since looking at your photos is a search – I’m not sure about that one).
They can only keep your camera around as long as they plan on using it as evidence – meaning that if there is no investigation or as soon as the investigation ends or after the court is finished with the case they have to give it back to you (unchanged if the court doesn’t rule otherwise – which it won’t).
The good news is that the police in Germany cannot make you pay a fine or get you into prison for taking photos of them. The bad news is that they can inconvenience you by temporarily taking away your camera. Which they can do but as soon as they delete so much as one photo you should defend yourself and sue.