THE PROBLEM
The original problem is that i have an image https://imgur.com/a/U4GLbDKThe images are Scanned documents with 300 DPI
and as you can see i have a bit of noise at random spots outside of the area of interest. I tried many ways to clean the noise and after some searching i found out about the `connectedComponents ` method.
I'm trying to follow this well documented topic but i don't know how i can implement it since connectedComponents seems to not working like i thought.
A BIT OF WHAT TRIED
I also tried to create a mask of the image above but i'm not so sure if i'm applying it the correct way, because it doesn't seem to work. https://imgur.com/a/V3PuK1G
Code: Select all
mgImgModified.Composite(origImg, CompositeOperator.CopyAlpha);
Code: Select all
origImg.ReadMask = mgImgModified;
END GOAL
My end goal is to dynamically clean the noise around the area of interest in order to be able to auto crop the image, to only the part i want in every instance.
Thank you:)