19#ifdef SB_ENABLE_DL_RESERVED_PAR
33#define SB_ENABLE_TENSORFLOW
5444#ifndef INCLUDE_SB_H_
5445#define INCLUDE_SB_H_
5451# define SB_EXTERN_C extern "C"
5453# define SB_EXTERN_C extern
5457# define SB_CDECL __cdecl
5464# ifdef SB_API_EXPORTS
5465# define SB_EXPORTS __declspec(dllexport)
5466# define SB_DL_EXPORTS __declspec(dllimport)
5468# define SB_EXPORTS __declspec(dllimport)
5471# ifdef SB_API_EXPORTS
5472# define SB_EXPORTS __attribute__ ((visibility ("default")))
5473# define SB_DL_EXPORTS __attribute__ ((visibility ("default")))
5478# define SB_PUBLIC(return_type) SB_EXTERN_C SB_EXPORTS return_type SB_CDECL
5479# define SB_DL_PUBLIC(return_type) SB_EXTERN_C SB_DL_EXPORTS return_type SB_CDECL
5482# ifdef SB_DL_API_EXPORTS
5483# define SB_DL_EXPORTS __declspec(dllexport)
5485# define SB_DL_EXPORTS __declspec(dllimport)
5488# ifdef SB_DL_API_EXPORTS
5489# define SB_DL_EXPORTS __attribute__ ((visibility ("default")))
5491# define SB_DL_EXPORTS
5494# define SB_PUBLIC(return_type) SB_EXTERN_C return_type SB_CDECL
5495# define SB_DL_PUBLIC(return_type) SB_EXTERN_C SB_DL_EXPORTS return_type SB_CDECL
5498#if defined __cplusplus
5499# define SB_INLINE inline
5501# define SB_INLINE static __inline
5952#define SB_INIT_ONLY_HW_LICENSE_KEY "ONLY_HW_KEY"
5958#define SB_INIT_ONLY_SB_LICENSE_KEY "ONLY_SB_KEY"
5964#define SB_INIT_NO_LICENSE_KEY "NO_KEY"
5971#define SB_DELIMITER ";"
6067 version.
major = major;
6068 version.
minor = minor;
6135 char compute_capability[8];
6182 char version_str[16];
6183 char compile_date[32];
6184 char compile_time[32];
6261#define SB_VALUE_NOT_SET 1000000.0f
6262#define SB_PAR_MODELS_NUM 64
6263#define SB_PAR_PERTURBATIONS_NUM 16
6264#define SB_PAR_STRING_LEN 64
6265#define SB_IMAGE_NAME_STRING_LEN 128
6266#define SB_PAR_LEVELS_NUM 32
6267#define SB_PAR_LEVEL_SCALE_GRANULARITY 0.50f
6268#define SB_PAR_LEVEL_SCALE_MIN 1.0f
6269#define SB_PAR_LEVEL_SCALE_MAX 16.0f
6270#define SB_PAR_RETINA_OBJ_SIZE_MIN 24
6271#define SB_PAR_RETINA_OBJ_SIZE_MAX 1024
6272#define SB_PAR_RETINA_OBJ_STRIDE_COARSE_MIN 4
6273#define SB_PAR_RETINA_OBJ_STRIDE_COARSE_MAX 32
6274#define SB_PAR_RETINA_OBJ_STRIDE_FINE_MIN 1
6275#define SB_PAR_RETINA_OBJ_STRIDE_FINE_MAX 8
6276#define SB_PAR_RETINA_OBJ_DISTANCE_MIN 4
6277#define SB_PAR_RETINA_NUM_OCCURRENCES_MIN -1
6279#define SB_SAMPLE_SCALE_GRANULARITY 0.25f
6280#define SB_SAMPLE_SCALE_MIN 1.0f
6281#define SB_SAMPLE_SCALE_MAX 32.0f
6283#define SB_SVL_DL_BATCH_SIZE_MIN 4
6284#define SB_SVL_DL_BATCH_SIZE_MAX 512
6286#define SB_SVL_DL_VALIDATION_PERCENTAGE_MIN 0.0f
6287#define SB_SVL_DL_VALIDATION_PERCENTAGE_MAX 0.5f
6289#define SB_SVL_DL_LEARNING_RATE_MIN 0.000001f
6290#define SB_SVL_DL_LEARNING_RATE_MAX 0.01f
6291#define SB_SVL_DL_LEARNING_RATE_DEFAULT 0.001f
6293#define SB_SVL_DL_TILE_FACTOR_MIN 1
6294#define SB_SVL_DL_TILE_FACTOR_MAX 64
6296#define SB_SVL_DL_FEATURES_MULTIPLIER_MIN 0.5f
6297#define SB_SVL_DL_FEATURES_MULTIPLIER_MAX 1.5f
6298#define SB_SVL_DL_FEATURES_MULTIPLIER_GRANULARITY 0.1f
6299#define SB_SVL_DL_FEATURES_MULTIPLIER_DEFAULT 1.0f
6301#define SB_SVL_DL_SCALE_MIN 1.0f
6302#define SB_SVL_DL_SCALE_MAX 16.0f
6303#define SB_SVL_DL_SCALE_GRANULARITY 0.01f
6305#define SB_SVL_DL_PERTURBATION_SHIFT_MIN 0.0f
6306#define SB_SVL_DL_PERTURBATION_SHIFT_MAX 0.5f
6308#define SB_SVL_DL_PERTURBATION_STRETCH_CONTRAST_MIN 0.0f
6309#define SB_SVL_DL_PERTURBATION_STRETCH_CONTRAST_MAX 0.5f
6311#define SB_SVL_DL_PERTURBATION_DELTA_BRIGHTNESS_MIN 0.0f
6312#define SB_SVL_DL_PERTURBATION_DELTA_BRIGHTNESS_MAX 0.5f
6320#define SB_SURFACE_OPTIONAL_GRAY_LEVEL 128
6945#define SB_LICENSE_VENDOR_CODE_SIZE 32
6954 char company_role[128];
6957 char operating_system[128];
6960 char sector_of_interest[1024];
6963 char machine_id[36];
7135#define SB_LUT_POINT_NOT_EXIST 0xFFFF
7243#define SB_IMAGE_FILE_EXTENSIONS "pgm" SB_DELIMITER \
7244 "ppm" SB_DELIMITER \
7245 "bmp" SB_DELIMITER \
7246 "png" SB_DELIMITER \
7247 "tif" SB_DELIMITER \
7248 "tiff" SB_DELIMITER \
7249 "jpeg" SB_DELIMITER \
7335#ifdef SB_PUBLIC_INTERNAL_ENABLE
7733 unsigned char lut[256];
8573 unsigned char lut[256];
8890#define SB_PROJECTS_NUM 32
8891#define SB_PROJECT_UUID_LEN 36
8901 char uuid[SB_PROJECT_UUID_LEN];
8925#define SB_SOLUTION_EXT "rprj"
9028#ifdef SB_ENABLE_TENSORFLOW
9029 SB_PROJECT_MODE_NO_DETECTION
9371#define SB_PAR_FEATURES_NAMES_LEN 256
9521 SB_NETWORK_TYPE_NONE = 0,
9552#ifdef NEW_VERSION_DEEP_SURFACE_UNET
9557 SB_NETWORK_TYPE_UNET_256 = 130,
9773 char inpainter_path[512];
9859#define SB_DL_WEIGHTS_EXT "weights"
9874 char network_path[512];
10088#define SB_DEVICES_MAX_NUMBER 4
10145 char project_path[512];
10153 char image_ext[64];
11918#define SB_IMAGE_INFO_EXT "rtn"
12476 char file_name[2][512];
12480 int sample_index[2];
12486#define SB_CLS_0 "cls0"
12487#define SB_CLS_1 "cls1"
12493#define SB_FEATURE_0A "0A"
12494#define SB_FEATURE_0B "0B"
12495#define SB_FEATURE_0A_RI "0A_RI"
12496#define SB_FEATURE_0B_RI "0B_RI"
12497#define SB_FEATURE_2A "2A"
12498#define SB_FEATURE_2B "2B"
12499#define SB_FEATURE_2C "2C"
12500#define SB_FEATURE_2D "2D"
12501#define SB_FEATURE_2A_R "2A.R"
12502#define SB_FEATURE_2AA_R "2AA.R"
12503#define SB_FEATURE_2B_R "2B.R"
12504#define SB_FEATURE_2C_R "2C.R"
12505#define SB_FEATURE_2D_R "2D.R"
12506#define SB_FEATURE_2A_G "2A.G"
12507#define SB_FEATURE_2AA_G "2AA.G"
12508#define SB_FEATURE_2B_G "2B.G"
12509#define SB_FEATURE_2C_G "2C.G"
12510#define SB_FEATURE_2D_G "2D.G"
12511#define SB_FEATURE_2A_B "2A.B"
12512#define SB_FEATURE_2AA_B "2AA.B"
12513#define SB_FEATURE_2B_B "2B.B"
12514#define SB_FEATURE_2C_B "2C.B"
12515#define SB_FEATURE_2D_B "2D.B"
12516#define SB_FEATURE_2A_RI "2A_RI"
12517#define SB_FEATURE_2B_RI "2B_RI"
12518#define SB_FEATURE_2C_RI "2C_RI"
12519#define SB_FEATURE_2A_RI_R "2A_RI.R"
12520#define SB_FEATURE_2AA_RI_R "2AA_RI.R"
12521#define SB_FEATURE_2B_RI_R "2B_RI.R"
12522#define SB_FEATURE_2C_RI_R "2C_RI.R"
12523#define SB_FEATURE_2A_RI_G "2A_RI.G"
12524#define SB_FEATURE_2AA_RI_G "2AA_RI.G"
12525#define SB_FEATURE_2B_RI_G "2B_RI.G"
12526#define SB_FEATURE_2C_RI_G "2C_RI.G"
12527#define SB_FEATURE_2A_RI_B "2A_RI.B"
12528#define SB_FEATURE_2AA_RI_B "2AA_RI.B"
12529#define SB_FEATURE_2B_RI_B "2B_RI.B"
12530#define SB_FEATURE_2C_RI_B "2C_RI.B"
12531#define SB_FEATURE_3A "3A"
12532#define SB_FEATURE_3B "3B"
12533#define SB_FEATURE_3C "3C"
12534#define SB_FEATURE_3D "3D"
12535#define SB_FEATURE_3E "3E"
12536#define SB_FEATURE_4A "4A"
12540#define SB_FEATURES SB_FEATURE_0A SB_DELIMITER \
12541 SB_FEATURE_0B SB_DELIMITER \
12542 SB_FEATURE_0A_RI SB_DELIMITER \
12543 SB_FEATURE_0B_RI SB_DELIMITER \
12544 SB_FEATURE_2A SB_DELIMITER \
12545 SB_FEATURE_2A_R SB_DELIMITER \
12546 SB_FEATURE_2A_G SB_DELIMITER \
12547 SB_FEATURE_2A_B SB_DELIMITER \
12548 SB_FEATURE_2AA_R SB_DELIMITER \
12549 SB_FEATURE_2AA_G SB_DELIMITER \
12550 SB_FEATURE_2AA_B SB_DELIMITER \
12551 SB_FEATURE_2B SB_DELIMITER \
12552 SB_FEATURE_2B_R SB_DELIMITER \
12553 SB_FEATURE_2B_G SB_DELIMITER \
12554 SB_FEATURE_2B_B SB_DELIMITER \
12555 SB_FEATURE_2C SB_DELIMITER \
12556 SB_FEATURE_2C_R SB_DELIMITER \
12557 SB_FEATURE_2C_G SB_DELIMITER \
12558 SB_FEATURE_2C_B SB_DELIMITER \
12559 SB_FEATURE_2D SB_DELIMITER \
12560 SB_FEATURE_2D_R SB_DELIMITER \
12561 SB_FEATURE_2D_G SB_DELIMITER \
12562 SB_FEATURE_2D_B SB_DELIMITER \
12563 SB_FEATURE_2A_RI SB_DELIMITER \
12564 SB_FEATURE_2A_RI_R SB_DELIMITER \
12565 SB_FEATURE_2A_RI_G SB_DELIMITER \
12566 SB_FEATURE_2A_RI_B SB_DELIMITER \
12567 SB_FEATURE_2AA_RI_R SB_DELIMITER \
12568 SB_FEATURE_2AA_RI_G SB_DELIMITER \
12569 SB_FEATURE_2AA_RI_B SB_DELIMITER \
12570 SB_FEATURE_2B_RI SB_DELIMITER \
12571 SB_FEATURE_2B_RI_R SB_DELIMITER \
12572 SB_FEATURE_2B_RI_G SB_DELIMITER \
12573 SB_FEATURE_2B_RI_B SB_DELIMITER \
12574 SB_FEATURE_2C_RI SB_DELIMITER \
12575 SB_FEATURE_2C_RI_R SB_DELIMITER \
12576 SB_FEATURE_2C_RI_G SB_DELIMITER \
12577 SB_FEATURE_2C_RI_B SB_DELIMITER \
12578 SB_FEATURE_3A SB_DELIMITER \
12579 SB_FEATURE_3B SB_DELIMITER \
12580 SB_FEATURE_3C SB_DELIMITER \
12581 SB_FEATURE_3D SB_DELIMITER \
12582 SB_FEATURE_3E SB_DELIMITER \
12785 char classificator[32];
12852#define SB_SVL_STEP_INITIALIZATION "initializing data for svl"
12853#define SB_SVL_STEP_SEARCHING_RECIPE "choosing recipe"
12854#define SB_SVL_STEP_TRAINING_RECIPE "training recipe"
12855#define SB_SVL_STEP_FINALIZATION "finalization of svl"
12856#define SB_SVL_STEP_FINISHED "svl has finished"
sb_t_err sb_blobs_plot_roi(const sb_t_blobs *const blobs, sb_t_roi *const roi, unsigned char gl)
Prints the blobs on the roi.
sb_t_err sb_blob_format_par(const sb_t_blob_par *const par, char *const str, int str_size)
Formats the blob analysis parameters structure.
sb_t_blob_distance_mode
Enumerates the algorithm for calculating the distance between blobs.
sb_t_blob_deleted
Defines the deleted blob.
sb_t_err sb_blob_plot_roi(const sb_t_blob *const blob, sb_t_roi *const roi, unsigned char gl)
Prints the blob on the roi.
sb_t_pixel_connection
Defines the pixel connection.
sb_t_err sb_blobs_destroy(sb_t_blobs **const blobs)
Destroys the blobs structure.
sb_t_err sb_blob_copy(sb_t_blob *const dst, const sb_t_blob *const src)
Blob copy.
sb_t_err sb_blob_init_par(sb_t_blob_par *const par)
Initializes the fields of the structure.
sb_t_err sb_blobs_clone(sb_t_blobs **const dst, const sb_t_blobs *const src)
Blobs structure clone.
sb_t_err sb_blob_destroy(sb_t_blob *const blob)
Destroys the blob.
sb_t_err sb_blob_intersect(const sb_t_blob *const blob1, const sb_t_blob *const blob2, int extract_blob_seg, sb_t_blob **const res)
Blob intersection.
sb_t_err sb_blobs_create(sb_t_blobs **const blobs)
Creates the blobs structure.
sb_t_err sb_blobs_detection(sb_t_blobs **const blobs, const sb_t_image *const image, const sb_t_roi *const roi, const sb_t_blob_par *const par, sb_t_image_circularity_type circularity_type)
Blob analysis.
@ SB_BLOB_DISTANCE_MODE_CONTOUR
The distance between blobs is calculated using the contour.
@ SB_BLOB_DISTANCE_MODE_BOUNDING_BOX
The distance between blobs is calculated using the unrotated bounding box.
@ SB_BLOB_OK
Blob is not deleted.
@ SB_BLOB_DELETED_AFTER_MERGE
Blob is deleted after merge.
@ SB_BLOB_DELETED_BEFORE_MERGE
Blob is deleted before merge.
@ SB_PIXEL_CONNECTION_8
8 connection. 8-connected pixels are neighbors to every pixel that touches one of their edges or corn...
@ SB_PIXEL_CONNECTION_4
4 connection.
sb_t_err
Errors code enum.
const char * sb_err_format(sb_t_err code)
Returns the error message.
sb_t_err sb_trace(int trace_enable, int date_time_enable, int line_enable, int trace_win_enable, const char *const filename, sb_fp_trace_callback trace_callback)
Sets the options for the messages trace.
void(* sb_fp_trace_callback)(const char *const msg)
Definition of the callback for message trace.
@ SB_ERR_SVL_VALIDATION_DATASET
The SVL images dataset is too small to extract a validation dataset.
@ SB_ERR_IMAGE_CREATE
An error occurred creating the image.
@ SB_ERR_FILE_READ
An error occurred reading the file.
@ SB_ERR_MACHINE_ID
Machine id has a wrong format.
@ SB_ERR_LICENSE_MACHINE_ID_MATCH
Machine id doesn't match.
@ SB_ERR_IMAGE_WARP
Image warp function returns an error.
@ SB_ERR_FILE_WRITE
An error occurred writing the file.
@ SB_ERR_PATH_SIZE
the path name exceeds the maximum size
@ SB_ERR_SOCKET_CREATE
An error occurred creating the socket.
@ SB_ERR_IMAGE_FORMAT
The image format is wrong.
@ SB_ERR_MODEL_NOT_TRAINED
The model is not trained.
@ SB_ERR_LICENSE_NOT_FOUND
License key not found.
@ SB_ERR_IMAGE_DEPTH
The image has a wrong bit depth.
@ SB_ERR_FILE_COPY
Error copying a file.
@ SB_ERR_DL_INPAINTER_NOT_ASSIGNED
Deep Learning inpainter network path is not assigned.
@ SB_ERR_VERSION
Unmanaged version.
@ SB_ERR_MODEL_DISABLED
A model is disabled.
@ SB_ERR_SAMPLE_NOT_FOUND
No sample found.
@ SB_ERR_IMAGE_RESIZE
Image resize function returns an error.
@ SB_ERR_MODEL_NAME
There are two models with the same name.
@ SB_ERR_LICENSE_VERSION
License is incompatible with the library version.
@ SB_ERR_IMAGE_DECODE
An error occurred decoding image.
@ SB_ERR_SVL_CHOOSE_FEATURES_FAST
Choose features failed to find a common combination for fast.
@ SB_ERR_MODEL_NOT_FOUND
The model of the sample is unknown or not assigned.
@ SB_ERR_IMAGE_CHANNELS
The image has a wrong number of channels.
@ SB_ERR_SAMPLE_BACKGROUND
Too few background samples to execute the training. Increase the analysis ROI or reduce the scale.
@ SB_ERR_SOCKET_INVALID_IP
IP address is invalid.
@ SB_ERR_FILE_REMOVE
Error removing a file.
@ SB_ERR_SOCKET_INVALID_PORT
Port isn't a valid number.
@ SB_ERR_FILE_VERSION
The file has no version.
@ SB_ERR_LIBRARY_DEPENDENCIES
Library dependencies not satisfied to execute the requested operation.
@ SB_ERR_SOCKET_LISTEN
Socket listen function has returned an error.
@ SB_ERR_SAMPLE_DISTANCE
There are two samples closer than the minimum distance set.
@ SB_ERR_ENCRYPT
An error occurred encrypting data.
@ SB_ERR_DIR_REMOVE
An error occurred removing the folder.
@ SB_ERR_DL_NETWORK_FILE_NOT_FOUND
Deep Learning Network file not found.
@ SB_ERR_LICENSE_EXPIRED
License is expired.
@ SB_ERR_SOCKET_SELECT
Socket select function has returned an error.
@ SB_ERR_SOCKET_SEND
Socket send function has returned an error.
@ SB_ERR_DECRYPT
An error occurred decrypting data.
@ SB_ERR_SVL_WAS_NOT_DONE
The SVL wasn't done.
@ SB_ERR_FILE_EMPTY
File is empty.
@ SB_ERR_DIR_NOT_EXIST
The directory doesn't exist.
@ SB_ERR_SOCKET_SET_PARAMETER
Set socket parameter has returned an error.
@ SB_ERR_LICENSE_MODELS_NUMBER
Number of models is greater than the maximum allowed for the current license configuration.
@ SB_ERR_FILE_NAME_EMPTY
File name is empty.
@ SB_ERR_SOCKET_CONNECT
An error occurred connecting the socket.
@ SB_ERR_BUFFER_SIZE
The buffer has an insufficient size.
@ SB_ERR_LICENSE_SAME_MACHINE_ID
Two licences have the same machine id.
@ SB_ERR_IMAGE_LOAD
An error occurred loading the image.
@ SB_ERR_INTERNAL
Internal error.
@ SB_ERR_IMAGE_RESOLUTION
The image has a wrong resolution.
@ SB_ERR_DL_INTERNAL
Internal Deep Learning error.
@ SB_ERR_FILE_FORMAT
Wrong data file format.
@ SB_ERR_PROJECT_LOAD_MODE
The project was loaded with the wrong load parameter.
@ SB_ERR_SOCKET
A socket function has returned an error.
@ SB_ERR_INVALID_MAIL_ADDRESS
Mail address has a wrong format.
@ SB_ERR_NO_FILE_FOUND
No file found in the folder.
@ SB_ERR_SVL_PERTURBATION
A perturbation has not been defined properly.
@ SB_ERR_SOCKET_BIND
An error occurred binding the socket.
@ SB_ERR_SENTINEL_TOO_MANY_KEYS
Too many keys connected to the pc.
@ SB_ERR_LICENSE_DISABLED
License is disabled.
@ SB_ERR_MODELS_ENABLED
There are no models enabled.
@ SB_ERR_LICENSE_CORRUPTED
License file is corrupted.
@ SB_ERR_SENTINEL
Sentinel key returns an error.
@ SB_ERR_PROJECT_NOT_FOUND
Project not found.
@ SB_ERR_FILE_NAME
Wrong file name: too long or unknown extension.
@ SB_ERR_LIBRARY_FUNCTION_ADDRESS
Could not locate the function.
@ SB_ERR_LEVELS_NUMBER
There aren't levels, or the number of the levels isn't the expected one, or exceeded the maximum leve...
@ SB_ERR_FILE_EXTENSION
Wrong file extension.
@ SB_ERR_XML
Error parsing xml file.
@ SB_ERR_FILE_OPEN
An error occurred opening the file.
@ SB_ERR_SAMPLES_GT_TOO_MANY
Too many ground truth samples.
@ SB_ERR_IMAGE_CIRCULARITY
The image circularity type is wrong.
@ SB_ERR_IMAGE_SIZE
Image has a wrong data size.
@ SB_ERR_IMAGE_WIDTH_STEP
Image has a wrong width_step value.
@ SB_ERR_FILE_NAME_LENGHT
File name too long.
@ SB_ERR_CLS_CREATE
The function for the creation of the classifier has returned an error.
@ SB_ERR_STRUCT_HEADER_WRONG_VERSION
The version of the structure sb_t_struct_header is wrong.
@ SB_ERR_SAMPLE_WRONG
The sample has wrong data.
@ SB_ERR_DIR_EXIST
Checking the existence of the folder gave error.
@ SB_ERR_IMAGE_COMPRESSION
The image compression type is wrong.
@ SB_ERR_NO_POINT_FOUND
Point isn't found.
@ SB_ERR_IMAGE_TYPE
Unknown image type, should be a sb_t_image_info_type enum value.
@ SB_ERR_STRING_EMPTY
String empty.
@ SB_ERR_NO_FEATURES_AVAILABLE
No features available for the data set.
@ SB_ERR_PROJECT_TYPE
Wrong project type.
@ SB_ERR_LICENSE_WAIT_SERVER
Waiting to contact the license server.
@ SB_ERR_SVL_CHOOSE_FEATURES
Choose features failed to find a good combination.
@ SB_ERR_CLS
The function of a classifier has returned an error.
@ SB_ERR_INITIALIZE
You must call the initialize function.
@ SB_ERR_ROI
The ROI is wrong.
@ SB_ERR_LICENSE_FEATURES_NUMBER
Number of features is greater than the maximum allowed for the current license configuration.
@ SB_ERR_LIBRARY_OPEN
Could not load the dynamic library or the shared object.
@ SB_ERR_WARP_POINT_NOT_FOUND
Point isn't found in the lut.
@ SB_ERR_FILE_SAVE
An error occurred saving the file.
@ SB_ERR_SENTINEL_MASTER_KEY
Sentinel LDK Master key not present.
@ SB_ERR_MALLOC
The function that allocates memory gave error
@ SB_ERR_BASE64_SIZE
The dimension of the base64 buffer isn't 4 bytes aligned.
@ SB_ERR_THREAD
Thread management error.
@ SB_ERR_MEMORY_LEAK
There is a memory leak.
@ SB_ERR_DL_TRAINING_DATA_MISSING
Deep Learning training data missing.
@ SB_ERR_INSUFFICIENT_FREE_MEMORY
Insufficient free memory to complete the svl.
@ SB_ERR_UUID
The generation of UUID has returned an error or invalid UUID.
@ SB_ERR_XML_NODE_NOT_FOUND
An xml node was not found.
@ SB_ERR_NULL_POINTER
Function has been called with a NULL pointer.
@ SB_ERR_LICENSE_TYPE
The license type is unknown.
@ SB_ERR_DL_ROI_NOT_SET
Not enough ROI analysis area in SVL or validation image dataset. Increase the analysis ROI or the til...
@ SB_ERR_LICENSE
The license isn't valid.
@ SB_ERR_STRUCT_HEADER_WRONG_SIZE
The dimension of the structure sb_t_struct_header is wrong.
@ SB_ERR_CLS_TRAINING
The training function has returned an error.
@ SB_ERR_LICENSE_CODE
Code of the TCP/IP license protocol is wrong.
@ SB_ERR_DL_INPAINTER_NOT_FOUND
Deep Learning inpainter network file not found.
@ SB_ERR_STRUCT_HEADER_WRONG_CODE
The code of the structure sb_t_struct_header is wrong.
@ SB_ERR_WRONG_PARAMETER
The function has been called with a parameter with a wrong value.
@ SB_ERR_LICENSE_FILE
License file error (not exist, not readable, wrong format, wrong mail address)
@ SB_ERR_DIR_CREATE
An error occurred creating the folder.
@ SB_ERR_NVIDIA_NVML
Nvidia NVML returns an error getting gpu information.
@ SB_ERR_LICENSE_VM
License isn't allowed on Virtual Machine.
@ SB_ERR_SVL_WRONG
SVL is wrong.
@ SB_ERR_NO_LEVELS_AVAILABLE
No levels available to be processed.
@ SB_ERR_IMAGE_ENCODE
An error occurred encoding image.
@ SB_ERR_SOCKET_IOCTL
Socket ioctl function has returned an error.
@ SB_ERR_ROI_DEFECTS
The defects ROI is wrong.
@ SB_ERR_LICENSE_TRAINING
License error: training is disabled.
@ SB_ERR_SOCKET_TIMEOUT
Timeout sending or receiving data on socket.
@ SB_ERR_VERSION_FORMAT
Version is not formatted properly.
@ SB_ERR_DL_PRE_TRAINED_FILE_NOT_FOUND
Deep Learning pre-trained file not found.
@ SB_ERR_DL_NOT_SUPPORTED
Deep Learning modules are not supported.
@ SB_ERR_DL_CUDA_OUT_OF_MEMORY
CUDA Out Of Memory (OOM). Insufficient free GPU memory to execute the operation. Try reducing the bat...
@ SB_ERR_RPF_NAME_EMPTY
The name of solution file is empty.
@ SB_ERR_SOCKET_RECEIVE
Socket receive function has returned an error.
@ SB_ERR_NO_CLASSIFIED_IMAGE
There aren't classified images.
@ SB_ERR_CLS_PREDICT
The predict function has returned an error.
@ SB_ERR_SCALE_NOT_FOUND
The scale is not found.
@ SB_ERR_LICENSE_MAIL_ADDRESS
Mail address in the license file is wrong.
@ SB_ERR_ROI_BOUNDING_BOX
Wrong roi bounding box.
@ SB_ERR_FILE_NOT_EXIST
The file doesn't exist.
@ SB_ERR_SENTINEL_RUN_TIME
Sentinel_LDK_Run-time is not running.
@ SB_ERR_SAMPLE_SCALE
The sample scale is wrong.
@ SB_ERR_SAMPLE_OUT_OF_IMAGE
The sample is out of image.
@ SB_ERR_MODELS_NUMBER
There aren't models, or the number of the models isn't the expected one, or exceeded the maximum mode...
@ SB_ERR_STRING_UTF8
String does not conform to UTF-8 format.
@ SB_ERR_SOCKET_CLOSED
Socket is closed.
@ SB_ERR_SOCKET_MAC
Error while looking for a valid MAC address.
@ SB_ERR_CLS_NOT_TRAINED
The training wasn't done.
@ SB_ERR_LEVELS_ENABLED
There are no levels enabled.
@ SB_ERR_DL_FRAMEWORK
Impossible to execute the requested operation: Deep Learning Framework not installed or corrupted.
@ SB_ERR_NOT_IMPLEMENTED
The function isn't implemented.
@ SB_ERR_LICENSE_MARKER
Marker of the TCP/IP license protocol is wrong.
@ SB_ERR_SAMPLE_NUMBER
Too few samples to execute the training.
@ SB_ERR_SOCKET_ACCEPT
Socket accept has returned an error.
@ SB_ERR_DL_PRE_TRAINED_FILE_NOT_VALID
Deep Learning pre-trained file is not valid.
sb_t_err sb_file_extract_folder(const char *const full, char *const folderpath, int folderpath_size)
Extracts the folder path from the full file path.
sb_t_err sb_file_extract_name(const char *const full, int with_ext, char *const name, int name_size)
Extracts the file name from the full file path.
sb_t_err sb_folder_create(const char *const path)
Creates the folder with the specified path.
sb_t_err sb_folder_destroy(sb_t_folder **folder)
Frees all the resources of the sb_t_folder structure.
sb_t_err sb_folder_filter_images(sb_t_folder *const folder, SB_HANDLE module, sb_t_image_info_type image_info_type)
Filters images by project and type.
sb_t_err sb_folder_erase(sb_t_folder *folder, int index)
Removes the file with the specified index from the list.
sb_t_err sb_folder_remove(const char *const path)
Deletes a folder and all the files and subfolder contained.
sb_t_err sb_folder_exist(const char *const path, int *const exist)
Checks if the folder with the specified path exists.
sb_t_err sb_folder_load(sb_t_folder **const f, const char *const path, const char *const ext, int sort, int verbosity)
Creates the list of the name of the files in a specified folder.
#define SB_PAR_MODELS_NUM
Maximum number of models.
#define SB_PAR_PERTURBATIONS_NUM
Maximum number of perturbation of a sample.
sb_t_err sb_destroy_info(sb_t_info **const info)
Destroys the structure.
sb_t_err sb_init_dl(const char *const search_path)
Initialize the Deep Learning library.
sb_t_err sb_release(void)
Releases all the resources allocates in the library.
sb_t_floating_point_op_type
Enumerates the floating point precision types to perform operations.
sb_t_err sb_init(const char *const license_file)
Initializes the SB library.
SB_INLINE sb_t_bgra sb_bgra(unsigned char b, unsigned char g, unsigned char r, unsigned char a)
Inline constructor of structure sb_t_bgra.
#define SB_PAR_LEVELS_NUM
Maximum scales levels number to be used for Surface.
#define SB_IMAGE_NAME_STRING_LEN
Maximum length, in byte, of the image name string.
sb_t_device_type
Defines computing device types.
sb_t_err sb_format_info(const sb_t_info *const info, char *const str, int str_size)
Formats the sb library information structure.
SB_INLINE sb_t_version sb_version(int major, int minor, int vminor, int build_major)
Inline constructor of structure sb_t_version.
void * SB_HANDLE
HANDLE definition.
sb_t_interpolation_mode
Enumerates the interpolation modes.
#define SB_PAR_STRING_LEN
Maximum length, in byte, of a parameter string.
int sb_version_check(sb_t_version version1, sb_t_version version2)
Compares two version.
sb_t_err sb_get_info(sb_t_info **const info, int gpu_info)
The function gets information about the sb library and the available computational devices.
SB_INLINE sb_t_rgba sb_rgba(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Inline constructor of structure sb_t_rgba.
sb_t_err sb_get_file_version(sb_t_version *const ver, const char *const file)
Get the version of a file.
int sb_is_valid_utf8(const char *string)
Check if a string conforms to UTF-8 format.
sb_t_err sb_get_uuid(char *const str, size_t size)
Creates a new uuid.
@ SB_FLOATING_POINT_OPS_TYPE_SINGLE_PRECISION
Single Precision (FP32).
@ SB_FLOATING_POINT_OPS_TYPE_HALF_PRECISION
Half Precision (FP16).
@ SB_DEVICE_GPU
GPU device.
@ SB_DEVICE_CPU
CPU device.
@ SB_INTERPOLATION_MODE_NN
Nearest Neighbor pixel interpolation.
@ SB_INTERPOLATION_MODE_BILINEAR
Bilinear interpolation.
SB_INLINE sb_t_point2d_f sb_point2d_f(float x, float y)
Inline constructor of structure sb_t_point2d_f.
SB_INLINE sb_t_range sb_range(int min, int max)
Inline constructor of structure sb_t_range.
SB_INLINE sb_t_range_flt sb_range_flt(float min, float max)
Inline constructor of structure sb_t_range_flt.
sb_t_err sb_polyline_resize(sb_t_point2d_f *points, int size, sb_t_point2d_f center, float angle, float offset)
Resize a polyline with respect of a center and an angle.
SB_INLINE sb_t_point sb_point(int x, int y)
Inline constructor of structure sb_t_point.
SB_INLINE sb_t_size sb_size(int width, int height)
Inline constructor of structure sb_t_size.
SB_INLINE sb_t_rect sb_rect(int x, int y, int width, int height)
Inline constructor of structure sb_t_rect.
SB_INLINE sb_t_size_flt sb_size_flt(float width, float height)
Inline constructor of structure sb_t_size_flt.
sb_t_err sb_image_info_get_version(const char *const image_file, sb_t_version *version, char *const version_str, int size_version_str)
Gets the version of the image information file.
sb_t_err sb_image_info_set_roi(SB_HANDLE image_info, const sb_t_roi *const roi)
Sets the ROI in a SqueezeBrains image info handle.
sb_t_err sb_image_info_get_results(SB_HANDLE image_info, sb_t_res **const res, int compressed)
Get the results of the detection from the image info handle.
sb_t_err sb_image_info_get_notes(SB_HANDLE image_info, char **const str)
Gets the note from the SqueezeBrains image info handle.
sb_t_err sb_image_info_get_samples(SB_HANDLE image_info, sb_t_samples **const samples)
Get the samples of an image from the corresponding SqueezeBrains image info handle.
sb_t_image_info_type
Defines the type of the image.
sb_t_err sb_image_info_destroy_details(sb_t_image_info_details **const details)
Destroys the array of the images info details.
sb_t_err sb_image_info_set_type(SB_HANDLE image_info, sb_t_image_info_type type)
Sets the type of the SqueezeBrains image info.
sb_t_err sb_image_info_set_notes(SB_HANDLE image_info, const char *const str)
Set a note into SqueezeBrains image info handle.
sb_t_err sb_image_info_get_type(SB_HANDLE image_info, const char *const model_name, sb_t_image_info_type *const type)
Retrieves the SqueezeBrains image info handle type.
sb_t_err sb_image_info_change_project(const char *const image_file, const sb_t_project_info *const project_info_old, SB_HANDLE module_handle_new)
Change the project to the data associated to the image.
sb_t_err sb_image_info_set_results(SB_HANDLE image_info, const sb_t_res *const res)
Set the results of the detection in the image info handle.
sb_t_err sb_image_info_get_name(SB_HANDLE image_info, char *const str, int str_size)
Retrieves the name of the image.
sb_t_err sb_image_info_add_sample(SB_HANDLE image_info, const sb_t_sample *const sample)
Adds a sample into the SqueezeBrains image info handle.
sb_t_err sb_image_info_get_project_info(SB_HANDLE handle, sb_t_project_info *const project_info)
Retrieves the project information.
sb_t_err sb_image_info_get_roi(SB_HANDLE image_info, sb_t_roi **const roi, int width, int height, int compressed)
Gets the ROI from a SqueezeBrains image info handle.
sb_t_err sb_image_info_copy_labeling(SB_HANDLE dst, const char *const image_file, const sb_t_project_info *src_prj, int roi, int ground_truth, int *copied)
Copies the labeling information from the src project into the destination image info.
sb_t_err sb_image_info_clone(SB_HANDLE src, SB_HANDLE *pdst, SB_HANDLE module_handle)
Clones the SqueezeBrains image info.
sb_t_err sb_image_info_get_details(const char *const image_file, sb_t_image_info_details **details)
Load the file and get the array of the image info details.
sb_t_err sb_image_info_get_roi_defects(SB_HANDLE image_info, sb_t_roi **const defects, int width, int height, int compressed)
Gets the surface defects ROI from a SqueezeBrains image info handle.
sb_t_err sb_image_info_load(SB_HANDLE *image_info, const char *const image_file, SB_HANDLE module_handle)
Creates a SqueezeBrains image info handle.
sb_t_err sb_image_info_set_samples(SB_HANDLE image_info, const sb_t_samples *const samples)
Saves the samples in the corresponding SqueezeBrains image info handle.
sb_t_err sb_image_info_set_project_name(SB_HANDLE image_info, const char *const project_name)
Set the project name in the image info handle.
sb_t_err sb_image_info_remove_project(const char *const image_file, const char *const project_uuid)
Remove the project with the specified UUID from the data associated to the image.
sb_t_err sb_image_info_apply_par_changes(SB_HANDLE image_info, const sb_t_par_changes_info *info)
Apply the par changes to the SqueezeBrains image info handle.
sb_t_err sb_image_info_set_roi_defects(SB_HANDLE image_info, const sb_t_roi *const defects)
Sets the surface defects ROI on a SqueezeBrains image info handle.
sb_t_err sb_image_info_get_tiles_svl(SB_HANDLE handle, sb_t_tiles_info **const ptiles)
Retrieves the svl tiles information.
sb_t_err sb_image_info_get_custom_par_root(SB_HANDLE handle, SB_HANDLE *node_root)
Returns the xml root node of your own custom parameters.
sb_t_err sb_image_info_reset(SB_HANDLE image_info)
Erases all the data from the SqueezeBrains image info handle.
sb_t_err sb_image_info_destroy(SB_HANDLE *image_info)
Destroys the SqueezeBrains image info handle.
sb_t_err sb_image_info_save(SB_HANDLE image_info)
Saves the SqueezeBrains image info handle into the image file.
@ SB_IMAGE_INFO_TYPE_SVL_USED
Read-only value. Image is used for SVL and for training.
@ SB_IMAGE_INFO_TYPE_TEST
Image is used for test.
@ SB_IMAGE_INFO_TYPE_SVL
Image is used for SVL and not used for training.
@ SB_IMAGE_INFO_TYPE_NONE
Image is not used.
sb_t_err sb_image_create(sb_t_image **const pimg, int width, int height, sb_t_image_format format)
Creates an image.
sb_t_err sb_image_change_brightness(const sb_t_image *const src, sb_t_image *const dst, float delta_brightness)
Changes the image brightness by the percentage amount specified.
sb_t_image_flip_mode
Enumeration of the flip mode.
sb_t_err sb_image_convert(sb_t_image **const dst, sb_t_image *const src, sb_t_image_format format)
Convert the source image into the destination image.
sb_t_image_circularity_type
Enumeration of the image circularity type.
sb_t_err sb_image_read_size(sb_t_size *const size, const char *const file)
Get the image size from a file.
const char * sb_image_format(sb_t_image_format format)
Returns the string of the image format.
sb_t_err sb_image_shift(const sb_t_image *const src, sb_t_image *const dst, int x_shift, int y_shift)
Shifts the image.
const char * sb_image_circularity_type_format(sb_t_image_circularity_type type)
Returns the string of the image circularity type.
sb_t_err sb_image_flip(const sb_t_image *const src, sb_t_image *const dst, sb_t_image_flip_mode mode)
Flips the image.
sb_t_image_compress_type
Type of image compression.
sb_t_err sb_image_change_contrast(const sb_t_image *const src, sb_t_image *const dst, float delta_contrast)
Changes the image contrast by the percentage amount specified.
sb_t_err sb_image_set_clip_blend(sb_t_image *const img, int x, int y, const sb_t_rgba *const color)
Set the pixel (x,y) with the color using also alpha blending.
sb_t_err sb_image_get_pixel(sb_t_image *const img, int x, int y, sb_t_rgba *const color)
Get the pixel (x,y).
sb_t_err sb_image_copy(const sb_t_image *const src, sb_t_image *const dst)
Copies the image.
sb_t_err sb_image_get_sample(const sb_t_image *const src, sb_t_point centre, double angle_rad, float scale, sb_t_image *const dst)
Copies, rotates, resizes a rectangular roi of the source image to the destination one.
sb_t_err sb_image_destroy(sb_t_image **const pimg)
Destroys the image.
sb_t_err sb_image_save(const sb_t_image *const img, const char *const file, const int *const params)
Saves the image in a file.
sb_t_err sb_image_rotate(const sb_t_image *const src, sb_t_point centre, double angle, sb_t_interpolation_mode interpolation_mode, sb_t_image *const dst)
Rotates an image.
sb_t_err sb_image_clone(sb_t_image **const dst, const sb_t_image *const src)
Clones the image.
sb_t_err sb_image_set_data(sb_t_image *const img, unsigned char *const data)
Sets the pointer to a block of memory for image data.
sb_t_err sb_image_create_header(sb_t_image **const pimg, int width, int height, int width_step, sb_t_image_format format)
Creates an image but doesn't allocate memory for the data.
sb_t_err sb_image_decompress(sb_t_image **const dst, sb_t_image *const src)
Decompress the image.
sb_t_err sb_image_clean(sb_t_image *const img)
Cleans the image.
sb_t_err sb_image_copy_rect(const sb_t_image *const src, sb_t_rect rect, sb_t_image **const dst)
Copies a rectangular ROI of an image into another one.
sb_t_err sb_image_resize(const sb_t_image *const src, sb_t_rect rect, float scale, sb_t_interpolation_mode interpolation_mode, sb_t_image *const dst)
Resizes the image.
sb_t_err sb_image_load(sb_t_image **const img, const char *const file)
Loads an image from a file.
sb_t_image_compress_par
Definitions of parameters used by the image encoders.
sb_t_err sb_image_compress(sb_t_image **const dst, sb_t_image *const src, sb_t_image_compress_type compression, const void *const params)
Compress the image with the compression method specified.
sb_t_image_format
Format of image pixel.
@ SB_IMAGE_FLIP_VERTICAL
flips the image around vertical axis.
@ SB_IMAGE_FLIP_HORIZONTAL
flips the image around horizontal axis.
@ SB_IMAGE_FLIP_BOTH
flips the image around both horizontal and vertical axises, it is a rotation of 180 degrees.
@ SB_IMAGE_CIRCULARITY_TYPE_HORIZONTAL
Horizontal image circularity.
@ SB_IMAGE_CIRCULARITY_TYPE_NONE
No image circularity.
@ SB_IMAGE_CIRCULARITY_TYPE_VERTICAL
Vertical image circularity, not implemented yet.
@ SB_IMAGE_COMPRESS_JPEG
JPEG compression.
@ SB_IMAGE_COMPRESS_NONE
uncompressed or raw images
@ SB_IMAGE_COMPRESS_RLE
RLE (Run Lenght Encoding) lossless compression.
@ SB_IMAGE_COMPRESS_PNG
PNG compression.
@ SB_IMAGE_COMPRESS_PAR_JPEG_QUALITY
Quality of jpeg image.
@ SB_IMAGE_FORMAT_BW8
BW: one channel, 8 bit per channel.
@ SB_IMAGE_FORMAT_BGR888
BGR: three channel, 8 bit per channel.
@ SB_IMAGE_FORMAT_RGB888
RGB: three channel, 8 bit per channel.
@ SB_IMAGE_FORMAT_UI32
unsigned int 32 bit
const char * sb_license_format_type(sb_t_license_type type)
Returns the string of the license type.
sb_t_err sb_license_configuration_check(SB_HANDLE module, sb_t_license_configuration_id configuration_id, char **const msg)
Checks if the project can be used with a license configuration.
sb_t_err sb_license_get_hw_info(char **const str)
Returns the hardware information.
sb_t_err sb_license_check(SB_HANDLE module, char **const msg)
Checks the license status and if the project can be used with the current license configuration.
const char * sb_license_format_configuration(sb_t_license_configuration_id configuration)
Returns the string of the license configuration.
sb_t_err sb_license_apply_v2c(const char *const v2c, char **const msg_err, int verbosity)
Applies the v2c file to the usb dongle key.
sb_t_license_module_status
Enumerations of status of a module of the license.
sb_t_err sb_license_get_info(sb_t_license *const info)
Returns the license information.
sb_t_license_module_id
Enumerations of modules of the SB library.
const char * sb_license_format_module_id(sb_t_license_module_id code)
Returns the string of the module id.
sb_t_err sb_license_format_info(const sb_t_license *const info, char *const str, int str_size)
Formats the license structure.
#define SB_LICENSE_VENDOR_CODE_SIZE
Size, in bytes, of the string of the vendor code.
sb_t_license_configuration_id
Enumerations of the license configurations.
const char * sb_license_format_module_status(sb_t_license_module_status status)
Returns the string of the feature status.
sb_t_license_type
Enumerations of the license types.
@ SB_LICENSE_MODULE_STATUS_ACTIVE
The license is valid and active.
@ SB_LICENSE_MODULE_STATUS_DISABLED
The license is disabled.
@ SB_LICENSE_MODULE_STATUS_ERR
There is an error. See the field sb_t_license_module::err.
@ SB_LICENSE_MODULE_STATUS_NULL
The license status is undefined.
@ SB_LICENSE_MODULE_RETINA
Retina.
@ SB_LICENSE_MODULE_NUMBER
Number of modules.
@ SB_LICENSE_MODULE_NONE
Module type not defined.
@ SB_LICENSE_MODULE_SURFACE
Surface.
@ SB_LICENSE_MODULE_DEEP_CORTEX
Deep Cortex.
@ SB_LICENSE_MODULE_DEEP_SURFACE
Deep Surface.
@ SB_LICENSE_BASIC
Basic configuration.
@ SB_LICENSE_CONFIGURATION_NUMBER
Number of configurations.
@ SB_LICENSE_PREMIUM
Premium configuration.
@ SB_LICENSE_STANDARD
Standard configuration.
@ SB_LICENSE_NOT_PRESENT
License is not present.
@ SB_LICENSE_DISABLED
License is disabled.
@ SB_LICENSE_MASTER
Master license: hasn't an expiry date.
@ SB_LICENSE_NULL
License type isn't defined.
@ SB_LICENSE_DEMO
Demo license: has an expiry date.
sb_t_err sb_lut_destroy(SB_HANDLE *phandle)
Destroys the handle of the lut.
sb_t_err sb_lut_save(SB_HANDLE phandle, const char *const file_path)
Saves the lut in a file.
sb_t_err sb_lut_get_size(SB_HANDLE phandle, int *const width, int *const height)
Retrieves the size of the lut.
sb_t_err sb_lut_create(SB_HANDLE *phandle, int width, int height)
Creates the handle of the lut.
sb_t_err sb_lut_warp_point(SB_HANDLE phandle, const sb_t_point *const src, sb_t_point *const dst)
Warps the point.
sb_t_err sb_lut_load(SB_HANDLE *phandle, const char *const file_path)
Loads the lut from a file.
sb_t_err sb_lut_get_ptr(SB_HANDLE phandle, sb_t_lut_point **const ptr)
Retrieves, in the parameter ptr, the pointer to internal array of the lut.
void * sb_malloc(size_t size)
Allocates a memory block.
void * sb_calloc(size_t count, size_t size)
Allocates and zero-initialize an array.
void * sb_realloc(void *ptr, size_t size)
Reallocates a memory block.
sb_t_malloc_check
Type of counter for the memory leak check.
void sb_free(void *ptr)
Deallocates a memory block.
sb_t_err sb_malloc_check_memory_leak_reset(sb_t_malloc_check check)
Resets the memory leak control.
sb_t_err sb_malloc_check_memory_leak(sb_t_malloc_check check)
Checks if the library has a memory leak.
@ SB_MALLOC_CHECK_MAIN_COUNTER
The main counter.
@ SB_MALLOC_CHECK_SECOND_COUNTER
The second counter.
const char * sb_interpolation_mode_format(sb_t_interpolation_mode mode)
Returns the string of the interpolation mode.
const char * sb_device_type_format(sb_t_device_type type)
Returns the string of the device type.
sb_t_err sb_par_add_level(sb_t_par *const par, const char *const model_name, float scale)
Adds the level to the parameter structure.
sb_t_err sb_par_auto_tiling_get_img_range(sb_t_range *const range, int net_input_size, float scale, int tile)
Calculates the scale range of the images to be processed compatible with the input size of the networ...
sb_t_err sb_par_remove_model(sb_t_par *const par, const char *const model_name)
Removes the model from the structure of the project parameters.
sb_t_err sb_par_format(const sb_t_par *const par, char *const str, int str_size)
Formats the parameters structure.
sb_t_err sb_par_get_collaboration(sb_t_par *par, const char *const model_name_1, const char *const model_name_2, int *const value)
Retreives the collaboration between two models.
sb_t_err sb_par_add_model(sb_t_par *const par, const char *const model_name)
Adds the model to the parameter structure.
sb_t_err sb_par_set_collaboration(sb_t_par *par, const char *const model_name_1, const char *const model_name_2, int value)
Sets collaboration between two models.
sb_t_err sb_par_init(sb_t_par *const par, sb_t_project_type project_type)
Initializes the fields of the structure.
sb_t_err sb_par_remove_level(sb_t_par *const par, const char *const model_name, float scale)
Removes the l-th level from the structure of the project parameters.
const char * sb_floating_point_precision_type_format(sb_t_floating_point_op_type type)
Returns the string of the floating point precision type.
sb_t_err sb_project_set_par(SB_HANDLE handle, const sb_t_par *const par)
Sets the parameters structure into the project handle.
sb_t_err sb_project_set_name(SB_HANDLE handle, const char *const name)
Sets the name into the project handle.
sb_t_err sb_project_get_par(SB_HANDLE handle, sb_t_par *const par)
Retrieves the project parameters structure.
sb_t_project_mode
Defines the loading or saving mode of a project.
sb_t_err sb_project_create(SB_HANDLE *phandle, const char *const project_name, sb_t_project_type project_type)
Creates a new project of the specifed type.
sb_t_err sb_project_save(SB_HANDLE handle, const char *const solution_file, sb_t_project_mode mode)
Saves the project to file.
sb_t_err sb_project_set_notes(SB_HANDLE handle, const char *const note)
Sets the note into the project handle.
sb_t_err sb_project_get_info(SB_HANDLE handle, sb_t_project_info *project_info)
Gets the project information from the handle.
sb_t_err sb_project_get_par_changes_info(SB_HANDLE handle, const sb_t_par *const par, sb_t_par_changes_info **const par_changes_info)
Returns the information on what sb_project_set_par and sb_image_info_apply_par_changes do when they a...
sb_t_err sb_project_destroy_par_changes_info(sb_t_par_changes_info **const par_changes_info)
Destroys the structure.
sb_t_err sb_project_set_sensitivity(SB_HANDLE handle, const char *const model_name, float scale, float sensitivity)
Sets the sensitivity of the detection in the project handle.
sb_t_err sb_project_get_custom_par_root(SB_HANDLE handle, SB_HANDLE *node_root)
Returns the xml root node of your own custom parameters.
sb_t_project_type
Project types enum.
sb_t_err sb_project_load(SB_HANDLE *phandle, const char *const solution_file, const char *const project_uuid, sb_t_project_mode mode)
Loads an existing project from file.
sb_t_err sb_project_detection(SB_HANDLE handle, const sb_t_image *const img, const sb_t_roi *const roi, const sb_t_roi *const roi_defects, const sb_t_samples *const samples)
Detection function.
sb_t_err sb_project_check_trained(SB_HANDLE handle, const char *const model_name, float scale, int *const is_trained)
Checks if the project is trained.
sb_t_err sb_project_get_scale_offset(SB_HANDLE handle, sb_t_size_flt *const scale_offset)
Gets the scale offset from the project handle.
sb_t_err sb_project_get_res(SB_HANDLE handle, sb_t_res **const res, int details)
Retrieves the results of the last elaborated image.
const char * sb_project_type_format(sb_t_project_type type)
Returns the string of the project type.
sb_t_err sb_project_destroy(SB_HANDLE *phandle)
Frees all the resources of the project handle.
sb_t_err sb_project_set_scale_offset(SB_HANDLE handle, sb_t_size_flt scale_offset)
Sets in the project handle the scale offset used at detection time.
sb_t_err sb_project_copy_labeling(const char *const path_solution_dst, const char *const path_solution_src, int copy_roi, int copy_labeling, int verbosity)
Copies the analysis roi and the labeling between two current projects of two different solutions.
sb_t_err sb_project_get_svl_version(SB_HANDLE handle, sb_t_version *const version, char *const version_str, int size_version_str)
Returns the version of the SB library when the last SVL was made.
sb_t_err sb_project_clone(SB_HANDLE src, SB_HANDLE *pdst, sb_t_project_mode mode, int regenerate_uuid)
Clones the SqueezeBrains project.
sb_t_err sb_project_change_type(const char *const solution_file, const char *const project_uuid, sb_t_project_type project_type)
Change the project type.
sb_t_err sb_project_reset_stat(SB_HANDLE handle)
Resets the internal statistics of the elaborations.
sb_t_err sb_project_get_default_features(SB_HANDLE handle, char *str, int size)
Get the project default features depending on the project type (Retina or Surface)
sb_t_err sb_project_invalidate(SB_HANDLE handle, const char *const model_name, float scale)
Eliminates the training of the models.
sb_t_err sb_project_get_stat(SB_HANDLE handle, sb_t_stat **const stat)
Gets the statistics from the handle.
sb_t_err sb_project_get_notes(SB_HANDLE handle, char **const note)
Gets the note from the project handle.
sb_t_err sb_project_get_sensitivity(SB_HANDLE handle, const char *const model_name, float scale, float *const sensitivity)
Gets the classification threshold from the project handle.
sb_t_err sb_project_get_name(SB_HANDLE handle, char **const name)
Gets the name from the project handle.
@ SB_PROJECT_MODE_DETECTION_ONLY
Load/save the minimum module information to allow detection.
@ SB_PROJECT_MODE_DETECTION_AND_SVL
Load/save all the module information.
@ SB_PROJECT_TYPE_RETINA
Project Retina.
@ SB_PROJECT_TYPE_SURFACE
Project Surface.
@ SB_PROJECT_TYPE_DEEP_SURFACE
Project Deep Surface.
@ SB_PROJECT_TYPE_DEEP_CORTEX
Project Deep Cortex.
sb_t_err sb_res_decompress(sb_t_res *const res)
Decompress thre results.
sb_t_surface_image_truth
Defines the surface image truth.
sb_t_err sb_tiles_info_destroy(sb_t_tiles_info **const ptiles)
Destroy the tiles information.
sb_t_tile_type
Enumerates the tile types.
sb_t_err sb_res_compress(sb_t_res *const res)
Compress the results, in particular the Surface plane images.
sb_t_err sb_tiles_info_no_overlap(sb_t_tiles_info *const tiles, sb_t_size img_size, int offset)
Rearranges the tiles so that they do not go out of the picture and do not overlap.
sb_t_err sb_res_destroy(sb_t_res **const res)
Destroys the module results structure.
const char * sb_tile_type_format(sb_t_tile_type type)
Returns the string of the tile type.
sb_t_err sb_tiles_info_clone(sb_t_tiles_info **const pdst, const sb_t_tiles_info *const src)
Clones the tiles information structure.
sb_t_err sb_res_clone(sb_t_res **const dst, const sb_t_res *const src)
Copies the results of image elaboration.
@ SB_IMAGE_TRUTH_OVERKILL
False defects found.
@ SB_IMAGE_TRUTH_UNDEFINED
Undefined truth.
@ SB_IMAGE_TRUTH_GOOD
No defects.
@ SB_IMAGE_TRUTH_NO_GOOD
Defects found.
@ SB_IMAGE_TRUTH_ESCAPE
Defects not found.
@ SB_TILE_TYPE_NOT_USED
The tile is not used because it has no pixels in the ROI analysis.
@ SB_TILE_TYPE_USED
The tile is used.
@ SB_TILE_TYPE_USED_SVL
The tile is used for svl by sb_svl_run function.
sb_t_err sb_roi_apply_lut(sb_t_roi *const roi, unsigned char *lut)
Applies the gray level lut to the roi image.
sb_t_err sb_roi_set_blob(sb_t_roi *const roi, unsigned char gl, const sb_t_image *const src, const sb_t_blob_par *const par, const sb_t_point *const start_point, int fill_holes, sb_t_range hole_area, const sb_t_rect *analysis_rect)
Sets a ROI from blob analysis.
sb_t_err sb_roi_reset(sb_t_roi *const roi)
Resets the ROI.
sb_t_err sb_roi_set_circle(sb_t_roi *const roi, unsigned char gl, int center_x, int center_y, int radius, int reset_roi)
Sets a circular ROI.
sb_t_err sb_roi_create_header(sb_t_roi **const roi, int width, int height, int width_step)
Creates a ROI but doesn't allocate memory for the data.
sb_t_err sb_roi_evaluate_bounding_box(sb_t_roi *const roi)
Calculates the bounding box of the roi depending by the lut.
sb_t_err sb_roi_set_rect(sb_t_roi *const roi, unsigned char gl, sb_t_rect rect, int reset_roi)
Sets a rectangular ROI.
sb_t_err sb_roi_set_ellipse(sb_t_roi *const roi, unsigned char gl, int center_x, int center_y, int radius_x, int radius_y, int reset_roi)
Sets an elliptical ROI.
sb_t_err sb_roi_clone(sb_t_roi **const dst, const sb_t_roi *const src)
Copies a roi.
sb_t_err sb_roi_compress(sb_t_roi *const roi)
Compresses the ROI and deletes the uncompressed version.
sb_t_err sb_roi_create(sb_t_roi **const roi, int width, int height)
Creates a ROI.
sb_t_err sb_roi_decompress(sb_t_roi *const roi)
Decompresses the ROI and deletes the compressed version.
sb_t_err sb_roi_plot(sb_t_image *const image, const sb_t_roi *const roi, const unsigned char *lut, sb_t_rgba color)
Draws the roi on the image.
sb_t_err sb_roi_set_data(sb_t_roi *const roi, unsigned char *const data)
Sets the pointer of the ROI data into the ROI.
sb_t_err sb_roi_set_circular_crown(sb_t_roi *const roi, unsigned char gl, int center_x, int center_y, int radius_min, int radius_max, int start_angle, int end_angle, int reset_roi)
Sets an angular circular crown ROI.
sb_t_err sb_roi_destroy(sb_t_roi **const roi)
Destroys the ROI.
sb_t_err sb_samples_destroy(sb_t_samples **const samples)
Destroy the samples structure.
sb_t_err sb_samples_clone(sb_t_samples **const dst, const sb_t_samples *const src)
Copies the samples of an image.
sb_t_err sb_sample_weights_image_overlay(sb_t_image *const image, const sb_t_sample *const s)
Draws the image of the weights of the sample on a image.
sb_t_err sb_samples_create(sb_t_samples **const samples)
Creates a samples structure.
sb_t_err sb_sample_clone(const sb_t_sample *const src, sb_t_sample *const dst)
Copies a single sample.
sb_t_err sb_sample_get_vertex(sb_t_point centre, float scale, sb_t_size obj_size, sb_t_point *const ul, sb_t_point *const br, sb_t_size *const size)
Evaluates the vertices of the rectangle of the sample.
sb_t_obj_type
Defines the type of the object.
sb_t_err sb_sample_get_model_index(const sb_t_sample *const s, SB_HANDLE handle, int *const model_index)
Returns the model index of the sample.
sb_t_err sb_sample_get_level_index(const sb_t_sample *const s, SB_HANDLE handle, int *const level_index)
Returns the index of scale level of the sample.
sb_t_sample_classify_mode
Enumeration of the classification modes of a sample.
sb_t_err sb_samples_insert(sb_t_samples *const samples, const sb_t_sample *const sample, int sample_index)
Inserts a sample in the list of the samples of an image.
sb_t_err sb_samples_distance(SB_HANDLE project, const sb_t_sample *const sample1, const sb_t_sample *const sample2, const sb_t_roi *const roi, float *const distance, int *const are_near)
Evaluates the distance between two samples.
const char * sb_format_truth(sb_t_truth truth)
Returns the string of the truth of the object.
sb_t_err sb_sample_destroy(sb_t_sample *const sample)
Destroys the content of sample structure.
sb_t_truth
Type of truth of a sample.
sb_t_err sb_samples_swap(sb_t_samples *const samples, int sample_index_1, int sample_index_2)
Swaps the samples with index sample_index_1 and sample_index_2.
sb_t_err sb_samples_remove(sb_t_samples *const samples, int sample_index)
Removes a sample from the list of the samples of an image.
@ SB_OBJ_LEARNING
Object is used for learning.
@ SB_OBJ_TEST
Object is not used for learning.
@ SB_TRUTH_MODEL_DISABLED
A sample of a disabled model.
@ SB_TRUTH_TRUE_NEGATIVE
Truth True Negative.
@ SB_TRUTH_FALSE_NEGATIVE
Truth False Negative.
@ SB_TRUTH_TRUE_POSITIVE
Truth True Positive.
@ SB_TRUTH_UNDEFINED
Truth not defined.
@ SB_TRUTH_OPTIONAL_POSITIVE
Truth Optional Positive.
@ SB_TRUTH_OPTIONAL_NEGATIVE
Truth Optional Negative.
@ SB_TRUTH_FALSE_POSITIVE
Truth False Positive.
@ SB_TRUTH_OUT_OF_ROI
Truth Out Of ROI.
sb_t_err sb_solution_set_current_project(const char *const solution_file, const char *const project_uuid)
Set current project in the solution_file.
sb_t_err sb_solution_get_info(const char *const solution_file, sb_t_solution_info **const solution)
Returns the information contained in the solution_file.
sb_t_err sb_solution_remove_project(const char *const solution_file, const char *const project_uuid)
Delete the project with the specified uuid from file.
sb_t_err sb_solution_get_version(const char *const solution_file, sb_t_version *version, char *const version_str, int size_version_str)
Gets the version of the solution file.
sb_t_err sb_solution_destroy_info(sb_t_solution_info **const solution)
Destroys the structure of the solution information.
sb_t_err sb_stat_from_res(sb_t_stat *const stat, const sb_t_res *const res)
Computes the sb_t_stat from sb_t_res.
sb_t_err sb_stat_destroy(sb_t_stat **const stat)
Destroys the sb_t_stat structure.
sb_t_err sb_stat_format(const sb_t_stat *const stat, char *const str, int str_size)
Formats the sb_t_stat structure.
sb_t_err sb_stat_reset(sb_t_stat *const stat, const sb_t_par *const par)
Resets the sb_t_stat structure.
sb_t_err sb_surface_model_to_gl(const sb_t_par *const par, const char *const model_name, unsigned char *const gl, unsigned char *const gl_opt)
Gets the model defects gray level for both required and optional model defects.
#define SB_DEVICES_MAX_NUMBER
Maximum number of computational devices managed by the sb library.
sb_t_svl_command
Enumerates the actions that SVL has to do after a stop.
sb_t_err(* sb_fp_svl_pre_elaboration)(const SB_HANDLE image_info, void *const user_data, const char *const image_file, int image_index, sb_t_svl_pre_elaboration *const pre_elaboration)
Definition of the callback for image pre elaboration.
sb_t_perturbation_mode
Enumerates the mode of the perturbations.
#define SB_PAR_FEATURES_NAMES_LEN
Maximum lenght, in byte, of the features names string.
sb_t_err sb_svl_stop_request(SB_HANDLE handle)
Sends a request to the SVL for stop.
sb_t_err sb_svl_destroy_res(sb_t_svl_res **const res)
Destroys the structure of the results of SVL.
const char * sb_perturbation_mode_format(sb_t_perturbation_mode mode)
Returns the string of the Deep Learning SVL image perturbation mode.
sb_t_svl_par_optimization_mode
Describes the optimization mode of SVL.
sb_t_err(* sb_fp_svl_progress)(void *const user_data, sb_t_svl_res *res, int force)
Definition of the callback for the working progress.
sb_t_perturbation_type
Enumerates the range of application of the perturbations.
const char * sb_perturbation_type_format(sb_t_perturbation_type type)
Returns the string of the Deep Learning SVL image perturbation type.
sb_t_err sb_svl_reset(SB_HANDLE handle)
Resets the history of previous executions of the SVL.
sb_t_loss_fn_type
Enumerates the loss functions.
sb_t_err(* sb_fp_svl_command)(void *const user_data, sb_t_svl_res *res, sb_t_svl_command *const command, const char *const msg)
Definition of the callback that the SVL calls when it needs to know how to continue.
const char * sb_loss_fn_type_format(sb_t_loss_fn_type type)
Returns the string of the loss function type.
const char * sb_feature_description(const char *const feature)
Returns a string with a brief description of a feature.
sb_t_network_type
Deep learning network types.
sb_t_err sb_svl_run(SB_HANDLE handle)
Runs the SVL.
const char * sb_svl_command_format(sb_t_svl_command command)
Returns the string of the SVL command.
const char * sb_network_type_format(sb_t_network_type type)
Returns the string of the network type.
sb_t_err sb_svl_get_res(SB_HANDLE handle, sb_t_svl_res **const res)
Retrieves the results of SVL.
sb_t_err sb_svl_clone_res(sb_t_svl_res **const dst, const sb_t_svl_res *const src)
Copies the structure of the results of SVL.
sb_t_svl_stop_reason
Enumerates the reasons why SVL is terminated or why the callback sb_t_svl_par::fp_command has been ca...
const char * sb_svl_par_optimization_mode_format(sb_t_svl_par_optimization_mode mode)
Returns the string of the SVL optimization mode.
@ SB_SVL_COMMAND_CONTINUE_NO_RESET
The SVL continues without reset.
@ SB_SVL_COMMAND_NEXT_STEP
The SVL go to next step.
@ SB_SVL_COMMAND_STOP
The SVL stops and exits, applying the training to the module.
@ SB_SVL_COMMAND_CONTINUE
The SVL continues and, if necessary, resets the training.
@ SB_SVL_COMMAND_ABORT
The SVL stops and exits, without applying the training reached to the module.
@ SB_PERTURBATION_MODE_OFFLINE
Offline perturbation.
@ SB_PERTURBATION_MODE_ONLINE
Online perturbation.
@ SB_PERTURBATION_MODE_BOTH
Both online and offline perturbations.
@ SB_SVL_PAR_OPTIMIZATION_TIME_SLOW
@ SB_SVL_PAR_OPTIMIZATION_USE_SELECTED
@ SB_SVL_PAR_OPTIMIZATION_TIME_MEDIUM
@ SB_SVL_PAR_OPTIMIZATION_TIME_FAST
@ SB_PERTURBATION_TYPE_IMAGE
The whole image is perturbated.
@ SB_PERTURBATION_TYPE_BOTH
Both image and defects perturbation type.
@ SB_PERTURBATION_TYPE_DEFECTS
Only the defect area is perturbated.
@ SB_LOSS_FN_TYPE_BCE
SB Binary Cross Entropy loss.
@ SB_LOSS_FN_TYPE_CCE
Categorical Cross Entropy loss.
@ SB_LOSS_FN_TYPE_FOCAL
Focal loss.
@ SB_NETWORK_TYPE_EFFICIENTNET_B1
Deep Learning EfficientNet b1.
@ SB_NETWORK_TYPE_SDINET0_331x128
Deep Learning Surface Defects Inspection Network 0 with input size 331x128.
@ SB_NETWORK_TYPE_EFFICIENTNET_B2
Deep Learning EfficientNet b2.
@ SB_NETWORK_TYPE_EFFICIENTNET_B0
Deep Learning EfficientNet b0.
@ SB_NETWORK_TYPE_SDINET0_400x160
Deep Learning Surface Defects Inspection Network 0 with input size 400x160.
@ SB_NETWORK_TYPE_SDINET0_331
Deep Learning Surface Defects Inspection Network 0 with input size 331x331.
@ SB_NETWORK_TYPE_ICNET0_128
Deep Learning Image Classification Network 0 with input size 128x128.
@ SB_NETWORK_TYPE_ICNET0_64
Deep Learning Image Classification Network 0 with input size 64x64.
@ SB_SVL_STOP_WARNING
Send a warning message.
@ SB_SVL_STOP_RESET_MANDATORY
Request for a mandatory reset of SVL.
@ SB_SVL_STOP_RESET_OPTIONAL
Ask for an optional reset of SVL.
@ SB_SVL_STOP_USER_REQUEST
The user has stopped the SVL.
@ SB_SVL_STOP_CONFLICT
There are errors which can not be eliminated.
@ SB_SVL_STOP_NONE
SVL finishes without errors.
@ SB_SVL_STOP_MEMORY
Insufficient memory to complete the SVL.
sb_t_err sb_xml_node_remove_itself(SB_HANDLE node)
Removes the current node.
sb_t_err sb_xml_node_count(SB_HANDLE parent, const char *const name, int *const cnt)
Gets the number of child nodes with the specified name.
sb_t_err sb_xml_node_set_attribute(SB_HANDLE node, const char *const attribute_name, const char *const content)
Sets the content of the attribute with the specified name.
SB_HANDLE sb_xml_node_add(SB_HANDLE parent, const char *const name, const char *const content)
Adds the node to the parent node.
SB_HANDLE sb_xml_node_get_child(SB_HANDLE parent)
Gets the first child of the node.
sb_t_err sb_xml_node_get_string_malloc(SB_HANDLE parent, const char *const name, char **const str)
Gets the content of the node with the specified name, allocating the string of the needed lenght.
SB_HANDLE sb_xml_node_next(SB_HANDLE node)
Gets the next sibling node.
sb_t_err sb_xml_node_get_attribute(SB_HANDLE node, const char *const attribute_name, char *const str, size_t str_size)
Gets the content of the attribute with the specified name.
sb_t_err sb_xml_node_get_name(SB_HANDLE node, char *const str, size_t str_size)
Gets the name of the current node.
SB_HANDLE sb_xml_node_previous(SB_HANDLE node)
Gets the previous sibling node.
sb_t_err sb_xml_node_remove(SB_HANDLE parent, const char *const name)
Removes the node with the specified name.
sb_t_err sb_xml_node_set_itself(SB_HANDLE node, const char *const content)
Sets the content of the node.
SB_HANDLE sb_xml_node_get(SB_HANDLE parent, const char *const name)
Gets the handle of the xml node with the specified name.
sb_t_err sb_xml_node_get_string(SB_HANDLE parent, const char *const name, char *const str, size_t str_size)
Gets the content of the node with the specified name.
sb_t_err sb_xml_node_set(SB_HANDLE parent, const char *const name, const char *const content)
Sets the content of the node with the specified name. The function checks if the node exists and othe...
Defines the color in the format BGRA.
unsigned char g
green component of color
unsigned char r
red component of color
unsigned char a
trasparency of color
unsigned char b
blue component of color
Defines the parameters for blob analysis.
int verbosity
Verbosity level.
sb_t_range width
Range of weight, value in pixel.
int blob_contour
Set to 1 if you want the contour of each blob.
sb_t_range area
Range of area, value in pixel.
sb_t_range height
Range of height, value in pixel.
sb_t_blob_distance_mode blob_distance_mode
Selection of the algorithm for calculating the distance between blobs.
int keep_deleted
If different than 0, deleted blobs are kept in the list and marked as deleted.
sb_t_range merge_area
Range of area after merge, value in pixel. Used only if sb_t_blob_par::merge_distance is greater than...
int blob_min_rot_rect
For each blob it enables the calculation of the smaller rotated rectangle containing the blob.
int blob_rle
Set to 1 if you want the rle of each blob.
int merge_distance
Blobs with a distance inferior or equal to the value are merged together.
sb_t_range merge_width
Range of weight after merge, value in pixel. Used only if sb_t_blob_par::merge_distance is greater th...
sb_t_range merge_height
Range of height after merge, value in pixel. Used only if sb_t_blob_par::merge_distance is greater th...
sb_t_pixel_connection connection_type
Pixel connection type.
sb_t_point2d_f bar
blob baricenter.
float m_xy
Moment of inertia about the x and y axes.
sb_t_truth truth
Truth value of the blob computed by the blob analysis routine, otherwise SB_TRUTH_UNDEFINED.
int contour_size
Number of point of the blob contour, ie the number of elements of the array contour.
sb_t_point * contour
Pointer to the array of the points of the blob contour.
sb_t_rle rle
Pointer to RLE buffer.
float m_yy
Moment of inertia about the y axis.
sb_t_rect rect
Bounding box of the blob.
int od
Value not evaluated.
float angle
Rotation angle of the smaller rotated rectangle.
int area
Area of the blob, number of the pixel.
sb_t_blob_deleted deleted
Blob is marked as deleted.
float m_xx
Moment of inertia about the x axis.
Defines the information about the blob analysis.
long long time_export
blobs esporting time, in us.
int deleted_for_area_min
Number of blobs deleted for an area too small, both during analysis and during merging.
int deleted_for_width_max
Number of blobs deleted for a width too big, both during analysis and during merging.
int deleted_for_area_max
Number of blobs deleted for an area too big, both during analysis and during merging.
long long time_blob
time, in us, of the blobs extraction.
int merged
Number of blobs merged with another blob.
int deleted_for_height_min
Number of blobs deleted for an height too small, both during analysis and during merging.
long long time_rle
time, in us, of the rle extraction.
sb_t_range deleted_height
height range of the deleted blobs for a out-of-range height, both during analysis and during merging.
int deleted_for_height_max
Number of blobs deleted for an height too big, both during analysis and during merging.
long long time_sort
blobs sorting time, in us.
sb_t_range deleted_area
area range of the deleted blobs for a out-of-range area, both during analysis and during merging.
int deleted_for_width_min
Number of blobs deleted for a width too small, both during analysis and during merging.
long long time_contour
time, in us, of the blobs contour estraction.
sb_t_range deleted_width
width range of the deleted blobs for a out-of-range width, both during analysis and during merging.
int deleted
Number of blobs deleted, both during analysis and during merging.
long long time_merge
blobs merging time, in us.
long long time_total
total time, in us.
sb_t_blob * blob
Array of the blobs.
sb_t_blobs_info info
Information about the blob analysis.
sb_t_blobs_info info_gt
Information about the blob analysis of the ground truth areas.
int size
Number of blobs, ie number of elements of the array sb_t_blobs::blob .
Information about a computing device.
sb_t_memory_info memory
Memory information about the device and its process.
int available
Indicates if the device is available on the PC in use.
int id
Identifier of the device.
sb_t_device_type type
Device type.
List of computing devices available on the machine.
int size
Number of available devices.
sb_t_device_info * device
Array of devices.
Property of computational devices.
sb_t_device_type type
Device type.
char * fname
Name of file excluded the path.
defines the list of the file in a folder.
int path_length
Number of characters of the path.
sb_t_file * file
Array of files.
int n
Number of elements of the array file.
Image information details structure.
sb_t_image_info_type type
Type of the image.
sb_t_project_info project_info
Project information data.
Array of the image information details structure.
sb_t_image_info_detail * details
Array of sb_t_image_info_detail.
int bytes_per_pixel
Number of bytes of each pixel.
int width
Width, in pixel, of the image.
unsigned char * data
Pointer to the data.
unsigned char * free_data
sb_t_image_format format
Format of the image pixel.
int height
Height, in pixel, of the image.
sb_t_rle rle
Image rle data (valid in case the image compression type is SB_IMAGE_COMPRESS_RLE)
int size
Dimension, in bytes, of the vector sb_t_image::data .
int width_step
Number of bytes to move the pointer to one row to the next one.
sb_t_image_compress_type compression
Image compression type.
General information about sb library and computing devices like CPU and GPUs.
sb_t_devices_info devices
List of available computing devices.
sb_t_version version
Version of the sb library.
signed long long malloc_size
Current allocated memory, expressed in bytes, by sb the library.
int dl_modules_enabled
Value is different from 0 if Deep Learning modules are enabled.
signed long long malloc_size_max
Maximum allocated memory, expressed in bytes, by sb the library.
Defines the configurations of the license.
float speed_boost
Maximum detection speed boost allowed with the current license configuration.
int num_features
Maximum number of features allowed with the current license configuration.
int num_models
Maximum number of models allowed with the current license configuration.
sb_t_license_configuration_id id
License configuration identifier.
int num_threads
Maximum number of threads allowed with the current license configuration.
Defines all the attributes and properties of a license module.
int training
Training status.
signed long long time_start
Start date of the license.
sb_t_license_module_status status
The license status.
signed long long time_end
End date of the license.
sb_t_err err
The license error.
signed long long remain
Number of second before expiration.
sb_t_version version
Version of the module when the license was created.
sb_t_license_configuration configuration
License configuration.
sb_t_license_type type
License type of the module.
Defines the license and its properties.
signed long long time_modify
Last modification date.
signed long long time_save
Last save date.
signed long long time_create
Creation date.
Struct that defines the coordinates of a point of a lut.
unsigned short y
ordinate of the point.
unsigned short x
abscissa of the point.
signed long long system_free
system free physical memory, in bytes
signed long long proc_virtual_used
virtual memory used by process, in bytes
signed long long proc_physical_used
physical memory used by the process, in bytes
signed long long system_total
system physical memory, in bytes
signed long long system_used
system used physical memory, in bytes
signed long long proc_virtual_used_max
maximum virtual memory used by the process, in bytes
signed long long proc_virtual_max
maximum virtual memory usable by the process, in bytes
signed long long proc_physical_used_max
maximum physical memory used by the process, in bytes
int lines
Number of the lines identified.
char * string
ocr result in string format
int words
Number of the words identified.
Information on what sb_project_set_par and sb_image_info_apply_par_changes do when they apply the new...
char * models
String of the name of the models to be invalidated.
sb_t_par par_cur
The current parameters of the project.
sb_t_par par_new
The new parameters that the user wants to set in the project.
int enabled
Enabling flag of the level.
int size
Number of levels that is number of elements of the array level.
Information about mapping between old and new models and levels in the sb_t_par structure.
int index
Index of the corresponding model, -1 if not present.
sb_t_par_perturbations perturbations
Perturbations of the samples.
sb_t_size obj_size
Model size.
int num_occurrences
Number of occurrences of the model that the function sb_project_get_res should export.
sb_t_size obj_stride_coarse
Coarse search step.
float defect_area_threshold
Threshold weight value for the bad area of the sample.
sb_t_rgba color_opt
Color of the optional defects.
sb_t_rgba color
Color of the defects.
float defect_area_percentage
Threshold percentage bad area of the sample to discard it as an occurrency.
sb_t_size obj_stride_fine
Fine search step.
int enabled
Enabling status of the model.
sb_t_par_levels levels
Array of levels parameters for this model.
sb_t_size obj_min_distance
Minimum distance between two samples.
Array of models parameters.
int size
Number of models that is number of elements of the array model.
Describes the perturbation of a sample.
sb_t_range angle_range
Angular range, in degrees, for random rotation.
int flip_vertical
Flip around x-axis. 3th operation.
int angle
Rotation angle, in degrees, of the sample. 1th operation.
int flip_horizontal
Flip around y-axis. 2th operation.
int num_synthetic_samples
Number of synthetic sample to generated with a random angle in the range sb_t_par_perturbation::angle...
List of the perturbations of a sample.
int size
Number of used elements of the array perturbation.
Shallow Learning modules parameters.
float speed_boost
Detection speed boost.
int detection_out_of_roi
Allow the detection of occurrencies at the extremities or partially outside the analysis roi.
int surface_blob_analysis
Enables the blob analysis.
sb_t_devices_par devices
Devices used for detection.
sb_t_par_sl sl
Shallow Learning modules parameters.
sb_t_par_models models
Models parameters.
int num_threads
Maximum number of OpenMP threads that detection can use.
sb_t_floating_point_op_type floating_point_precision
Floating Point precision used to run operations.
sb_t_svl_par svl
SVL parameters.
sb_t_project_type project_type
Project type.
sb_t_interpolation_mode resize_mode
Interpolation mode used to resize the images.
sb_t_rgba color_opt
Color of the optional defects for all models.
sb_t_blob_par blob_par
Surface blob analysis parameters.
Represents an ordered pair of float x and y coordinates that defines a point in a two-dimensional pla...
Represents an ordered pair of integer x and y coordinates that defines a point in a two-dimensional p...
int x
abscissa of the point
int y
ordinate of the point
sb_t_project_type type
Project type.
Array of the projects info.
sb_t_project_info * info
Array of solution project information.
int size
Number of projects.
Represents an ordered pair of float minimum and maximum values that defines a range.
Represents an ordered pair of 32 bits signed integer minimum and maximum values that defines a range.
Defines the position and size of a rectangle in a two-dimensional plane.
int y
y coordinate of the upper left corner of the rectangle
int x
x coordinate of the upper left corner of the rectangle
int width
width of the rectangle
int height
height of the rectangle
Defines the results of a model.
sb_t_surface_res * surface
Surface model analysis result.
int out_of_roi
Count of Out Of ROI.
int disabled
Count of samples with model disabled.
int tp
Count of True Positive.
int on
Count of Optional Negative.
int fp
Count of False Positive.
int tn
Count of True Negative.
int op
Count of Optional Positive.
int fn
Count of False Negative.
Defines the results of the models.
int size
Number of element of the array sb_t_res_models::model.
sb_t_res_model * model
Array of the models result.
int is_valid
It is 1 when the fields of the structure are valid, otherwise it is 0.
sb_t_tiles_info * tiles
Information about the tiles used to process the image.
sb_t_samples samples
Samples found in the image.
long long time_us
Elaboration time of the image, in us.
sb_t_err err
Error of last image processing with sb_project_detection function .
sb_t_par par
Project parameters.
sb_t_ocr_res ocr
Result of OCR analysis.
sb_t_devices_par devices
The devices used to compute the current results.
sb_t_res_model global
Global results.
int img_width_circular
Original width of the image, before the extension in the x-axis.
sb_t_res_models models
Models results.
Defines the color in the format RGBA.
unsigned char r
red component of color
unsigned char g
green component of color
unsigned char b
blue component of color
unsigned char a
trasparency of color
int offset
Offset of the segment from the beginning of the uncompressed buffer, in bytes.
int x
x-coordinate of the beginning of the segment
int length
Length of the segment.
unsigned int value
Value of the segment.
int y
y-coordinate of the beginning of the segment
sb_t_rle_seg * seg
Pointer to RLE buffer.
int size
Number of elements of seg array.
sb_t_rect bounding_box
Bounding box of the roi (Not used for defects roi)
sb_t_rgba color
Color RGBA of the roi (Not used for defects roi)
sb_t_image * img
8bit BW image.
Image of weights of the sample.
float max
maximum weight corresponding, in the image, the to value 255.
sb_t_image * img
Image of the weights of the sample, format is SB_IMAGE_FORMAT_BW8.
float min
minimum weight corresponding, in the image, the to value 1.
sb_t_point centre_warp
Coordinates of the centre in the warped image.
sb_t_point centre
Coordinates of the centre of the sample.
void * user_data
Pointer to the user data.
float defect_area_percentage
sb_t_truth truth
Truth of the sample.
int user_data_size
Size, in bytes, of sb_t_sample::user_data buffer.
int is_near
FALSE NEGATIVE with some other sample close to it.
sb_t_sample_weights_image weights_image
Image of the weights of the sample.
sb_t_sample_classify_mode classify_mode
Classification mode.
sb_t_obj_type type
Sample type.
float weight
Weight of classification.
int size
Number of samples that is number of elements of the array sb_t_samples::sample .
sb_t_sample * sample
Pointer to the array of sample. The number of element is sb_t_samples::size .
Represents an ordered pair of float x and y length that defines a rectangle in a two-dimensional plan...
Represents an ordered pair of integer x and y length that defines a rectangle in a two-dimensional pl...
sb_t_version version
Version of the solution.
sb_t_projects_info projects
Array of the projects info.
int current_project
Index of the current project in the projects array.
sb_t_range_flt fp_weight
Range of classification weight of the False Positive samples.
int fn
Count of False Negative.
int on
Count of Optional Negative.
int tp
Count of True Positive.
float specificity
specificity
sb_t_range_flt op_weight
Range of classification weight of the Optional Positive samples.
sb_t_range_flt or_weight
Range of classification weight of the out of the ROI samples.
int op
Count of Optional Positive.
int mod_disabled
Count of samples with model disabled.
int fp
Count of False Positive.
sb_t_range_flt tp_weight
Range of classification weight of the True Positive samples.
sb_t_range_flt fn_weight
Range of classification weight of the False Negative samples.
sb_t_range_flt on_weight
Range of classification weight of the Optional Negative samples.
sb_t_range_flt tn_weight
Range of classification weight of the True Negative samples.
int out_of_roi
Count of Out Of ROI.
int tn
Count of True Negative.
int size
Number of models that is number of elements of the array model.
Statistics of the elaborations done with the function sb_project_detection .
long long time_res_us
Total sb_project_get_res time in microsecond. This time is included in the time_us.
float specificity
Specificity.
int good
Counter of "Good" images.
long long time_us
Total analysis time in microsecond.
long long time_blob_us
Total blob analysis time in microsecond. This time is included in the time_us.
int no_good
Counter of "No Good" images.
long long time_us_average
Average analyis time in microsecond.
int elaborated
Count of the elaborated images.
sb_t_stat_model global
Global statistics.
int overkill
Counter of "Overkill" images.
sb_t_stat_models models
Array of the statistics of the models.
long long time_res_us_average
Average sb_project_get_res time in microsecond.
int escape
Counter of "Escape" images.
sb_t_par par
Project parameters.
float precision
Precision.
long long time_blob_us_average
Average blob analyis time in microsecond.
Defines the result of the Surface analysis.
sb_t_point ul
Coordinates of the upper left corner.
sb_t_image * model
Model plane image.
sb_t_blobs * blobs
Defects blobs extracted.
sb_t_image * truth
Truth plane image.
sb_t_image * weight
Image of the voting plan.
sb_t_surface_image_truth image_truth
Truth of the image.
Deep Learning modules parameters.
float features_multiplier
Features multiplier factor of the network.
sb_t_image_format image_format
Network input image format.
int n_channels
Network input channels.
sb_t_size input_size
Network input size.
sb_t_network_type type
Network type.
Describes the perturbation of the image / defect.
sb_t_range angle_range
Angular range, in degrees, for random rotation.
float shift_horizontal
Maximum shift along x-axis.
sb_t_perturbation_type type
Select the perturbation type.
int flip_horizontal
Flip around y-axis.
float stretch_contrast
Maximum variation for histogram stretching.
float shift_vertical
Maximum shift along y-axis.
sb_t_perturbation_mode mode
Select the perturbation mode.
int flip_vertical
Flip around x-axis.
float delta_scale
Maximum variation for defects scaling.
float delta_brightness
Maximum delta of brightness.
SVL parameters to configure the Deep Learning training.
int batch_size
Size of the batch used during SVL.
int save_best
At the end of the training, the best internal parameters configuration is recovered.
sb_t_size tile_factor
Number of horizontal and vertical tiles used to process the image.
float learning_rate
Learning rate.
sb_t_size_flt scale
Scale to applied to the image before the processing.
int pre_trained
The network is loaded as pre-trained, i.e. network parameters are not randomly initialized before tra...
int auto_tiling
Enable the automatic tiling for image processing.
sb_t_svl_dl_par_network network
Network parameters.
int num_epochs
Number of epochs.
sb_t_loss_fn_type loss_fn
Loss function.
sb_t_svl_dl_par_perturbation perturbations
Perturbations for deep learning training.
float validation_percentage
Validation percentage.
Contains information regarding the error of the SVL.
sb_t_err err
Error code sb_t_err.
float dist
Distance, in pixel, between the samples.
float min_dist
Minimum allowed distance between samples.
int num_samples
Number of samples.
sb_fp_svl_progress fp_progress
The SVL calls this callback to notify the user the results of SVL.
int num_threads
Maximum number of OpenMP threads that SVL can use.
sb_t_svl_sl_par sl
Shallow Learning SVL parameters.
sb_fp_svl_pre_elaboration fp_pre_elaboration
Callback to execute an image pre elaboration.
float free_memory_percentage
Percentage of system memory that the svl tries to leave free.
sb_t_devices_par devices
Devices used for SVL/training.
sb_t_image_circularity_type image_circularity_type
Image circularity.
sb_fp_svl_command fp_command
Callback called by SVL to allow the user to decide how to continue when particular situations happen,...
void * user_data
Pointer to data which is passed to the callbacks.
sb_t_svl_dl_par dl
Deep Learning SVL parameters.
int reproducibility
Enable the reproducibility of the training.
Contains the results of the image pre-processing.
sb_t_image * image
Pre processed image, that is the warped image.
SB_HANDLE warped2ori
lut of the samples coordinates from warped image to the original one.
sb_t_roi * roi
Image elaboration ROI.
sb_t_roi * roi_defects
Image defects ROI.
Results of a training epoch.
float validation_accuracy
SVL validation accuracy metric.
float validation_loss
SVL validation loss.
float accuracy
SVL accuracy metric.
Results of the training epochs.
sb_t_svl_res_epoch * epoch
Array of the results of the training epochs.
int size
Number of the elements of the array epoch .
Defines the results of the elaboration of the SVL of an image.
sb_t_image_info_type type
Image type. The possible values are SB_IMAGE_INFO_TYPE_SVL, SB_IMAGE_INFO_TYPE_SVL_USED.
Defines the results of the elaboration of the SVL images.
int size
Number of images that is number of elements of the array sb_t_svl_res_images::image .
sb_t_svl_res_image * image
Pointer to the array of SVL images results. The number of element is sb_t_svl_res_images::size .
Results of the SVL of a level per model.
int num_img_l
Number of images of the training dataset used for learning.
int num_samples_l
Number of samples of the training dataset used for learning.
int out_of_roi
Number of Out Of ROI samples, both optional and required.
int reset
1 if the SVL of the model has been resetted or when the user reset the SVL, 0 otherwise.
int mod_disabled
Number of samples with disabled model, both optional and required.
int op
Number of OPTIONAL POSITIVE samples.
sb_t_svl_par_optimization_mode optimization_mode
Optimization mode.
sb_t_svl_res_epochs epochs
Results of training of module based on Deep Learning.
float goodness
Goodness of the training.
int fn
Number of FALSE NEGATIVE samples.
int tn
Number of TRUE NEGATIVE samples.
int num_samples_t
Number of samples of the training dataset not used for learning.
int tp
Number of TRUE POSITIVE samples.
int on
Number of OPTIONAL NEGATIVE samples.
int fp
Number of FALSE POSITIVE samples.
char * warning
Warning in string format occurred during the training.
Results of the SVL of a levels processed.
int size
Number of the elements of the array level.
Results of the SVL of a specific model.
sb_t_svl_res_levels levels
Specific results for each level.
sb_t_svl_res_level global
Cumulative results of all levels.
Results of the SVL of a models processed.
int size
Number of the elements of the array model.
Defines the results of SVL.
sb_t_svl_res_models models
Results for each model.
sb_t_samples * list_op
List of Optional Positive samples.
int num_img_test
Number of test images of the project.
sb_t_samples * list_out_of_roi
List of samples out of the ROI.
sb_t_samples * list_on
List of Optional Negative samples.
sb_t_svl_res_images * list_img_elab
Results for each images.
sb_t_svl_err err
Error details.
sb_t_svl_res_level global
Cumulative results of all levels of all models.
sb_t_svl_command last_command
Command executed by SVL after a stop that is detailed with the parameter stop_reason.
sb_t_samples * list_tn
List of True Negative samples.
long long time_ms_last_improvement
Time, in ms, when there was the last improvement.
long long time_ms
Execution time, in ms, of SVL.
sb_t_par par
Project parameters.
int num_img_svl
Number of svl images of the project.
int reset_done
The SVL reset has been done or no training has been done yet.
sb_t_samples * list_tp
List of True Positive samples.
sb_t_svl_stop_reason stop_reason
It describes the reason why the SVL is finished.
long long time_left_ms
Estimated time, in ms, left to the end of the SVL.
sb_t_devices_par devices
The devices used to compute the current SVL results.
sb_t_samples * list_fn
List of False Negative samples.
char running_step[256]
Description of the current step of the training.
sb_t_samples * list_fp
List of False Positive samples.
SVL parameters that configure the Shallow Learning training.
int auto_levels
Enable the automatic Surface levels training.
sb_t_svl_par_optimization_mode optimization_mode
Optimization mode.
float goodness_target
Goodness target of the training.
sb_t_rect rect
Rectangle of the tile on the elaborated image.
sb_t_tile_type type
Tile type.
Information about the tiles used to process the image.
sb_t_tiles tiles
Tiles list.
sb_t_size_flt scale
Scale factor.
sb_t_size factor
Number of horizontal and vertical tiles used to process the image.
sb_t_tile * tile
Tiles array.
int size
Number of elements of the array sb_t_tiles::tile.
int vminor
vminor number, changes on internal improvement which doesn't modify the interface
int build_major
build_major number, changes every time the library is built
int minor
minor number, changes when the interface is no longer compatible
int major
major number, changes when there are new features