NNEngine
|
Static Public Member Functions | |
static void | getImageSize (UTexture *inputTexture, FVector2D &dimensions) |
static bool | isExternal (UTexture *texture) |
static void | getInverseAffineMatFrom2Points (const FVector2D ¢er, const FVector2D &topCenter, const float &scalingFactor, FAffineMat2D &out_inverseAffineMat) |
static void | getInverseAffineMat (const FVector2D ¢er, const FVector2D &orientation, const float &size, FAffineMat2D &out_inverseAffineMat) |
static void | correctAspectRatio (const FVector2D &uvScalingFactor, const FAffineMat2D &affineMat, FAffineMat2D &correctedAffineMat) |
static FVector2D | affineTransformPoint (const FAffineMat2D &affineMat, const FVector2D &point) |
static void | affineTransformPoints (const TArray< FVector2D > &in_points, TArray< FVector2D > &out_points, const FAffineMat2D affineMat) |
static void | showImageWith2dPoints (const TArray< uint8 > &rawDataHxWxBGR, const TArray< FVector2D > &overlayPoints, const int imageWidth, const int imageHeight, const int windowSize=700, const FString windowTitle="Debug", const bool denormalizePoints=true) |
static void | showImageWith3dPoints (const TArray< uint8 > &rawDataHxWxBGR, const TArray< FVector > &overlayPoints, const int imageWidth, const int imageHeight, const int windowSize=700, const FString windowTitle="Debug", const bool denormalizePoints=true) |
static void | showImage (const TArray< uint8 > &rawDataHxWxBGR, const int imageWidth, const int imageHeight, const int windowSize=700, const FString windowTitle="Debug") |
static void | showImageFloat (const TArray< float > &rawDataHxWxBGR, const int imageWidth, const int imageHeight, const int windowSize=700, const FString windowTitle="Debug") |
static void | convertToIntImage (UPARAM(ref) TArray< uint8 > &in_rawDataHxWxBGR, TArray< int > &out_rawDataHxWxBGR, const int imageWidth, const int imageHeight) |
static void | normalizeFloatArray (UPARAM(ref) TArray< float > &in_data, TArray< float > &out_data, const float bias=0.0f, const float scalingFactor=1.0f) |
static void | normalizeFloatArrayWith3Channels (UPARAM(ref) TArray< float > &in_data, TArray< float > &out_data, const FVector bias=FVector::ZeroVector, const FVector scalingFactor=FVector(1.0f, 1.0f, 1.0f), const bool isCHW=true) |
static UTexture2D * | CreateTexture2d_Gray_Byte (const int32 width, const int32 height) |
static UTexture2D * | CreateTexture2d_Gray_Float (const int32 width, const int32 height) |
static UTexture2D * | CreateTexture2d_BGRA_Byte (const int32 width, const int32 height) |
static UTexture2D * | CreateTexture2d_RGBA_Float (const int32 width, const int32 height) |
static void | CopyByteArrayToTexture2D (const TArray< uint8 > &source_data, UPARAM(ref) UTexture2D *destination_texture2D, const bool useMultiThread=true) |
static void | CopyFloatArrayToTexture2D (const TArray< float > &source_data, UPARAM(ref) UTexture2D *destination_texture2D, const bool useMultiThread=true) |
static void | CopyByteArrayToTexture2D_RGB_To_BGRA (const TArray< uint8 > &source_data, UPARAM(ref) UTexture2D *destination_texture2D, const bool useMultiThread=true, const bool CHW_to_HWC=true) |
static void | CopyFloatArrayToTexture2D_RGB_To_RGBA (const TArray< float > &source_data, UPARAM(ref) UTexture2D *destination_texture2D, const bool useMultiThread=true, const bool CHW_to_HWC=true) |
static void | multiplyAffineTransformMatrices (const FAffineMat2D &affineMat_A, const FAffineMat2D &affineMat_B, FAffineMat2D &affineMat_C) |
Blueprint-callable static function library for image processing
|
static |
Affine transform a point
affineMat | Input matrix which represents affine transform |
point | Point to be transformed |
|
static |
Affine transform points
in_points | Points to be transformed |
out_points | Transformed points |
affineMat | Input matrix which represents affine transform |
|
static |
Convert image from byte array to integer array. Works only when CustomizedOpenCv module is enabled.
in_rawDataHxWxBGR | Input image as an array of bytes whose length is (imageHeight x imageWidth x 3(BGR)). |
out_rawDataHxWxBGR | Output image as an array of 32-bit integers whose length is (imageHeight x imageWidth x 3(BGR)). |
imageWidth | The width of the image |
imageHeight | The height of the image |
|
static |
Fill Texture2D data by byte array.
source_data | Input data copied to texture |
destination_texture2D | Texture to be filled |
useMultiThread | Whether to use multithread to copy the data |
|
static |
Fill Texture2D data by byte array while converting CHW-RGB format to HWC-BGRA format.
source_data | Input data copied to texture. (Channel x Height x Width), RGB format. |
destination_texture2D | Texture to be filled. (Width x Height x Channel), BGRA format. |
useMultiThread | Whether to use multithread to copy the data |
CHW_to_HWC | Whether to convert the image from (Channel x Height x Width) to (Width x Height x Channel) format. If false, the input data is assumed to be in (Width x Height x Channel) format. |
|
static |
Fill Texture2D data by float array.
source_data | Input data copied to texture |
destination_texture2D | Texture to be filled |
useMultiThread | Whether to use multithread to copy the data |
|
static |
Fill Texture2D data by float array while converting RGB format to BGRA format.
source_data | Input data copied to texture. (Channel x Height x Width), RGB format. |
destination_texture2D | Texture to be filled. (Width x Height x Channel), RGBA format. |
useMultiThread | Whether to use multithread to copy the data |
CHW_to_HWC | Whether to convert the image from (Channel x Height x Width) to (Width x Height x Channel) format. If false, the input data is assumed to be in (Width x Height x Channel) format. |
|
static |
Convert the matrix of affine transform which was calculated in the scaled UV space which keeps the image's aspect ratio to the matrix in the original UV space.
uvScalingFactor | The scaling factor of the UV of the image to keep the aspect ratio of the image. X = 1 and Y > 1 for a landscape image. X > 1 and Y = 1 for a portrait image. |
affineMat | Input matrix |
correctedAffineMat | Output matrix |
|
static |
Create Texture2D with 4(BGRA) color channel of byte
width | Texture width |
height | Texture height |
|
static |
Create Texture2D with one color channel of byte
width | Texture width |
height | Texture height |
|
static |
Create Texture2D with one color channel of float32
width | Texture width |
height | Texture height |
|
static |
Create Texture2D with 4(ABGR) color channel of float32
width | Texture width |
height | Texture height |
|
static |
Get the width and the height of a texture
inputTexture | Input image |
dimensions | Width and height |
|
static |
Calculate the matrix of affine transform to crop image
center | The center of the image after cropping |
orientation | The normalized vector from the center of the top edge of the image after cropping to the center of the image after cropping. For example, (0, 1) means no rotation, (1, 0) means 90 degree rotation. |
size | The side length of cropped square image |
out_inverseAffineMat | The matrix which transforms the cropped image to the original image |
|
static |
Calculate the matrix of affine transform to crop image
center | The center of the image after cropping |
topCenter | The center of the top edge of the image after cropping |
scalingFactor | The scaling factor of the cropping. |
out_inverseAffineMat | The matrix which transforms the cropped image to the original image |
|
static |
Check if the sampler type of the texture is "External"
Texture | Input texture |
|
static |
C * x = B * ( A * x )
|
static |
Add and multiply values to float array. out_data = scalingFactor * (in_data + bias)
in_data | Input float array. |
out_data | Output float array. |
bias | The value added to each array element. For example, if this value is -0.5, data in [0.0, 1.0] is converted to [-0.5, 0.5]. This addition is performed before the multiplication of the scalingFactor. |
scalingFactor | The value multiplied to each array element. For example, if this value is 2.0, data in [0, 1.0] is converted to [0.0, 2.0]. This multiplication is performed after the addition of the bias. |
|
static |
Add and multiply values to float array. The data is assumed to have 3 channels in (Channel x Height x Width) format or (Width x Height x Channel) format. out_data = scalingFactor * (in_data + bias)
in_data | Input float array. |
out_data | Output float array. |
bias | The value added to each array element. XYZ corresponds to 3 channels of the data. |
scalingFactor | The value multiplied to each array element. XYZ corresponds to 3 channels of the data. |
isCHW | Whether the input data is in (Channel x Height x Width) format or (Width x Height x Channel) format. |
|
static |
Visualize the image. Works only on Windows and when CustomizedOpenCv module is enabled.
rawDataHxWxBGR | Input image as an array of byte whose length is (imageHeight x imageWidth x 3(BGR)). |
imageWidth | The width of the input image |
imageHeight | The height of the input image |
windowSize | The size of the output window |
windowTitle | The title of the output window |
|
static |
Visualize the image. Works only on Windows and when CustomizedOpenCv module is enabled.
rawDataHxWxBGR | Input image as an array of float whose length is (imageHeight x imageWidth x 3(BGR)). |
imageWidth | The width of the input image |
imageHeight | The height of the input image |
windowSize | The size of the output window |
windowTitle | The title of the output window |
|
static |
Visualize the image while overlaying points. Works only on Windows and when CustomizedOpenCv module is enabled.
rawDataHxWxBGR | Input image as an array of bytes whose length is (imageHeight x imageWidth x 3(BGR)). |
overlayPoints | Points to be drawn on the input image |
imageWidth | The width of the input image |
imageHeight | The height of the input image |
windowSize | The size of the output window |
windowTitle | The title of the output window |
denormalizePoints | Whether to multiply the image width and height to the point coordinates |
|
static |
Visualize the image while overlaying points. Works only on Windows and when CustomizedOpenCv module is enabled.
rawDataHxWxBGR | Input image as an array of bytes whose length is (imageHeight x imageWidth x 3(BGR)). |
overlayPoints | Points to be drawn on the input image |
imageWidth | The width of the input image |
imageHeight | The height of the input image |
windowSize | The size of the output window |
windowTitle | The title of the output window |
denormalizePoints | Whether to multiply the image width and height to the point coordinates |