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

No its not part of the original image added them to show the region i want to trim but there is noise and trim dosnt work ,the original image is this https://imgur.com/a/6tNQJAZ , the area of interest is the document.

I'm using 7.4.6 Magick.Net Q16.

Trying to auto crop/trim ,the documents are not only in this color i want to dynamically remove noise from the white areas in order for trim to work