SqueezeBrains SDK 1.18
sb.h
Go to the documentation of this file.
1//Created on : 22 Jan 2016
2
3//#define SB_PROFILE_TIME //Abilitare se si deve profilare il tempo di calcolo della sb_project_detection
4//#define SB_DEBUG_PROJECT_GET_PAR_MEMORY_LEAK
5
6//Il define rende non modificabili dall'utente questi parametri.
7//Se si modificano i seguenti parametri la funzione sb_project_set_par da errore.
8//sb_t_par.svl.dl.perturbations.inpainter_path
9//sb_t_par.svl.dl.perturbations.mode
10//sb_t_par.svl.dl.perturbations.type
11//sb_t_par.svl.dl.learning_rate
12//sb_t_par.svl.dl.network.n_channels
13//sb_t_par.svl.dl.network.input_size
14//sb_t_par.svl.dl.network.image_format
15//sb_t_par.svl.dl.network.freeze_mode
16//sb_t_par.svl.dl.loss_fn
17//#define SB_ENABLE_DL_RESERVED_PAR
18
19#ifdef SB_ENABLE_DL_RESERVED_PAR
20//#define SB_ENABLE_TENSORFLOW
21#endif
22
23//#define ENABLE_TILING_GET_RANGE // Abilita la funzione sb_par_tiling_get_range
24//#define ENABLE_DEEP_RETINA // Abilita il modulo Deep Retina
25//#define NEW_VERSION_SDINET1
26//Il define abilita la rete di segmentazione semantica UNet.
27//#define NEW_VERSION_DEEP_SURFACE_UNET
28
29
6133#ifndef INCLUDE_SB_H_
6134#define INCLUDE_SB_H_
6135
6136#include <time.h>
6137#include <stdio.h>
6138
6139#ifdef __cplusplus
6140# define SB_EXTERN_C extern "C"
6141#else
6142# define SB_EXTERN_C extern
6143#endif
6144
6145#if defined _MSC_VER
6146# define SB_CDECL __cdecl
6147#else
6148# define SB_CDECL
6149#endif
6150
6151#ifndef SB_DL_DLL //sb_lib
6152# ifdef _MSC_VER
6153# ifdef SB_API_EXPORTS
6154# define SB_EXPORTS __declspec(dllexport)
6155# define SB_DL_EXPORTS __declspec(dllimport)
6156# else
6157# define SB_EXPORTS __declspec(dllimport)
6158# endif
6159# else
6160# ifdef SB_API_EXPORTS
6161# define SB_EXPORTS __attribute__ ((visibility ("default")))
6162# define SB_DL_EXPORTS __attribute__ ((visibility ("default")))
6163# else
6164# define SB_EXPORTS
6165# endif
6166# endif
6167# define SB_PUBLIC(return_type) SB_EXTERN_C SB_EXPORTS return_type SB_CDECL
6168# define SB_DL_PUBLIC(return_type) SB_EXTERN_C SB_DL_EXPORTS return_type SB_CDECL
6169#else //sb_dl_lib
6170# ifdef _MSC_VER
6171# ifdef SB_DL_API_EXPORTS
6172# define SB_DL_EXPORTS __declspec(dllexport)
6173# else
6174# define SB_DL_EXPORTS __declspec(dllimport)
6175# endif
6176# else
6177# ifdef SB_DL_API_EXPORTS
6178# define SB_DL_EXPORTS __attribute__ ((visibility ("default")))
6179# else
6180# define SB_DL_EXPORTS
6181# endif
6182# endif
6183# define SB_PUBLIC(return_type) SB_EXTERN_C return_type SB_CDECL
6184# define SB_DL_PUBLIC(return_type) SB_EXTERN_C SB_DL_EXPORTS return_type SB_CDECL
6185#endif //SB_DL_DLL
6186
6187#if defined __cplusplus
6188# define SB_INLINE inline
6189#else
6190# define SB_INLINE static __inline
6191#endif
6192
6229typedef enum
6230{
6234 SB_ERR_CLS = 30000,
6331 SB_ERR_MALLOC = 140000,
6355 SB_ERR_ROI = 230000,
6371 SB_ERR_SOCKET = 250000,
6387 //N.B. Fino a 251999 i codici di errore sono riservati ai socket SB_ERR_SOCKET_xxxxx
6388 // Se si cambia modificare anche la funzione sb_err_socket
6400 SB_ERR_THREAD = 280000,
6401 SB_ERR_UUID = 290000,
6406 SB_ERR_XML = 330000,
6408}sb_t_err;
6409
6416typedef void(*sb_fp_trace_callback)(void* const user_data, const char * const msg);
6417
6460SB_PUBLIC(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, void* const user_data);
6461
6467SB_PUBLIC(const char*) sb_err_format(sb_t_err code); // group_error
6469
6478typedef struct
6479{
6480 int x;
6481 int y;
6482}sb_t_point;
6483
6487typedef struct
6488{
6489 float x;
6490 float y;
6492
6496typedef struct
6497{
6498 int width;
6500}sb_t_size;
6501
6505typedef struct
6506{
6507 float width;
6508 float height;
6510
6514typedef struct
6515{
6516 int min;
6517 int max;
6518}sb_t_range;
6519
6523typedef struct
6524{
6525 float min;
6526 float max;
6528
6532typedef struct
6533{
6534 int x;
6535 int y;
6536 int width;
6538}sb_t_rect;
6539
6546SB_INLINE sb_t_point sb_point(int x, int y)
6547{
6548 sb_t_point p;
6549 p.x = x;
6550 p.y = y;
6551 return(p);
6552}
6553
6560SB_INLINE sb_t_point2d_f sb_point2d_f(float x, float y)
6561{
6563 p.x = x;
6564 p.y = y;
6565 return(p);
6566}
6567
6574SB_INLINE sb_t_size sb_size(int width, int height)
6575{
6576 sb_t_size sz;
6577 sz.width = width;
6578 sz.height = height;
6579 return(sz);
6580}
6581
6588SB_INLINE sb_t_size_flt sb_size_flt(float width, float height)
6589{
6590 sb_t_size_flt sz;
6591 sz.width = width;
6592 sz.height = height;
6593 return(sz);
6594}
6595
6602SB_INLINE sb_t_range sb_range(int min, int max)
6603{
6604 sb_t_range r;
6605 r.min = min;
6606 r.max = max;
6607 return(r);
6608}
6609
6616SB_INLINE sb_t_range_flt sb_range_flt(float min, float max)
6617{
6619 r.min = min;
6620 r.max = max;
6621 return(r);
6622}
6623
6632SB_INLINE sb_t_rect sb_rect(int x, int y, int width, int height)
6633{
6634 sb_t_rect r;
6635
6636 r.x = x;
6637 r.y = y;
6638 r.width = width;
6639 r.height = height;
6640
6641 return r;
6642}
6643
6653SB_PUBLIC(sb_t_err) sb_polyline_resize(sb_t_point2d_f* points, int size, sb_t_point2d_f center, float angle, float offset);
6654 // group_geometric
6656
6666#define SB_INIT_ONLY_HW_LICENSE_KEY "ONLY_HW_KEY"
6667
6672#define SB_INIT_ONLY_SB_LICENSE_KEY "ONLY_SB_KEY"
6673
6678#define SB_INIT_NO_LICENSE_KEY "NO_KEY"
6679
6685#define SB_DELIMITER ";"
6686
6690typedef enum
6691{
6696
6724SB_PUBLIC(sb_t_err) sb_init(const char* const license_file);
6725
6749SB_PUBLIC(sb_t_err) sb_init_dl(const char* const search_path, sb_t_dl_library_type lib_type);
6750
6761SB_PUBLIC(sb_t_err) sb_release(void);
6762
6766typedef void * SB_HANDLE;
6767
6772typedef struct
6773{
6774 int major;
6775 int minor;
6779
6788SB_INLINE sb_t_version sb_version(int major, int minor, int vminor, int build_major)
6789{
6790 sb_t_version version;
6791 version.major = major;
6792 version.minor = minor;
6793 version.vminor = vminor;
6794 version.build_major = build_major;
6795 return(version);
6796}
6797
6810SB_PUBLIC(int) sb_version_check(sb_t_version version1, sb_t_version version2);
6811
6815typedef struct
6816{
6817 signed long long proc_virtual_used;
6818 signed long long proc_virtual_used_max;
6819 signed long long proc_virtual_max;
6820 signed long long proc_physical_used;
6821 signed long long proc_physical_used_max;
6822 signed long long system_total;
6823 signed long long system_used;
6824 signed long long system_free;
6826
6830typedef enum
6831{
6838
6842typedef enum
6843{
6849
6854#define SB_FRAMEWORKS_MAX_NUMBER 4
6855
6859typedef struct
6860{
6866
6870 int size;
6872
6877typedef struct
6878{
6883
6889
6893 char name[128];
6894
6901 char compute_capability[8];
6902
6910 int id;
6911
6917
6924
6928typedef struct
6929{
6935
6939 int size;
6941
6945typedef struct
6946{
6948 char version_str[16];
6949 char compile_date[32];
6950 char compile_time[32];
6951 signed long long malloc_size;
6952 signed long long malloc_size_max;
6955}sb_t_info;
6956
6960typedef struct
6961{
6962 unsigned char b;
6963 unsigned char g;
6964 unsigned char r;
6969 unsigned char a;
6970}sb_t_bgra;
6971
6980SB_INLINE sb_t_bgra sb_bgra(unsigned char b, unsigned char g, unsigned char r, unsigned char a)
6981{
6982 sb_t_bgra bgra;
6983 bgra.b = b;
6984 bgra.g = g;
6985 bgra.r = r;
6986 bgra.a = a;
6987 return(bgra);
6988}
6989
6993typedef struct
6994{
6995 unsigned char r;
6996 unsigned char g;
6997 unsigned char b;
7002 unsigned char a;
7003}sb_t_rgba;
7004
7013SB_INLINE sb_t_rgba sb_rgba(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
7014{
7015 sb_t_rgba rgba;
7016 rgba.r = r;
7017 rgba.g = g;
7018 rgba.b = b;
7019 rgba.a = a;
7020 return(rgba);
7021}
7022
7027#define SB_VALUE_NOT_SET 1000000.0f
7028#define SB_PAR_MODELS_NUM 64
7029#define SB_PAR_PERTURBATIONS_NUM 16
7030#define SB_PAR_STRING_LEN 64
7031#define SB_IMAGE_NAME_STRING_LEN 128
7032#define SB_PAR_LEVELS_NUM 32
7033#define SB_PAR_LEVEL_SCALE_GRANULARITY 0.50f
7034#define SB_PAR_LEVEL_SCALE_MIN 1.0f
7035#define SB_PAR_LEVEL_SCALE_MAX 16.0f
7036#define SB_PAR_RETINA_OBJ_SIZE_MIN 24
7037#define SB_PAR_RETINA_OBJ_SIZE_MAX 1024
7038#define SB_PAR_RETINA_OBJ_STRIDE_COARSE_MIN 4
7039#define SB_PAR_RETINA_OBJ_STRIDE_COARSE_MAX 32
7040#define SB_PAR_RETINA_OBJ_STRIDE_FINE_MIN 1
7041#define SB_PAR_RETINA_OBJ_STRIDE_FINE_MAX 8
7042#define SB_PAR_RETINA_OBJ_DISTANCE_MIN 4
7043#define SB_PAR_RETINA_NUM_OCCURRENCES_MIN -1
7044
7045#define SB_SAMPLE_SCALE_GRANULARITY 0.25f
7046#define SB_SAMPLE_SCALE_MIN 1.0f
7047#define SB_SAMPLE_SCALE_MAX 32.0f
7048
7049#define SB_DL_SCALE_MIN 0.1f
7051#define SB_DL_SCALE_MAX 32.0f
7053#define SB_DL_SCALE_GRANULARITY 0.01f
7054
7055#define SB_SVL_DL_INPUT_SDINET0_SIZE_DEFAULT 331
7056#define SB_SVL_DL_INPUT_SDINET0_SIZE_MIN 128
7057#define SB_SVL_DL_INPUT_SDINET0_SIZE_MAX 512
7058
7059#ifdef NEW_VERSION_SDINET1
7060#define SB_SVL_DL_INPUT_SDINET1_SIZE_DEFAULT 331
7061#define SB_SVL_DL_INPUT_SDINET1_SIZE_MIN 128
7062#define SB_SVL_DL_INPUT_SDINET1_SIZE_MAX 512
7063#endif
7064
7065#define SB_SVL_DL_BATCH_SIZE_MIN 4
7066#define SB_SVL_DL_BATCH_SIZE_MAX 512
7067
7068#define SB_SVL_DL_VALIDATION_PERCENTAGE_MIN 0.0f
7069#define SB_SVL_DL_VALIDATION_PERCENTAGE_MAX 0.5f
7070
7071#define SB_SVL_DL_LEARNING_RATE_MIN 0.000001f
7072#define SB_SVL_DL_LEARNING_RATE_MAX 0.01f
7073#define SB_SVL_DL_LEARNING_RATE_DEFAULT 0.001f
7074
7075#define SB_SVL_DL_NUM_TILES_MIN 1
7076#define SB_SVL_DL_NUM_TILES_MAX 64
7077
7078#define SB_SVL_DL_FEATURES_MULTIPLIER_MIN 0.5f
7079#define SB_SVL_DL_FEATURES_MULTIPLIER_MAX 1.5f
7080#define SB_SVL_DL_FEATURES_MULTIPLIER_GRANULARITY 0.1f
7081#define SB_SVL_DL_FEATURES_MULTIPLIER_DEFAULT 1.0f
7082
7083#define SB_SVL_DL_PERTURBATION_SCALE_MIN 0.0f
7084#define SB_SVL_DL_PERTURBATION_SCALE_MAX 0.5f
7085
7086#define SB_SVL_DL_PERTURBATION_SHIFT_MIN 0.0f
7087#define SB_SVL_DL_PERTURBATION_SHIFT_MAX 0.5f
7088
7089#define SB_SVL_DL_PERTURBATION_STRETCH_CONTRAST_MIN 0.0f
7090#define SB_SVL_DL_PERTURBATION_STRETCH_CONTRAST_MAX 0.5f
7091
7092#define SB_SVL_DL_PERTURBATION_DELTA_BRIGHTNESS_MIN 0.0f
7093#define SB_SVL_DL_PERTURBATION_DELTA_BRIGHTNESS_MAX 0.5f
7094
7101#define SB_SURFACE_OPTIONAL_GRAY_LEVEL 128
7102
7112SB_PUBLIC(sb_t_err) sb_get_info(sb_t_info** const info, int dl_devices_info);
7113
7120SB_PUBLIC(sb_t_err) sb_destroy_info(sb_t_info** const info);
7121
7130SB_PUBLIC(sb_t_err) sb_format_info(const sb_t_info* const info, char* const str, int str_size);
7131
7140SB_PUBLIC(sb_t_err) sb_get_uuid(char* const str, size_t size);
7141
7151SB_PUBLIC(sb_t_err) sb_get_file_version(sb_t_version* const ver, const char* const file);
7152
7159typedef enum
7160{
7164
7169typedef enum
7170{
7174
7181SB_PUBLIC(int) sb_is_valid_utf8(const char * string);
7182
7183 // group_generic
7185
7201SB_PUBLIC(SB_HANDLE) sb_xml_node_get(SB_HANDLE parent, const char* const name);
7202
7211
7221
7231
7243SB_PUBLIC(SB_HANDLE) sb_xml_node_add(SB_HANDLE parent, const char* const name, const char* const content);
7244
7255SB_PUBLIC(sb_t_err) sb_xml_node_set(SB_HANDLE parent, const char* const name, const char* const content);
7256
7265SB_PUBLIC(sb_t_err) sb_xml_node_get_name(SB_HANDLE node, char* const str, size_t str_size);
7266
7275SB_PUBLIC(sb_t_err) sb_xml_node_set_attribute(SB_HANDLE node, const char* const attribute_name, const char* const content);
7276
7286SB_PUBLIC(sb_t_err) sb_xml_node_get_attribute(SB_HANDLE node, const char* const attribute_name, char* const str, size_t str_size);
7287
7295SB_PUBLIC(sb_t_err) sb_xml_node_set_itself(SB_HANDLE node, const char* const content);
7296
7305SB_PUBLIC(sb_t_err) sb_xml_node_count(SB_HANDLE parent, const char* const name, int* const cnt);
7306
7316SB_PUBLIC(sb_t_err) sb_xml_node_get_string(SB_HANDLE parent, const char* const name, char* const str, size_t str_size);
7317
7329SB_PUBLIC(sb_t_err) sb_xml_node_get_string_malloc(SB_HANDLE parent, const char* const name, char** const str);
7330
7338SB_PUBLIC(sb_t_err) sb_xml_node_remove(SB_HANDLE parent, const char* const name);
7339
7346SB_PUBLIC(sb_t_err) sb_xml_node_remove_itself(SB_HANDLE node); // group_xml
7348
7357typedef struct
7358{
7359 char name[256];
7360 char *fname;
7361}sb_t_file;
7362
7366typedef struct
7367{
7369 int n;
7372
7386SB_PUBLIC(sb_t_err) sb_folder_load(sb_t_folder** const f, const char* const path, const char* const ext, int sort, int verbosity);
7387
7393
7400SB_PUBLIC(sb_t_err) sb_folder_erase(sb_t_folder *folder, int index);
7401
7407SB_PUBLIC(sb_t_err) sb_folder_create(const char* const path);
7408
7414SB_PUBLIC(sb_t_err) sb_folder_remove(const char* const path);
7415
7422SB_PUBLIC(sb_t_err) sb_folder_rename ( const char* const oldpath, const char* const newpath );
7423
7430SB_PUBLIC(sb_t_err) sb_folder_exist(const char* const path, int* const exist);
7431
7440SB_PUBLIC(sb_t_err) sb_file_extract_name(const char* const full, int with_ext, char* const name, int name_size);
7441
7449SB_PUBLIC(sb_t_err) sb_file_extract_folder(const char* const full, char* const folderpath, int folderpath_size);
7450 // group_folder
7452
7472SB_PUBLIC(void) sb_free(void* ptr);
7473
7491SB_PUBLIC(void*) sb_malloc(size_t size);
7492
7511SB_PUBLIC(void*) sb_calloc(size_t count, size_t size);
7512
7529SB_PUBLIC(void*) sb_realloc(void* ptr, size_t size);
7530
7537typedef enum
7538{
7542
7553
7563 // group_memory
7565
7576typedef enum
7577{
7583
7588typedef enum
7589{
7596
7601typedef enum
7602{
7612
7617typedef enum
7618{
7631
7638typedef struct
7639{
7647
7654
7663
7671
7676typedef struct
7677{
7682
7687
7693
7698
7703 signed long long time_start;
7704
7709 signed long long time_end;
7710
7714 signed long long remain;
7715
7721
7727
7732 char sn[32];
7734
7735#define SB_LICENSE_VENDOR_CODE_SIZE 32
7736
7740typedef struct
7741{
7742 char address[256];
7743 char company[128];
7744 char company_role[128];
7745 char mail[128];
7746 char name[128];
7747 char operating_system[128];
7748 char phone[32];
7749 char surname[128];
7750 char sector_of_interest[1024];
7751 char vat[32];
7752 char vendor_code[SB_LICENSE_VENDOR_CODE_SIZE + 4];
7753 char machine_id[36];
7762 signed long long time_create;
7767 signed long long time_modify;
7772 signed long long time_save;
7774
7785SB_PUBLIC(sb_t_err) sb_license_get_hw_info(char** const str);
7786
7802SB_PUBLIC(sb_t_err) sb_license_check(SB_HANDLE module, char** const msg);
7803
7822SB_PUBLIC(sb_t_err) sb_license_configuration_check(SB_HANDLE module, sb_t_license_configuration_id configuration_id, char** const msg);
7823
7850
7859SB_PUBLIC(sb_t_err) sb_license_format_info(const sb_t_license* const info, char* const str, int str_size);
7860
7869
7878
7886SB_PUBLIC(const char*) sb_license_format_type(sb_t_license_type type);
7887
7896
7911SB_PUBLIC(sb_t_err) sb_license_apply_v2c(const char* const v2c, char** const msg_err, int verbosity);
7912 // group_license
7914
7925#define SB_LUT_POINT_NOT_EXIST 0xFFFF
7926
7931typedef struct
7932{
7933 unsigned short x;
7934 unsigned short y;
7936
7948SB_PUBLIC(sb_t_err) sb_lut_create(SB_HANDLE* phandle, int width, int height);
7949
7957SB_PUBLIC(sb_t_err) sb_lut_destroy(SB_HANDLE* phandle);
7958
7971SB_PUBLIC(sb_t_err) sb_lut_get_ptr(SB_HANDLE phandle, sb_t_lut_point** const ptr);
7972
7981SB_PUBLIC(sb_t_err) sb_lut_get_size(SB_HANDLE phandle, int* const width, int* const height);
7982
7991SB_PUBLIC(sb_t_err) sb_lut_save(SB_HANDLE phandle, const char* const file_path);
7992
8004SB_PUBLIC(sb_t_err) sb_lut_load(SB_HANDLE* phandle, const char* const file_path);
8005
8020SB_PUBLIC(sb_t_err) sb_lut_warp_point(SB_HANDLE phandle, const sb_t_point* const src, sb_t_point* const dst);
8021 // group_lut
8023
8033#define SB_IMAGE_FILE_EXTENSIONS "pgm" SB_DELIMITER \
8034 "ppm" SB_DELIMITER \
8035 "bmp" SB_DELIMITER \
8036 "png" SB_DELIMITER \
8037 "tif" SB_DELIMITER \
8038 "tiff" SB_DELIMITER \
8039 "jpeg" SB_DELIMITER \
8040 "jpg"
8041
8046typedef enum
8047{
8053
8061SB_PUBLIC(const char*) sb_image_format(sb_t_image_format format);
8062
8067typedef enum
8068{
8074
8078typedef struct
8079{
8080 unsigned int value;
8081 int x;
8082 int y;
8086
8090typedef struct
8091{
8093 int size;
8094}sb_t_rle;
8095
8099typedef struct
8100{
8101 unsigned char* data;
8102 unsigned char* free_data;
8104 int width;
8107 int size;
8119
8124
8125#ifdef SB_PUBLIC_INTERNAL_ENABLE
8126#ifdef SB_USE_OPENCV
8127 IplImage *cvi;
8128#else
8129 void* cvi;
8130#endif
8131#endif
8132}sb_t_image;
8133
8145SB_PUBLIC(sb_t_err) sb_image_create(sb_t_image** const pimg, int width, int height, sb_t_image_format format);
8146
8162SB_PUBLIC(sb_t_err) sb_image_create_header(sb_t_image** const pimg, int width, int height, int width_step, sb_t_image_format format);
8163
8173SB_PUBLIC(sb_t_err) sb_image_destroy(sb_t_image** const pimg);
8174
8181typedef enum
8182{
8185
8210SB_PUBLIC(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);
8211
8221SB_PUBLIC(sb_t_err) sb_image_decompress(sb_t_image** const dst, sb_t_image* const src);
8222
8233SB_PUBLIC(sb_t_err) sb_image_set_clip_blend(sb_t_image* const img, int x, int y, const sb_t_rgba* const color);
8234
8245SB_PUBLIC(sb_t_err) sb_image_get_pixel(const sb_t_image* const img, int x, int y, sb_t_rgba* const color);
8246
8256SB_PUBLIC(sb_t_err) sb_image_set_data(sb_t_image* const img, unsigned char* const data);
8257
8266SB_PUBLIC(sb_t_err) sb_image_clone(sb_t_image** const dst, const sb_t_image* const src);
8267
8275SB_PUBLIC(sb_t_err) sb_image_copy(const sb_t_image* const src, sb_t_image* const dst);
8276
8289SB_PUBLIC(sb_t_err) sb_image_copy_rect(const sb_t_image* const src, sb_t_rect rect, sb_t_image** const dst);
8290
8296SB_PUBLIC(sb_t_err) sb_image_clean(sb_t_image* const img);
8297
8331SB_PUBLIC(sb_t_err) sb_image_save(const sb_t_image* const img, const char* const file, const int* const params);
8332
8348SB_PUBLIC(sb_t_err) sb_image_load(sb_t_image** const img, const char* const file);
8349
8365SB_PUBLIC(sb_t_err) sb_image_convert(sb_t_image** const dst, sb_t_image* const src, sb_t_image_format format);
8366
8371typedef enum
8372{
8377
8389SB_PUBLIC(sb_t_err) sb_image_flip(const sb_t_image* const src, sb_t_image* const dst, sb_t_image_flip_mode mode);
8390
8404SB_PUBLIC(sb_t_err) sb_image_shift(const sb_t_image* const src, sb_t_image* const dst, int x_shift, int y_shift, int circular);
8405
8421SB_PUBLIC(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);
8422
8441SB_PUBLIC(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);
8442
8457SB_PUBLIC(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);
8458
8467SB_PUBLIC(sb_t_err) sb_image_change_brightness(const sb_t_image* const src, sb_t_image* const dst, float delta_brightness);
8468
8478SB_PUBLIC(sb_t_err) sb_image_change_contrast(const sb_t_image* const src, sb_t_image* const dst, float delta_contrast);
8479
8483typedef enum
8484{
8489
8498
8505SB_PUBLIC(sb_t_err) sb_image_read_size(sb_t_size* const size, const char* const file);
8506 // group_image
8508
8519typedef struct
8520{
8523 unsigned char lut[256];
8525}sb_t_roi;
8526
8538SB_PUBLIC(sb_t_err) sb_roi_create(sb_t_roi** const roi, int width, int height);
8539
8554SB_PUBLIC(sb_t_err) sb_roi_create_header(sb_t_roi** const roi, int width, int height, int width_step);
8555
8564SB_PUBLIC(sb_t_err) sb_roi_destroy(sb_t_roi** const roi);
8565
8576SB_PUBLIC(sb_t_err) sb_roi_reset(sb_t_roi* const roi);
8577
8589
8597SB_PUBLIC(sb_t_err) sb_roi_set_data(sb_t_roi* const roi, unsigned char* const data);
8598
8616SB_PUBLIC(sb_t_err) sb_roi_set_rect(sb_t_roi* const roi, unsigned char gl, sb_t_rect rect, int reset_roi);
8617
8637SB_PUBLIC(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);
8638
8639
8662SB_PUBLIC(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);
8663
8684SB_PUBLIC(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);
8685
8694SB_PUBLIC(sb_t_err) sb_roi_clone(sb_t_roi** const dst, const sb_t_roi* const src);
8695
8705SB_PUBLIC(sb_t_err) sb_roi_compress(sb_t_roi* const roi);
8706
8715SB_PUBLIC(sb_t_err) sb_roi_decompress(sb_t_roi* const roi);
8716
8726SB_PUBLIC(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);
8727
8748SB_PUBLIC(sb_t_err) sb_roi_apply_lut(sb_t_roi* const roi, unsigned char *lut); // group_roi
8750
8760typedef enum
8761{
8765
8772typedef enum
8773{
8778
8784
8796
8802
8808
8814
8820
8827
8833
8839typedef enum
8840{
8841
8846
8855
8891typedef struct
8892{
8894 float max;
8895 float min;
8897
8907typedef struct
8908{
8909 char uuid[36];
8910 char image_name[SB_IMAGE_NAME_STRING_LEN];
8911
8917
8939
8951 sb_t_point vertex[4];
8952
8976 sb_t_point vertex_warp[4];
8977
8981 char model_name[SB_PAR_STRING_LEN];
8982
8994 float scale;
8995
9000
9013 float weight;
9014
9029
9036
9075
9085
9117 float IoU;
9118
9123} sb_t_sample;
9124
9132SB_PUBLIC(const char*) sb_format_truth(sb_t_truth truth);
9133
9141SB_PUBLIC(sb_t_err) sb_sample_clone(const sb_t_sample* const src, sb_t_sample* const dst);
9142
9149SB_PUBLIC(sb_t_err) sb_sample_destroy(sb_t_sample* const sample);
9150
9160SB_PUBLIC(sb_t_err) sb_sample_weights_image_overlay(sb_t_image* const image, const sb_t_sample* const s);
9161
9166typedef struct
9167{
9169 int size;
9171
9182SB_PUBLIC(sb_t_err) sb_samples_create(sb_t_samples** const samples);
9183
9192SB_PUBLIC(sb_t_err) sb_samples_destroy(sb_t_samples** const samples);
9193
9207SB_PUBLIC(sb_t_err) sb_samples_clone(sb_t_samples** const dst, const sb_t_samples* const src);
9208
9223SB_PUBLIC(sb_t_err) sb_samples_insert(sb_t_samples* const samples, const sb_t_sample* const sample, int sample_index);
9224
9237SB_PUBLIC(sb_t_err) sb_samples_remove(sb_t_samples* const samples, int sample_index);
9238
9246SB_PUBLIC(sb_t_err) sb_samples_swap(sb_t_samples* const samples, int sample_index_1, int sample_index_2);
9247
9259SB_PUBLIC(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);
9260
9268SB_PUBLIC(sb_t_err) sb_sample_get_model_index(const sb_t_sample* const s, SB_HANDLE handle, int* const model_index);
9269
9277SB_PUBLIC(sb_t_err) sb_sample_get_level_index(const sb_t_sample* const s, SB_HANDLE handle, int* const level_index);
9278
9292SB_PUBLIC(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); // group_samples
9294
9295
9305typedef enum
9306{
9315
9326
9337typedef enum
9338{
9349
9353typedef struct
9354{
9364 unsigned char lut[256];
9401
9405typedef struct
9406{
9407 long long time_rle;
9408 long long time_blob;
9409 long long time_contour;
9410 long long time_merge;
9411 long long time_sort;
9412 long long time_export;
9413 long long time_total;
9426
9431typedef enum
9432{
9437
9441typedef struct
9442{
9444 int area;
9445 int od;
9446 int lut;
9470 char model_name[SB_PAR_STRING_LEN];
9481 float angle;
9487 sb_t_point2d_f coord_min_rot_rect[4];
9493 float m_xx;
9499 float m_yy;
9506 float m_xy;
9507}sb_t_blob;
9508
9512typedef struct
9513{
9514 int size;
9518}sb_t_blobs;
9519
9525SB_PUBLIC(sb_t_err) sb_blobs_create(sb_t_blobs** const blobs);
9526
9533
9547SB_PUBLIC(sb_t_err) sb_blob_format_par(int* const c, char* const str, int str_size, int indentation, const sb_t_blob_par* const par);
9548
9566SB_PUBLIC(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);
9567
9577SB_PUBLIC(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);
9578
9588SB_PUBLIC(sb_t_err) sb_blobs_plot_roi(const sb_t_blobs* const blobs, sb_t_roi* const roi, unsigned char gl);
9589
9599SB_PUBLIC(sb_t_err) sb_blob_plot_roi(const sb_t_blob* const blob, sb_t_roi* const roi, unsigned char gl);
9600
9608SB_PUBLIC(sb_t_err) sb_blobs_clone(sb_t_blobs** const dst, const sb_t_blobs* const src);
9609
9616SB_PUBLIC(sb_t_err) sb_blobs_destroy(sb_t_blobs** const blobs);
9617
9624SB_PUBLIC(sb_t_err) sb_blob_destroy(sb_t_blob* const blob);
9625
9633SB_PUBLIC(sb_t_err) sb_blob_copy(sb_t_blob* const dst, const sb_t_blob* const src);
9634 // group_blob
9636
9654SB_PUBLIC(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);
9655 // group_roi
9657
9668typedef enum
9669{
9676
9684SB_PUBLIC(const char*) sb_project_type_format(sb_t_project_type type);
9685
9686#define SB_PROJECTS_NUM 32
9687#define SB_PROJECT_UUID_LEN 36
9688
9694typedef struct
9695{
9697 char uuid[SB_PROJECT_UUID_LEN];
9700
9705typedef struct
9706{
9708 int size;
9709}sb_t_projects_info; // group_project 1
9711
9721#define SB_SOLUTION_EXT "rprj"
9722
9726typedef struct
9727{
9732
9744SB_PUBLIC(sb_t_err) sb_solution_get_info(const char* const solution_file, sb_t_solution_info** const solution);
9745
9754
9763SB_PUBLIC(sb_t_err) sb_solution_set_current_project(const char* const solution_file, const char* const project_uuid);
9764
9775SB_PUBLIC(sb_t_err) sb_solution_remove_project(const char* const solution_file, const char* const project_uuid);
9776
9787SB_PUBLIC(sb_t_err) sb_solution_get_version(const char* const solution_file, sb_t_version* version, char* const version_str, int size_version_str);
9788 // group_solution
9790
9791
9804
9815
9820typedef enum
9821{
9827
9839SB_PUBLIC(sb_t_err) sb_project_create(SB_HANDLE* phandle, const char* const project_name, sb_t_project_type project_type);
9840
9864SB_PUBLIC(sb_t_err) sb_project_load(SB_HANDLE* phandle, const char* const solution_file, const char* const project_uuid, sb_t_project_mode mode);
9865
9885SB_PUBLIC(sb_t_err) sb_project_save(SB_HANDLE handle, const char* const solution_file, sb_t_project_mode mode);
9886
9904SB_PUBLIC(sb_t_err) sb_project_clone(SB_HANDLE src, SB_HANDLE* pdst, sb_t_project_mode mode, int regenerate_uuid);
9905
9915SB_PUBLIC(sb_t_err) sb_project_invalidate(SB_HANDLE handle, const char* const model_name, float scale);
9916
9920typedef enum
9921{
9930
9939
9997SB_PUBLIC(sb_t_err) sb_project_check_trained(SB_HANDLE handle, const char* const model_name, float scale, sb_t_project_training_status* const training_status);
9998
10002SB_PUBLIC(sb_t_err) sb_project_get_default_features(SB_HANDLE handle, char* str, int size);
10003
10017SB_PUBLIC(sb_t_err) sb_project_set_sensitivity(SB_HANDLE handle, const char* const model_name, float scale, float sensitivity);
10018
10028SB_PUBLIC(sb_t_err) sb_project_get_sensitivity(SB_HANDLE handle, const char* const model_name, float scale, float* const sensitivity);
10029
10039SB_PUBLIC(sb_t_err) sb_project_get_notes(SB_HANDLE handle, char** const note);
10040
10048SB_PUBLIC(sb_t_err) sb_project_set_notes(SB_HANDLE handle, const char* const note);
10049
10059SB_PUBLIC(sb_t_err) sb_project_get_name(SB_HANDLE handle, char** const name);
10060
10068SB_PUBLIC(sb_t_err) sb_project_set_name(SB_HANDLE handle, const char* const name);
10069
10094
10105SB_PUBLIC(sb_t_err) sb_project_get_svl_version(SB_HANDLE handle, sb_t_version* const version, char* const version_str, int size_version_str);
10106
10147SB_PUBLIC(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);
10148
10162SB_PUBLIC(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);
10163
10168typedef struct
10169{
10175
10219
10229
10244SB_PUBLIC(sb_t_err) sb_project_openvino_conversion(SB_HANDLE handle, const char* const converter_path);
10245 // group_project 2
10247
10255#define SB_PAR_FEATURES_NAMES_LEN 256
10256
10257typedef struct sb_t_svl_res sb_t_svl_res;
10258
10263typedef struct
10264{
10277
10286typedef enum
10287{
10311
10319SB_PUBLIC(const char*) sb_svl_command_format(sb_t_svl_command command);
10320
10329typedef enum
10330{
10353
10362
10373typedef 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);
10374
10385typedef sb_t_err(*sb_fp_svl_progress)(void* const user_data, sb_t_svl_res* res, int force);
10386
10398typedef 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);
10399
10403typedef enum
10404{
10405 SB_NETWORK_TYPE_NONE = 0,
10425#ifdef NEW_VERSION_SDINET1
10429 SB_NETWORK_TYPE_SDINET1 = 110,
10430#endif
10431
10432#ifdef NEW_VERSION_DEEP_SURFACE_UNET
10437 SB_NETWORK_TYPE_UNET_256 = 130,
10438#endif
10449
10454 SB_NETWORK_TYPE_ODNET0 = 300, //TODO DR
10455
10456 //Must be the last
10457 SB_NETWORK_TYPE_END
10459
10467SB_PUBLIC(const char*) sb_network_type_format(sb_t_network_type type);
10468
10472typedef enum
10473{
10501
10502 SB_NETWORK_FREEZE_MODE_END
10504
10513
10518typedef struct
10519{
10541
10549
10558
10566
10575
10586
10587 //TODO aggiungere questa nota quando si riabilita la funzione sb_par_tiling_get_range
10588 //The @ref sb_par_tiling_get_range function returns the variability range of the image resolution given the @ref sb_t_svl_dl_tiling_par.scale "scale" and the number of tiles.
10589
10609typedef enum
10610{
10625
10650
10658SB_PUBLIC(const char*) sb_tiling_mode_format(sb_t_tiling_mode mode);
10659
10663typedef enum
10664{
10697 //SB_LOSS_FN_TYPE_DICE,
10702 //SB_LOSS_FN_TYPE_RMI,
10703#ifdef ENABLE_DEEP_RETINA
10707 SB_LOSS_FN_TYPE_YOLO,
10708#endif
10710
10718SB_PUBLIC(const char*) sb_loss_fn_type_format(sb_t_loss_fn_type type);
10719
10723typedef enum
10724{
10785
10794
10799typedef enum
10800{
10806
10812
10818
10827
10832typedef enum
10833{
10842
10848
10857
10862typedef struct
10863{
10869 char inpainter_path[512];
10870
10877
10884
10893
10902
10910
10918
10926
10935
10943
10953
10957#define SB_PRE_TRAINING_EXT "ptf"
10958
10964typedef struct
10965{
10981
11010
11022
11027typedef struct
11028{
11034
11061 char pre_training_file[512];
11062
11074
11080
11091
11097
11107
11124
11132
11141
11146
11151
11159
11161
11166typedef struct
11167{
11207
11221
11226#define SB_DEVICES_MAX_NUMBER 4
11227
11232typedef struct
11233{
11238
11244
11254
11261typedef struct {
11267
11273
11279
11285
11289 char project_path[512];
11290
11297 char image_ext[64];
11298
11305
11314
11330
11337
11343
11349
11379 // group_svl
11381
11391typedef struct
11392{
11398
11406
11414
11422
11430
11437typedef struct
11438{
11443
11447 int size;
11449
11455typedef struct
11456{
11468 float scale;
11470
11476typedef struct
11477{
11483
11487 int size;
11489
11494typedef struct
11495{
11501
11506 char description[SB_PAR_STRING_LEN];
11507
11577
11593
11605
11611
11619
11627
11654
11669
11683
11705
11717
11728
11732typedef struct
11733{
11739
11744 int size;
11746
11750typedef struct
11751{
11776
11791
11796typedef struct
11797{
11799
11805
11842 unsigned char collaborations[SB_PAR_MODELS_NUM][SB_PAR_MODELS_NUM];
11843
11852
11858
11865
11872
11883
11891
11902
11908
11914}sb_t_par;
11915
11929SB_PUBLIC(sb_t_err) sb_par_create(sb_t_par** const par, sb_t_project_type project_type);
11930
11938SB_PUBLIC(sb_t_err) sb_par_destroy(sb_t_par** const par);
11939
11949SB_PUBLIC(sb_t_err) sb_par_copy(sb_t_par* const dst, const sb_t_par* const src);
11950
11962SB_PUBLIC(sb_t_err) sb_par_clone(sb_t_par** const dst, const sb_t_par* const src);
11963
11978SB_PUBLIC(sb_t_err) sb_par_compare(const sb_t_par* const par1, const sb_t_par* const par2);
11979
11990SB_PUBLIC(sb_t_err) sb_par_init(sb_t_par* const par, sb_t_project_type project_type);
11991
12000SB_PUBLIC(sb_t_err) sb_par_add_model(sb_t_par* const par, const char* const model_name);
12001
12010SB_PUBLIC(sb_t_err) sb_par_remove_model(sb_t_par* const par, const char* const model_name);
12011
12023SB_PUBLIC(sb_t_err) sb_par_set_model_description(sb_t_par* const par, const char* const model_name, const char* const description);
12024
12037SB_PUBLIC(sb_t_err) sb_par_set_devices(sb_t_par* const par, sb_t_device_type device_type, sb_t_framework_type framework, int id, int svl);
12038
12049SB_PUBLIC(sb_t_err) sb_par_add_level(sb_t_par* const par, const char* const model_name, float scale);
12050
12061SB_PUBLIC(sb_t_err) sb_par_remove_level(sb_t_par* const par, const char* const model_name, float scale);
12062
12074SB_PUBLIC(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);
12075
12087SB_PUBLIC(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);
12088
12099SB_PUBLIC(sb_t_err) sb_par_format(const sb_t_par* const par, char* const str, int str_size);
12100
12109
12118
12126SB_PUBLIC(const char*) sb_device_type_format(sb_t_device_type type);
12127
12136
12137#ifdef ENABLE_TILING_GET_RANGE
12141typedef enum
12142{
12143 SB_DL_TILING_CALC_TYPE_NONE = 0,
12144 SB_DL_TILING_CALC_TYPE_IMAGE_SIZE,
12150 SB_DL_TILING_CALC_TYPE_IMAGE_SCALE
12151}sb_t_dl_auto_tile_calc_type;
12152
12160SB_PUBLIC(const char*) sb_dl_auto_tile_calc_type_format(sb_t_dl_auto_tile_calc_type type);
12161
12230SB_PUBLIC(sb_t_err) sb_par_tiling_get_range(sb_t_range_flt* const range, int img_size, sb_t_range_flt scale, int net_size, int tiles, sb_t_tiling_mode tiling_mode, sb_t_image_circularity_type circularity_type, sb_t_dl_auto_tile_calc_type mode);
12231
12243SB_PUBLIC(sb_t_err) sb_par_tiling_get_range_info(const sb_t_par* const par, sb_t_size img_size, char** const pmsg);
12244#endif //ENABLE_TILING_GET_RANGE // group_parameters
12246
12257typedef enum
12258{
12280
12281
12287typedef struct
12288{
12293 char* string;
12294 int words;
12295 int lines;
12297
12305typedef struct
12306{
12313
12319 float recall;
12320
12327
12336
12344
12352typedef struct
12353{
12355
12363
12372
12386
12405
12406
12415
12422
12451typedef struct
12452{
12460 int tp;
12461
12469 int tn;
12470
12478 int fp;
12479
12487 int fn;
12488
12496 int op;
12497
12505 int on;
12506
12515
12523
12531
12536typedef struct
12537{
12539 int size;
12541
12545typedef enum
12546{
12561
12569SB_PUBLIC(const char*) sb_tile_type_format(sb_t_tile_type type);
12570
12574typedef struct
12575{
12578}sb_t_tile;
12579
12583typedef struct
12584{
12586 int size;
12587}sb_t_tiles;
12588
12592typedef struct
12593{
12598
12606SB_PUBLIC(sb_t_err) sb_tiles_info_clone(sb_t_tiles_info** const pdst, const sb_t_tiles_info* const src);
12607
12614
12624SB_PUBLIC(sb_t_err) sb_tiles_info_no_overlap(sb_t_tiles_info* const tiles, sb_t_size img_size, int offset);
12625
12626//TODO TABELLA DEI PUNTATORI NEI RISULTATI
12671typedef struct
12672{
12680
12686
12693
12699
12708
12714
12719 long long time_us;
12720
12725
12734
12739
12746}sb_t_res;
12747
12754SB_PUBLIC(sb_t_err) sb_res_destroy(sb_t_res** const res);
12755
12763SB_PUBLIC(sb_t_err) sb_res_clone(sb_t_res** const dst, const sb_t_res* const src);
12764
12771SB_PUBLIC(sb_t_err) sb_res_compress(sb_t_res* const res);
12772
12778SB_PUBLIC(sb_t_err) sb_res_decompress(sb_t_res* const res);
12779 // group_res
12781
12793typedef struct
12794{
12803 int tp;
12804
12824 int tn;
12825
12834 int fp;
12835
12844 int fn;
12845
12854 int op;
12855
12863 int on;
12864
12873
12888
12894
12901 float score;
12903
12908typedef struct
12909{
12915
12919 int size;
12921
12931typedef struct
12932{
12941
12948
12955 int good;
12956
12963
12970
12977
12978
12979 long long time_us;
12981 long long time_blob_us;
12983 long long time_res_us;
12986}sb_t_stat;
12987
12997SB_PUBLIC(sb_t_err) sb_stat_format(const sb_t_stat* const stat, char* const str, int str_size);
12998
13005SB_PUBLIC(sb_t_err) sb_stat_destroy(sb_t_stat** const stat);
13006
13015SB_PUBLIC(sb_t_err) sb_stat_reset(sb_t_stat* const stat, const sb_t_par* const par);
13016
13029SB_PUBLIC(sb_t_err) sb_stat_from_res(sb_t_stat* const stat, const sb_t_res* const res);
13030 // group_stat
13032
13041typedef struct
13042{
13043 int index;
13044 int lut_level[SB_PAR_LEVELS_NUM];
13046
13053typedef struct
13054{
13059 char* models;
13070
13074
13087SB_PUBLIC(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);
13088
13097
13129SB_PUBLIC(sb_t_err) sb_project_change_type(const char* const solution_file, const char* const project_uuid, sb_t_project_type project_type);
13130
13153#ifdef SB_DEBUG_PROJECT_GET_PAR_MEMORY_LEAK
13154SB_PUBLIC(sb_t_err) sb_project_get_par_imp(const char* const file, const char* const function, int line, SB_HANDLE handle, sb_t_par** const par);
13155#define sb_project_get_par(handle, par) sb_project_get_par_imp(__FILE__, __FUNCTION__, __LINE__, handle, par)
13156#else
13157SB_PUBLIC(sb_t_err) sb_project_get_par(SB_HANDLE handle, sb_t_par** const par);
13158#endif
13159
13245SB_PUBLIC(sb_t_err) sb_project_set_par(SB_HANDLE handle, const sb_t_par* const par);
13246
13267SB_PUBLIC(sb_t_err) sb_project_get_res(SB_HANDLE handle, sb_t_res** const res, int details);
13268
13276
13289SB_PUBLIC(sb_t_err) sb_project_get_stat(SB_HANDLE handle, sb_t_stat** const stat);
13290
13294typedef struct
13295{
13297 char* info;
13299
13303typedef struct
13304{
13306 int size;
13308
13312typedef struct
13313{
13328
13336
13349SB_PUBLIC(sb_t_err) sb_project_detection_get_info(SB_HANDLE handle, const sb_t_image* const src, const sb_t_roi* const roi, sb_t_project_detection_info** const di);
13350 // group_project 3
13352
13364#define SB_IMAGE_INFO_EXT "rtn"
13365
13373typedef enum
13374{
13380
13384typedef struct
13385{
13389
13393typedef struct
13394{
13396 int size;
13398
13408SB_PUBLIC(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);
13409
13418SB_PUBLIC(sb_t_err) sb_image_info_get_details(const char* const image_file, sb_t_image_info_details** details);
13419
13428
13443SB_PUBLIC(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);
13444
13454SB_PUBLIC(sb_t_err) sb_image_info_remove_project(const char* const image_file, const char* const project_uuid);
13455
13480SB_PUBLIC(sb_t_err) sb_image_info_load(SB_HANDLE* image_info, const char* const image_file, SB_HANDLE module_handle);
13481
13490
13499
13510SB_PUBLIC(sb_t_err) sb_image_info_clone(SB_HANDLE src, SB_HANDLE* pdst, SB_HANDLE module_handle);
13511
13532SB_PUBLIC(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);
13533
13542SB_PUBLIC(sb_t_err) sb_image_info_add_sample(SB_HANDLE image_info, const sb_t_sample* const sample);
13543
13554SB_PUBLIC(sb_t_err) sb_image_info_set_samples(SB_HANDLE image_info, const sb_t_samples* const samples);
13555
13569SB_PUBLIC(sb_t_err) sb_image_info_get_samples(SB_HANDLE image_info, sb_t_samples** const samples);
13570
13589SB_PUBLIC(sb_t_err) sb_image_info_check_samples(const sb_t_samples* const samples, SB_HANDLE project, SB_HANDLE image_info, sb_t_size image_size);
13590
13599
13614
13627SB_PUBLIC(sb_t_err) sb_image_info_get_type(SB_HANDLE image_info, const char* const model_name, sb_t_image_info_type* const type);
13628
13642
13650
13659SB_PUBLIC(sb_t_err) sb_image_info_set_notes(SB_HANDLE image_info, const char* const str);
13660
13671SB_PUBLIC(sb_t_err) sb_image_info_get_notes(SB_HANDLE image_info, char** const str);
13672
13681SB_PUBLIC(sb_t_err) sb_image_info_get_name(SB_HANDLE image_info, char* const str, int str_size);
13682
13692SB_PUBLIC(sb_t_err) sb_image_info_set_results(SB_HANDLE image_info, const sb_t_res* const res);
13693
13704SB_PUBLIC(sb_t_err) sb_image_info_get_results(SB_HANDLE image_info, sb_t_res** const res, int compressed);
13705
13714SB_PUBLIC(sb_t_err) sb_image_info_set_project_name(SB_HANDLE image_info, const char* const project_name);
13715
13726
13737SB_PUBLIC(sb_t_err) sb_image_info_set_roi(SB_HANDLE image_info, const sb_t_roi* const roi);
13738
13762SB_PUBLIC(sb_t_err) sb_image_info_get_roi(SB_HANDLE image_info, sb_t_roi** const roi, int width, int height, int compressed);
13763
13776SB_PUBLIC(sb_t_err) sb_image_info_set_roi_defects(SB_HANDLE image_info, const sb_t_roi* const defects);
13777
13801SB_PUBLIC(sb_t_err) sb_image_info_get_roi_defects(SB_HANDLE image_info, sb_t_roi** const defects, int width, int height, int compressed);
13802
13828 // group_image_info
13830
13831
13846SB_PUBLIC(sb_t_err) sb_folder_filter_images(sb_t_folder* const folder, SB_HANDLE module, sb_t_image_info_type image_info_type);
13847 // group_folder_2
13849
13850
13862typedef enum
13863{
13868
13878
13883
13888
13905
13931
13952
14176typedef struct
14177{
14178 char *msg;
14180 char file_name[2][512];
14181 float scale[2];
14183 char model_name[2][SB_PAR_STRING_LEN];
14184 int sample_index[2];
14185 sb_t_point centre[2];
14186 float dist;
14187 float min_dist;
14188 int models_number[2];
14192
14193#define SB_CLS_0 "cls0"
14194#define SB_CLS_1 "cls1"
14195
14200#define SB_FEATURE_0A "0A"
14201#define SB_FEATURE_0B "0B"
14202#define SB_FEATURE_0A_RI "0A_RI"
14203#define SB_FEATURE_0B_RI "0B_RI"
14204#define SB_FEATURE_2A "2A"
14205#define SB_FEATURE_2B "2B"
14206#define SB_FEATURE_2C "2C"
14207#define SB_FEATURE_2D "2D"
14208#define SB_FEATURE_2A_R "2A.R"
14209#define SB_FEATURE_2AA_R "2AA.R"
14210#define SB_FEATURE_2B_R "2B.R"
14211#define SB_FEATURE_2C_R "2C.R"
14212#define SB_FEATURE_2D_R "2D.R"
14213#define SB_FEATURE_2A_G "2A.G"
14214#define SB_FEATURE_2AA_G "2AA.G"
14215#define SB_FEATURE_2B_G "2B.G"
14216#define SB_FEATURE_2C_G "2C.G"
14217#define SB_FEATURE_2D_G "2D.G"
14218#define SB_FEATURE_2A_B "2A.B"
14219#define SB_FEATURE_2AA_B "2AA.B"
14220#define SB_FEATURE_2B_B "2B.B"
14221#define SB_FEATURE_2C_B "2C.B"
14222#define SB_FEATURE_2D_B "2D.B"
14223#define SB_FEATURE_2A_RI "2A_RI"
14224#define SB_FEATURE_2B_RI "2B_RI"
14225#define SB_FEATURE_2C_RI "2C_RI"
14226#define SB_FEATURE_2A_RI_R "2A_RI.R"
14227#define SB_FEATURE_2AA_RI_R "2AA_RI.R"
14228#define SB_FEATURE_2B_RI_R "2B_RI.R"
14229#define SB_FEATURE_2C_RI_R "2C_RI.R"
14230#define SB_FEATURE_2A_RI_G "2A_RI.G"
14231#define SB_FEATURE_2AA_RI_G "2AA_RI.G"
14232#define SB_FEATURE_2B_RI_G "2B_RI.G"
14233#define SB_FEATURE_2C_RI_G "2C_RI.G"
14234#define SB_FEATURE_2A_RI_B "2A_RI.B"
14235#define SB_FEATURE_2AA_RI_B "2AA_RI.B"
14236#define SB_FEATURE_2B_RI_B "2B_RI.B"
14237#define SB_FEATURE_2C_RI_B "2C_RI.B"
14238#define SB_FEATURE_3A "3A"
14239#define SB_FEATURE_3B "3B"
14240#define SB_FEATURE_3C "3C"
14241#define SB_FEATURE_3D "3D"
14242#define SB_FEATURE_3E "3E"
14243#define SB_FEATURE_4A "4A" //group_features
14245
14247#define SB_FEATURES SB_FEATURE_0A SB_DELIMITER \
14248 SB_FEATURE_0B SB_DELIMITER \
14249 SB_FEATURE_0A_RI SB_DELIMITER \
14250 SB_FEATURE_0B_RI SB_DELIMITER \
14251 SB_FEATURE_2A SB_DELIMITER \
14252 SB_FEATURE_2A_R SB_DELIMITER \
14253 SB_FEATURE_2A_G SB_DELIMITER \
14254 SB_FEATURE_2A_B SB_DELIMITER \
14255 SB_FEATURE_2AA_R SB_DELIMITER \
14256 SB_FEATURE_2AA_G SB_DELIMITER \
14257 SB_FEATURE_2AA_B SB_DELIMITER \
14258 SB_FEATURE_2B SB_DELIMITER \
14259 SB_FEATURE_2B_R SB_DELIMITER \
14260 SB_FEATURE_2B_G SB_DELIMITER \
14261 SB_FEATURE_2B_B SB_DELIMITER \
14262 SB_FEATURE_2C SB_DELIMITER \
14263 SB_FEATURE_2C_R SB_DELIMITER \
14264 SB_FEATURE_2C_G SB_DELIMITER \
14265 SB_FEATURE_2C_B SB_DELIMITER \
14266 SB_FEATURE_2D SB_DELIMITER \
14267 SB_FEATURE_2D_R SB_DELIMITER \
14268 SB_FEATURE_2D_G SB_DELIMITER \
14269 SB_FEATURE_2D_B SB_DELIMITER \
14270 SB_FEATURE_2A_RI SB_DELIMITER \
14271 SB_FEATURE_2A_RI_R SB_DELIMITER \
14272 SB_FEATURE_2A_RI_G SB_DELIMITER \
14273 SB_FEATURE_2A_RI_B SB_DELIMITER \
14274 SB_FEATURE_2AA_RI_R SB_DELIMITER \
14275 SB_FEATURE_2AA_RI_G SB_DELIMITER \
14276 SB_FEATURE_2AA_RI_B SB_DELIMITER \
14277 SB_FEATURE_2B_RI SB_DELIMITER \
14278 SB_FEATURE_2B_RI_R SB_DELIMITER \
14279 SB_FEATURE_2B_RI_G SB_DELIMITER \
14280 SB_FEATURE_2B_RI_B SB_DELIMITER \
14281 SB_FEATURE_2C_RI SB_DELIMITER \
14282 SB_FEATURE_2C_RI_R SB_DELIMITER \
14283 SB_FEATURE_2C_RI_G SB_DELIMITER \
14284 SB_FEATURE_2C_RI_B SB_DELIMITER \
14285 SB_FEATURE_3A SB_DELIMITER \
14286 SB_FEATURE_3B SB_DELIMITER \
14287 SB_FEATURE_3C SB_DELIMITER \
14288 SB_FEATURE_3D SB_DELIMITER \
14289 SB_FEATURE_3E SB_DELIMITER \
14290 SB_FEATURE_4A
14291
14305SB_PUBLIC(const char*) sb_feature_description(const char* const feature);
14306
14310typedef struct
14311{
14312 char image_name[SB_IMAGE_NAME_STRING_LEN];
14315
14319typedef struct
14320{
14322 int size;
14324
14329typedef struct
14330{
14338 float loss;
14363
14367typedef struct
14368{
14372 int size;
14374
14390typedef struct
14391{
14411 float score;
14416 int tp;
14421 int fp;
14426 int tn;
14431 int fn;
14436 int op;
14441 int on;
14546 char classificator[32];
14558 char features_available[SB_PAR_FEATURES_NAMES_LEN];
14562 char* warning;
14569
14574typedef struct
14575{
14577 int size;
14579
14583typedef struct
14584{
14596
14600typedef struct
14601{
14610 int size;
14612
14613#define SB_SVL_STEP_INITIALIZATION "initializing data for svl"
14614#define SB_SVL_STEP_SEARCHING_RECIPE "choosing recipe"
14615#define SB_SVL_STEP_TRAINING_RECIPE "training recipe"
14616#define SB_SVL_STEP_FINALIZATION "finalization of svl"
14617#define SB_SVL_STEP_FINISHED "svl has finished"
14618
14642
14668 char running_step[256];
14740 long long time_ms;
14751 long long time_left_ms;
14760};
14761
14803SB_PUBLIC(sb_t_err) sb_svl_run(SB_HANDLE handle);
14804
14813
14821
14832SB_PUBLIC(sb_t_err) sb_svl_get_res(SB_HANDLE handle, sb_t_svl_res** const res);
14833
14841
14849SB_PUBLIC(sb_t_err) sb_svl_clone_res(sb_t_svl_res** const dst, const sb_t_svl_res* const src);
14850
14862SB_PUBLIC(sb_t_err) sb_svl_save_pre_training(SB_HANDLE handle, const char* const file_name);
14863
14877SB_PUBLIC(sb_t_err) sb_pre_training_get_par(sb_t_par** const par, const char* const file_name);
14878 // group_svl
14880
14909SB_PUBLIC(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);
14910
14911 // group_surface // group_cpp
14914#endif
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_blob_distance_mode
Enumerates the algorithm for calculating the distance between blobs.
Definition: sb.h:9338
sb_t_blob_deleted
Defines the deleted blob.
Definition: sb.h:9432
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.
Definition: sb.h:9306
sb_t_err sb_blobs_destroy(sb_t_blobs **const blobs)
Destroys the blobs structure.
sb_t_err sb_blob_format_par(int *const c, char *const str, int str_size, int indentation, const sb_t_blob_par *const par)
Formats the blob analysis parameters 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.
Definition: sb.h:9347
@ SB_BLOB_DISTANCE_MODE_BOUNDING_BOX
The distance between blobs is calculated using the unrotated bounding box.
Definition: sb.h:9342
@ SB_BLOB_OK
Blob is not deleted.
Definition: sb.h:9433
@ SB_BLOB_DELETED_AFTER_MERGE
Blob is deleted after merge.
Definition: sb.h:9435
@ SB_BLOB_DELETED_BEFORE_MERGE
Blob is deleted before merge.
Definition: sb.h:9434
@ SB_PIXEL_CONNECTION_8
8 connection. 8-connected pixels are neighbors to every pixel that touches one of their edges or corn...
Definition: sb.h:9324
@ SB_PIXEL_CONNECTION_4
4 connection.
Definition: sb.h:9314
sb_t_err
Errors code enum.
Definition: sb.h:6230
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, void *const user_data)
Sets the options for the messages trace.
void(* sb_fp_trace_callback)(void *const user_data, const char *const msg)
Definition of the callback for message trace.
Definition: sb.h:6416
@ SB_ERR_SVL_VALIDATION_DATASET
The SVL images dataset is too small to extract a validation dataset.
Definition: sb.h:6399
@ SB_ERR_IMAGE_CREATE
An error occurred creating the image.
Definition: sb.h:6290
@ SB_ERR_FILE_READ
An error occurred reading the file.
Definition: sb.h:6281
@ SB_ERR_MACHINE_ID
Machine id has a wrong format.
Definition: sb.h:6330
@ SB_ERR_LICENSE_MACHINE_ID_MATCH
Machine id doesn't match.
Definition: sb.h:6319
@ SB_ERR_IMAGE_WARP
Image warp function returns an error.
Definition: sb.h:6301
@ SB_ERR_FILE_WRITE
An error occurred writing the file.
Definition: sb.h:6286
@ SB_ERR_PATH_SIZE
the path name exceeds the maximum size
Definition: sb.h:6350
@ SB_ERR_SOCKET_CREATE
An error occurred creating the socket.
Definition: sb.h:6376
@ SB_ERR_IMAGE_FORMAT
The image format is wrong.
Definition: sb.h:6294
@ SB_ERR_MODEL_NOT_TRAINED
The model is not trained.
Definition: sb.h:6339
@ SB_ERR_LICENSE_NOT_FOUND
License key not found.
Definition: sb.h:6323
@ SB_ERR_IMAGE_DEPTH
The image has a wrong bit depth.
Definition: sb.h:6292
@ SB_ERR_FILE_COPY
Error copying a file.
Definition: sb.h:6273
@ SB_ERR_DL_INPAINTER_NOT_ASSIGNED
Deep Learning inpainter network path is not assigned.
Definition: sb.h:6248
@ SB_ERR_DIR_RENAME
An error occurred renaming the folder.
Definition: sb.h:6243
@ SB_ERR_VERSION
Unmanaged version.
Definition: sb.h:6402
@ SB_ERR_MODEL_DISABLED
A model is disabled.
Definition: sb.h:6334
@ SB_ERR_SAMPLE_NOT_FOUND
No sample found.
Definition: sb.h:6359
@ SB_ERR_IMAGE_RESIZE
Image resize function returns an error.
Definition: sb.h:6296
@ SB_ERR_MODEL_NAME
There are two models with the same name.
Definition: sb.h:6335
@ SB_ERR_LICENSE_VERSION
License is incompatible with the library version.
Definition: sb.h:6327
@ SB_ERR_IMAGE_DECODE
An error occurred decoding image.
Definition: sb.h:6291
@ SB_ERR_SVL_CHOOSE_FEATURES_FAST
Choose features failed to find a common combination for fast.
Definition: sb.h:6398
@ SB_ERR_MODEL_NOT_FOUND
The model of the sample is unknown or not assigned.
Definition: sb.h:6338
@ SB_ERR_MODEL_DESC_UTF8
Model description is not conform to UTF - 8 format.
Definition: sb.h:6333
@ SB_ERR_IMAGE_CHANNELS
The image has a wrong number of channels.
Definition: sb.h:6287
@ SB_ERR_SAMPLE_BACKGROUND
Too few background samples to execute the training. Increase the analysis ROI or reduce the scale.
Definition: sb.h:6358
@ SB_ERR_SOCKET_INVALID_IP
IP address is invalid.
Definition: sb.h:6377
@ SB_ERR_FILE_REMOVE
Error removing a file.
Definition: sb.h:6282
@ SB_ERR_SOCKET_INVALID_PORT
Port isn't a valid number.
Definition: sb.h:6378
@ SB_ERR_FILE_VERSION
The file has no version.
Definition: sb.h:6285
@ SB_ERR_DL_PRE_TRAINING_BORDERS_EXTENSION_MODE
The borders extension mode of pre-training file is different from that of the project.
Definition: sb.h:6257
@ SB_ERR_LIBRARY_DEPENDENCIES
Library dependencies not satisfied to execute the requested operation.
Definition: sb.h:6309
@ SB_ERR_SOCKET_LISTEN
Socket listen function has returned an error.
Definition: sb.h:6380
@ SB_ERR_SAMPLE_DISTANCE
There are two samples closer than the minimum distance set.
Definition: sb.h:6363
@ SB_ERR_ENCRYPT
An error occurred encrypting data.
Definition: sb.h:6272
@ SB_ERR_DIR_REMOVE
An error occurred removing the folder.
Definition: sb.h:6244
@ SB_ERR_DL_NETWORK_FILE_NOT_FOUND
Deep Learning Network file not found.
Definition: sb.h:6252
@ SB_ERR_DL_PRE_TRAINING_FILE_NOT_FOUND
Deep Learning pre-training file not found.
Definition: sb.h:6259
@ SB_ERR_LICENSE_EXPIRED
License is expired.
Definition: sb.h:6316
@ SB_ERR_SOCKET_SELECT
Socket select function has returned an error.
Definition: sb.h:6383
@ SB_ERR_SOCKET_SEND
Socket send function has returned an error.
Definition: sb.h:6384
@ SB_ERR_DECRYPT
An error occurred decrypting data.
Definition: sb.h:6239
@ SB_ERR_SVL_WAS_NOT_DONE
The SVL wasn't done.
Definition: sb.h:6395
@ SB_ERR_FILE_EMPTY
File is empty.
Definition: sb.h:6274
@ SB_ERR_DIR_NOT_EXIST
The directory doesn't exist.
Definition: sb.h:6242
@ SB_ERR_SOCKET_SET_PARAMETER
Set socket parameter has returned an error.
Definition: sb.h:6385
@ SB_ERR_LICENSE_MODELS_NUMBER
Number of models is greater than the maximum allowed for the current license configuration.
Definition: sb.h:6322
@ SB_ERR_FILE_NAME_EMPTY
File name is empty.
Definition: sb.h:6278
@ SB_ERR_SOCKET_CONNECT
An error occurred connecting the socket.
Definition: sb.h:6374
@ SB_ERR_BUFFER_SIZE
The buffer has an insufficient size.
Definition: sb.h:6233
@ SB_ERR_LICENSE_SAME_MACHINE_ID
Two licenses have the same machine id.
Definition: sb.h:6324
@ SB_ERR_MODEL_NAME_UNDEFINED
Model name is an empty string.
Definition: sb.h:6336
@ SB_ERR_DL_ROI_DEFECTS_NOT_SET
Not enough ROI defects area in SVL or validation image dataset for at least one model....
Definition: sb.h:6267
@ SB_ERR_IMAGE_LOAD
An error occurred loading the image.
Definition: sb.h:6295
@ SB_ERR_INTERNAL
Internal error.
Definition: sb.h:6305
@ SB_ERR_IMAGE_RESOLUTION
The image has a wrong resolution.
Definition: sb.h:6297
@ SB_ERR_DL_INTERNAL
Internal Deep Learning error.
Definition: sb.h:6251
@ SB_ERR_FILE_FORMAT
Wrong data file format.
Definition: sb.h:6276
@ SB_ERR_PROJECT_LOAD_MODE
The project was loaded with the wrong load parameter.
Definition: sb.h:6351
@ SB_ERR_SOCKET
A socket function has returned an error.
Definition: sb.h:6371
@ SB_ERR_INVALID_MAIL_ADDRESS
Mail address has a wrong format.
Definition: sb.h:6306
@ SB_ERR_NO_FILE_FOUND
No file found in the folder.
Definition: sb.h:6346
@ SB_ERR_DL_PRE_TRAINING_INPUT_SIZE
The input image size of pre-training file is different from that of the project.
Definition: sb.h:6263
@ SB_ERR_SVL_PERTURBATION
A perturbation has not been defined properly.
Definition: sb.h:6394
@ SB_ERR_SOCKET_BIND
An error occurred binding the socket.
Definition: sb.h:6373
@ SB_ERR_SENTINEL_TOO_MANY_KEYS
Too many keys connected to the pc.
Definition: sb.h:6369
@ SB_ERR_LICENSE_DISABLED
License is disabled.
Definition: sb.h:6315
@ SB_ERR_MODELS_ENABLED
There are no models enabled.
Definition: sb.h:6340
@ SB_ERR_LICENSE_CORRUPTED
License file is corrupted.
Definition: sb.h:6314
@ SB_ERR_SENTINEL
Sentinel key returns an error.
Definition: sb.h:6367
@ SB_ERR_PROJECT_NOT_FOUND
Project not found.
Definition: sb.h:6352
@ SB_ERR_FILE_NAME
Wrong file name: too long or unknown extension.
Definition: sb.h:6277
@ SB_ERR_DL_PRE_TRAINING_IMAGE_FORMAT
The image format of pre-training file is different from that of the project.
Definition: sb.h:6262
@ SB_ERR_LIBRARY_FUNCTION_ADDRESS
Could not locate the function.
Definition: sb.h:6310
@ SB_ERR_LEVELS_NUMBER
There aren't levels, or the number of the levels isn't the expected one, or exceeded the maximum leve...
Definition: sb.h:6308
@ SB_ERR_FILE_EXTENSION
Wrong file extension.
Definition: sb.h:6275
@ SB_ERR_XML
Error parsing xml file.
Definition: sb.h:6406
@ SB_ERR_FILE_OPEN
An error occurred opening the file.
Definition: sb.h:6283
@ SB_ERR_SAMPLES_GT_TOO_MANY
Too many ground truth samples.
Definition: sb.h:6365
@ SB_ERR_IMAGE_CIRCULARITY
The image circularity type is wrong.
Definition: sb.h:6288
@ SB_ERR_IMAGE_SIZE
Image has a wrong data size.
Definition: sb.h:6298
@ SB_ERR_IMAGE_WIDTH_STEP
Image has a wrong width_step value.
Definition: sb.h:6302
@ SB_ERR_FILE_NAME_LENGHT
File name too long.
Definition: sb.h:6279
@ SB_ERR_DL_NO_LABELED_IMAGES
No labeled images.
Definition: sb.h:6253
@ SB_ERR_CLS_CREATE
The function for the creation of the classifier has returned an error.
Definition: sb.h:6235
@ SB_ERR_DL_FREEZE_NOT_PRE_TRAINED
You cannot run SVL from scratch with freeze_mode enabled and without a pre-training file.
Definition: sb.h:6247
@ SB_ERR_STRUCT_HEADER_WRONG_VERSION
The version of the structure sb_t_struct_header is wrong.
Definition: sb.h:6393
@ SB_ERR_SAMPLE_WRONG
The sample has wrong data.
Definition: sb.h:6362
@ SB_ERR_DIR_EXIST
Checking the existence of the folder gave error.
Definition: sb.h:6241
@ SB_ERR_IMAGE_COMPRESSION
The image compression type is wrong.
Definition: sb.h:6289
@ SB_ERR_NO_POINT_FOUND
Point isn't found.
Definition: sb.h:6347
@ SB_ERR_IMAGE_TYPE
Unknown image type, should be a sb_t_image_info_type enum value.
Definition: sb.h:6300
@ SB_ERR_STRING_EMPTY
String empty.
Definition: sb.h:6389
@ SB_ERR_DL_PRE_TRAINING_FILE_NOT_VALID
Deep Learning pre-training file is not valid.
Definition: sb.h:6260
@ SB_ERR_NO_FEATURES_AVAILABLE
No features available for the data set.
Definition: sb.h:6344
@ SB_ERR_IMAGE_SIZE_CIRCULAR
Image resolution is smaller than the minimum allowed to handle circularity, reduce the scale or incre...
Definition: sb.h:6299
@ SB_ERR_PROJECT_TYPE
Wrong project type.
Definition: sb.h:6353
@ SB_ERR_LICENSE_WAIT_SERVER
Waiting to contact the license server.
Definition: sb.h:6329
@ SB_ERR_SVL_CHOOSE_FEATURES
Choose features failed to find a good combination.
Definition: sb.h:6397
@ SB_ERR_CLS
The function of a classifier has returned an error.
Definition: sb.h:6234
@ SB_ERR_DL_TILING_MODE
Wrong tiling mode.
Definition: sb.h:6269
@ SB_ERR_INITIALIZE
You must call the initialize function.
Definition: sb.h:6303
@ SB_ERR_ROI
The ROI is wrong.
Definition: sb.h:6355
@ SB_ERR_DL_PRE_TRAINING_MODELS_NUMBER
The models number of pre-training file is different from that of the project.
Definition: sb.h:6265
@ SB_ERR_LICENSE_FEATURES_NUMBER
Number of features is greater than the maximum allowed for the current license configuration.
Definition: sb.h:6317
@ SB_ERR_LIBRARY_OPEN
Could not load the dynamic library or the shared object.
Definition: sb.h:6311
@ SB_ERR_WARP_POINT_NOT_FOUND
Point isn't found in the lut.
Definition: sb.h:6404
@ SB_ERR_FILE_SAVE
An error occurred saving the file.
Definition: sb.h:6284
@ SB_ERR_SENTINEL_MASTER_KEY
Sentinel LDK Master key not present.
Definition: sb.h:6368
@ SB_ERR_MALLOC
The function that allocates memory gave error
Definition: sb.h:6331
@ SB_ERR_BASE64_SIZE
The dimension of the base64 buffer isn't 4 bytes aligned.
Definition: sb.h:6232
@ SB_ERR_THREAD
Thread management error.
Definition: sb.h:6400
@ SB_ERR_MEMORY_LEAK
There is a memory leak.
Definition: sb.h:6332
@ SB_ERR_DL_TRAINING_DATA_MISSING
Deep Learning training data missing.
Definition: sb.h:6271
@ SB_ERR_INSUFFICIENT_FREE_MEMORY
Insufficient free memory to complete the svl.
Definition: sb.h:6304
@ SB_ERR_DL_TILING_RANGE
It is not possible to calculate the range with the set values.
Definition: sb.h:6270
@ SB_ERR_UUID
The generation of UUID has returned an error or invalid UUID.
Definition: sb.h:6401
@ SB_ERR_XML_NODE_NOT_FOUND
An xml node was not found.
Definition: sb.h:6407
@ SB_ERR_NONE
No errors.
Definition: sb.h:6231
@ SB_ERR_NULL_POINTER
Function has been called with a NULL pointer.
Definition: sb.h:6342
@ SB_ERR_LICENSE_TYPE
The license type is unknown.
Definition: sb.h:6326
@ SB_ERR_DL_ROI_NOT_SET
Not enough ROI analysis area in SVL or validation image dataset. Increase the analysis ROI or the til...
Definition: sb.h:6268
@ SB_ERR_LICENSE
The license isn't valid.
Definition: sb.h:6312
@ SB_ERR_STRUCT_HEADER_WRONG_SIZE
The dimension of the structure sb_t_struct_header is wrong.
Definition: sb.h:6392
@ SB_ERR_CLS_TRAINING
The training function has returned an error.
Definition: sb.h:6238
@ SB_ERR_DL_ONNX_CONVERSION
Error in conversion in onnx format.
Definition: sb.h:6255
@ SB_ERR_LICENSE_CODE
Code of the TCP/IP license protocol is wrong.
Definition: sb.h:6313
@ SB_ERR_DL_INPAINTER_NOT_FOUND
Deep Learning inpainter network file not found.
Definition: sb.h:6249
@ SB_ERR_STRUCT_HEADER_WRONG_CODE
The code of the structure sb_t_struct_header is wrong.
Definition: sb.h:6391
@ SB_ERR_WRONG_PARAMETER
The function has been called with a parameter with a wrong value.
Definition: sb.h:6405
@ SB_ERR_DL_PRE_TRAINING_NETWORK_TYPE
The network type of pre-training file is different from that of the project.
Definition: sb.h:6266
@ SB_ERR_LICENSE_FILE
License file error (not exist, not readable, wrong format, wrong mail address)
Definition: sb.h:6318
@ SB_ERR_DIR_CREATE
An error occurred creating the folder.
Definition: sb.h:6240
@ SB_ERR_NVIDIA_NVML
Nvidia NVML returns an error getting gpu information.
Definition: sb.h:6349
@ SB_ERR_LICENSE_VM
License isn't allowed on Virtual Machine.
Definition: sb.h:6328
@ SB_ERR_SVL_WRONG
SVL is wrong.
Definition: sb.h:6396
@ SB_ERR_NO_LEVELS_AVAILABLE
No levels available to be processed.
Definition: sb.h:6345
@ SB_ERR_IMAGE_ENCODE
An error occurred encoding image.
Definition: sb.h:6293
@ SB_ERR_SOCKET_IOCTL
Socket ioctl function has returned an error.
Definition: sb.h:6379
@ SB_ERR_ROI_DEFECTS
The defects ROI is wrong.
Definition: sb.h:6357
@ SB_ERR_LICENSE_TRAINING
License error: training is disabled.
Definition: sb.h:6325
@ SB_ERR_SOCKET_TIMEOUT
Timeout sending or receiving data on socket.
Definition: sb.h:6386
@ SB_ERR_VERSION_FORMAT
Version is not formatted properly.
Definition: sb.h:6403
@ SB_ERR_DL_OPENVINO_DATA_NOT_EXIST
OpenVino weights do not exist.
Definition: sb.h:6256
@ SB_ERR_DL_PRE_TRAINING_IMAGE_CHANNELS
The image number of channels of pre-training file is different from that of the project.
Definition: sb.h:6261
@ SB_ERR_DL_NOT_SUPPORTED
Deep Learning modules are not supported.
Definition: sb.h:6254
@ SB_ERR_DL_CUDA_OUT_OF_MEMORY
CUDA Out Of Memory (OOM). Insufficient free GPU memory to execute the operation. Try reducing the net...
Definition: sb.h:6245
@ SB_ERR_RPF_NAME_EMPTY
The name of solution file is empty.
Definition: sb.h:6354
@ SB_ERR_SOCKET_RECEIVE
Socket receive function has returned an error.
Definition: sb.h:6382
@ SB_ERR_NO_CLASSIFIED_IMAGE
There aren't classified images.
Definition: sb.h:6343
@ SB_ERR_CLS_PREDICT
The predict function has returned an error.
Definition: sb.h:6237
@ SB_ERR_SCALE_NOT_FOUND
The scale is not found.
Definition: sb.h:6366
@ SB_ERR_LICENSE_MAIL_ADDRESS
Mail address in the license file is wrong.
Definition: sb.h:6320
@ SB_ERR_DL_INPUT_NETWORK_SIZE
Deep Learning wrong input network size.
Definition: sb.h:6250
@ SB_ERR_ROI_BOUNDING_BOX
Wrong roi bounding box.
Definition: sb.h:6356
@ SB_ERR_FILE_NOT_EXIST
The file doesn't exist.
Definition: sb.h:6280
@ SB_ERR_SENTINEL_RUN_TIME
Sentinel_LDK_Run-time is not running.
Definition: sb.h:6370
@ SB_ERR_SAMPLE_SCALE
The sample scale is wrong.
Definition: sb.h:6364
@ SB_ERR_SAMPLE_OUT_OF_IMAGE
The sample is out of image.
Definition: sb.h:6361
@ SB_ERR_MODELS_NUMBER
There aren't models, or the number of the models isn't the expected one, or exceeded the maximum mode...
Definition: sb.h:6341
@ SB_ERR_STRING_UTF8
String does not conform to UTF-8 format.
Definition: sb.h:6390
@ SB_ERR_SOCKET_CLOSED
Socket is closed.
Definition: sb.h:6375
@ SB_ERR_MODEL_NAME_UTF8
Model name is not conform to UTF - 8 format.
Definition: sb.h:6337
@ SB_ERR_DL_PRE_TRAINING_FEATURES_MULTIPLIER
The feature multiplier parameter of pre-training file is different from that of the project.
Definition: sb.h:6258
@ SB_ERR_SOCKET_MAC
Error while looking for a valid MAC address.
Definition: sb.h:6381
@ SB_ERR_CLS_NOT_TRAINED
The training wasn't done.
Definition: sb.h:6236
@ SB_ERR_LEVELS_ENABLED
There are no levels enabled.
Definition: sb.h:6307
@ SB_ERR_DL_PRE_TRAINING_LOSS_FN
The loss function of pre-training file is different from that of the project.
Definition: sb.h:6264
@ SB_ERR_DL_FRAMEWORK
Impossible to execute the requested operation: Deep Learning Frameworks not installed or corrupted.
Definition: sb.h:6246
@ SB_ERR_NOT_IMPLEMENTED
The function isn't implemented.
Definition: sb.h:6348
@ SB_ERR_LICENSE_MARKER
Marker of the TCP/IP license protocol is wrong.
Definition: sb.h:6321
@ SB_ERR_SAMPLE_NUMBER
Too few samples to execute the training.
Definition: sb.h:6360
@ SB_ERR_SOCKET_ACCEPT
Socket accept has returned an error.
Definition: sb.h:6372
sb_t_err sb_folder_rename(const char *const oldpath, const char *const newpath)
Renames a folder.
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.
Definition: sb.h:7028
#define SB_PAR_PERTURBATIONS_NUM
Maximum number of perturbation of a sample.
Definition: sb.h:7029
sb_t_dl_library_type
Deep Learning library types.
Definition: sb.h:6691
sb_t_err sb_destroy_info(sb_t_info **const info)
Destroys the structure.
sb_t_err sb_release(void)
Releases all the resources allocates in the library.
sb_t_err sb_get_info(sb_t_info **const info, int dl_devices_info)
The function gets information about the sb library and the available computational devices.
sb_t_floating_point_op_type
Enumerates the floating point precision types to perform operations.
Definition: sb.h:7170
sb_t_err sb_init(const char *const license_file)
Initializes the SB library.
sb_t_err sb_init_dl(const char *const search_path, sb_t_dl_library_type lib_type)
Initialize the Deep Learning 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.
Definition: sb.h:6980
#define SB_PAR_LEVELS_NUM
Maximum scales levels number to be used for Surface.
Definition: sb.h:7032
sb_t_framework_type
Defines framework types.
Definition: sb.h:6843
#define SB_IMAGE_NAME_STRING_LEN
Maximum length, in byte, of the image name string.
Definition: sb.h:7031
sb_t_device_type
Defines computing device types.
Definition: sb.h:6831
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.
Definition: sb.h:6788
void * SB_HANDLE
HANDLE definition.
Definition: sb.h:6766
sb_t_interpolation_mode
Enumerates the interpolation modes.
Definition: sb.h:7160
#define SB_PAR_STRING_LEN
Maximum length, in byte, of a parameter string.
Definition: sb.h:7030
int sb_version_check(sb_t_version version1, sb_t_version version2)
Compares two version.
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.
Definition: sb.h:7013
#define SB_FRAMEWORKS_MAX_NUMBER
Maximum number of frameworks associable to a device managed by the sb library.
Definition: sb.h:6854
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_DL_LIBRARY_NONE
No libraries defined.
Definition: sb.h:6692
@ SB_DL_LIBRARY_PYTORCH
Pytorch library.
Definition: sb.h:6693
@ SB_DL_LIBRARY_OPENVINO
Openvino library. Can be used only for inference with sb_project_detection function.
Definition: sb.h:6694
@ SB_FLOATING_POINT_OPS_TYPE_SINGLE_PRECISION
Single Precision (FP32).
Definition: sb.h:7171
@ SB_FLOATING_POINT_OPS_TYPE_HALF_PRECISION
Half Precision (FP16).
Definition: sb.h:7172
@ SB_FRAMEWORK_TYPE_SB
Framework type SqueezeBrains. To be used for Retina and Surface projects.
Definition: sb.h:6845
@ SB_FRAMEWORK_TYPE_PYTORCH
Framework type Pytorch. To be used for Deep Cortex and Deep Surface projects.
Definition: sb.h:6846
@ SB_FRAMEWORK_TYPE_OPENVINO
Frameowrk type Intel OpenVino. To be used for Deep Cortex and Deep Surface projects (detection only).
Definition: sb.h:6847
@ SB_FRAMEWORK_TYPE_NONE
Framework type None.
Definition: sb.h:6844
@ SB_DEVICE_IGPU_INTEL
GPU Integrated Intel device.
Definition: sb.h:6835
@ SB_DEVICE_DGPU_INTEL
GPU Discrete Intel device.
Definition: sb.h:6836
@ SB_DEVICE_GPU_NVIDIA
GPU NVidia device.
Definition: sb.h:6834
@ SB_DEVICE_NONE
Device not defined.
Definition: sb.h:6832
@ SB_DEVICE_CPU
CPU generic device.
Definition: sb.h:6833
@ SB_INTERPOLATION_MODE_NN
Nearest Neighbor pixel interpolation.
Definition: sb.h:7162
@ SB_INTERPOLATION_MODE_BILINEAR
Bilinear interpolation.
Definition: sb.h:7161
SB_INLINE sb_t_point2d_f sb_point2d_f(float x, float y)
Inline constructor of structure sb_t_point2d_f.
Definition: sb.h:6560
SB_INLINE sb_t_range sb_range(int min, int max)
Inline constructor of structure sb_t_range.
Definition: sb.h:6602
SB_INLINE sb_t_range_flt sb_range_flt(float min, float max)
Inline constructor of structure sb_t_range_flt.
Definition: sb.h:6616
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.
Definition: sb.h:6546
SB_INLINE sb_t_size sb_size(int width, int height)
Inline constructor of structure sb_t_size.
Definition: sb.h:6574
SB_INLINE sb_t_rect sb_rect(int x, int y, int width, int height)
Inline constructor of structure sb_t_rect.
Definition: sb.h:6632
SB_INLINE sb_t_size_flt sb_size_flt(float width, float height)
Inline constructor of structure sb_t_size_flt.
Definition: sb.h:6588
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.
Definition: sb.h:13374
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_check_samples(const sb_t_samples *const samples, SB_HANDLE project, SB_HANDLE image_info, sb_t_size image_size)
Check the correctness of the samples metadata.
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.
Definition: sb.h:13378
@ SB_IMAGE_INFO_TYPE_TEST
Image is used for test.
Definition: sb.h:13376
@ SB_IMAGE_INFO_TYPE_SVL
Image is used for SVL and not used for training.
Definition: sb.h:13377
@ SB_IMAGE_INFO_TYPE_NONE
Image is not used.
Definition: sb.h:13375
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.
Definition: sb.h:8372
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.
Definition: sb.h:8484
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.
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.
Definition: sb.h:8068
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_shift(const sb_t_image *const src, sb_t_image *const dst, int x_shift, int y_shift, int circular)
Shifts the image.
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 crop 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.
Definition: sb.h:8182
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_err sb_image_get_pixel(const sb_t_image *const img, int x, int y, sb_t_rgba *const color)
Get the pixel (x,y).
sb_t_image_format
Format of image pixel.
Definition: sb.h:8047
@ SB_IMAGE_FLIP_VERTICAL
flips the image around vertical axis.
Definition: sb.h:8375
@ SB_IMAGE_FLIP_HORIZONTAL
flips the image around horizontal axis.
Definition: sb.h:8374
@ SB_IMAGE_FLIP_BOTH
flips the image around both horizontal and vertical axises, it is a rotation of 180 degrees.
Definition: sb.h:8373
@ SB_IMAGE_CIRCULARITY_TYPE_HORIZONTAL
Horizontal image circularity.
Definition: sb.h:8486
@ SB_IMAGE_CIRCULARITY_TYPE_NONE
No image circularity.
Definition: sb.h:8485
@ SB_IMAGE_CIRCULARITY_TYPE_VERTICAL
Vertical image circularity, not implemented yet.
Definition: sb.h:8487
@ SB_IMAGE_COMPRESS_JPEG
JPEG compression.
Definition: sb.h:8071
@ SB_IMAGE_COMPRESS_NONE
uncompressed or raw images
Definition: sb.h:8069
@ SB_IMAGE_COMPRESS_RLE
RLE (Run Length Encoding) lossless compression.
Definition: sb.h:8070
@ SB_IMAGE_COMPRESS_PNG
PNG compression.
Definition: sb.h:8072
@ SB_IMAGE_COMPRESS_PAR_JPEG_QUALITY
Quality of jpeg image.
Definition: sb.h:8183
@ SB_IMAGE_FORMAT_BW8
BW: one channel, 8 bit per channel.
Definition: sb.h:8048
@ SB_IMAGE_FORMAT_BGR888
BGR: three channel, 8 bit per channel.
Definition: sb.h:8049
@ SB_IMAGE_FORMAT_RGB888
RGB: three channel, 8 bit per channel.
Definition: sb.h:8050
@ SB_IMAGE_FORMAT_UI32
unsigned int 32 bit
Definition: sb.h:8051
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.
Definition: sb.h:7577
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.
Definition: sb.h:7618
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.
Definition: sb.h:7735
sb_t_license_configuration_id
Enumerations of the license configurations.
Definition: sb.h:7602
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.
Definition: sb.h:7589
@ SB_LICENSE_MODULE_STATUS_ACTIVE
The license is valid and active.
Definition: sb.h:7579
@ SB_LICENSE_MODULE_STATUS_DISABLED
The license is disabled.
Definition: sb.h:7580
@ SB_LICENSE_MODULE_STATUS_ERR
There is an error. See the field sb_t_license_module::err.
Definition: sb.h:7581
@ SB_LICENSE_MODULE_STATUS_NULL
The license status is undefined.
Definition: sb.h:7578
@ SB_LICENSE_MODULE_RETINA
Retina.
Definition: sb.h:7620
@ SB_LICENSE_MODULE_NUMBER
Number of modules.
Definition: sb.h:7629
@ SB_LICENSE_MODULE_NONE
Module type not defined.
Definition: sb.h:7619
@ SB_LICENSE_MODULE_DEEP_RETINA
Deep Retina.
Definition: sb.h:7624
@ SB_LICENSE_MODULE_SURFACE
Surface.
Definition: sb.h:7621
@ SB_LICENSE_MODULE_DEEP_CORTEX
Deep Cortex.
Definition: sb.h:7622
@ SB_LICENSE_MODULE_DEEP_SURFACE
Deep Surface.
Definition: sb.h:7623
@ SB_LICENSE_BASIC
Basic configuration.
Definition: sb.h:7605
@ SB_LICENSE_CONFIGURATION_NUMBER
Number of configurations.
Definition: sb.h:7610
@ SB_LICENSE_PREMIUM
Premium configuration.
Definition: sb.h:7603
@ SB_LICENSE_STANDARD
Standard configuration.
Definition: sb.h:7604
@ SB_LICENSE_NOT_PRESENT
License is not present.
Definition: sb.h:7594
@ SB_LICENSE_DISABLED
License is disabled.
Definition: sb.h:7591
@ SB_LICENSE_MASTER
Master license: hasn't an expiry date.
Definition: sb.h:7593
@ SB_LICENSE_NULL
License type isn't defined.
Definition: sb.h:7590
@ SB_LICENSE_DEMO
Demo license: has an expiry date.
Definition: sb.h:7592
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.
Definition: sb.h:7538
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.
Definition: sb.h:7539
@ SB_MALLOC_CHECK_SECOND_COUNTER
The second counter.
Definition: sb.h:7540
const char * sb_framework_type_format(sb_t_framework_type type)
Returns the string of the framework type.
const char * sb_interpolation_mode_format(sb_t_interpolation_mode mode)
Returns the string of the interpolation mode.
sb_t_err sb_par_copy(sb_t_par *const dst, const sb_t_par *const src)
Copies the project parameters structure.
sb_t_err sb_par_create(sb_t_par **const par, sb_t_project_type project_type)
Creates the project parameters structure.
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_compare(const sb_t_par *const par1, const sb_t_par *const par2)
Compares content of a pair of project parameter structures.
sb_t_err sb_par_set_model_description(sb_t_par *const par, const char *const model_name, const char *const description)
Set a brief description of the model into parameters.
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_clone(sb_t_par **const dst, const sb_t_par *const src)
Clones the project parameters structure.
sb_t_err sb_par_format(const sb_t_par *const par, char *const str, int str_size)
Formats the project 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)
Retrieves the collaboration between two models.
sb_t_err sb_par_set_devices(sb_t_par *const par, sb_t_device_type device_type, sb_t_framework_type framework, int id, int svl)
Set device parameters.
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.
sb_t_err sb_par_destroy(sb_t_par **const par)
Destroys the project parameters structure.
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_project_training_status
Defines project training status.
Definition: sb.h:9921
sb_t_err sb_project_detection_destroy_info(sb_t_project_detection_info **const di)
Destroy the detection info structure.
sb_t_err sb_project_get_scale_offset_par(SB_HANDLE handle, sb_t_scale_offset_par *const scale_offset)
Gets the scale offset from the project handle.
sb_t_project_mode
Defines the loading or saving mode of a project.
Definition: sb.h:9821
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.
Definition: sb.h:9669
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 a solution 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_set_scale_offset_par(SB_HANDLE handle, sb_t_scale_offset_par scale_offset)
Sets in the project handle the scale offset used at detection time.
const char * sb_project_training_status_format(sb_t_project_training_status training_status)
Returns the string of the training status.
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_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_detection_get_info(SB_HANDLE handle, const sb_t_image *const src, const sb_t_roi *const roi, sb_t_project_detection_info **const di)
Returns detection information.
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_openvino_conversion(SB_HANDLE handle, const char *const converter_path)
Starting from the pytorch weights, it generates the openvino weights.
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_t_err sb_project_get_par(SB_HANDLE handle, sb_t_par **const par)
Retrieves the project parameters structure.
sb_t_err sb_project_check_trained(SB_HANDLE handle, const char *const model_name, float scale, sb_t_project_training_status *const training_status)
Checks if the project is trained.
@ SB_PROJECT_TRAINED_NONE
Project is not trained.
Definition: sb.h:9922
@ SB_PROJECT_TRAINED
Project is trained.
Definition: sb.h:9923
@ SB_PROJECT_TRAINED_OPENVINO
Project is trained and Intel OpenVino support is available.
Definition: sb.h:9928
@ SB_PROJECT_MODE_NO_DETECTION
Definition: sb.h:9824
@ SB_PROJECT_MODE_DETECTION_ONLY
Load/save the minimum module information to allow detection.
Definition: sb.h:9822
@ SB_PROJECT_MODE_DETECTION_AND_SVL
Load/save all the module information.
Definition: sb.h:9823
@ SB_PROJECT_TYPE_RETINA
Project Retina.
Definition: sb.h:9670
@ SB_PROJECT_TYPE_DEEP_RETINA
Project Deep Retina.
Definition: sb.h:9674
@ SB_PROJECT_TYPE_SURFACE
Project Surface.
Definition: sb.h:9671
@ SB_PROJECT_TYPE_DEEP_SURFACE
Project Deep Surface.
Definition: sb.h:9672
@ SB_PROJECT_TYPE_DEEP_CORTEX
Project Deep Cortex.
Definition: sb.h:9673
sb_t_err sb_res_decompress(sb_t_res *const res)
Decompress thre results.
sb_t_surface_image_truth
Defines the surface image truth.
Definition: sb.h:12258
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.
Definition: sb.h:12546
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 tile 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.
Definition: sb.h:12274
@ SB_IMAGE_TRUTH_UNDEFINED
Undefined truth.
Definition: sb.h:12262
@ SB_IMAGE_TRUTH_GOOD
No defects.
Definition: sb.h:12266
@ SB_IMAGE_TRUTH_NO_GOOD
Defects found.
Definition: sb.h:12270
@ SB_IMAGE_TRUTH_ESCAPE
Defects not found.
Definition: sb.h:12278
@ SB_TILE_TYPE_NOT_USED
The tile is not used because it has no pixels in the ROI analysis.
Definition: sb.h:12550
@ SB_TILE_TYPE_USED
The tile is used.
Definition: sb.h:12555
@ SB_TILE_TYPE_USED_SVL
The tile is used for svl by sb_svl_run function.
Definition: sb.h:12559
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.
Definition: sb.h:8761
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.
Definition: sb.h:8840
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.
Definition: sb.h:8773
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.
Definition: sb.h:8763
@ SB_OBJ_TEST
Object is not used for learning.
Definition: sb.h:8762
@ SB_SAMPLE_OPTIONAL
Definition: sb.h:8853
@ SB_SAMPLE_REQUIRED
Definition: sb.h:8845
@ SB_TRUTH_MODEL_DISABLED
A sample of a disabled model.
Definition: sb.h:8831
@ SB_TRUTH_TRUE_NEGATIVE
Truth True Negative.
Definition: sb.h:8795
@ SB_TRUTH_FALSE_NEGATIVE
Truth False Negative.
Definition: sb.h:8807
@ SB_TRUTH_TRUE_POSITIVE
Truth True Positive.
Definition: sb.h:8783
@ SB_TRUTH_UNDEFINED
Truth not defined.
Definition: sb.h:8777
@ SB_TRUTH_OPTIONAL_POSITIVE
Truth Optional Positive.
Definition: sb.h:8813
@ SB_TRUTH_OPTIONAL_NEGATIVE
Truth Optional Negative.
Definition: sb.h:8819
@ SB_TRUTH_FALSE_POSITIVE
Truth False Positive.
Definition: sb.h:8801
@ SB_TRUTH_OUT_OF_ROI
Truth Out Of ROI.
Definition: sb.h:8826
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.
sb_t_tiling_mode
Enumerates the tiling mode.
Definition: sb.h:10610
#define SB_DEVICES_MAX_NUMBER
Maximum number of computational devices managed by the sb library.
Definition: sb.h:11226
sb_t_svl_command
Enumerates the actions that SVL has to do after a stop.
Definition: sb.h:10287
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.
Definition: sb.h:10373
sb_t_perturbation_mode
Enumerates the mode of the perturbations.
Definition: sb.h:10800
sb_t_image_borders_extension_mode
Enumerate the image borders extension mode.
Definition: sb.h:10724
#define SB_PAR_FEATURES_NAMES_LEN
Maximum length, in byte, of the features names string.
Definition: sb.h:10255
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.
Definition: sb.h:10330
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.
Definition: sb.h:10385
sb_t_network_freeze_mode
Deep learning network freeze mode.
Definition: sb.h:10473
sb_t_err sb_svl_save_pre_training(SB_HANDLE handle, const char *const file_name)
Saves the current SVL parameter configuration into a pre-training file.
sb_t_perturbation_type
Enumerates the range of application of the perturbations.
Definition: sb.h:10833
const char * sb_perturbation_type_format(sb_t_perturbation_type type)
Returns the string of the Deep Learning SVL image perturbation type.
const char * sb_network_freeze_mode_format(sb_t_network_freeze_mode freeze_mode)
Returns the string of the network freeze mode.
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.
Definition: sb.h:10664
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.
Definition: sb.h:10398
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.
Definition: sb.h:10404
sb_t_err sb_pre_training_get_par(sb_t_par **const par, const char *const file_name)
Retrieves the project parameter structure of a pre-training file.
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.
const char * sb_image_borders_extension_mode_format(sb_t_image_borders_extension_mode mode)
Returns the string of the image borders extension mode.
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.
const char * sb_tiling_mode_format(sb_t_tiling_mode mode)
Returns the string of the tiling mode.
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...
Definition: sb.h:13863
const char * sb_svl_par_optimization_mode_format(sb_t_svl_par_optimization_mode mode)
Returns the string of the SVL optimization mode.
@ SB_TILING_MODE_AUTO
Auto tiling.
Definition: sb.h:10648
@ SB_TILING_MODE_MANUAL
Manual tiling.
Definition: sb.h:10624
@ SB_SVL_COMMAND_CONTINUE_NO_RESET
The SVL continues without reset.
Definition: sb.h:10305
@ SB_SVL_COMMAND_NEXT_STEP
The SVL go to next step.
Definition: sb.h:10309
@ SB_SVL_COMMAND_STOP
The SVL stops and exits, applying the training to the module.
Definition: sb.h:10292
@ SB_SVL_COMMAND_CONTINUE
The SVL continues and, if necessary, resets the training.
Definition: sb.h:10296
@ SB_SVL_COMMAND_ABORT
The SVL stops and exits, without applying the training reached to the module.
Definition: sb.h:10301
@ SB_PERTURBATION_MODE_OFFLINE
Offline perturbation.
Definition: sb.h:10811
@ SB_PERTURBATION_MODE_ONLINE
Online perturbation.
Definition: sb.h:10805
@ SB_PERTURBATION_MODE_BOTH
Both online and offline perturbations.
Definition: sb.h:10816
@ SB_IMAGE_BORDERS_EXTENSION_MODE_MIRRORING
Mirroring extension mode.
Definition: sb.h:10766
@ SB_IMAGE_BORDERS_EXTENSION_MODE_BORDER_AVG_LOCAL
Last line local average extension mode.
Definition: sb.h:10777
@ SB_IMAGE_BORDERS_EXTENSION_MODE_LAST
Last pixel extension mode.
Definition: sb.h:10749
@ SB_IMAGE_BORDERS_EXTENSION_MODE_IMAGE_AVG
Image average extension mode.
Definition: sb.h:10754
@ SB_IMAGE_BORDERS_EXTENSION_MODE_V_255
Grey extension mode.
Definition: sb.h:10744
@ SB_IMAGE_BORDERS_EXTENSION_MODE_KERNEL_AVG
Local average extension mode.
Definition: sb.h:10760
@ SB_IMAGE_BORDERS_EXTENSION_MODE_V_127
Grey extension mode.
Definition: sb.h:10739
@ SB_IMAGE_BORDERS_EXTENSION_MODE_KERNEL_AVG_17x1
Horizontal local average extension mode.
Definition: sb.h:10783
@ SB_IMAGE_BORDERS_EXTENSION_MODE_BORDER_AVG
Last line average extension mode.
Definition: sb.h:10771
@ SB_IMAGE_BORDERS_EXTENSION_MODE_V_0
Zero extension mode.
Definition: sb.h:10734
@ SB_IMAGE_BORDERS_EXTENSION_MODE_NONE
Undefined extension mode.
Definition: sb.h:10729
@ SB_SVL_PAR_OPTIMIZATION_TIME_SLOW
Definition: sb.h:10336
@ SB_SVL_PAR_OPTIMIZATION_USE_SELECTED
Definition: sb.h:10351
@ SB_SVL_PAR_OPTIMIZATION_TIME_MEDIUM
Definition: sb.h:10341
@ SB_SVL_PAR_OPTIMIZATION_TIME_FAST
Definition: sb.h:10346
@ SB_NETWORK_FREEZE_MODE_ENCODER_DECODER
Freeze both encoder and decoder.
Definition: sb.h:10500
@ SB_NETWORK_FREEZE_MODE_FIRST_BLOCK
Freeze the first block of the newtork.
Definition: sb.h:10484
@ SB_NETWORK_FREEZE_MODE_NONE
Freeze mode disabled.
Definition: sb.h:10478
@ SB_NETWORK_FREEZE_MODE_ENCODER
Freeze the network encoder.
Definition: sb.h:10491
@ SB_PERTURBATION_TYPE_IMAGE
The whole image is perturbated.
Definition: sb.h:10837
@ SB_PERTURBATION_TYPE_BOTH
Both image and defects perturbation type.
Definition: sb.h:10846
@ SB_PERTURBATION_TYPE_DEFECTS
Only the defect area is perturbated.
Definition: sb.h:10841
@ SB_LOSS_FN_TYPE_BCE
SB Binary Cross Entropy loss.
Definition: sb.h:10692
@ SB_LOSS_FN_TYPE_CCE
Categorical Cross Entropy loss.
Definition: sb.h:10673
@ SB_LOSS_FN_TYPE_FOCAL
Focal loss.
Definition: sb.h:10682
@ SB_NETWORK_TYPE_SDINET0
Deep Learning Surface Defects Inspection Network 0 with variable input size.
Definition: sb.h:10424
@ SB_NETWORK_TYPE_ODNET0
Deep Learning Object Detection Network 0 with input size 416x416.
Definition: sb.h:10454
@ SB_NETWORK_TYPE_EFFICIENTNET_B1
Deep Learning EfficientNet b1.
Definition: sb.h:10415
@ SB_NETWORK_TYPE_EFFICIENTNET_B2
Deep Learning EfficientNet b2.
Definition: sb.h:10420
@ SB_NETWORK_TYPE_EFFICIENTNET_B0
Deep Learning EfficientNet b0.
Definition: sb.h:10410
@ SB_NETWORK_TYPE_ICNET0_128
Deep Learning Image Classification Network 0 with input size 128x128.
Definition: sb.h:10448
@ SB_NETWORK_TYPE_ICNET0_64
Deep Learning Image Classification Network 0 with input size 64x64.
Definition: sb.h:10443
@ SB_SVL_STOP_WARNING
Send a warning message.
Definition: sb.h:13950
@ SB_SVL_STOP_RESET_MANDATORY
Request for a mandatory reset of SVL.
Definition: sb.h:13904
@ SB_SVL_STOP_RESET_OPTIONAL
Ask for an optional reset of SVL.
Definition: sb.h:13930
@ SB_SVL_STOP_USER_REQUEST
The user has stopped the SVL.
Definition: sb.h:13882
@ SB_SVL_STOP_CONFLICT
There are errors which can not be eliminated.
Definition: sb.h:13877
@ SB_SVL_STOP_NONE
SVL finishes without errors.
Definition: sb.h:13867
@ SB_SVL_STOP_MEMORY
Insufficient memory to complete the SVL.
Definition: sb.h:13887
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 length.
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.
Definition: sb.h:6961
unsigned char g
green component of color
Definition: sb.h:6963
unsigned char r
red component of color
Definition: sb.h:6964
unsigned char a
transparency of color
Definition: sb.h:6969
unsigned char b
blue component of color
Definition: sb.h:6962
Defines the parameters for blob analysis.
Definition: sb.h:9354
int verbosity
Verbosity level.
Definition: sb.h:9399
sb_t_range width
Range of weight, value in pixel.
Definition: sb.h:9367
int blob_contour
Set to 1 if you want the contour of each blob.
Definition: sb.h:9378
sb_t_range area
Range of area, value in pixel.
Definition: sb.h:9365
sb_t_range height
Range of height, value in pixel.
Definition: sb.h:9366
sb_t_blob_distance_mode blob_distance_mode
Selection of the algorithm for calculating the distance between blobs.
Definition: sb.h:9388
int keep_deleted
If different than 0, deleted blobs are kept in the list and marked as deleted.
Definition: sb.h:9398
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...
Definition: sb.h:9395
int blob_min_rot_rect
For each blob it enables the calculation of the smaller rotated rectangle containing the blob.
Definition: sb.h:9383
int blob_rle
Set to 1 if you want the rle of each blob.
Definition: sb.h:9373
int merge_distance
Blobs with a distance inferior or equal to the value are merged together.
Definition: sb.h:9394
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...
Definition: sb.h:9397
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...
Definition: sb.h:9396
sb_t_pixel_connection connection_type
Pixel connection type.
Definition: sb.h:9368
Defines a blob.
Definition: sb.h:9442
sb_t_point2d_f bar
blob barycenter.
Definition: sb.h:9443
float m_xy
Moment of inertia about the x and y axes.
Definition: sb.h:9506
sb_t_truth truth
Truth value of the blob computed by the blob analysis routine, otherwise SB_TRUTH_UNDEFINED.
Definition: sb.h:9461
int contour_size
Number of point of the blob contour, ie the number of elements of the array contour.
Definition: sb.h:9460
sb_t_point * contour
Pointer to the array of the points of the blob contour.
Definition: sb.h:9459
sb_t_rle rle
Pointer to RLE buffer.
Definition: sb.h:9453
float m_yy
Moment of inertia about the y axis.
Definition: sb.h:9499
sb_t_rect rect
Bounding box of the blob.
Definition: sb.h:9447
int od
Value not evaluated.
Definition: sb.h:9445
float angle
Rotation angle of the smaller rotated rectangle.
Definition: sb.h:9481
int area
Area of the blob, number of the pixel.
Definition: sb.h:9444
sb_t_blob_deleted deleted
Blob is marked as deleted.
Definition: sb.h:9469
int lut
Value of the lut.
Definition: sb.h:9446
float m_xx
Moment of inertia about the x axis.
Definition: sb.h:9493
Defines the information about the blob analysis.
Definition: sb.h:9406
long long time_export
blobs exporting time, in us.
Definition: sb.h:9412
int deleted_for_area_min
Number of blobs deleted for an area too small, both during analysis and during merging.
Definition: sb.h:9417
int deleted_for_width_max
Number of blobs deleted for a width too big, both during analysis and during merging.
Definition: sb.h:9418
int deleted_for_area_max
Number of blobs deleted for an area too big, both during analysis and during merging.
Definition: sb.h:9416
long long time_blob
time, in us, of the blobs extraction.
Definition: sb.h:9408
int merged
Number of blobs merged with another blob.
Definition: sb.h:9414
int deleted_for_height_min
Number of blobs deleted for an height too small, both during analysis and during merging.
Definition: sb.h:9421
long long time_rle
time, in us, of the rle extraction.
Definition: sb.h:9407
sb_t_range deleted_height
height range of the deleted blobs for a out-of-range height, both during analysis and during merging.
Definition: sb.h:9424
int deleted_for_height_max
Number of blobs deleted for an height too big, both during analysis and during merging.
Definition: sb.h:9420
long long time_sort
blobs sorting time, in us.
Definition: sb.h:9411
sb_t_range deleted_area
area range of the deleted blobs for a out-of-range area, both during analysis and during merging.
Definition: sb.h:9422
int deleted_for_width_min
Number of blobs deleted for a width too small, both during analysis and during merging.
Definition: sb.h:9419
long long time_contour
time, in us, of the blobs contour extraction.
Definition: sb.h:9409
sb_t_range deleted_width
width range of the deleted blobs for a out-of-range width, both during analysis and during merging.
Definition: sb.h:9423
int deleted
Number of blobs deleted, both during analysis and during merging.
Definition: sb.h:9415
long long time_merge
blobs merging time, in us.
Definition: sb.h:9410
long long time_total
total time, in us.
Definition: sb.h:9413
Defines a blobs list.
Definition: sb.h:9513
sb_t_blob * blob
Array of the blobs.
Definition: sb.h:9515
sb_t_blobs_info info
Information about the blob analysis.
Definition: sb.h:9516
sb_t_blobs_info info_gt
Information about the blob analysis of the ground truth areas.
Definition: sb.h:9517
int size
Number of blobs, ie number of elements of the array sb_t_blobs::blob .
Definition: sb.h:9514
Information about a computing device.
Definition: sb.h:6878
sb_t_memory_info memory
Memory information about the device and its process.
Definition: sb.h:6916
sb_t_frameworks frameworks
Compatible frameworks.
Definition: sb.h:6888
int available
Indicates if the device is available on the PC in use.
Definition: sb.h:6922
int id
Identifier of the device.
Definition: sb.h:6910
sb_t_device_type type
Device type.
Definition: sb.h:6882
List of computing devices available on the machine.
Definition: sb.h:6929
int size
Number of available devices.
Definition: sb.h:6939
sb_t_device_info * device
Array of devices.
Definition: sb.h:6934
Property of computational devices.
Definition: sb.h:11233
sb_t_device_type type
Device type.
Definition: sb.h:11237
sb_t_framework_type framework
Framework associated to the device.
Definition: sb.h:11243
Elaborated image.
Definition: sb.h:13295
char * info
Information string.
Definition: sb.h:13297
sb_t_image * img
Image.
Definition: sb.h:13296
List of elaborated images.
Definition: sb.h:13304
int size
Number of the elaborated images.
Definition: sb.h:13306
sb_t_elaborated_image * imgs
Array of the elaborated images.
Definition: sb.h:13305
Defines the single file.
Definition: sb.h:7358
char * fname
Name of file excluded the path.
Definition: sb.h:7360
defines the list of the file in a folder.
Definition: sb.h:7367
int path_length
Number of characters of the path.
Definition: sb.h:7370
sb_t_file * file
Array of files.
Definition: sb.h:7368
int n
Number of elements of the array file.
Definition: sb.h:7369
Frameworks list.
Definition: sb.h:6860
int size
Number of available frameworks.
Definition: sb.h:6870
Image information details structure.
Definition: sb.h:13385
sb_t_image_info_type type
Type of the image.
Definition: sb.h:13387
sb_t_project_info project_info
Project information data.
Definition: sb.h:13386
Array of the image information details structure.
Definition: sb.h:13394
sb_t_image_info_detail * details
Array of sb_t_image_info_detail.
Definition: sb.h:13395
Defines an image.
Definition: sb.h:8100
int free_rle
Definition: sb.h:8121
int bytes_per_pixel
Number of bytes of each pixel.
Definition: sb.h:8118
int width
Width, in pixel, of the image.
Definition: sb.h:8104
unsigned char * data
Pointer to the data.
Definition: sb.h:8101
unsigned char * free_data
Definition: sb.h:8102
sb_t_image_format format
Format of the image pixel.
Definition: sb.h:8110
int height
Height, in pixel, of the image.
Definition: sb.h:8105
sb_t_rle rle
Image rle data (valid in case the image compression type is SB_IMAGE_COMPRESS_RLE)
Definition: sb.h:8123
int size
Dimension, in bytes, of the vector sb_t_image::data .
Definition: sb.h:8107
int width_step
Number of bytes to move the pointer to one row to the next one.
Definition: sb.h:8106
sb_t_image_compress_type compression
Image compression type.
Definition: sb.h:8120
int free_data_size
Definition: sb.h:8108
General information about sb library and computing devices like CPU and GPUs.
Definition: sb.h:6946
sb_t_devices_info devices
List of available computing devices.
Definition: sb.h:6954
sb_t_version version
Version of the sb library.
Definition: sb.h:6947
signed long long malloc_size
Current allocated memory, expressed in bytes, by sb the library.
Definition: sb.h:6951
int dl_modules_enabled
Value is different from 0 if Deep Learning modules are enabled.
Definition: sb.h:6953
signed long long malloc_size_max
Maximum allocated memory, expressed in bytes, by sb the library.
Definition: sb.h:6952
Defines the configurations of the license.
Definition: sb.h:7639
float speed_boost
Maximum detection speed boost allowed with the current license configuration.
Definition: sb.h:7669
int num_features
Maximum number of features allowed with the current license configuration.
Definition: sb.h:7653
int num_models
Maximum number of models allowed with the current license configuration.
Definition: sb.h:7646
sb_t_license_configuration_id id
License configuration identifier.
Definition: sb.h:7640
int num_threads
Maximum number of threads allowed with the current license configuration.
Definition: sb.h:7662
Defines all the attributes and properties of a license module.
Definition: sb.h:7677
int training
Training status.
Definition: sb.h:7692
signed long long time_start
Start date of the license.
Definition: sb.h:7703
sb_t_license_module_status status
The license status.
Definition: sb.h:7720
signed long long time_end
End date of the license.
Definition: sb.h:7709
sb_t_err err
The license error.
Definition: sb.h:7726
signed long long remain
Number of second before expiration.
Definition: sb.h:7714
sb_t_version version
Version of the module when the license was created.
Definition: sb.h:7697
sb_t_license_configuration configuration
License configuration.
Definition: sb.h:7686
sb_t_license_type type
License type of the module.
Definition: sb.h:7681
Defines the license and its properties.
Definition: sb.h:7741
signed long long time_modify
Last modification date.
Definition: sb.h:7767
signed long long time_save
Last save date.
Definition: sb.h:7772
signed long long time_create
Creation date.
Definition: sb.h:7762
Struct that defines the coordinates of a point of a lut.
Definition: sb.h:7932
unsigned short y
ordinate of the point.
Definition: sb.h:7934
unsigned short x
abscissa of the point.
Definition: sb.h:7933
Memory information.
Definition: sb.h:6816
signed long long system_free
system free physical memory, in bytes
Definition: sb.h:6824
signed long long proc_virtual_used
virtual memory used by process, in bytes
Definition: sb.h:6817
signed long long proc_physical_used
physical memory used by the process, in bytes
Definition: sb.h:6820
signed long long system_total
system physical memory, in bytes
Definition: sb.h:6822
signed long long system_used
system used physical memory, in bytes
Definition: sb.h:6823
signed long long proc_virtual_used_max
maximum virtual memory used by the process, in bytes
Definition: sb.h:6818
signed long long proc_virtual_max
maximum virtual memory usable by the process, in bytes
Definition: sb.h:6819
signed long long proc_physical_used_max
maximum physical memory used by the process, in bytes
Definition: sb.h:6821
Metrics calculated on counters.
Definition: sb.h:12306
float accuracy
accuracy
Definition: sb.h:12312
float f1_score
f1-score
Definition: sb.h:12335
float precision
precision
Definition: sb.h:12326
float specificity
specificity
Definition: sb.h:12342
float recall
recall
Definition: sb.h:12319
Results of OCR analysis.
Definition: sb.h:12288
int lines
Number of the lines identified.
Definition: sb.h:12295
char * string
ocr result in string format
Definition: sb.h:12293
int words
Number of the words identified.
Definition: sb.h:12294
Information on what sb_project_set_par and sb_image_info_apply_par_changes do when they apply the new...
Definition: sb.h:13054
char * models
String of the name of the models to be invalidated.
Definition: sb.h:13059
sb_t_par par_cur
The current parameters of the project.
Definition: sb.h:13071
sb_t_par par_new
The new parameters that the user wants to set in the project.
Definition: sb.h:13072
Level parameters.
Definition: sb.h:11456
float scale
Scale factor.
Definition: sb.h:11468
int enabled
Enabling flag of the level.
Definition: sb.h:11463
Levels parameter array.
Definition: sb.h:11477
int size
Number of levels that is number of elements of the array level.
Definition: sb.h:11487
Information about mapping between old and new models and levels in the sb_t_par structure.
Definition: sb.h:13042
int index
Index of the corresponding model, -1 if not present.
Definition: sb.h:13043
Parameters of a model.
Definition: sb.h:11495
sb_t_par_perturbations perturbations
Perturbations of the samples.
Definition: sb.h:11610
sb_t_size obj_size
Model size.
Definition: sb.h:11576
int num_occurrences
Number of occurrences of the model that the function sb_project_get_res should export.
Definition: sb.h:11704
sb_t_size obj_stride_coarse
Coarse search step.
Definition: sb.h:11668
float defect_area_threshold
Threshold weight value for the bad area of the sample.
Definition: sb.h:11726
sb_t_rgba color_opt
Color of the optional defects.
Definition: sb.h:11626
sb_t_rgba color
Color of the defects.
Definition: sb.h:11618
float defect_area_percentage
Threshold percentage bad area of the sample to discard it as an occurrence.
Definition: sb.h:11716
sb_t_size obj_stride_fine
Fine search step.
Definition: sb.h:11682
int enabled
Enabling status of the model.
Definition: sb.h:11592
sb_t_par_levels levels
Array of levels parameters for this model.
Definition: sb.h:11604
sb_t_size obj_min_distance
Minimum distance between two samples.
Definition: sb.h:11653
Array of models parameters.
Definition: sb.h:11733
int size
Number of models that is number of elements of the array model.
Definition: sb.h:11744
Describes the perturbation of a sample.
Definition: sb.h:11392
sb_t_range angle_range
Angular range, in degrees, for random rotation.
Definition: sb.h:11421
int flip_vertical
Flip around vertical axis. 3th operation.
Definition: sb.h:11413
int angle
Rotation angle, in degrees, of the sample. 1th operation.
Definition: sb.h:11397
int flip_horizontal
Flip around horizontal axis. 2th operation.
Definition: sb.h:11405
int num_synthetic_samples
Number of synthetic sample to generated with a random angle in the range sb_t_par_perturbation::angle...
Definition: sb.h:11428
List of the perturbations of a sample.
Definition: sb.h:11438
int size
Number of used elements of the array perturbation.
Definition: sb.h:11447
Shallow Learning modules parameters.
Definition: sb.h:11751
float speed_boost
Detection speed boost.
Definition: sb.h:11775
int detection_out_of_roi
Allow the detection of occurrences at the extremities or partially outside the analysis roi.
Definition: sb.h:11789
Project parameters.
Definition: sb.h:11797
int surface_blob_analysis
Enables the blob analysis.
Definition: sb.h:11901
sb_t_devices_par devices
Devices used for detection.
Definition: sb.h:11864
sb_t_par_sl sl
Shallow Learning modules parameters.
Definition: sb.h:11907
sb_t_par_models models
Models parameters.
Definition: sb.h:11804
int num_threads
Maximum number of OpenMP threads that detection can use.
Definition: sb.h:11851
sb_t_floating_point_op_type floating_point_precision
Floating Point precision used to run operations.
Definition: sb.h:11882
sb_t_svl_par svl
SVL parameters.
Definition: sb.h:11913
sb_t_project_type project_type
Project type.
Definition: sb.h:11798
sb_t_interpolation_mode resize_mode
Interpolation mode used to resize the images.
Definition: sb.h:11871
sb_t_rgba color_opt
Color of the optional defects for all models.
Definition: sb.h:11890
sb_t_blob_par blob_par
Surface blob analysis parameters.
Definition: sb.h:11857
Represents an ordered pair of float x and y coordinates that defines a point in a two-dimensional pla...
Definition: sb.h:6488
Represents an ordered pair of integer x and y coordinates that defines a point in a two-dimensional p...
Definition: sb.h:6479
int x
abscissa of the point
Definition: sb.h:6480
int y
ordinate of the point
Definition: sb.h:6481
Detection information structure.
Definition: sb.h:13313
sb_t_elaborated_images imgs
List of the elaborated tile images and the complete reconstructed image.
Definition: sb.h:13326
sb_t_par * par
Project parameters.
Definition: sb.h:13317
Project info structure.
Definition: sb.h:9695
sb_t_project_type type
Project type.
Definition: sb.h:9696
Array of the projects info.
Definition: sb.h:9706
sb_t_project_info * info
Array of solution project information.
Definition: sb.h:9707
int size
Number of projects.
Definition: sb.h:9708
Represents an ordered pair of float minimum and maximum values that defines a range.
Definition: sb.h:6524
float max
maximum value
Definition: sb.h:6526
float min
minimum value
Definition: sb.h:6525
Represents an ordered pair of 32 bits signed integer minimum and maximum values that defines a range.
Definition: sb.h:6515
int max
maximum value
Definition: sb.h:6517
int min
minimum value
Definition: sb.h:6516
Defines the position and size of a rectangle in a two-dimensional plane.
Definition: sb.h:6533
int y
y coordinate of the upper left corner of the rectangle
Definition: sb.h:6535
int x
x coordinate of the upper left corner of the rectangle
Definition: sb.h:6534
int width
width of the rectangle
Definition: sb.h:6536
int height
height of the rectangle
Definition: sb.h:6537
Defines the results of a model.
Definition: sb.h:12452
sb_t_surface_res * surface
Surface model analysis result.
Definition: sb.h:12529
int out_of_roi
Count of Out Of ROI.
Definition: sb.h:12514
int disabled
Count of samples with model disabled.
Definition: sb.h:12522
int tp
Count of True Positive.
Definition: sb.h:12460
int on
Count of Optional Negative.
Definition: sb.h:12505
int fp
Count of False Positive.
Definition: sb.h:12478
int tn
Count of True Negative.
Definition: sb.h:12469
int op
Count of Optional Positive.
Definition: sb.h:12496
int fn
Count of False Negative.
Definition: sb.h:12487
Defines the results of the models.
Definition: sb.h:12537
int size
Number of element of the array sb_t_res_models::model.
Definition: sb.h:12539
sb_t_res_model * model
Array of the models result.
Definition: sb.h:12538
Results of detection.
Definition: sb.h:12672
int is_valid
It is 1 when the fields of the structure are valid, otherwise it is 0.
Definition: sb.h:12679
sb_t_tiles_info * tiles
Information about the tiles used to process the image.
Definition: sb.h:12733
sb_t_samples samples
Samples found in the image.
Definition: sb.h:12692
long long time_us
Elaboration time of the image, in us.
Definition: sb.h:12719
sb_t_err err
Error of last image processing with sb_project_detection function .
Definition: sb.h:12745
sb_t_par par
Project parameters.
Definition: sb.h:12685
sb_t_ocr_res ocr
Result of OCR analysis.
Definition: sb.h:12698
sb_t_devices_par devices
The devices used to compute the current results.
Definition: sb.h:12724
sb_t_res_model global
Global results.
Definition: sb.h:12707
sb_t_version svl_version
Library version used to run the SVL with which the current results are obtained.
Definition: sb.h:12738
sb_t_res_models models
Models results.
Definition: sb.h:12713
Defines the color in the format RGBA.
Definition: sb.h:6994
unsigned char r
red component of color
Definition: sb.h:6995
unsigned char g
green component of color
Definition: sb.h:6996
unsigned char b
blue component of color
Definition: sb.h:6997
unsigned char a
transparency of color
Definition: sb.h:7002
Define a RLE segment.
Definition: sb.h:8079
int offset
Offset of the segment from the beginning of the uncompressed buffer, in bytes.
Definition: sb.h:8084
int x
x-coordinate of the beginning of the segment
Definition: sb.h:8081
int length
Length of the segment.
Definition: sb.h:8083
unsigned int value
Value of the segment.
Definition: sb.h:8080
int y
y-coordinate of the beginning of the segment
Definition: sb.h:8082
Defines a RLE.
Definition: sb.h:8091
sb_t_rle_seg * seg
Pointer to RLE buffer.
Definition: sb.h:8092
int size
Number of elements of seg array.
Definition: sb.h:8093
Defines a roi.
Definition: sb.h:8520
sb_t_rect bounding_box
Bounding box of the roi (Not used for defects ROI)
Definition: sb.h:8521
sb_t_rgba color
Color RGBA of the roi (Not used for defects ROI)
Definition: sb.h:8522
sb_t_image * img
8bit BW image.
Definition: sb.h:8524
Image of weights of the sample.
Definition: sb.h:8892
float max
maximum weight corresponding, in the image, the to value 255.
Definition: sb.h:8894
sb_t_image * img
Image of the weights of the sample, format is SB_IMAGE_FORMAT_BW8.
Definition: sb.h:8893
float min
minimum weight corresponding, in the image, the to value 1.
Definition: sb.h:8895
Sample of an image.
Definition: sb.h:8908
float IoU
Definition: sb.h:9117
sb_t_point centre_warp
Coordinates of the centre in the warped image.
Definition: sb.h:8938
sb_t_point centre
Coordinates of the centre of the sample.
Definition: sb.h:8916
void * user_data
Pointer to the user data.
Definition: sb.h:9070
float defect_area_percentage
Definition: sb.h:9122
sb_t_truth truth
Truth of the sample.
Definition: sb.h:9035
int user_data_size
Size, in bytes, of sb_t_sample::user_data buffer.
Definition: sb.h:9074
float scale
Scale factor.
Definition: sb.h:8994
int is_near
FALSE NEGATIVE with some other sample close to it.
Definition: sb.h:9084
sb_t_sample_weights_image weights_image
Image of the weights of the sample.
Definition: sb.h:9028
sb_t_sample_classify_mode classify_mode
Classification mode.
Definition: sb.h:9063
sb_t_obj_type type
Sample type.
Definition: sb.h:8999
float weight
Weight of classification.
Definition: sb.h:9013
Samples of an image.
Definition: sb.h:9167
int size
Number of samples that is number of elements of the array sb_t_samples::sample .
Definition: sb.h:9169
sb_t_sample * sample
Pointer to the array of sample. The number of element is sb_t_samples::size .
Definition: sb.h:9168
Offsets to change scale ranges.
Definition: sb.h:10169
float height_min
Offset to apply on the minimum value of the height scale range.
Definition: sb.h:10172
float width_max
Offset to apply on the maximum value of the width scale range.
Definition: sb.h:10171
float width_min
Offset to apply on the minimum value of the width scale range.
Definition: sb.h:10170
float height_max
Offset to apply on the maximum value of the height scale range.
Definition: sb.h:10173
Represents an ordered pair of float x and y length that defines a rectangle in a two-dimensional plan...
Definition: sb.h:6506
float height
height
Definition: sb.h:6508
float width
width
Definition: sb.h:6507
Represents an ordered pair of integer x and y length that defines a rectangle in a two-dimensional pl...
Definition: sb.h:6497
int height
height
Definition: sb.h:6499
int width
width
Definition: sb.h:6498
Solution info structure.
Definition: sb.h:9727
sb_t_version version
Version of the solution.
Definition: sb.h:9730
sb_t_projects_info projects
Array of the projects info.
Definition: sb.h:9728
int current_project
Index of the current project in the projects array.
Definition: sb.h:9729
Statistics of a model.
Definition: sb.h:12794
sb_t_range_flt fp_weight
Range of classification weight of the False Positive samples.
Definition: sb.h:12883
int fn
Count of False Negative.
Definition: sb.h:12844
int on
Count of Optional Negative.
Definition: sb.h:12863
int tp
Count of True Positive.
Definition: sb.h:12803
sb_t_range_flt op_weight
Range of classification weight of the Optional Positive samples.
Definition: sb.h:12885
sb_t_metrics metrics
Metrics.
Definition: sb.h:12893
sb_t_range_flt or_weight
Range of classification weight of the out of the ROI samples.
Definition: sb.h:12887
float score
Level score.
Definition: sb.h:12901
int op
Count of Optional Positive.
Definition: sb.h:12854
int mod_disabled
Count of samples with model disabled.
Definition: sb.h:12880
int fp
Count of False Positive.
Definition: sb.h:12834
sb_t_range_flt tp_weight
Range of classification weight of the True Positive samples.
Definition: sb.h:12881
sb_t_range_flt fn_weight
Range of classification weight of the False Negative samples.
Definition: sb.h:12884
sb_t_range_flt on_weight
Range of classification weight of the Optional Negative samples.
Definition: sb.h:12886
sb_t_range_flt tn_weight
Range of classification weight of the True Negative samples.
Definition: sb.h:12882
int out_of_roi
Count of Out Of ROI.
Definition: sb.h:12872
int tn
Count of True Negative.
Definition: sb.h:12824
Statistics of a model.
Definition: sb.h:12909
int size
Number of models that is number of elements of the array model.
Definition: sb.h:12919
Statistics of the elaborations done with the function sb_project_detection .
Definition: sb.h:12932
long long time_res_us
Total sb_project_get_res time in microsecond. This time is included in the time_us.
Definition: sb.h:12983
int good
Counter of "Good" images.
Definition: sb.h:12955
long long time_us
Total analysis time in microsecond.
Definition: sb.h:12979
sb_t_metrics metrics
Metrics evaluated on images.
Definition: sb.h:12976
long long time_blob_us
Total blob analysis time in microsecond. This time is included in the time_us.
Definition: sb.h:12981
int no_good
Counter of "No Good" images.
Definition: sb.h:12947
long long time_us_average
Average analysis time in microsecond.
Definition: sb.h:12980
int elaborated
Count of the elaborated images.
Definition: sb.h:12985
sb_t_stat_model global
Global statistics.
Definition: sb.h:12940
int overkill
Counter of "Overkill" images.
Definition: sb.h:12962
sb_t_stat_models models
Array of the statistics of the models.
Definition: sb.h:12939
long long time_res_us_average
Average sb_project_get_res time in microsecond.
Definition: sb.h:12984
int escape
Counter of "Escape" images.
Definition: sb.h:12969
sb_t_par par
Project parameters.
Definition: sb.h:12938
long long time_blob_us_average
Average blob analysis time in microsecond.
Definition: sb.h:12982
Defines the result of the Surface analysis.
Definition: sb.h:12353
sb_t_point ul
Coordinates of the upper left corner.
Definition: sb.h:12354
sb_t_image * model
Model plane image.
Definition: sb.h:12371
sb_t_metrics pixel_metrics
Metrics calculated on predicted pixels.
Definition: sb.h:12362
sb_t_blobs * blobs
Defects blobs extracted.
Definition: sb.h:12414
sb_t_image * truth
Truth plane image.
Definition: sb.h:12385
sb_t_image * weight
Image of the voting plan.
Definition: sb.h:12404
sb_t_surface_image_truth image_truth
Truth of the image.
Definition: sb.h:12420
Deep Learning network parameters.
Definition: sb.h:10519
float features_multiplier
Features multiplier factor of the network.
Definition: sb.h:10574
sb_t_image_format image_format
Network input image format.
Definition: sb.h:10557
int n_channels
Network input channels.
Definition: sb.h:10565
sb_t_size input_size
Network input size.
Definition: sb.h:10548
sb_t_network_freeze_mode freeze_mode
Freeze mode to apply on network parameters.
Definition: sb.h:10584
sb_t_network_type type
Network type.
Definition: sb.h:10540
Describes the perturbation of the image / defect.
Definition: sb.h:10863
sb_t_range angle_range
Angular range, in degrees, for random rotation.
Definition: sb.h:10925
float shift_horizontal
Maximum shift along x-axis.
Definition: sb.h:10909
sb_t_perturbation_type type
Select the perturbation type.
Definition: sb.h:10883
int flip_horizontal
Flip around horizontal axis.
Definition: sb.h:10892
float stretch_contrast
Maximum variation for histogram stretching.
Definition: sb.h:10942
float shift_vertical
Maximum shift along y-axis.
Definition: sb.h:10917
sb_t_perturbation_mode mode
Select the perturbation mode.
Definition: sb.h:10876
int flip_vertical
Flip around vertical axis.
Definition: sb.h:10901
float delta_scale
Maximum variation for image scaling.
Definition: sb.h:10951
float delta_brightness
Maximum delta of brightness.
Definition: sb.h:10934
SVL parameters to configure the Deep Learning training.
Definition: sb.h:11028
int batch_size
Size of the batch used during SVL.
Definition: sb.h:11106
int save_best
At the end of the training, the best internal parameters configuration is recovered.
Definition: sb.h:11131
sb_t_svl_dl_tiling_par tiling_par_width
Width tiling configuration.
Definition: sb.h:11145
int load_pre_training_models
Load models parameters from pre-training file.
Definition: sb.h:11073
float learning_rate
Learning rate.
Definition: sb.h:11090
sb_t_svl_dl_par_network network
Network parameters.
Definition: sb.h:11033
int num_epochs
Number of epochs.
Definition: sb.h:11096
sb_t_image_borders_extension_mode borders_extension_mode
Image borders extension mode.
Definition: sb.h:11158
sb_t_loss_fn_type loss_fn
Loss function.
Definition: sb.h:11140
sb_t_svl_dl_par_perturbation perturbations
Perturbations for deep learning training.
Definition: sb.h:11079
sb_t_svl_dl_tiling_par tiling_par_height
Height tiling configuration.
Definition: sb.h:11150
float validation_percentage
Validation percentage.
Definition: sb.h:11123
Image tiling parameters.
Definition: sb.h:10965
int num_tiles
Number of horizontal and vertical tiles used to process the image.
Definition: sb.h:11009
sb_t_range_flt scale
Image scale.
Definition: sb.h:11020
sb_t_tiling_mode mode
Tiling mode to use for image processing.
Definition: sb.h:10980
Contains information regarding the error of the SVL.
Definition: sb.h:14177
char * msg
Error message.
Definition: sb.h:14178
sb_t_err err
Error code sb_t_err.
Definition: sb.h:14179
float dist
Distance, in pixel, between the samples.
Definition: sb.h:14186
float min_dist
Minimum allowed distance between samples.
Definition: sb.h:14187
int num_samples
Number of samples.
Definition: sb.h:14182
SVL parameters.
Definition: sb.h:11261
sb_fp_svl_progress fp_progress
The SVL calls this callback to notify the user the results of SVL.
Definition: sb.h:11272
int num_threads
Maximum number of OpenMP threads that SVL can use.
Definition: sb.h:11313
sb_t_svl_sl_par sl
Shallow Learning SVL parameters.
Definition: sb.h:11342
sb_fp_svl_pre_elaboration fp_pre_elaboration
Callback to execute an image pre elaboration.
Definition: sb.h:11266
float free_memory_percentage
Percentage of system memory that the svl tries to leave free.
Definition: sb.h:11304
sb_t_devices_par devices
Devices used for SVL/training.
Definition: sb.h:11336
sb_t_image_circularity_type image_circularity_type
Image circularity.
Definition: sb.h:11377
sb_fp_svl_command fp_command
Callback called by SVL to allow the user to decide how to continue when particular situations happen,...
Definition: sb.h:11278
void * user_data
Pointer to data which is passed to the callbacks.
Definition: sb.h:11284
sb_t_svl_dl_par dl
Deep Learning SVL parameters.
Definition: sb.h:11348
int reproducibility
Enable the reproducibility of the training.
Definition: sb.h:11329
Contains the results of the image pre-processing.
Definition: sb.h:10264
sb_t_image * image
Pre processed image, that is the warped image.
Definition: sb.h:10272
SB_HANDLE warped2ori
lut of the samples coordinates from warped image to the original one.
Definition: sb.h:10275
sb_t_roi * roi
Image elaboration ROI.
Definition: sb.h:10273
sb_t_roi * roi_defects
Image defects ROI.
Definition: sb.h:10274
Results of a training epoch.
Definition: sb.h:14330
float loss
SVL loss.
Definition: sb.h:14338
sb_t_metrics validation_metrics
SVL validation metrics.
Definition: sb.h:14361
sb_t_metrics metrics
SVL metrics.
Definition: sb.h:14354
float validation_loss
SVL validation loss.
Definition: sb.h:14347
Results of the training epochs.
Definition: sb.h:14368
sb_t_svl_res_epoch * epoch
Array of the results of the training epochs.
Definition: sb.h:14369
int size
Number of the elements of the array epoch .
Definition: sb.h:14372
Defines the results of the elaboration of the SVL of an image.
Definition: sb.h:14311
sb_t_image_info_type type
Image type. The possible values are SB_IMAGE_INFO_TYPE_SVL, SB_IMAGE_INFO_TYPE_SVL_USED.
Definition: sb.h:14313
Defines the results of the elaboration of the SVL images.
Definition: sb.h:14320
int size
Number of images that is number of elements of the array sb_t_svl_res_images::image .
Definition: sb.h:14322
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 .
Definition: sb.h:14321
Results of the SVL of a level per model.
Definition: sb.h:14391
int num_img_l
Number of images of the training set used for learning.
Definition: sb.h:14474
long long num_pixels_defect_l
Number of ROI defects pixels from the training set effectively used for training.
Definition: sb.h:14520
long long num_pixels_defect_v
Number of ROI defects pixels from the training set effectively used for validation.
Definition: sb.h:14536
long long num_pixels_roi_l
Number of pixels from the training set effectively used for learning.
Definition: sb.h:14498
int num_samples_l
Number of samples of the training set used for learning.
Definition: sb.h:14461
int out_of_roi
Number of Out Of ROI samples, both optional and required.
Definition: sb.h:14446
int reset
1 if the SVL of the model has been resetted or when the user reset the SVL, 0 otherwise.
Definition: sb.h:14456
int mod_disabled
Number of samples with disabled model, both optional and required.
Definition: sb.h:14451
int op
Number of OPTIONAL POSITIVE samples.
Definition: sb.h:14436
sb_t_svl_par_optimization_mode optimization_mode
Optimization mode.
Definition: sb.h:14541
float accuracy
Accuracy.
Definition: sb.h:14406
long long num_pixels_roi_u
Number of pixels from the training set not used neither for learning and validation.
Definition: sb.h:14505
sb_t_svl_res_epochs epochs
Results of training of module based on Deep Learning.
Definition: sb.h:14567
int num_tiles_u
Number of tiles from the training set not used neither for learning and validation.
Definition: sb.h:14486
float goodness
Goodness of the training.
Definition: sb.h:14396
int fn
Number of FALSE NEGATIVE samples.
Definition: sb.h:14431
int tn
Number of TRUE NEGATIVE samples.
Definition: sb.h:14426
int num_samples_t
Number of samples of the training set not used for learning.
Definition: sb.h:14466
long long num_pixels_defect_u
Number of ROI defects pixels from the training set not used neither for learning and validation.
Definition: sb.h:14528
int tp
Number of TRUE POSITIVE samples.
Definition: sb.h:14416
int num_tiles_l
Number of tiles from the training set used for learning.
Definition: sb.h:14480
int on
Number of OPTIONAL NEGATIVE samples.
Definition: sb.h:14441
int num_tiles_v
Number of tiles from the training set used for validation.
Definition: sb.h:14492
int fp
Number of FALSE POSITIVE samples.
Definition: sb.h:14421
long long num_pixels_roi_v
Number of pixels from the training set effectively used for validation.
Definition: sb.h:14512
char * warning
Warning in string format occurred during the training.
Definition: sb.h:14562
float score
Level score.
Definition: sb.h:14411
Results of the SVL of a levels processed.
Definition: sb.h:14575
int size
Number of the elements of the array level.
Definition: sb.h:14577
Results of the SVL of a specific model.
Definition: sb.h:14584
sb_t_svl_res_levels levels
Specific results for each level.
Definition: sb.h:14590
sb_t_svl_res_level global
Cumulative results of all levels.
Definition: sb.h:14594
Results of the SVL of a models processed.
Definition: sb.h:14601
int size
Number of the elements of the array model.
Definition: sb.h:14610
Defines the results of SVL.
Definition: sb.h:14638
sb_t_svl_res_models models
Results for each model.
Definition: sb.h:14677
sb_t_samples * list_op
List of Optional Positive samples.
Definition: sb.h:14706
int num_img_test
Number of test images of the project.
Definition: sb.h:14736
sb_t_samples * list_out_of_roi
List of samples out of the ROI.
Definition: sb.h:14716
sb_t_samples * list_on
List of Optional Negative samples.
Definition: sb.h:14711
sb_t_svl_res_images * list_img_elab
Results for each images.
Definition: sb.h:14722
sb_t_svl_err err
Error details.
Definition: sb.h:14673
sb_t_svl_res_level global
Cumulative results of all levels of all models.
Definition: sb.h:14681
sb_t_svl_command last_command
Command executed by SVL after a stop that is detailed with the parameter stop_reason.
Definition: sb.h:14641
sb_t_samples * list_tn
List of True Negative samples.
Definition: sb.h:14691
long long time_ms_last_improvement
Time, in ms, when there was the last improvement.
Definition: sb.h:14746
long long time_ms
Execution time, in ms, of SVL.
Definition: sb.h:14740
sb_t_par par
Project parameters.
Definition: sb.h:14639
int num_img_svl
Number of svl images of the project.
Definition: sb.h:14729
int reset_done
The SVL reset has been done or no training has been done yet.
Definition: sb.h:14755
sb_t_samples * list_tp
List of True Positive samples.
Definition: sb.h:14686
sb_t_svl_stop_reason stop_reason
It describes the reason why the SVL is finished.
Definition: sb.h:14640
long long time_left_ms
Estimated time, in ms, left to the end of the SVL.
Definition: sb.h:14751
sb_t_devices_par devices
The devices used to compute the current SVL results.
Definition: sb.h:14759
sb_t_samples * list_fn
List of False Negative samples.
Definition: sb.h:14701
char running_step[256]
Description of the current step of the training.
Definition: sb.h:14668
sb_t_samples * list_fp
List of False Positive samples.
Definition: sb.h:14696
SVL parameters that configure the Shallow Learning training.
Definition: sb.h:11167
int auto_levels
Enable the automatic Surface levels training.
Definition: sb.h:11219
sb_t_svl_par_optimization_mode optimization_mode
Optimization mode.
Definition: sb.h:11206
float goodness_target
Goodness target of the training.
Definition: sb.h:11184
Defines a tile.
Definition: sb.h:12575
sb_t_rect rect
Rectangle of the tile on the elaborated image.
Definition: sb.h:12576
sb_t_tile_type type
Tile type.
Definition: sb.h:12577
Information about the tiles used to process the image.
Definition: sb.h:12593
sb_t_tiles tiles
Tiles list.
Definition: sb.h:12596
sb_t_size_flt scale
Scale factor.
Definition: sb.h:12595
sb_t_size factor
Number of horizontal and vertical tiles used to process the image.
Definition: sb.h:12594
Tiles list.
Definition: sb.h:12584
sb_t_tile * tile
Tiles array.
Definition: sb.h:12585
int size
Number of elements of the array sb_t_tiles::tile.
Definition: sb.h:12586
Defines the version.
Definition: sb.h:6773
int vminor
vminor number, changes on internal improvement which doesn't modify the interface
Definition: sb.h:6776
int build_major
build_major number, changes every time the library is built
Definition: sb.h:6777
int minor
minor number, changes when the interface is no longer compatible
Definition: sb.h:6775
int major
major number, changes when there are new features
Definition: sb.h:6774