I have thousands of X-ray images of the left hand. All of these images have thin white borders surrounding them.
I want to create a function (OpenCV/numpy) that will allow me to just auto remove/crop these thin white borders out or replace them with black/gray color.
First image is the original image, second image is the output with white borders removed. Is this even possible?
Note: For some images, the white borders aren't always surrounding the image, instead there can be white bars on the sides of the image -->