• Getting Started
  • Api Documentation
  • Release Notes
Show / Hide Table of Contents
  • Installation
  • Photometric Stereo
  • Find Circle
  • Find Line
  • Image Synthesis

SaigeVision ImageProcess Quick Start - Image Synthesis

이 문서는 ImageProcess 기능 중 Image Synthesis 에 대해서 사용하는 방법에 대해 설명합니다

기능 소개

Image Synthesis 은 이미지 합성을 통해 나타나는 이미지입니다. 두장의 이미지를 통하여 합성 후 하나의 이미지를 확인할 수 있습니다.

API Detail

아래는 ‘Image Synthesis’ 을 설명하기 위한 샘플 코드 입니다.

List<Bitmap> _images = new List<Bitmap>();
string path = @"..\..\images";
_images.Add(new Bitmap(Path.Combine(path, "SampleA.bmp")));
_images.Add(new Bitmap(Path.Combine(path, "SampleB.bmp")));

ImageSynthesis synthesis = new ImageSynthesis();
synthesis.SetImage(_images[0], _images[1]);

var option = synthesis.GetOptions();
option.SynthesisFlags = SynthesisFlags.BOUNDED;
synthesis.SetOptions(option);

synthesis.Inspection();
var result = synthesis.GetResult();

Bitmap bmp = synthesis.GetResultImage();

synthesis.Dispose();

Inspection


ImageSynthesis 사용하기 위한 초기화 함수입니다.

SetImage 를 통해 합성할 이미지에 대해서 설정을 합니다.

GetOptions 를 통하여 설정값을 가져오고 SetOptions 로 변경된 값을 적용합니다

  • SynthesisFlags: 이미지 합성 방법을 선택할 수 있습니다. 아래설명에서는 SetImage 에서 첫번째 param: A, 두번째 param: B, 결과물을 C로 정합니다.
    • BOUNDED: A + B = C, if(C >= 255){C = 255}
    • WRAP: A + B = C, if(C > 255){C = C - 255}
    • SHIFT: (A + B) / 2 = C
    • SUBTRACT: A - B = C
    • ABS_DIFF: |A - B| = C
    • MAX: max(A, B) = C
    • MIN: min(A, B) = C

이후 Inspeciton 을 통해 검사 후 GetResult 를 통해 최종 결과를 받아옵니다.

최종 결과물은 bitmap 이미지로 확인할 수 있습니다.

ImageSynthesis synthesis = new ImageSynthesis();
synthesis.SetImage(_images[0], _images[1]);

var option = synthesis.GetOptions();
option.SynthesisFlags = SynthesisFlags.BOUNDED;
synthesis.SetOptions(option);

synthesis.Inspection();
var result = synthesis.GetResult();

Bitmap bmp = synthesis.GetResultImage();

모든 검사가 완료되었다면 Dispose 를 통해 메모리를 해제해 줍니다.

synthesis.Dispose();
  • Improve this Doc
In This Article
Back to top Generated by DocFX