HALCON Reference Manual 10.0.2
Table of Contents / Filters / Arithmetic ClassesClassesClasses | | | Operators

invert_imageinvert_imageinvert_imageInvertImageInvertImage (Operator)

Name

invert_imageinvert_imageinvert_imageInvertImageInvertImage — Invert an image.

Signature

invert_image(Image : ImageInvert : : )

Herror invert_image(const Hobject Image, Hobject* ImageInvert)

Herror T_invert_image(const Hobject Image, Hobject* ImageInvert)

Herror invert_image(Hobject Image, Hobject* ImageInvert)

HImage HImage::InvertImage() const

HImageArray HImageArray::InvertImage() const

void HOperatorSetX.InvertImage(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageInvert)

IHImageX* HImageX.InvertImage()

static void HOperatorSet.InvertImage(HObject image, out HObject imageInvert)

HImage HImage.InvertImage()

Description

The operator invert_imageinvert_imageinvert_imageInvertImageInvertImage inverts the gray values of an image. For images of the 'byte' and 'cyclic' type the result is calculated as:

     g' = 255 - g

Images of the 'direction' type are transformed by

     g' = (g + 90) modulo 180

In the case of signed types the values are negated. The resulting image has the same pixel type as the input image.

Several images can be processed in one call. An output image is generated for every input image.

invert_imageinvert_imageinvert_imageInvertImageInvertImage can be executed on an OpenCL device for byte, direction, cyclic, int1, int2, uint2, int4, and real images.

Parallelization

Parameters

ImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject (byte* / direction* / cyclic* / int1* / int2* / uint2* / int4* / int8 / real*) *allowed for compute devices

Input image(s).

ImageInvertImageInvertImageInvertImageInvertimageInvert (output_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject * (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real)

Image(s) with inverted gray values.

Example (HDevelop)

read_image(Orig,'fabrik')
invert_image(Orig,Invert)
disp_image(Invert,WindowHandle)

Example (C)

read_image(&Orig,"fabrik");
invert_image(Orig,&Invert);
disp_image(Invert,WindowHandle);

Example (C++)

#include "HalconCpp.h"
using namespace Halcon;
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif

int main()
{
  HWindow  win;
  HImage   inv,
           org ("monkey");

   cout << "Display original image" << endl;
   org.Display (win);
   win.Click ();

   inv = org.InvertImage ();

   cout << "Display inverted image" << endl;
   inv.Display (win);
   win.Click ();

   return 0;
}

Example (HDevelop)

read_image(Orig,'fabrik')
invert_image(Orig,Invert)
disp_image(Invert,WindowHandle)

Example (HDevelop)

read_image(Orig,'fabrik')
invert_image(Orig,Invert)
disp_image(Invert,WindowHandle)

Possible Successors

watershedswatershedswatershedsWatershedsWatersheds

Alternatives

scale_imagescale_imagescale_imageScaleImageScaleImage

See also

scale_imagescale_imagescale_imageScaleImageScaleImage, add_imageadd_imageadd_imageAddImageAddImage, sub_imagesub_imagesub_imageSubImageSubImage

Module

Foundation


Table of Contents / Filters / Arithmetic ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH