Name
class_ndim_normclass_ndim_normClassNdimNormClassNdimNorm — Classify pixels using hyper-spheres or hyper-cubes.
Herror class_ndim_norm(const Hobject MultiChannelImage, Hobject* Regions, const char* Metric, const char* SingleMultiple, double Radius, double Center)
Herror T_class_ndim_norm(const Hobject MultiChannelImage, Hobject* Regions, const Htuple Metric, const Htuple SingleMultiple, const Htuple Radius, const Htuple Center)
void ClassNdimNorm(const HObject& MultiChannelImage, HObject* Regions, const HTuple& Metric, const HTuple& SingleMultiple, const HTuple& Radius, const HTuple& Center)
HRegion HImage::ClassNdimNorm(const HString& Metric, const HString& SingleMultiple, const HTuple& Radius, const HTuple& Center) const
HRegion HImage::ClassNdimNorm(const HString& Metric, const HString& SingleMultiple, double Radius, double Center) const
HRegion HImage::ClassNdimNorm(const char* Metric, const char* SingleMultiple, double Radius, double Center) const
static void HOperatorSet.ClassNdimNorm(HObject multiChannelImage, out HObject regions, HTuple metric, HTuple singleMultiple, HTuple radius, HTuple center)
HRegion HImage.ClassNdimNorm(string metric, string singleMultiple, HTuple radius, HTuple center)
HRegion HImage.ClassNdimNorm(string metric, string singleMultiple, double radius, double center)
class_ndim_normclass_ndim_normClassNdimNormClassNdimNormClassNdimNorm classifies the pixels of the multi-channel
image given in MultiChannelImageMultiChannelImageMultiChannelImageMultiChannelImagemultiChannelImage. The result is returned
in RegionsRegionsRegionsRegionsregions as one region per classification object. The
metric used ('euclid' or 'maximum') is determined by
MetricMetricMetricMetricmetric. This parameter must be set to the same value used
in learn_ndim_normlearn_ndim_normLearnNdimNormLearnNdimNormLearnNdimNorm. The parameter SingleMultipleSingleMultipleSingleMultipleSingleMultiplesingleMultiple
determines whether one region ('single') or multiples regions ('multiple')
are generated for each cluster. RadiusRadiusRadiusRadiusradius determines the
radii or half edge length of the clusters, respectively.
CenterCenterCenterCentercenter determines their centers.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on tuple level.
Multi channel input image.
Metric to be used.
Default value:
'euclid'
"euclid"
"euclid"
"euclid"
"euclid"
List of values: 'euclid'"euclid""euclid""euclid""euclid", 'maximum'"maximum""maximum""maximum""maximum"
Return one region or one region for each cluster.
Default value:
'single'
"single"
"single"
"single"
"single"
List of values: 'multiple'"multiple""multiple""multiple""multiple", 'single'"single""single""single""single"
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
using namespace Halcon;
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.TextureLaws ("el", 2, 5); m1 = t1.MeanImage (21, 21);
t2 = image.TextureLaws ("es", 2, 5); m2 = t2.MeanImage (21, 21);
t3 = image.TextureLaws ("le", 2, 5); m3 = t3.MeanImage (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.LearnNdimNorm (empty, m, Metric, Radius,
MinNum, NbrCha, &cen, &t);
Tuple RegMod = "multiple";
HRegionArray reg = m.ClassNdimNorm (Metric, RegMod, Radius, cen, NbrCha);
w.SetColored (12);
reg.Display (w);
cout << "Result of classification" << endl;
return (0);
}
read_image(&Image,"meer:);
open_window(0,0,-1,-1,0,"visible","",&WindowHandle);
disp_image(Image,WindowHandle);
fwrite_string("draw region of interest with the mouse");
fnew_line();
set_color(WindowHandle,"green");
draw_region(&Testreg,draw_region);
/* Texture transformation for 3-dimensional charachteristic */
texture_laws(Image,&T1,"el",2,5);
mean_image(T1,&M1,21,21);
texture_laws(Image,&T2,"es",2,5);
mean_image(T2,&M2,21,21);
texture_laws(Image,&T3,"le",2,5);
mean_image(T3,&M3,21,21);
compose3(M1,M2,M3,&M);
/* Cluster for 3-dimensional characteristic area determine training area */
create_tuple(&Metric,1);
set_s(Metric,"euclid",0);
create_tuple(&Radius,1);
set_d(Radius,20.0,0);
create_tuple(&MinNumber,1);
set_i(MinNumber,5,0);
T_learn_ndim_norm(Testobj,EMPTY_REGION,&M,"euclid",Radius,MinNumber,
&Radius,&Center,NULL);
/* Segmentation */
create_tuple(&RegionMode,1);
set_s(RegionMode,"multiple",0);
class_ndim_norm(M,&Regions,Metric,RegionMode,Radius,Center);
set_colored(WindowHandle,12);
disp_region(Regions,WindowHandle);
fwrite_string("Result of classification;");
fwrite_string("Each cluster in another color.");
fnew_line();
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
using namespace Halcon;
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.TextureLaws ("el", 2, 5); m1 = t1.MeanImage (21, 21);
t2 = image.TextureLaws ("es", 2, 5); m2 = t2.MeanImage (21, 21);
t3 = image.TextureLaws ("le", 2, 5); m3 = t3.MeanImage (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.LearnNdimNorm (empty, m, Metric, Radius,
MinNum, NbrCha, &cen, &t);
Tuple RegMod = "multiple";
HRegionArray reg = m.ClassNdimNorm (Metric, RegMod, Radius, cen, NbrCha);
w.SetColored (12);
reg.Display (w);
cout << "Result of classification" << endl;
return (0);
}
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
using namespace Halcon;
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.TextureLaws ("el", 2, 5); m1 = t1.MeanImage (21, 21);
t2 = image.TextureLaws ("es", 2, 5); m2 = t2.MeanImage (21, 21);
t3 = image.TextureLaws ("le", 2, 5); m3 = t3.MeanImage (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.LearnNdimNorm (empty, m, Metric, Radius,
MinNum, NbrCha, &cen, &t);
Tuple RegMod = "multiple";
HRegionArray reg = m.ClassNdimNorm (Metric, RegMod, Radius, cen, NbrCha);
w.SetColored (12);
reg.Display (w);
cout << "Result of classification" << endl;
return (0);
}
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
using namespace Halcon;
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.TextureLaws ("el", 2, 5); m1 = t1.MeanImage (21, 21);
t2 = image.TextureLaws ("es", 2, 5); m2 = t2.MeanImage (21, 21);
t3 = image.TextureLaws ("le", 2, 5); m3 = t3.MeanImage (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.LearnNdimNorm (empty, m, Metric, Radius,
MinNum, NbrCha, &cen, &t);
Tuple RegMod = "multiple";
HRegionArray reg = m.ClassNdimNorm (Metric, RegMod, Radius, cen, NbrCha);
w.SetColored (12);
reg.Display (w);
cout << "Result of classification" << endl;
return (0);
}
Let N be the number of clusters and A be the area of the input
region. Then the runtime complexity is O(N,A).
class_ndim_normclass_ndim_normClassNdimNormClassNdimNormClassNdimNorm 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'"no_object_result""no_object_result""no_object_result""no_object_result", 'empty_region_result'"empty_region_result""empty_region_result""empty_region_result""empty_region_result", and
'store_empty_region'"store_empty_region""store_empty_region""store_empty_region""store_empty_region" with set_systemset_systemSetSystemSetSystemSetSystem.
If necessary, an exception is raised.
learn_ndim_normlearn_ndim_normLearnNdimNormLearnNdimNormLearnNdimNorm,
compose2compose2Compose2Compose2Compose2,
compose3compose3Compose3Compose3Compose3,
compose4compose4Compose4Compose4Compose4,
compose5compose5Compose5Compose5Compose5,
compose6compose6Compose6Compose6Compose6,
compose7compose7Compose7Compose7Compose7
connectionconnectionConnectionConnectionConnection,
select_shapeselect_shapeSelectShapeSelectShapeSelectShape,
reduce_domainreduce_domainReduceDomainReduceDomainReduceDomain,
select_grayselect_graySelectGraySelectGraySelectGray
class_2dim_supclass_2dim_supClass2dimSupClass2dimSupClass2dimSup,
class_2dim_unsupclass_2dim_unsupClass2dimUnsupClass2dimUnsupClass2dimUnsup
Foundation