EPITA 2020 MLRF practice_01-90_twinit-bonus v2021-05-17_160644 by Joseph CHAZALON

Creative Commons License This work is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).

Practice session 1 bonus level: Twin it! pre-processing

This is a bonus session, you are free!

Goal

From the original full image (shown below)… Twin it!

… generate segmented bubbles, in separated files, with the background masked in black, like this:

b002 b003 b004 b005 b006

Hints

Use connected component labelling twice, after thresholding the image, first to select the biggest component in the background (and remove the bubbles and their content), then to remove the small elements within the background.

You can find useful documentation here:

You can also check the files twin_it/bubbles_labels_stats.npz and twin_it/mask_bubbles.png that we produced.

Bonus bonuses

We did not do them, so good luck.

Distance study

Plot the distribution of the distances/similarities for a given distance/similarity matrix.

Is it possible to find an appropriate normalization (per bubble?) so we can have a better global threshold? (I do not think so).

Better patches

Extract the largest possible rectangle inscribed in the bubble so we have a nice patch without background.

An interesting approach: http://d3plus.org/blog/behind-the-scenes/2014/07/08/largest-rect/