Machine learning is a scientific study that works on the basis of searching similar information(color) around its neighboring pixels. The learning process is based on the principle of “Mahalanobis Distance”, that is the learning is based on the distance covered by similar color pixels.
In the beginning, we used this algorithm to make BG removal process automated, i.e. as soon as you open an image in the editor, background, and foreground gets separated automatically. The automated system defines the product boundaries and eliminates the background. But there were certain problems in the automatic process because of which it was not quite ready, like:
- No fixed criteria was there to select the object in the image frame, as the position of an object can be different in different images.
- For an automated BG removal, the software needs to have a repeated database of images, so that it would be easy for the software to analyse the product shape.
- The automated process was only successful for the images that have a contrasting background, no colour of the object should be there in the background.
Since there were problems in the automated system, so the process was shifted to “Marking based BG removal”. In this, you will have to indicate the software by marking foreground & background, & you will get the results in a single go.
Improvements made in BG Removal
- Improvement in the machine learning process: In the automated grabcut algorithm, it was difficult for the software to recognize the foreground and background easily. Thus to remove this problem in the latest version, we are defining the foreground and background in advance by marking them separately using green(for foreground) and red(for background) markings tool. So now it is easy for the software to differentiate between the foreground and background, hence a clear output can be achieved.
Matting: Matting is done to keep the edges of the foreground in such a way that it gets easily merged with different color backgrounds.
How can you see the effects of matting?
If you zoom foreground of an image to the corners, you will see that the color of object keeps on getting transparent with each increasing pixel(in total the effect of matting is visible on last 7 pixels) and easily gets merged with the background. This makes the object look realistic as the gradual increase in edge transparency helps the object to merge with different background easily.
Rough edges: There were some problems in the edges of the object, the edges were not cut smoothly.
To solve this problem “contouring process” was followed, contouring means to define the path. That means the marking of foreground was improved to a level that it can clearly define it’s path & can cover the edges of the object properly.
- To solve this problem “contouring process” was followed, contouring means to define the path. That means the marking of foreground was improved to a level that it can clearly define it’s path & can cover the edges of the object properly.