This is an application using python OpenCV that processes images with background into output images with white background. In order to achieve the output, we used the adaptive threshold method that implements segmentation, median blur as pre-processing and post processing method, and erosion.
Median blur: used to smoothen the image before the segmentation. It is also used after the segmentation to get rid of the apparent noise of the resulting images.
Adaptive Gaussian threshold: implement segmentation to partition an image. The image’s threshold value is calculated for smaller regions and therefore, there will be different threshold values for different regions
Erosion: Used to structure the image where it shrinks the foreground image and enlarges the background image. This will result in a readable output image.
Mask 3 is the most suitable for a fair background that contrasts with the foreground. The higher the number of segmentation masks, the more pixels will be isolated. Images with shadows at the background and different pixels that make it hard to segment. Therefore, the suitable segmentation masks for these images are 5.