class_ndim1__ ( MultiChannelImage : Regions : Metric, SingleMultiple, Radius, Center, NumberOfChannels : )
Classify pixels using hyper-spheres or hyper-cubes.
class_ndim1__ classifies the pixels of the multi-channel
image given in MultiChannelImage. The result is returned
in Regions as one region per classification object. The
metric used ('euclid' or 'maximum')is determined by
Metric. This paramter must be set to the same value used
in learn_ndim1__. The parameter is used to determine
whether one region ('single') or multiple regions ('multiple') are
to be generated for each cluster. Radius determines the
radii or half edge legth of the clusters, respectively.
Center determines their centers.
Parameters
MultiChannelImage (input_object)
|
multichannel-image(-array) -> object : byte / int1 / int2 / int4 / real
|
Multi-channel input image. |
Regions (output_object)
|
region-array -> object
|
Segmentation result. |
Metric (input_control)
|
string -> string
|
Metric used. |
Default value: 'euclid' |
List of values: 'euclid', 'maximum' |
SingleMultiple (input_control)
|
string -> string
|
Return one region or one region for each cluster. |
Default value: 'multiple' |
List of values: 'single', 'multiple' |
Radius (input_control)
|
number(-array) -> real / integer
|
Cluster radii or half edge lengths (returned by
learn_ndim1__). |
Center (input_control)
|
number(-array) -> real / integer
|
Coordinates of the cluster centers (returned by
learn_ndim1__). |
NumberOfChannels (input_control)
|
integer -> integer
|
Number of gray channels. |
Default value: 3 |
Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 9 |
Restriction: NumberOfChannels >= 1 |
Example
#include "HCPP.H"
#include
int main ()
{
HImage image ("meer"),
t1, t2, t3,
m1, m2, m3, m;
HWindow w;
w.SetColor ("green");
image.Display (w);
cout << "Draw your region of interest " << endl;
HRegion testreg = w.DrawRegion ();
t1 = image.LawsByte ("el", 2, 5); m1 = t1.Mean (21, 21);
t2 = image.LawsByte ("es", 2, 5); m2 = t2.Mean (21, 21);
t3 = image.LawsByte ("le", 2, 5); m3 = t3.Mean (21, 21);
m = m1.Compose3 (m2, m3);
Tuple Metric = "euclid";
Tuple Radius = 20.0;
Tuple MinNum = 5;
Tuple NbrCha = 3;
HRegion empty;
Tuple cen, t;
Radius = testreg.LearnNdim1 (empty, m, Metric, Radius,
MinNum, NbrCha, &cen, &t);
Tuple RegMod = "multiple";
HRegionArray reg = m.ClassNdim1 (Metric, RegMod, Radius, cen, NbrCha);
w.SetColored (12);
reg.Display (w);
cout << "Result of classification" << endl;
return (0);
}
Complexity
Let N be the number of clusters and F be the area of the input
region. Then the runtime complexity is O(N * F).
Result
class_ndim1__ returns TRUE if all parameters are
correct. The behaviour 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.
Possible Predecessors
learn_ndim1__,
compose2,
compose3,
compose4
Possible Successors
connection,
select_shape,
reduce_domain,
select_grey__
Alternatives
class_ndim2__,
class_2dim__
See also
disp_circle,
disp_rectangle1
Copyright © 1996-1997 MVTec Software GmbH