![]() |
IPSDK
4_1_0_2
IPSDK : Image Processing Software Development Kit
|
module demonstrating shape filtering on 2d images More...
module demonstrating shape filtering on 2d images
This application proceeds to a shape filtering operation from an input image TIFF files cupple (a binary or label image and an optional grey level image) and a filtering formula.
The application can be called through a command line as follows:
<application_script_filename> [--inputGreyImgPath <input_grey_image_file_path>] [--inputBinLabImgPath <input_binary_image_file_path>] [--inputFilterFormula <input_filter_formula>] [--outputImgFilePath <output_image_file_path>]
Arguments:
--inputGreyImgPath optional; specifies the name of the TIFF file, from
which the input grey level image will be loaded; if not
specified by the user, used input image is loaded from
file
<DEV_ROOT>/data/Sample/images/blobs_483x348_UInt8.tif
--inputBinLabImgPath optional; specifies the name of the TIFF file, from
which the input binary or label image will be loaded;
if not specified by the user, the input image is
loaded from file
<DEV_ROOT>/data/Sample/images/blobs_483x348_Binary.tif
--inputFilterFormula optional; specifies the formula string used to filter
shapes from input binary/label image.
if not specified by the user, the input filter formula
will be set to
Area2dMsr > 800
--outputImgFilePath optional; specifies the name of the TIFF file, in
which the output filtered image will be saved; if not
specified by the user, the output image file is saved
to file
<TEMPORARY_IPSDK_DIR>/Sample/shapeFiltering2dImg.tifHere is a snapshot of default input images used by the application and of corresponding output results with the following filtering criteria Circularity<0.9 and Mean<170:
Central displayed table correspond to the working data used during filtering operation.
We start by importing all necessary libraries:
Then we define the input parameters.
We load our input image from the associated Tiff file, by calling the function ipsdk::image::file::loadTiffImageFile.
We then apply the main shape filtering algorithm on input image using input formula string.
Lastly, we save the image resulting from the operation to the Tiff file.
See the full source listing
1.8.14