regiongrowing_nπ
Short descriptionπ
regiongrowing_n β Segment an image using region growing for multi-channel images.
Signatureπ
regiongrowing_n( image MultiChannelImage, out region Regions, string Metric, number MinTolerance, number MaxTolerance, integer MinSize )
Descriptionπ
regiongrowing_n performs a multi-channel
region growing. The \(n\) channels give
rise to an n-dimensional feature vector. Neighboring points are
aggregated into the same region if the difference of their feature
vectors with respect to the given metric lies in the interval
[MinTolerance, MaxTolerance]. Only
neighbors of the 4-neighborhood are examined. The following metrics can be
used:
Let \(g_{A}\) denote the gray value in the feature vector \(A\)
at point \(a\) of the image, and likewise be \(g_{B}\) the gray
value in the feature vector \(B\) at point a neighboring point
\(b\). Let \(g(d)\) be the gray value with index \(d\).
Furthermore, let \(MinT\) denote
MinTolerance and \(MaxT\) denote MaxTolerance.
-
'1-norm': Sum of absolute values
\[\begin{eqnarray*}MinT \le \frac{1}{n} \sum{|g_{A} - g_{B}|} \le MaxT\end{eqnarray*}\] -
'2-norm': Euclidean distance
\[\begin{eqnarray*}MinT \le \sqrt{ \frac{ \sum{(g_{A} - g_{B})^2 }}{n} } \le MaxT\end{eqnarray*}\] -
'3-norm': p - Norm with p = 3
\[\begin{eqnarray*}MinT \le \sqrt[3]{ \frac{ \sum {(g_{A} - g_{B})^3 }}{n} } \le MaxT\end{eqnarray*}\] -
'4-norm': p - Norm with p = 4
\[\begin{eqnarray*} MinT \le \sqrt[4]{ \frac{ \sum {(g_{A} - g_{B})^4 }}{n} } \le MaxT \end{eqnarray*}\] -
'n-norm': Minkowski distance
\[\begin{eqnarray*}MinT \le \sqrt[n]{ \frac{ \sum {(g_{A} - g_{B})^n }}{n} } \le MaxT\end{eqnarray*}\] -
'max-diff': Supremum distance
\[\begin{eqnarray*}MinT \le \max { \{ |g_{A} - g_{B}| \} } \le MaxT\end{eqnarray*}\] -
'min-diff': Infimum distance
\[\begin{eqnarray*}MinT \le \min { \{ |g_{A} - g_{B}| \} } \le MaxT\end{eqnarray*}\] -
'variance': Variance of gray value differences
\[\begin{eqnarray*}MinT \le Var(g_{A} - g_{B}) \le MaxT\end{eqnarray*}\] -
'dot-product': Dot product
\[\begin{eqnarray*}MinT \le \frac{1}{n} \sqrt { \sum { (g_{A} g_{B}) } } \le MaxT\end{eqnarray*}\] -
'correlation': Correlation
\[\begin{eqnarray*} m_{A} &=& \frac{1}{n} \sum { g_{A} } \\ Var_{A} &=& \frac{1}{n} \sqrt { \sum { (g_{A} - m_{A})^2 } } \\ m_{B} &=& \frac{1}{n} \sum { g_{B} } \\ Var_{B} &=& \frac{1}{n} \sqrt { \sum { (g_{B} - m_{B})^2 } } \\ MinT &\le& \frac{1}{n^2} \sum {\frac{(g_{A} - m_{A}) (g_{B} - m_{B})} {(Var_{A} Var_{B})}} \le MaxT \end{eqnarray*}\] -
'mean-diff': Difference of arithmetic means
\[\begin{eqnarray*} a &=& \frac{1}{n} \sum { g_{A} } \\ b &=& \frac{1}{n} \sum { g_{B} } \\ MinT &\le& |a - b| \le MaxT \end{eqnarray*}\] -
'mean-ratio': Ratio of arithmetic means
\[\begin{eqnarray*} a &=& \frac{1}{n} \sum { g_{A} } \\ b &=& \frac{1}{n} \sum { g_{B} } \\ MinT &\le& \min { \left\{ \frac{a}{b},\frac{b}{a} \right\} } \le MaxT \end{eqnarray*}\] -
'length-diff': Difference of the vector lengths
\[\begin{eqnarray*} a &=& \sqrt { \frac{ \sum { g_{A}^2 }}{n}}\\ b &=& \sqrt { \frac{ \sum { g_{B}^2 }}{n}}\\ MinT &\le& |a - b| \le MaxT \end{eqnarray*}\] -
'length-ratio': Ratio of the vector lengths
\[\begin{eqnarray*} a &=& \sqrt { \frac{ \sum { g_{A}^2 } }{n} }\\ b &=& \sqrt { \frac{ \sum { g_{B}^2 } }{n} }\\ MinT &\le& \min { \left\{ \frac{a}{b},\frac{b}{a} \right\} } \le MaxT \end{eqnarray*}\] -
'n-norm-ratio': Ratio of the vector lengths w.r.t the p-norm with p = n
\[\begin{eqnarray*} a &=& \sqrt[n]{ \frac{ \sum { g_{A}^n } }{ n }}\\ b &=& \sqrt[n]{ \frac{ \sum { g_{B}^n } }{ n }}\\ MinT &\le& \min { \left\{ \frac{a}{b},\frac{b}{a} \right\} } \le MaxT \end{eqnarray*}\] -
'gray-max-diff': Difference of the maximum gray values
\[\begin{eqnarray*} a &=& \max { \{ |g_{A}| \} }\\ b &=& \max { \{ |g_{B}| \} }\\ MinT &\le& |a - b| \le MaxT \end{eqnarray*}\] -
'gray-max-ratio': Ratio of the maximum gray values
\[\begin{eqnarray*} a &=& \max { \{ |g_{A}| \} }\\ b &=& \max { \{ |g_{B}| \} }\\ MinT &\le& \min { \left\{ \frac{a}{b},\frac{b}{a} \right\} } \le MaxT \end{eqnarray*}\] -
'gray-min-diff': Difference of the minimum gray values
\[\begin{eqnarray*} a &=& \min { \{|g_{A}| \} }\\ b &=& \min { \{|g_{B}| \} }\\ MinT &\le& |a - b| \le MaxT \end{eqnarray*}\] -
'gray-min-ratio': Ratio of the minimum gray values
\[\begin{eqnarray*} a &=& \min { \{ |g_{A}| \} }\\ b &=& \min { \{ |g_{B}| \} }\\ MinT &\le& \min { \left\{ \frac{a}{b},\frac{b}{a} \right\} } \le MaxT \end{eqnarray*}\] -
'variance-diff': Difference of the variances over all gray values (channels)
\[\begin{eqnarray*}MinT \le | Var(g_{A}) - Var(g_{B}) | \le MaxT\end{eqnarray*}\] -
'variance-ratio': Ratio of the variances over all gray values (channels)
\[\begin{eqnarray*}MinT \le \frac{Var(g_{B})}{Var(g_{A})} \le MaxT\end{eqnarray*}\] -
'mean-abs-diff': Difference of the sum of absolute values over all gray values (channels)
\[\begin{eqnarray*} a &=& \sum_{d,k,k < d} { |g_{A}(d) - g_{A}(k)| }\\ b &=& \sum_{d,k,k < d} { |g_{B}(d) - g_{B}(k)| }\\ MinT &\le& \frac{|a - b|}{\mbox{number of sums}} \le MaxT \end{eqnarray*}\] -
'mean-abs-ratio': Ratio of the sum of absolute values over all gray values (channels)
\[\begin{eqnarray*} a &=& \sum_{d,k,k < d} { |g_{A}(d) - g_{A}(k)| }\\ b &=& \sum_{d,k,k < d} { |g_{B}(d) - g_{B}(k)| }\\ MinT &\le& \min { \left\{ \frac{a}{b},\frac{b}{a} \right\} } \le MaxT \end{eqnarray*}\] -
'max-abs-diff': Difference of the maximum distance of the components
\[\begin{eqnarray*} a &=& \max { \{ g_{A}(d), g_{A}(k) \} } \\ b &=& \max { \{ g_{B}(d), g_{B}(k) \} } \\ MinT &\le& \min { \left\{ \frac{a}{b},\frac{b}{a} \right\} } \le MaxT \end{eqnarray*}\] -
'max-abs-ratio': Ratio of the maximum distance of the components
\[\begin{eqnarray*} a &=& \max { \{ g_{A}(d), g_{A}(k) \} } \\ b &=& \max { \{ g_{B}(d), g_{B}(k) \} } \\ MinT &\le& \min { \left\{ \frac{a}{b},\frac{b}{a} \right\} } \le MaxT \end{eqnarray*}\] -
'min-abs-diff': Difference of the minimum distance of the components
\[\begin{eqnarray*} a &=& \min { \{ g_{A}(d), g_{A}(k) \} }, k < d\\ b &=& \min { \{ g_{B}(d), g_{B}(k) \} }, k < d\\ MinT &\le& |a - b| \le MaxT \end{eqnarray*}\] -
'min-abs-ratio': Ratio of the minimum distance of the components
\[\begin{eqnarray*} a &=& \min { \{ g_{A}(d), g_{A}(k) \}}, k < d\\ b &=& \min { \{ g_{B}(d), g_{B}(k) \}}, k < d\\ MinT &\le& \min { \left\{\frac{a}{b},\frac{b}{a} \right\} } \le MaxT \end{eqnarray*}\] -
'plane': The following has to hold for all \(d_{1}\),\(d_{2} \in [1,n]\):
\[\begin{eqnarray*} g_{A}(d_{1}) &>& g_{A}(d_{2}) \Rightarrow g_{B}(d_{1}) > g_{B}(d_{2})\\ g_{A}(d_{1}) &<& g_{A}(d_{2}) \Rightarrow g_{B}(d_{1}) < g_{B}(d_{2}) \end{eqnarray*}\]
Regions with an area less than MinSize are suppressed.
Execution informationπ
Execution information
-
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
-
Multithreading scope: global (may be called from any thread).
-
Automatically parallelized on tuple level.
Parametersπ
MultiChannelImage (input_object) (multichannel-)image(-array) β object (byte)
Input image.
Regions (output_object) region-array β object
Segmented regions.
Metric (input_control) string β (string)
Metric for the distance of the feature vectors.
Default: '2-norm'
List of values: '1-norm', '2-norm', '3-norm', '4-norm', 'correlation', 'dot-product', 'gray-max-diff', 'gray-max-ratio', 'gray-min-diff', 'gray-min-ratio', 'length-diff', 'length-ratio', 'max-abs-diff', 'max-abs-ratio', 'max-diff', 'mean-abs-diff', 'mean-abs-ratio', 'mean-diff', 'mean-ratio', 'min-abs-diff', 'min-abs-ratio', 'min-diff', 'n-norm', 'n-norm-ratio', 'plane', 'variance', 'variance-diff', 'variance-ratio'
MinTolerance (input_control) number β (real / integer)
Lower threshold for the featuresβ distance.
Default: 0.0
Suggested values: 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 25.0, 30.0
MaxTolerance (input_control) number β (real / integer)
Upper threshold for the featuresβ distance.
Default: 20.0
Suggested values: 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 25.0, 30.0
MinSize (input_control) integer β (integer)
Minimum size of the output regions.
Default: 30
Suggested values: 1, 10, 25, 50, 100, 200, 500, 1000
Value range: 1 β€ MinSize
Minimum increment: 1
Recommended increment: 5
Resultπ
regiongrowing_n returns 2 (H_MSG_TRUE) if all parameters are
correct. The behavior with respect to the input images and output
regions can be determined by setting the values of the flags
'no_object_result', 'empty_region_result', and
'store_empty_region' with set_system.
If necessary, an exception is raised.
Combinations with other operatorsπ
Moduleπ
Foundation