콘텐츠로 이동

이미지 정렬 기능

이미지 정렬 기능

Public Functions

Type Name
int SaigeInitializeAlignModule (const int gpuIndex, const int sourceWidth, const int sourceHeight, const int targetWidth, const int targetHeight)
Saige Alignment 기능을 활성화하는 함수입니다.
int SaigeFinalizeAlignModule ()
Saige Alignment 기능을 종료하는 함수입니다. 기능에 사용된 GPU 메모리를 해제합니다.
int SaigeAlignImageFromByteArray (const unsigned char * sourceImage, const int sourceWidth, const int sourceHeight, const int sourceChannel, const unsigned char * targetImage, const int targetWidht, const int targetHeight, const int targetChannel, unsigned int flag, unsigned char * croppedSourceImage)
Source 이미지를 Target 이미지에 맞게 위치를 조정하여 Crop하는 함수입니다.
int SaigeAlignImageFromFile (const char * sourceImagePath, const char * targetImagePath, int * cropWidth, int * cropHeight, int * cropChannel, unsigned char * croppedSourceImage)
Not Implemented.

Public Functions Documentation

SaigeInitializeAlignModule

Saige Alignment 기능을 활성화하는 함수입니다.

int SaigeInitializeAlignModule (
    const int gpuIndex,
    const int sourceWidth,
    const int sourceHeight,
    const int targetWidth,
    const int targetHeight
) 

Alignment 기능은 Source 이미지를 Target 이미지에 맞게 위치를 조정하여 Crop하는 기능입니다. 따라서, Source 이미지가 Target 이미지보다 크기가 커야 합니다.

Parameters:

  • gpuIndex GPU를 사용하는 기능이며, 사용할 GPU의 인덱스입니다.
  • sourceWidth
  • sourceHeight
  • targetWidth
  • targetHeight

Returns:

errorCode 정상 작동 시 0을 리턴하고, 에러 발생 시 에러코드를 리턴합니다.

SaigeFinalizeAlignModule

Saige Alignment 기능을 종료하는 함수입니다. 기능에 사용된 GPU 메모리를 해제합니다.

int SaigeFinalizeAlignModule () 

Returns:

errorCode 정상 작동 시 0을 리턴하고, 에러 발생 시 에러코드를 리턴합니다.

SaigeAlignImageFromByteArray

Source 이미지를 Target 이미지에 맞게 위치를 조정하여 Crop하는 함수입니다.

int SaigeAlignImageFromByteArray (
    const unsigned char * sourceImage,
    const int sourceWidth,
    const int sourceHeight,
    const int sourceChannel,
    const unsigned char * targetImage,
    const int targetWidht,
    const int targetHeight,
    const int targetChannel,
    unsigned int flag,
    unsigned char * croppedSourceImage
) 

Source 이미지가 Target 이미지에 맞게 가로, 세로가 Crop되기 때문에 croppedSourceImage의 크기는 targetWidth * targetHeight * sourceChannel이어야 합니다.

Parameters:

  • sourceImage Source 이미지의 바이트 배열입니다.
  • sourceWidth Source 이미지의 너비입니다.
  • sourceHeight Source 이미지의 높이입니다.
  • sourceChannel Source 이미지의 채널입니다.
  • targetImage Target 이미지의 바이트 배열입니다.
  • targetWidht Target 이미지의 너비입니다.
  • targetHeight Target 이미지의 높이입니다.
  • targetChannel Target 이미지의 채널입니다.
  • flag Crop된 Source 이미지의 테두리를 검출할지 여부입니다.
  • croppedSourceImage Crop된 Source 이미지의 바이트 배열입니다.

Returns:

errorCode 정상 작동 시 0을 리턴하고, 에러 발생 시 에러코드를 리턴합니다.

SaigeAlignImageFromFile

Not Implemented.

int SaigeAlignImageFromFile (
    const char * sourceImagePath,
    const char * targetImagePath,
    int * cropWidth,
    int * cropHeight,
    int * cropChannel,
    unsigned char * croppedSourceImage
)