Regiongrowing for multi-channel images.
::regiongrowing_n performs a multi-channel regiongrowing. 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 4-connected neighbors 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
----
1 \
MinT <= - * / |gA - gB| <= MaxT
n ----
'2-norm'
Euclidian distance
---------------------
| ----
| 1 \ 2
MinT <= \ | - * / (gA - gB) <= MaxT
\| n ----
'3-norm'
p - Norm with p = 3
---------------------
| ----
3 | 1 \ 3
MinT <= \ | - * / (gA - gB) <= MaxT
\| n ----
'4-norm'
p - Norm with p = 4
---------------------
| ----
4 | 1 \ 4
MinT <= \ | - * / (gA - gB) <= MaxT
\| n ----
'n-norm'
Minkowski distance
---------------------
| ----
n | 1 \ n
MinT <= \ | - * / (gA - gB) <= MaxT
\| n ----
'max-diff'
Supremum distance
MinT <= max { |gA - gB| } <= MaxT
'min-diff'
Infimum distance
MinT <= min { |gA - gB| } <= MaxT
'variance'
Variance of gray value differences
X = gA - gB,
MinT <= Var(X) <= MaxT
'dot-product'
Dot product
------------------
| ----
1 | 1 \
MinT <= - * \ | - * / gA * gB <= MaxT
n \| n ----
'correlation'
Correlation
----
1 \
SA = - * / gA ,
n ----
-----------------
| ----
1 | \ 2
VarA = - * \ | / (gA - SA) ,
n \| ----
----
1 \
SB = - * / gB ,
n ----
-----------------
| ----
1 | \ 2
VarB = - * \ | / (gB - SB) ,
n \| ----
1 ----
-- * \ (gA - SA)*(gB - SB)
MinT <= 2 / ------------------- <= MaxT
n ---- VarA * VarB
'mean-diff'
Difference of arithmetic means
----
1 \
a = - * / gA ,
n ----
----
1 \
b = - * / gB ,
n ----
MinT <= |a - b| <= MaxT
'mean-ratio'
Ratio of arithmetic means
----
1 \
a = - * / gA ,
n ----
----
1 \
b = - * / gB ,
n ----
MinT <= min { a/b, b/a } <= MaxT
'length-diff'
Difference of the vector lengths
---------------
| ----
| 1 \ 2
a = \ | - * / gA ,
\| n ----
---------------
| ----
| 1 \ 2
b = \ | - * / gB ,
\| n ----
MinT <= |a - b| <= MaxT
'length-ratio'
Ratio of the vector lengths
---------------
| ----
| 1 \ 2
a = \ | - * / gA ,
\| n ----
---------------
| ----
| 1 \ 2
b = \ | - * / gB ,
\| n ----
MinT <= min { a/b, b/a } <= MaxT
'n-norm-ratio'
Ratio of the vector lengths w.r.t the p-norm with p = n
---------------
| ----
n | 1 \ n
a = \ | - * / gA ,
\| n ----
---------------
| ----
n | 1 \ n
b = \ | - * / gB ,
\| n ----
MinT <= min { a/b, b/a } <= MaxT
'gray-max-diff'
Difference of the maximum gray values
a = max { |gA| },
b = max { |gB| },
MinT <= |a - b| <= MaxT
'gray-max-ratio'
Ratio of the maximum gray values
a = max { |gA| },
b = max { |gB| },
MinT <= min { a/b, b/a } <= MaxT
'gray-min-diff'
Difference of the minimum gray values
a = min { |gA| },
b = min { |gB| },
MinT <= |a - b| <= MaxT
'gray-min-ratio'
Ratio of the minimum gray values
a = min { |gA| },
b = min { |gB| },
MinT <= min { a/b, b/a } <= MaxT
'variance-diff'
Difference of the variances over all gray values (channels)
MinT <= | Var(gA) - Var(gB) | <= MaxT
'variance-ratio'
Ratio of the variances over all gray values (channels)
MinT <= Var(gB) / Var(gA) <= MaxT
'mean-abs-diff'
Difference of the sum of absolute values over all
gray values (channels)
----
\
a = / |gA(d) - gA(k)|
----
d,k,k<d
----
\
b = / |gB(d) - gB(k)|
----
d,k,k<d
MinT <= 1/z * |a - b| <= MaxT, z = Anzahl der Summen
'mean-abs-ratio'
Ratio of the sum of absolute values over all
gray values (channels)
----
\
a = / |gA(d) - gA(k)|
----
d,k,k<d
----
\
b = / |gB(d) - gB(k)|
----
d,k,k<d
MinT <= min { a/b, b/a } <= MaxT
'max-abs-diff'
Difference of the maximum distance of the components
a = max { gA(d), gA(k) },
b = max { gB(d), gB(k) },
MinT <= |a - b| <= MaxT
'max-abs-ratio'
Ratio of the maximum distance of the components
a = max { gA(d), gA(k) },
b = max { gB(d), gB(k) },
MinT <= min { a/b, b/a } <= MaxT
'min-abs-diff'
Difference of the minimum distance of the components
a = min { gA(d), gA(k) }, k < d
b = min { gB(d), gB(k) }, k < d
MinT <= |a - b| <= MaxT
'min-abs-ratio'
Ratio of the minimum distance of the components
a = min { gA(d), gA(k) }, k < d
b = min { gB(d), gB(k) }, k < d
MinT <= min { a/b, b/a } <= MaxT
'plane'
The following has to hold for all d1,d2 in [1,n]:
gA(d1) > gA(d2) ==> gB(d1) > gB(d2),
gA(d1) < gA(d2) ==> gB(d1) < gB(d2)
Regions with less than MinSize are suppressed.
|
MultiChannelImage (input_object) |
image(-array) -> Hobject: HImage(Array) ( byte ) |
| Multi-channel image to be segmented. | |
|
Regions (output_object) |
region-array -> Hobject * : HRegionArray |
| Segmented regions. | |
|
Metric (input_control) |
string -> HTuple.char * |
| Metric for the distance of the feature vectors. | |
| Default value: '2-norm' | |
| List of values: '1-norm', '2-norm', '3-norm', '4-norm', 'n-norm', 'max-diff', 'min-diff', 'variance', 'dot-product', 'correlation', 'mean-diff', 'mean-ratio', 'length-diff', 'length-ratio', 'n-norm-ratio', 'gray-max-diff', 'gray-max-ratio', 'gray-min-diff', 'gray-min-ratio', 'variance-diff', 'variance-ratio', 'mean-abs-diff', 'mean-abs-ratio', 'max-abs-diff', 'max-abs-ratio', 'min-abs-diff', 'min-abs-ratio', 'plane' | |
|
MinTolerance (input_control) |
number -> HTuple.double / long |
| Lower threshold for the features' distance. | |
| Default value: 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 | |
| Typical range of values: 0.0 <= MinTolerance <= 255.0 (lin) | |
| Minimum increment: 0.01 | |
|
Recommended increment: 1.0 | |
|
MaxTolerance (input_control) |
number -> HTuple.double / long |
| Upper threshold for the features' distance. | |
| Default value: 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 | |
| Typical range of values: 0.0 <= MaxTolerance <= 255.0 (lin) | |
| Minimum increment: 0.01 | |
|
Recommended increment: 1.0 | |
|
MinSize (input_control) |
integer -> HTuple.long |
| Minimum size of the output regions. | |
| Default value: 30 | |
| Suggested values: 1, 10, 25, 50, 100, 200, 500, 1000 | |
| Typical range of values: 1 <= MinSize <= 10000 (lin) | |
| Minimum increment: 1 | |
|
Recommended increment: 5 | |
::regiongrowing_n returns 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.
::class_2dim_sup, ::class_ndim_norm, ::class_ndim_box
Region processing