Herror ::class_ndim_box (
    Hobject MultiChannelImage,
    Hobject *Regions,
    const HTuple &ClassifHandle
)
HRegionArray HImage::ClassNdimBox (
    const HTuple &ClassifHandle
) const
HRegionArray HImageArray::ClassNdimBox (
    const HTuple &ClassifHandle
) const

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.


Parameters

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.


Example
#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);
}

Complexity

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).


Result

::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.


Possible Predecessors

::create_class_box, ::learn_class_box, ::median_image, ::compose2, ::compose3, ::compose4


Alternatives

::class_ndim_norm, ::class_2dim_sup


See also

::class_ndim_box, ::descript_class_box, ::create_class_box


Module

Region processing



Copyright © 1996-2002 MVTec Software GmbH