Count objects within a rect