detecting rim patterns