It is important to ask before taking a photo. First, because it is polite, especially when you are using a flash. Second, because you will be able to take much better photos if the person is giving you their attention and facing your direction. I’ll admit, sometimes I’m okay with taking a snapshot where a large group of photographers has wrapped around a cosplayer or group of cosplayers. It is mainly due to not being able to get their attention when there are 5 or more other people around taking photos in an almost unending stream, so I’d just take a quick photo.
Many photographers off frame.
Sometimes when I ask for a photo and start taking pictures of the cosplayer or group, other photographers end up trying to get in on the action and start taking shots (say 20% of the time this happens…). While it is not always an issue, sometimes I end up physically running into them because I do not know they are behind me, or they are in my way as I move around to try and get the best images I can. Other times the cosplayer changes who they are looking at, which ruins my shot. In situations like this, please wait there until the person is finished and then ask the cosplayer for a photo. It is polite to both of them to just wait, and it will allow you to take the best images you can without being restricted by having a person in the way or in the frame itself. Use your discretion in these matters.