Classify pixels using hyper-cuboids.
::class_ndim_box classifies the pixels of the multi-channel image given in MultiChannelImage. To do so, the classificator ClassifHandle created with ::create_class_box is used. The classificator can be trained using ::class_ndim_box or as described with ::create_class_box. More information on the structure of the classificator can be found also under that operator.
MultiChannelImage is a multi channel image. Its pixel values are used for the classification.
|
MultiChannelImage (input_object) |
multichannel-image(-array) -> Hobject: HImage(Array) ( byte / int1 / int2 / int4 / real / direction / cyclic ) |
| Multi-channel input image. | |
|
Regions (output_object) |
region-array -> Hobject * : HRegionArray |
| Segmentation result. | |
|
ClassifHandle (input_control) |
class_box -> HTuple.long |
| Classificator's handle number. | |
#include "HalconCpp.h"
#include <iostream.h>
int main ()
{
HImage image ("meer"),
foreground, background;
HRegion reg1, reg2;
HWindow w;
image.Display (w);
w.SetColor ("green");
cout << "Draw foreground " << endl;
reg1 = w.DrawRegion ();
w.SetColor ("red");
cout << "Draw background " << endl;
reg2 = w.DrawRegion ();
create_class_box (&ClassifHandle);
cout << "Start classification " << endl;
reg1.LearnNdimBox (reg2, image, ClassifHandle);
HRegionArray res = image.ClassNdimBox (ClassifHandle);
w.SetDraw ("fill");
res.Display (w);
w.Click ();
return (0);
}
Let N be the number of hyper-cuboids and F be the area of the input region. Then the runtime complexity is O(N * F).
::class_ndim_box 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.
::create_class_box, ::learn_class_box, ::median_image, ::compose2, ::compose3, ::compose4
::class_ndim_norm, ::class_2dim_sup
::class_ndim_box, ::descript_class_box, ::create_class_box
Region processing