I need you to develop a robust code from extracting a region of interest from 8-bit PNG images. The code needs to be adaptive so that if can handle images of varying size and different proportion of background area. The object of interest is the central rectangular feature as seen in the image. This object, in several occasions, can be truncated (broken in sections horizontally. So the code should be able to identify the same.
Get in touch for more details or images for writing/testing the code