Skip to content

Image Alignment

Image Alignment.

Public Functions

Type Name
int SaigeInitializeAlignModule (const int gpuIndex, const int sourceWidth, const int sourceHeight, const int targetWidth, const int targetHeight)
Function to activate the Saige Alignment function.
int SaigeFinalizeAlignModule ()
Function to terminate the Saige Alignment function. Releases the GPU memory used by the function.
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)
Function to adjust the position of the Source image to match the Target image.
int SaigeAlignImageFromFile (const char * sourceImagePath, const char * targetImagePath, int * cropWidth, int * cropHeight, int * cropChannel, unsigned char * croppedSourceImage)
Not Implemented.

Public Functions Documentation

SaigeInitializeAlignModule

Function to activate the Saige Alignment function.

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

The Alignment function adjusts the position of the Source image to match the Target image and Crop it. Therefore, the Source image must be larger than the Target image.

Parameters:

  • gpuIndex This function uses the GPU, and is the index of the GPU to use.
  • sourceWidth
  • sourceHeight
  • targetWidth
  • targetHeight

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeFinalizeAlignModule

Function to terminate the Saige Alignment function. Releases the GPU memory used by the function.

int SaigeFinalizeAlignModule () 

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeAlignImageFromByteArray

Function to adjust the position of the Source image to match the Target image.

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
) 

The croppedSourceImage should be targetWidth * targetHeight * sourceChannel

Parameters:

  • sourceImage The byte array of the Source image.
  • sourceWidth The width of the Source image.
  • sourceHeight The height of the Source image.
  • sourceChannel The channel of the Source image.
  • targetImage The byte array of the Target image.
  • targetWidht The width of the Target image.
  • targetHeight The height of the Target image.
  • targetChannel The channel of the Target image.
  • flag Whether to detect the edges of the cropped Source image.
  • croppedSourceImage The byte array of the cropped Source image.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

SaigeAlignImageFromFile

Not Implemented.

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