Skip to content

invert_imageInvertImageInvertImageinvert_imageinvert_image🔗

説明🔗

invert_imageInvertImageInvertImageinvert_imageinvert_image — 画像のグレイ値を反転させる。

書式🔗

invert_image( image Image, out image ImageInvert )void InvertImage( const HObject& Image, HObject* ImageInvert )static void HOperatorSet.InvertImage( HObject image, out HObject imageInvert )def invert_image( image: HObject ) -> HObject

Herror invert_image( const Hobject Image, Hobject* ImageInvert )

Herror T_invert_image( const Hobject Image, Hobject* ImageInvert )

HImage HImage::InvertImage( ) const

HImage HImage.InvertImage( )

説明🔗

オペレーター invert_imageInvertImage は、画像のグレイ値を反転します。 byte 型と cyclic 型の画像に対して、結果は次式で計算されます。 : g’ = 255 - g 「direction」型の画像は、次式によって変換されます。 g’ = (g + 90) modulo 180 符号付きの型の画像の場合、符号が反転します。 結果として得られる画像は、入力画像と同じピクセルタイプを持ちます。

* 複数の画像を一度の呼び出しで処理することができます。 出力画像は、すべての入力画像に対して生成されます。

invert_imageInvertImage はOpenCLデバイス上で byte, direction, cyclic, int1, int2, uint2, int4, real 画像への処理を動作させることができます。

実行情報🔗

実行情報
  • OpenCL演算デバイスによる演算をサポート

  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • tupleレベルで自動的に並列演算処理を実施

  • チャンネルレベルで自動的に並列演算処理を実施

  • ドメインレベルで自動的に並列演算処理を実施

パラメーター🔗

Imageimageimage (input_object) (multichannel-)image(-array) → object (byte* / direction* / cyclic* / int1* / int2* / uint2* / int4* / int8 / real*)HObject (byte* / direction* / cyclic* / int1* / int2* / uint2* / int4* / int8 / real*)HImage (byte* / direction* / cyclic* / int1* / int2* / uint2* / int4* / int8 / real*)HObject (byte* / direction* / cyclic* / int1* / int2* / uint2* / int4* / int8 / real*)Hobject (byte* / direction* / cyclic* / int1* / int2* / uint2* / int4* / int8 / real*) *計算デバイスに対して有効

入力画像

ImageInvertimageInvertimage_invert (output_object) (multichannel-)image(-array) → object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real)Hobject * (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real)

グレイ値を反転させた画像

例🔗

(HDevelop)


read_image(Orig,'fabrik')
invert_image(Orig,Invert)
dev_display(Invert)
(C)
read_image(&Orig,"fabrik")\;
invert_image(Orig,&Invert)\;
disp_image(Invert,WindowHandle)\;
(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\;
}

他のオペレーターとの組み合わせ🔗

組み合わせ

後処理の候補

watershedsWatersheds

他の選択候補

scale_imageScaleImage

関連項目

scale_imageScaleImage, add_imageAddImage, sub_imageSubImage

モジュール🔗

Foundation