I have an image like below. It has black border/regions in the top and right side of the image. I want to be able to find these regions like shown in the 2nd images. Note these regions should be always streight (ie rectangle shaped). I want to be able to do this using ‘image processing with code not with photoshop’ (such as matlab, c# or opencv).
I am very new to ‘image process’. I have tried to find all the pionts that have (0,0,0) rgb values. But because there are so many of these black values in the noise part (and any other places in the images). My result region also contains these unwanted region….
———- Edit —————
Thanks for all the comments/answers. However, I have lots of these images. Some of them are rotated, which is a bit more difficult to deal with. I have just uploaded one as shown below.
2
Answers
Using Python2.7 + OpenCV3. The idea is to keep only non-zero rows and columns. The code follows.
Here is the implementation in MATLAB. Find zeros column and zeros row and draw a border using them.
For Rotated Images (should work for non-rotated also)