Counting objects in photographs