input

if we directly bounding box, the result is like:

notch defect will come from the right side
reduce to one column and one row
one row:

one column:

threshold and calculate rect
then we have this

result
the new box is more suitable for the pack mask
blue and yellow area are diff
