Text this: A novel optical granulometry algorithm for ore particles