First use case is the rectangles generated by running OCR at multiple scales of the same image - you often get multiple very similar (but not exactly the same) rectangles. The coordinates will be off by 2 pixels but sometimes by 4 pixels.
These can be merged to the largest bounding box except that
DicomRect - need to check they are the same frame and overlay
DicomRectText - need to compare the text strings (see https://pypi.org/project/fastDamerauLevenshtein/) and maybe pick the longest if they are very similar or just keep both rectangles otherwise
First use case is the rectangles generated by running OCR at multiple scales of the same image - you often get multiple very similar (but not exactly the same) rectangles. The coordinates will be off by 2 pixels but sometimes by 4 pixels.
These can be merged to the largest bounding box except that