![]() |
IPSDK
4_1_0_2
IPSDK : Image Processing Software Development Kit
|
tutorial for basic 2d quantification process More...
tutorial for basic 2d quantification process
This script introduce basics for 2d quantification problems resolution using IPSDK library. The following figure presents such problems :
It presents some classical processing steps used during 2d quantification :
The application can be called through a command line as follows:
<application_exe_filename> [--inputImgFilePath <input_image_file_path>] [--outputReportPath <output_report_file_path>] [--inHalfKnlSize <half_kernel_size>] [--inSpaceSigma <space_sigma_value>] [--inDilateFactor <dilate_factor>]
Arguments:
--inputImgFilePath optional; specifies the name of the TIFF file, from
which the input grey level image will be loaded; if not
specified by the user, the input image is loaded from
file <DEV_ROOT>/data/Sample/images/blobs_483x348_UInt8.tif
--outputReportPath optional; specifies the name of the CSV file, in
which the output quantification will be saved; if not
specified by the user, the output results file is saved to
file <TEMPORARY_IPSDK_DIR>/Sample/quantification2d.csv
--inHalfKnlSize optional; specifies the value of half kernel size along each axis,
used while applying the mean smoothing filter; if not
specified by the user, equals to 3 by default
--inSpaceSigma optional; specifies the value of the spatial Gaussian standard deviation,
used while applying the 2d separated bilateral filter; if not
specified by the user, equals to 8 by default
--inDilateFactor optional; specifies the value of the dilation factor
used while applying the 2d watershed-based binary separation; if not
specified by the user, equals to 5 by defaultWe start by importing all necessary libraries:
In the main function body, we start by asking to display all the log messages generated by IPSDK libraries and by our application itself to the application console:
Next, we initialize the IPSDK environment:
Then, we define the input image file path, the output CSV file path and the other parameter values.
We then read the arguments of the command line :
We load the input image from the associated TIFF file, by calling the function ipsdk::image::file::loadTiffImageFile.
The first step consists in input image filtering to remove noise. In this tutorial we use Separated bilateral smoothing 2d filter. The good choice of used filter is a quite difficult task since it is dependent on input image type and on searched shapes.
At this step, the user will have to make a choice which is generally the result of successive try. See Filtering image operations for a list of available filters. There is no universal solution for that step, the user could nevertheless be interested in following questions :
Once the input image is filtered, we process to an automatic image binarization. In this tutorial we use Otsu Threshold binarization filter.
Please note in previous image connected area enhanced by red circles. During the next step, we will automatically separate these areae using a binary separation technic based on watershed algorithm (Watershed Binary Separation 2d).
Once all shape separated, we can proceed to a connected components analysis (Connected Component 2d) :
And then to the extraction of associated contours (LabelContourExtraction2d_Grp) :
We can now define a collection of measures that should be computed on extracted shapes (see Shape Analysis and Measurement for a complete list of available measures) :
And finally compute these measures :
At last, we save the measurement report into a csv format.
Data can also be directly accessed by using the following syntax :
See the full source listing
1.8.14