A Combinatorial Approach to Detection of Box Pallet Layouts