[Olena-patches] r3609: Consider box cardinality for line detection criteria