I am trying to automatically crop the image below to a bounding box. The background will always be the same colour. I have tried the answers at Find the edges of image and crop it in MATLAB and various applications and examples on Mathworks' file exchange but I get stuck at getting a proper boundingbox.
I was thinking to convert the image to black and white, converting it to binary and removing everything that's closer to white than black, but I'm not sure how to go about it.