Image processing to quantify swarm properties