Perimeter of sets and BMO-type norms