IPSDK 4.1
IPSDK : Image Processing Software Development Kit
IPSDK Interface documentation

2D Granulometry & Grain segmentation module


The 2D Granulometry [1] module is designed to detect, separate, and analyze grains in 2D. It is accessible via one dedicated button, inside the menu bar of IPSDK Explorer.


Input selection

The module window contains a dropdown menu at the top left corner to select an input image to process. Both grayscale and RGB formats are supported, for individual 2D images or sequences of 2D images.

InputImageList.png


Note
Input images must be loaded inside IPSDK Explorer to be selected inside the dropdown list.

Configuration management

The second dropdown menu appearing on the right corner allows to choose and reload previously saved configurations. The special entry "..." refers to the last auto-saved configuration made during the last preview.

ModuleSettings.png


The button
applies the settings to the different processing sections, while the
delete the current setting selected in the list.
The button
at the top right corner, resets all the settings to default values.

The checkbox Keep images for next process is an optional setting that allows to save processed images for the next process, and therefore gain some time during computations. When this option is checked, images will be saved everytime a preview is done, reducing redundant computations.

To save the current configuration :

Processing sections

The core of the plugin window includes seven distinct and collapsible sections :

Module Section Structure


Each processing section is made up of individual functions.

Each line is described as follows :

Here is an example with the pre process section :



Pre Process


This section is intended to enhance image quality before grain detection.

It includes:

Here's an example of pre processing :

preprocess.png
Pre process of a color image by extracting the Red channel, applying a median of size 1, and removing dark and light points.


Binarization


This step converts the pre-processed image into a binary mask highlighting the grains.

This section includes 5 thresholding methods, with 3 classical algorithms :

And also two advanced options :

Parameters vary depending on the chosen method. The documentation of each function is accessible through Explorer function sections, using the
button.

Here is an example of a binarization using the Otsu method :

binarization.png
Binarization of grains using the Otsu light type method.


When using the smart segmentation method, a pre-trained model is needed. The documentation shows how to build a smart segmentation model here.

The smart segmentation option allows to select a pre-trained model and to choose the model classes to use for the binarization.

Note
The trained model relies on the pre-processed image as input; therefore, any changes to the pre-processing steps afterward may cause the model to malfunction or deliver inaccurate results.



binarization_smartSegmentation.png


The
button can be used to refresh the models list, in case the model doesn't appear in the list.


Here is an example of binarization using the smart segmentation method :

binarization_smartSegmentation_example.png

Besides the smart segmentation algorithm, the macro-based binarization can be usefull for very complex images binarization.

The previous example shows that the binarization isn't perfect with a multitude of holes inside the objects. To improve the binary image we can use morphological operations.

Morphological Operations


Morphological operations refine the binary image by cleaning up artifacts and enhancing the separation of grains.

Available operations are :

Each operation is optional and configurable.

Here's an example of holes removal using the morphological operations inside the module :

morphologicalOperations.png



Separation


Grain segmentation is performed here to label individual grains for further analysis.

Three different segmentation methods are available :

Only one method can be selected at a time.

separation.png
Grain separation using the classic watershed algorithm


Post Process


Additional cleaning of the labeled result can be performed here using a set of post-processing tools.

This section implements 4 different methods :

Measures

This section provides quantitative analysis of the segmented grains.

It is divided in two different parts :

Measures selection

The right pane lists all available measurements.

measuresRight.png
Measures are separated in 2 different categories and again in multiple sub-categories


The preview button gives a peak of the results inside IPSDK Explorer.

Selected measures

Once a measure is added, it appear on the left side with the possibility to compute two different histograms by clicking the checkboxes.

measuresLeft.png


Sieves can be customized under Settings → Sieves → Preferences.

sieveSelection.png
Sieves can be created and edited inside the sieves edition window


Output Images


This section defines the type of output results (label images, binary masks, overlays, etc.) to compute and save.

Saving and Launching Analyses


At the bottom right, three buttons control the execution of the analyses :

The
button shows the python code for the current analysis pipeline.




References


[1] https://en.wikipedia.org/wiki/Granulometry

[2] https://en.wikipedia.org/wiki/Watershed_(image_processing)