Search code examples
c#image-processingaforgeenvelope

How can I crop the area containing the recipient's details in a mail through Image Processing in C#?


Given this image link as my input image:

enter image description here

How can I possibly crop the image using C# and Image Processing Techniques so I could only get the Rounded Rectangular area with the recipient's details, the fastest way possible?

As of now, I'm using AForge.NET, and I'm still stuck at using Histogram Equalization as shown:

enter image description here

Thanks!


Solution

  • I would start with the otsu threshold (link):

    enter image description here

    After, you can do blob detection, iterate through all detected blobs and merge two blobs whether the distance between any of its edges is less than some fixed value. This will give you two blobs, one containing address information and second containing "if undelivered...". You chose the blob with the greatest area.