Showing results for 
Search instead for 
Do you mean 

Calling a Model from within a Model

by AndyZ on ‎12-04-2015 11:46 AM - edited on ‎04-14-2016 06:28 AM by Community Manager (600 Views)

Download models

Description:

Applies a directional 5x5 convolution smoothing filter. This technique smooths small regions while preserving significant edges. The model implementation consists of a simple primary model calling another external model via the Spatial Model operator.

 

Input image and directionally smoothed output image
DirectionalSmoothingInputImage.png
DirectionalSmoothingOutputImage.png

 

The directional smoothing technique uses 8 different 5x5 convolution filters representing 8 directional neighborhoods (north, northeast, etc).  A focal standard deviation is calculated for each neighborhood,  Then a convolution is selected for the neighborhood that has the least amount of variability.  This technique is useful for image generalization.

 

The implementation of this model illustrates use of the Spatial Model operator.  This operator enables models to call other models.  The primary model stores the full path and file name of the model it is calling.  If it cannot find the model, it tries to locate the model in the same directory as the primary model. Effectively this enables Spatial Models to be re-used as if they were Operators.

 

 

ApplyDirectionalSmoothing-v15-1-1.gmdx - the Primary Model
ApplyDirectionalSmoothing-v15-1-1.png

 

DirectionalSmoothing-v15-1-1.gmdx - the Model Called by the Primary Model
DirectionalSmoothing-v15-1-1.png

 

Input parameters:

 

Image In: Name of the input image to be smoothed.

Image Out: Name of the output image file created by the smoothing.

Courses