SqueezeBrains SDK 1.13
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
5//Il define rende non modificabili dall'utente questi parametri.
6//Se si modificano i seguenti parametri la funzione sb_project_set_par da errore.
7//sb_t_par.svl.dl.perturbations.inpainter_path
8//sb_t_par.svl.dl.perturbations.mode
9//sb_t_par.svl.dl.perturbations.type
10//sb_t_par.svl.dl.perturbations.delta_scale
11//sb_t_par.svl.dl.pre_trained
12//sb_t_par.svl.dl.learning_rate
13//sb_t_par.svl.dl.network.n_channels
14//sb_t_par.svl.dl.network.input_size
15//sb_t_par.svl.dl.network.image_format
16//sb_t_par.svl.dl.loss_fn
17//#define SB_ENABLE_DL_RESERVED_PAR
18
19#ifdef SB_ENABLE_DL_RESERVED_PAR
20// SB_ENABLE_TENSORFLOW abilita il valore SB_PROJECT_MODE_NO_DETECTION nell enum sb_t_project_mode
21// Serve solo alla GUI con tensorflow per essere piu' veloci nella clonazione del progetto quando si entra e si esce dai setting
22// commenti al parametro SB_PROJECT_MODE_NO_DETECTION nelle funzioni che lo utilizzano
23// sb_project_load
24//- @ref SB_PROJECT_MODE_NO_DETECTION if it is not necessary to do the @ref sb_project_detection "detection" but only other operations such as
25// @ref sb_project_clone "cloning", @ref sb_project_get_par "reading parameters" etc.
26// With @ref SB_PROJECT_TYPE_DEEP_CORTEX "Deep Cortex" and @ref SB_PROJECT_TYPE_DEEP_SURFACE "Deep Surface" projects,
27// this mode avoids loading the weights into the network as it can be very slow.
28// sb_project_save
29// -@ref SB_PROJECT_MODE_NO_DETECTION if it is not necessary to do the detection but only other operations such as cloning, reading parameters etc.This avoids loading the architecture as it can be very slow..
30// sb_project_clone
31// -@ref SB_PROJECT_MODE_NO_DETECTION if it is not necessary to do the detection but only other operations such as cloning, reading parameters etc.
32// This avoids loading the architecture as it can be very slow.
33#define SB_ENABLE_TENSORFLOW
34#endif
35
36//Il define abilita la rete di segmentazione semantica UNet.
37//#define NEW_VERSION_DEEP_SURFACE_UNET
38
5444#ifndef INCLUDE_SB_H_
5445#define INCLUDE_SB_H_
5446
5447#include <time.h>
5448#include <stdio.h>
5449
5450#ifdef __cplusplus
5451# define SB_EXTERN_C extern "C"
5452#else
5453# define SB_EXTERN_C extern
5454#endif
5455
5456#if defined _MSC_VER
5457# define SB_CDECL __cdecl
5458#else
5459# define SB_CDECL
5460#endif
5461
5462#ifndef SB_DL_DLL //sb_lib
5463# ifdef _MSC_VER
5464# ifdef SB_API_EXPORTS
5465# define SB_EXPORTS __declspec(dllexport)
5466# define SB_DL_EXPORTS __declspec(dllimport)
5467# else
5468# define SB_EXPORTS __declspec(dllimport)
5469# endif
5470# else
5471# ifdef SB_API_EXPORTS
5472# define SB_EXPORTS __attribute__ ((visibility ("default")))
5473# define SB_DL_EXPORTS __attribute__ ((visibility ("default")))
5474# else
5475# define SB_EXPORTS
5476# endif
5477# endif
5478# define SB_PUBLIC(return_type) SB_EXTERN_C SB_EXPORTS return_type SB_CDECL
5479# define SB_DL_PUBLIC(return_type) SB_EXTERN_C SB_DL_EXPORTS return_type SB_CDECL
5480#else //sb_dl_lib
5481# ifdef _MSC_VER
5482# ifdef SB_DL_API_EXPORTS
5483# define SB_DL_EXPORTS __declspec(dllexport)
5484# else
5485# define SB_DL_EXPORTS __declspec(dllimport)
5486# endif
5487# else
5488# ifdef SB_DL_API_EXPORTS
5489# define SB_DL_EXPORTS __attribute__ ((visibility ("default")))
5490# else
5491# define SB_DL_EXPORTS
5492# endif
5493# endif
5494# define SB_PUBLIC(return_type) SB_EXTERN_C return_type SB_CDECL
5495# define SB_DL_PUBLIC(return_type) SB_EXTERN_C SB_DL_EXPORTS return_type SB_CDECL
5496#endif //SB_DL_DLL
5497
5498#if defined __cplusplus
5499# define SB_INLINE inline
5500#else
5501# define SB_INLINE static __inline
5502#endif
5503
5540typedef enum
5541{
5545 SB_ERR_CLS = 30000,
5624 SB_ERR_MALLOC = 140000,
5645 SB_ERR_ROI = 230000,
5661 SB_ERR_SOCKET = 250000,
5677 //N.B. Fino a 251999 i codici di errore sono riservati ai socket SB_ERR_SOCKET_xxxxx
5678 // Se si cambia modificare anche la funzione sb_err_socket
5690 SB_ERR_THREAD = 280000,
5691 SB_ERR_UUID = 290000,
5696 SB_ERR_XML = 330000,
5698}sb_t_err;
5699
5706typedef void(*sb_fp_trace_callback)(const char * const msg);
5707
5746SB_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);
5747
5753SB_PUBLIC(const char*) sb_err_format(sb_t_err code); // group_error
5755
5764typedef struct
5765{
5766 int x;
5767 int y;
5768}sb_t_point;
5769
5773typedef struct
5774{
5775 float x;
5776 float y;
5778
5782typedef struct
5783{
5784 int width;
5786}sb_t_size;
5787
5791typedef struct
5792{
5793 float width;
5794 float height;
5796
5800typedef struct
5801{
5802 int min;
5803 int max;
5804}sb_t_range;
5805
5809typedef struct
5810{
5811 float min;
5812 float max;
5814
5818typedef struct
5819{
5820 int x;
5821 int y;
5822 int width;
5824}sb_t_rect;
5825
5832SB_INLINE sb_t_point sb_point(int x, int y)
5833{
5834 sb_t_point p;
5835 p.x = x;
5836 p.y = y;
5837 return(p);
5838}
5839
5846SB_INLINE sb_t_point2d_f sb_point2d_f(float x, float y)
5847{
5849 p.x = x;
5850 p.y = y;
5851 return(p);
5852}
5853
5860SB_INLINE sb_t_size sb_size(int width, int height)
5861{
5862 sb_t_size sz;
5863 sz.width = width;
5864 sz.height = height;
5865 return(sz);
5866}
5867
5874SB_INLINE sb_t_size_flt sb_size_flt(float width, float height)
5875{
5876 sb_t_size_flt sz;
5877 sz.width = width;
5878 sz.height = height;
5879 return(sz);
5880}
5881
5888SB_INLINE sb_t_range sb_range(int min, int max)
5889{
5890 sb_t_range r;
5891 r.min = min;
5892 r.max = max;
5893 return(r);
5894}
5895
5902SB_INLINE sb_t_range_flt sb_range_flt(float min, float max)
5903{
5905 r.min = min;
5906 r.max = max;
5907 return(r);
5908}
5909
5918SB_INLINE sb_t_rect sb_rect(int x, int y, int width, int height)
5919{
5920 sb_t_rect r;
5921
5922 r.x = x;
5923 r.y = y;
5924 r.width = width;
5925 r.height = height;
5926
5927 return r;
5928}
5929
5939SB_PUBLIC(sb_t_err) sb_polyline_resize(sb_t_point2d_f* points, int size, sb_t_point2d_f center, float angle, float offset);
5940 // group_geometric
5942
5952#define SB_INIT_ONLY_HW_LICENSE_KEY "ONLY_HW_KEY"
5953
5958#define SB_INIT_ONLY_SB_LICENSE_KEY "ONLY_SB_KEY"
5959
5964#define SB_INIT_NO_LICENSE_KEY "NO_KEY"
5965
5971#define SB_DELIMITER ";"
5972
6000SB_PUBLIC(sb_t_err) sb_init(const char* const license_file);
6001
6025SB_PUBLIC(sb_t_err) sb_init_dl(const char* const search_path);
6026
6037SB_PUBLIC(sb_t_err) sb_release(void);
6038
6042typedef void * SB_HANDLE;
6043
6048typedef struct
6049{
6050 int major;
6051 int minor;
6055
6064SB_INLINE sb_t_version sb_version(int major, int minor, int vminor, int build_major)
6065{
6066 sb_t_version version;
6067 version.major = major;
6068 version.minor = minor;
6069 version.vminor = vminor;
6070 version.build_major = build_major;
6071 return(version);
6072}
6073
6086SB_PUBLIC(int) sb_version_check(sb_t_version version1, sb_t_version version2);
6087
6091typedef struct
6092{
6093 signed long long proc_virtual_used;
6094 signed long long proc_virtual_used_max;
6095 signed long long proc_virtual_max;
6096 signed long long proc_physical_used;
6097 signed long long proc_physical_used_max;
6098 signed long long system_total;
6099 signed long long system_used;
6100 signed long long system_free;
6102
6106typedef enum
6107{
6110 //SB_DEVICE_TPU,
6112
6117typedef struct
6118{
6123
6127 char name[128];
6128
6135 char compute_capability[8];
6136
6144 int id;
6145
6150
6157
6158
6162typedef struct
6163{
6169
6173 int size;
6175
6179typedef struct
6180{
6182 char version_str[16];
6183 char compile_date[32];
6184 char compile_time[32];
6185 signed long long malloc_size;
6186 signed long long malloc_size_max;
6189}sb_t_info;
6190
6194typedef struct
6195{
6196 unsigned char b;
6197 unsigned char g;
6198 unsigned char r;
6203 unsigned char a;
6204}sb_t_bgra;
6205
6214SB_INLINE sb_t_bgra sb_bgra(unsigned char b, unsigned char g, unsigned char r, unsigned char a)
6215{
6216 sb_t_bgra bgra;
6217 bgra.b = b;
6218 bgra.g = g;
6219 bgra.r = r;
6220 bgra.a = a;
6221 return(bgra);
6222}
6223
6227typedef struct
6228{
6229 unsigned char r;
6230 unsigned char g;
6231 unsigned char b;
6236 unsigned char a;
6237}sb_t_rgba;
6238
6247SB_INLINE sb_t_rgba sb_rgba(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
6248{
6249 sb_t_rgba rgba;
6250 rgba.r = r;
6251 rgba.g = g;
6252 rgba.b = b;
6253 rgba.a = a;
6254 return(rgba);
6255}
6256
6261#define SB_VALUE_NOT_SET 1000000.0f
6262#define SB_PAR_MODELS_NUM 64
6263#define SB_PAR_PERTURBATIONS_NUM 16
6264#define SB_PAR_STRING_LEN 64
6265#define SB_IMAGE_NAME_STRING_LEN 128
6266#define SB_PAR_LEVELS_NUM 32
6267#define SB_PAR_LEVEL_SCALE_GRANULARITY 0.50f
6268#define SB_PAR_LEVEL_SCALE_MIN 1.0f
6269#define SB_PAR_LEVEL_SCALE_MAX 16.0f
6270#define SB_PAR_RETINA_OBJ_SIZE_MIN 24
6271#define SB_PAR_RETINA_OBJ_SIZE_MAX 1024
6272#define SB_PAR_RETINA_OBJ_STRIDE_COARSE_MIN 4
6273#define SB_PAR_RETINA_OBJ_STRIDE_COARSE_MAX 32
6274#define SB_PAR_RETINA_OBJ_STRIDE_FINE_MIN 1
6275#define SB_PAR_RETINA_OBJ_STRIDE_FINE_MAX 8
6276#define SB_PAR_RETINA_OBJ_DISTANCE_MIN 4
6277#define SB_PAR_RETINA_NUM_OCCURRENCES_MIN -1
6278
6279#define SB_SAMPLE_SCALE_GRANULARITY 0.25f
6280#define SB_SAMPLE_SCALE_MIN 1.0f
6281#define SB_SAMPLE_SCALE_MAX 32.0f
6282
6283#define SB_SVL_DL_BATCH_SIZE_MIN 4
6284#define SB_SVL_DL_BATCH_SIZE_MAX 512
6285
6286#define SB_SVL_DL_VALIDATION_PERCENTAGE_MIN 0.0f
6287#define SB_SVL_DL_VALIDATION_PERCENTAGE_MAX 0.5f
6288
6289#define SB_SVL_DL_LEARNING_RATE_MIN 0.000001f
6290#define SB_SVL_DL_LEARNING_RATE_MAX 0.01f
6291#define SB_SVL_DL_LEARNING_RATE_DEFAULT 0.001f
6292
6293#define SB_SVL_DL_TILE_FACTOR_MIN 1
6294#define SB_SVL_DL_TILE_FACTOR_MAX 64
6295
6296#define SB_SVL_DL_FEATURES_MULTIPLIER_MIN 0.5f
6297#define SB_SVL_DL_FEATURES_MULTIPLIER_MAX 1.5f
6298#define SB_SVL_DL_FEATURES_MULTIPLIER_GRANULARITY 0.1f
6299#define SB_SVL_DL_FEATURES_MULTIPLIER_DEFAULT 1.0f
6300
6301#define SB_SVL_DL_SCALE_MIN 1.0f
6302#define SB_SVL_DL_SCALE_MAX 16.0f
6303#define SB_SVL_DL_SCALE_GRANULARITY 0.01f
6304
6305#define SB_SVL_DL_PERTURBATION_SHIFT_MIN 0.0f
6306#define SB_SVL_DL_PERTURBATION_SHIFT_MAX 0.5f
6307
6308#define SB_SVL_DL_PERTURBATION_STRETCH_CONTRAST_MIN 0.0f
6309#define SB_SVL_DL_PERTURBATION_STRETCH_CONTRAST_MAX 0.5f
6310
6311#define SB_SVL_DL_PERTURBATION_DELTA_BRIGHTNESS_MIN 0.0f
6312#define SB_SVL_DL_PERTURBATION_DELTA_BRIGHTNESS_MAX 0.5f
6313
6320#define SB_SURFACE_OPTIONAL_GRAY_LEVEL 128
6321
6331SB_PUBLIC(sb_t_err) sb_get_info(sb_t_info** const info, int gpu_info);
6332
6339SB_PUBLIC(sb_t_err) sb_destroy_info(sb_t_info** const info);
6340
6349SB_PUBLIC(sb_t_err) sb_format_info(const sb_t_info* const info, char* const str, int str_size);
6350
6359SB_PUBLIC(sb_t_err) sb_get_uuid(char* const str, size_t size);
6360
6370SB_PUBLIC(sb_t_err) sb_get_file_version(sb_t_version* const ver, const char* const file);
6371
6378typedef enum
6379{
6383
6388typedef enum
6389{
6393
6400SB_PUBLIC(int) sb_is_valid_utf8(const char * string);
6401
6402 // group_generic
6404
6420SB_PUBLIC(SB_HANDLE) sb_xml_node_get(SB_HANDLE parent, const char* const name);
6421
6430
6440
6450
6462SB_PUBLIC(SB_HANDLE) sb_xml_node_add(SB_HANDLE parent, const char* const name, const char* const content);
6463
6474SB_PUBLIC(sb_t_err) sb_xml_node_set(SB_HANDLE parent, const char* const name, const char* const content);
6475
6484SB_PUBLIC(sb_t_err) sb_xml_node_get_name(SB_HANDLE node, char* const str, size_t str_size);
6485
6494SB_PUBLIC(sb_t_err) sb_xml_node_set_attribute(SB_HANDLE node, const char* const attribute_name, const char* const content);
6495
6505SB_PUBLIC(sb_t_err) sb_xml_node_get_attribute(SB_HANDLE node, const char* const attribute_name, char* const str, size_t str_size);
6506
6514SB_PUBLIC(sb_t_err) sb_xml_node_set_itself(SB_HANDLE node, const char* const content);
6515
6524SB_PUBLIC(sb_t_err) sb_xml_node_count(SB_HANDLE parent, const char* const name, int* const cnt);
6525
6535SB_PUBLIC(sb_t_err) sb_xml_node_get_string(SB_HANDLE parent, const char* const name, char* const str, size_t str_size);
6536
6548SB_PUBLIC(sb_t_err) sb_xml_node_get_string_malloc(SB_HANDLE parent, const char* const name, char** const str);
6549
6557SB_PUBLIC(sb_t_err) sb_xml_node_remove(SB_HANDLE parent, const char* const name);
6558
6565SB_PUBLIC(sb_t_err) sb_xml_node_remove_itself(SB_HANDLE node); // group_xml
6567
6576typedef struct
6577{
6578 char name[256];
6579 char *fname;
6580}sb_t_file;
6581
6585typedef struct
6586{
6588 int n;
6591
6605SB_PUBLIC(sb_t_err) sb_folder_load(sb_t_folder** const f, const char* const path, const char* const ext, int sort, int verbosity);
6606
6612
6619SB_PUBLIC(sb_t_err) sb_folder_erase(sb_t_folder *folder, int index);
6620
6626SB_PUBLIC(sb_t_err) sb_folder_create(const char* const path);
6627
6633SB_PUBLIC(sb_t_err) sb_folder_remove(const char* const path);
6634
6641SB_PUBLIC(sb_t_err) sb_folder_exist(const char* const path, int* const exist);
6642
6651SB_PUBLIC(sb_t_err) sb_file_extract_name(const char* const full, int with_ext, char* const name, int name_size);
6652
6660SB_PUBLIC(sb_t_err) sb_file_extract_folder(const char* const full, char* const folderpath, int folderpath_size);
6661 // group_folder
6663
6683SB_PUBLIC(void) sb_free(void* ptr);
6684
6702SB_PUBLIC(void*) sb_malloc(size_t size);
6703
6722SB_PUBLIC(void*) sb_calloc(size_t count, size_t size);
6723
6740SB_PUBLIC(void*) sb_realloc(void* ptr, size_t size);
6741
6748typedef enum
6749{
6753
6764
6774 // group_memory
6776
6787typedef enum
6788{
6794
6799typedef enum
6800{
6807
6812typedef enum
6813{
6823
6828typedef enum
6829{
6841
6848typedef struct
6849{
6857
6864
6873
6881
6886typedef struct
6887{
6892
6897
6903
6908
6913 signed long long time_start;
6914
6919 signed long long time_end;
6920
6924 signed long long remain;
6925
6931
6937
6942 char sn[32];
6944
6945#define SB_LICENSE_VENDOR_CODE_SIZE 32
6946
6950typedef struct
6951{
6952 char address[256];
6953 char company[128];
6954 char company_role[128];
6955 char mail[128];
6956 char name[128];
6957 char operating_system[128];
6958 char phone[32];
6959 char surname[128];
6960 char sector_of_interest[1024];
6961 char vat[32];
6962 char vendor_code[SB_LICENSE_VENDOR_CODE_SIZE + 4];
6963 char machine_id[36];
6972 signed long long time_create;
6977 signed long long time_modify;
6982 signed long long time_save;
6984
6995SB_PUBLIC(sb_t_err) sb_license_get_hw_info(char** const str);
6996
7012SB_PUBLIC(sb_t_err) sb_license_check(SB_HANDLE module, char** const msg);
7013
7032SB_PUBLIC(sb_t_err) sb_license_configuration_check(SB_HANDLE module, sb_t_license_configuration_id configuration_id, char** const msg);
7033
7060
7069SB_PUBLIC(sb_t_err) sb_license_format_info(const sb_t_license* const info, char* const str, int str_size);
7070
7079
7088
7096SB_PUBLIC(const char*) sb_license_format_type(sb_t_license_type type);
7097
7106
7121SB_PUBLIC(sb_t_err) sb_license_apply_v2c(const char* const v2c, char** const msg_err, int verbosity);
7122 // group_license
7124
7135#define SB_LUT_POINT_NOT_EXIST 0xFFFF
7136
7141typedef struct
7142{
7143 unsigned short x;
7144 unsigned short y;
7146
7158SB_PUBLIC(sb_t_err) sb_lut_create(SB_HANDLE* phandle, int width, int height);
7159
7167SB_PUBLIC(sb_t_err) sb_lut_destroy(SB_HANDLE* phandle);
7168
7181SB_PUBLIC(sb_t_err) sb_lut_get_ptr(SB_HANDLE phandle, sb_t_lut_point** const ptr);
7182
7191SB_PUBLIC(sb_t_err) sb_lut_get_size(SB_HANDLE phandle, int* const width, int* const height);
7192
7201SB_PUBLIC(sb_t_err) sb_lut_save(SB_HANDLE phandle, const char* const file_path);
7202
7214SB_PUBLIC(sb_t_err) sb_lut_load(SB_HANDLE* phandle, const char* const file_path);
7215
7230SB_PUBLIC(sb_t_err) sb_lut_warp_point(SB_HANDLE phandle, const sb_t_point* const src, sb_t_point* const dst);
7231 // group_lut
7233
7243#define SB_IMAGE_FILE_EXTENSIONS "pgm" SB_DELIMITER \
7244 "ppm" SB_DELIMITER \
7245 "bmp" SB_DELIMITER \
7246 "png" SB_DELIMITER \
7247 "tif" SB_DELIMITER \
7248 "tiff" SB_DELIMITER \
7249 "jpeg" SB_DELIMITER \
7250 "jpg"
7251
7256typedef enum
7257{
7263
7271SB_PUBLIC(const char*) sb_image_format(sb_t_image_format format);
7272
7277typedef enum
7278{
7284
7288typedef struct
7289{
7290 unsigned int value;
7291 int x;
7292 int y;
7296
7300typedef struct
7301{
7303 int size;
7304}sb_t_rle;
7305
7309typedef struct
7310{
7311 unsigned char* data;
7312 unsigned char* free_data;
7314 int width;
7317 int size;
7329
7334
7335#ifdef SB_PUBLIC_INTERNAL_ENABLE
7336#ifdef SB_USE_OPENCV
7337 IplImage *cvi;
7338#else
7339 void* cvi;
7340#endif
7341#endif
7342}sb_t_image;
7343
7355SB_PUBLIC(sb_t_err) sb_image_create(sb_t_image** const pimg, int width, int height, sb_t_image_format format);
7356
7372SB_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);
7373
7383SB_PUBLIC(sb_t_err) sb_image_destroy(sb_t_image** const pimg);
7384
7391typedef enum
7392{
7395
7420SB_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);
7421
7431SB_PUBLIC(sb_t_err) sb_image_decompress(sb_t_image** const dst, sb_t_image* const src);
7432
7443SB_PUBLIC(sb_t_err) sb_image_set_clip_blend(sb_t_image * const img, int x, int y, const sb_t_rgba * const color);
7444
7455SB_PUBLIC(sb_t_err) sb_image_get_pixel(sb_t_image * const img, int x, int y, sb_t_rgba * const color);
7456
7466SB_PUBLIC(sb_t_err) sb_image_set_data(sb_t_image* const img, unsigned char* const data);
7467
7476SB_PUBLIC(sb_t_err) sb_image_clone(sb_t_image** const dst, const sb_t_image* const src);
7477
7485SB_PUBLIC(sb_t_err) sb_image_copy(const sb_t_image* const src, sb_t_image* const dst);
7486
7499SB_PUBLIC(sb_t_err) sb_image_copy_rect(const sb_t_image* const src, sb_t_rect rect, sb_t_image** const dst);
7500
7506SB_PUBLIC(sb_t_err) sb_image_clean(sb_t_image* const img);
7507
7541SB_PUBLIC(sb_t_err) sb_image_save(const sb_t_image* const img, const char* const file, const int* const params);
7542
7558SB_PUBLIC(sb_t_err) sb_image_load(sb_t_image** const img, const char* const file);
7559
7575SB_PUBLIC(sb_t_err) sb_image_convert(sb_t_image** const dst, sb_t_image* const src, sb_t_image_format format);
7576
7581typedef enum
7582{
7587
7599SB_PUBLIC(sb_t_err) sb_image_flip(const sb_t_image* const src, sb_t_image* const dst, sb_t_image_flip_mode mode);
7600
7613SB_PUBLIC(sb_t_err) sb_image_shift(const sb_t_image* const src, sb_t_image* const dst, int x_shift, int y_shift);
7614
7631SB_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);
7632
7651SB_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);
7652
7667SB_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);
7668
7677SB_PUBLIC(sb_t_err) sb_image_change_brightness(const sb_t_image* const src, sb_t_image* const dst, float delta_brightness);
7678
7688SB_PUBLIC(sb_t_err) sb_image_change_contrast(const sb_t_image* const src, sb_t_image* const dst, float delta_contrast);
7689
7693typedef enum
7694{
7699
7708
7715SB_PUBLIC(sb_t_err) sb_image_read_size(sb_t_size* const size, const char* const file);
7716 // group_image
7718
7729typedef struct
7730{
7733 unsigned char lut[256];
7735}sb_t_roi;
7736
7748SB_PUBLIC(sb_t_err) sb_roi_create(sb_t_roi** const roi, int width, int height);
7749
7764SB_PUBLIC(sb_t_err) sb_roi_create_header(sb_t_roi** const roi, int width, int height, int width_step);
7765
7774SB_PUBLIC(sb_t_err) sb_roi_destroy(sb_t_roi** const roi);
7775
7786SB_PUBLIC(sb_t_err) sb_roi_reset(sb_t_roi* const roi);
7787
7799
7807SB_PUBLIC(sb_t_err) sb_roi_set_data(sb_t_roi* const roi, unsigned char* const data);
7808
7826SB_PUBLIC(sb_t_err) sb_roi_set_rect(sb_t_roi* const roi, unsigned char gl, sb_t_rect rect, int reset_roi);
7827
7847SB_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);
7848
7849
7872SB_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);
7873
7894SB_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);
7895
7904SB_PUBLIC(sb_t_err) sb_roi_clone(sb_t_roi** const dst, const sb_t_roi* const src);
7905
7915SB_PUBLIC(sb_t_err) sb_roi_compress(sb_t_roi* const roi);
7916
7925SB_PUBLIC(sb_t_err) sb_roi_decompress(sb_t_roi* const roi);
7926
7936SB_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);
7937
7958SB_PUBLIC(sb_t_err) sb_roi_apply_lut(sb_t_roi* const roi, unsigned char *lut); // group_roi
7960
7970typedef enum
7971{
7975
7982typedef enum
7983{
7988
7994
8006
8012
8018
8024
8030
8037
8043
8049typedef enum
8050{
8051
8056
8065
8101typedef struct
8102{
8104 float max;
8105 float min;
8107
8117typedef struct
8118{
8119 char uuid[36];
8120 char image_name[SB_IMAGE_NAME_STRING_LEN];
8121
8127
8149
8161 sb_t_point vertex[4];
8162
8186 sb_t_point vertex_warp[4];
8187
8191 char model_name[SB_PAR_STRING_LEN];
8192
8204 float scale;
8205
8210
8223 float weight;
8224
8239
8246
8285
8295
8327 float IoU;
8328
8333} sb_t_sample;
8334
8342SB_PUBLIC(const char*) sb_format_truth(sb_t_truth truth);
8343
8351SB_PUBLIC(sb_t_err) sb_sample_clone(const sb_t_sample* const src, sb_t_sample* const dst);
8352
8359SB_PUBLIC(sb_t_err) sb_sample_destroy(sb_t_sample* const sample);
8360
8370SB_PUBLIC(sb_t_err) sb_sample_weights_image_overlay(sb_t_image* const image, const sb_t_sample* const s);
8371
8376typedef struct
8377{
8379 int size;
8381
8392SB_PUBLIC(sb_t_err) sb_samples_create(sb_t_samples** const samples);
8393
8402SB_PUBLIC(sb_t_err) sb_samples_destroy(sb_t_samples** const samples);
8403
8417SB_PUBLIC(sb_t_err) sb_samples_clone(sb_t_samples** const dst, const sb_t_samples* const src);
8418
8433SB_PUBLIC(sb_t_err) sb_samples_insert(sb_t_samples* const samples, const sb_t_sample* const sample, int sample_index);
8434
8447SB_PUBLIC(sb_t_err) sb_samples_remove(sb_t_samples* const samples, int sample_index);
8448
8456SB_PUBLIC(sb_t_err) sb_samples_swap(sb_t_samples* const samples, int sample_index_1, int sample_index_2);
8457
8468SB_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);
8469
8477SB_PUBLIC(sb_t_err) sb_sample_get_model_index(const sb_t_sample* const s, SB_HANDLE handle, int* const model_index);
8478
8486SB_PUBLIC(sb_t_err) sb_sample_get_level_index(const sb_t_sample* const s, SB_HANDLE handle, int* const level_index);
8487
8501SB_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
8503
8504
8514typedef enum
8515{
8524
8535
8546typedef enum
8547{
8558
8562typedef struct
8563{
8573 unsigned char lut[256];
8610
8614typedef struct
8615{
8616 long long time_rle;
8617 long long time_blob;
8618 long long time_contour;
8619 long long time_merge;
8620 long long time_sort;
8621 long long time_export;
8622 long long time_total;
8635
8640typedef enum
8641{
8646
8650typedef struct
8651{
8653 int area;
8654 int od;
8655 int lut;
8679 char model_name[SB_PAR_STRING_LEN];
8690 float angle;
8696 sb_t_point2d_f coord_min_rot_rect[4];
8702 float m_xx;
8708 float m_yy;
8715 float m_xy;
8716}sb_t_blob;
8717
8721typedef struct
8722{
8723 int size;
8727}sb_t_blobs;
8728
8734SB_PUBLIC(sb_t_err) sb_blobs_create(sb_t_blobs** const blobs);
8735
8742
8752SB_PUBLIC(sb_t_err) sb_blob_format_par(const sb_t_blob_par* const par, char* const str, int str_size);
8753
8771SB_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);
8772
8782SB_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);
8783
8793SB_PUBLIC(sb_t_err) sb_blobs_plot_roi(const sb_t_blobs* const blobs, sb_t_roi* const roi, unsigned char gl);
8794
8804SB_PUBLIC(sb_t_err) sb_blob_plot_roi(const sb_t_blob* const blob, sb_t_roi* const roi, unsigned char gl);
8805
8813SB_PUBLIC(sb_t_err) sb_blobs_clone(sb_t_blobs** const dst, const sb_t_blobs* const src);
8814
8821SB_PUBLIC(sb_t_err) sb_blobs_destroy(sb_t_blobs** const blobs);
8822
8829SB_PUBLIC(sb_t_err) sb_blob_destroy(sb_t_blob* const blob);
8830
8838SB_PUBLIC(sb_t_err) sb_blob_copy(sb_t_blob* const dst, const sb_t_blob* const src);
8839 // group_blob
8841
8859SB_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);
8860 // group_roi
8862
8873typedef enum
8874{
8880
8888SB_PUBLIC(const char*) sb_project_type_format(sb_t_project_type type);
8889
8890#define SB_PROJECTS_NUM 32
8891#define SB_PROJECT_UUID_LEN 36
8892
8898typedef struct
8899{
8901 char uuid[SB_PROJECT_UUID_LEN];
8904
8909typedef struct
8910{
8912 int size;
8913}sb_t_projects_info; // group_project 1
8915
8925#define SB_SOLUTION_EXT "rprj"
8926
8930typedef struct
8931{
8936
8948SB_PUBLIC(sb_t_err) sb_solution_get_info(const char* const solution_file, sb_t_solution_info** const solution);
8949
8958
8967SB_PUBLIC(sb_t_err) sb_solution_set_current_project(const char* const solution_file, const char* const project_uuid);
8968
8979SB_PUBLIC(sb_t_err) sb_solution_remove_project(const char* const solution_file, const char* const project_uuid);
8980
8991SB_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);
8992 // group_solution
8994
8995
9008
9019
9024typedef enum
9025{
9028#ifdef SB_ENABLE_TENSORFLOW
9029 SB_PROJECT_MODE_NO_DETECTION
9031#endif
9033
9045SB_PUBLIC(sb_t_err) sb_project_create(SB_HANDLE* phandle, const char* const project_name, sb_t_project_type project_type);
9046
9065SB_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);
9066
9083SB_PUBLIC(sb_t_err) sb_project_save(SB_HANDLE handle, const char* const solution_file, sb_t_project_mode mode);
9084
9099SB_PUBLIC(sb_t_err) sb_project_clone(SB_HANDLE src, SB_HANDLE* pdst, sb_t_project_mode mode, int regenerate_uuid);
9100
9110SB_PUBLIC(sb_t_err) sb_project_invalidate(SB_HANDLE handle, const char* const model_name, float scale);
9111
9169SB_PUBLIC(sb_t_err) sb_project_check_trained(SB_HANDLE handle, const char* const model_name, float scale, int* const is_trained);
9170
9174SB_PUBLIC(sb_t_err) sb_project_get_default_features(SB_HANDLE handle, char* str, int size);
9175
9189SB_PUBLIC(sb_t_err) sb_project_set_sensitivity(SB_HANDLE handle, const char* const model_name, float scale, float sensitivity);
9190
9200SB_PUBLIC(sb_t_err) sb_project_get_sensitivity(SB_HANDLE handle, const char* const model_name, float scale, float* const sensitivity);
9201
9211SB_PUBLIC(sb_t_err) sb_project_get_notes(SB_HANDLE handle, char** const note);
9212
9220SB_PUBLIC(sb_t_err) sb_project_set_notes(SB_HANDLE handle, const char* const note);
9221
9231SB_PUBLIC(sb_t_err) sb_project_get_name(SB_HANDLE handle, char** const name);
9232
9240SB_PUBLIC(sb_t_err) sb_project_set_name(SB_HANDLE handle, const char* const name);
9241
9266
9277SB_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);
9278
9317SB_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);
9318
9332SB_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);
9333
9351
9360SB_PUBLIC(sb_t_err) sb_project_get_scale_offset(SB_HANDLE handle, sb_t_size_flt* const scale_offset);
9361 // group_project 2
9363
9371#define SB_PAR_FEATURES_NAMES_LEN 256
9372
9373typedef struct sb_t_svl_res sb_t_svl_res;
9374
9379typedef struct
9380{
9393
9402typedef enum
9403{
9427
9435SB_PUBLIC(const char*) sb_svl_command_format(sb_t_svl_command command);
9436
9445typedef enum
9446{
9469
9478
9489typedef 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);
9490
9501typedef sb_t_err(*sb_fp_svl_progress)(void* const user_data, sb_t_svl_res* res, int force);
9502
9514typedef 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);
9515
9519typedef enum
9520{
9521 SB_NETWORK_TYPE_NONE = 0,
9552#ifdef NEW_VERSION_DEEP_SURFACE_UNET
9557 SB_NETWORK_TYPE_UNET_256 = 130,
9558#endif
9569
9570 //Must be the last
9571 SB_NETWORK_TYPE_END
9573
9581SB_PUBLIC(const char*) sb_network_type_format(sb_t_network_type type);
9582
9587typedef struct
9588{
9609
9617
9626
9634
9644
9648typedef enum
9649{
9682 //SB_LOSS_FN_TYPE_DICE,
9687 //SB_LOSS_FN_TYPE_RMI,
9689
9697SB_PUBLIC(const char*) sb_loss_fn_type_format(sb_t_loss_fn_type type);
9698
9703typedef enum
9704{
9710
9716
9722
9731
9736typedef enum
9737{
9746
9752
9761
9766typedef struct
9767{
9773 char inpainter_path[512];
9774
9781
9788
9797
9806
9814
9822
9830
9839
9847
9855
9859#define SB_DL_WEIGHTS_EXT "weights"
9860
9865typedef struct
9866{
9874 char network_path[512];
9875
9881
9890
9896
9907
9913
9923
9942
9950
9974
9999
10013
10023
10028typedef struct
10029{
10069
10083
10088#define SB_DEVICES_MAX_NUMBER 4
10089
10094typedef struct
10095{
10100
10110
10117typedef struct {
10123
10129
10135
10141
10145 char project_path[512];
10146
10153 char image_ext[64];
10154
10161
10170
10186
10193
10199
10205
10235 // group_svl
10237
10247typedef struct
10248{
10254
10262
10270
10278
10286
10293typedef struct
10294{
10299
10303 int size;
10305
10311typedef struct
10312{
10324 float scale;
10326
10332typedef struct
10333{
10339
10343 int size;
10345
10350typedef struct
10351{
10357
10427
10443
10455
10461
10469
10477
10504
10519
10533
10555
10567
10578
10582typedef struct
10583{
10589
10594 int size;
10596
10600typedef struct
10601{
10626
10641
10646typedef struct
10647{
10649
10655
10692 unsigned char collaborations[SB_PAR_MODELS_NUM][SB_PAR_MODELS_NUM];
10693
10702
10708
10715
10722
10733
10741
10752
10758
10764}sb_t_par;
10765
10772SB_PUBLIC(sb_t_err) sb_par_init(sb_t_par* const par, sb_t_project_type project_type);
10773
10781SB_PUBLIC(sb_t_err) sb_par_add_model(sb_t_par* const par, const char* const model_name);
10782
10790SB_PUBLIC(sb_t_err) sb_par_remove_model(sb_t_par* const par, const char* const model_name);
10791
10801SB_PUBLIC(sb_t_err) sb_par_add_level(sb_t_par* const par, const char* const model_name, float scale);
10802
10812SB_PUBLIC(sb_t_err) sb_par_remove_level(sb_t_par* const par, const char* const model_name, float scale);
10813
10824SB_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);
10825
10836SB_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);
10837
10847SB_PUBLIC(sb_t_err) sb_par_format(const sb_t_par* const par, char* const str, int str_size);
10848
10877SB_PUBLIC(sb_t_err) sb_par_auto_tiling_get_img_range(sb_t_range* const range, int net_input_size, float scale, int tile);
10878
10887
10896
10904SB_PUBLIC(const char*) sb_device_type_format(sb_t_device_type type);
10905 // group_parameters
10907
10918typedef enum
10919{
10941
10942
10948typedef struct
10949{
10954 char* string;
10955 int words;
10956 int lines;
10958
10966typedef struct
10967{
10969
10978
10992
11011
11012
11021
11028
11057typedef struct
11058{
11066 int tp;
11067
11075 int tn;
11076
11084 int fp;
11085
11093 int fn;
11094
11102 int op;
11103
11111 int on;
11112
11121
11129
11137
11142typedef struct
11143{
11145 int size;
11147
11151typedef enum
11152{
11167
11175SB_PUBLIC(const char*) sb_tile_type_format(sb_t_tile_type type);
11176
11180typedef struct
11181{
11184}sb_t_tile;
11185
11189typedef struct
11190{
11192 int size;
11193}sb_t_tiles;
11194
11198typedef struct
11199{
11204
11212SB_PUBLIC(sb_t_err) sb_tiles_info_clone(sb_t_tiles_info** const pdst, const sb_t_tiles_info* const src);
11213
11220
11228SB_PUBLIC(sb_t_err) sb_tiles_info_no_overlap(sb_t_tiles_info* const tiles, sb_t_size img_size, int offset);
11229
11230//TODO TABELLA DEI PUNTATORI NEI RISULTATI
11275typedef struct
11276{
11284
11290
11297
11303
11311
11317
11324
11329 long long time_us;
11330
11335
11343
11350}sb_t_res;
11351
11358SB_PUBLIC(sb_t_err) sb_res_destroy(sb_t_res** const res);
11359
11367SB_PUBLIC(sb_t_err) sb_res_clone(sb_t_res** const dst, const sb_t_res* const src);
11368
11375SB_PUBLIC(sb_t_err) sb_res_compress(sb_t_res* const res);
11376
11382SB_PUBLIC(sb_t_err) sb_res_decompress(sb_t_res* const res);
11383 // group_res
11385
11397typedef struct
11398{
11407 int tp;
11408
11418 int tn;
11419
11428 int fp;
11429
11438 int fn;
11439
11448 int op;
11449
11457 int on;
11458
11467
11482
11488
11493 float recall;
11494
11500
11506
11513 float score;
11515
11520typedef struct
11521{
11527
11531 int size;
11533
11543typedef struct
11544{
11553
11560
11567 int good;
11568
11575
11582
11589
11595 float recall;
11596
11603
11610
11611 long long time_us;
11613 long long time_blob_us;
11615 long long time_res_us;
11618}sb_t_stat;
11619
11629SB_PUBLIC(sb_t_err) sb_stat_format(const sb_t_stat* const stat, char* const str, int str_size);
11630
11637SB_PUBLIC(sb_t_err) sb_stat_destroy(sb_t_stat** const stat);
11638
11647SB_PUBLIC(sb_t_err) sb_stat_reset(sb_t_stat* const stat, const sb_t_par* const par);
11648
11661SB_PUBLIC(sb_t_err) sb_stat_from_res(sb_t_stat* const stat, const sb_t_res* const res);
11662 // group_stat
11664
11673typedef struct
11674{
11675 int index;
11676 int lut_level[SB_PAR_LEVELS_NUM];
11678
11685typedef struct
11686{
11691 char* models;
11702
11706
11719SB_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);
11720
11729
11761SB_PUBLIC(sb_t_err) sb_project_change_type(const char* const solution_file, const char* const project_uuid, sb_t_project_type project_type);
11762
11774SB_PUBLIC(sb_t_err) sb_project_get_par(SB_HANDLE handle, sb_t_par* const par);
11775
11859SB_PUBLIC(sb_t_err) sb_project_set_par(SB_HANDLE handle, const sb_t_par* const par);
11860
11881SB_PUBLIC(sb_t_err) sb_project_get_res(SB_HANDLE handle, sb_t_res** const res, int details);
11882
11890
11903SB_PUBLIC(sb_t_err) sb_project_get_stat(SB_HANDLE handle, sb_t_stat** const stat);
11904 // group_project 3
11906
11918#define SB_IMAGE_INFO_EXT "rtn"
11919
11927typedef enum
11928{
11934
11938typedef struct
11939{
11943
11947typedef struct
11948{
11950 int size;
11952
11962SB_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);
11963
11972SB_PUBLIC(sb_t_err) sb_image_info_get_details(const char* const image_file, sb_t_image_info_details** details);
11973
11982
11991SB_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);
11992
12002SB_PUBLIC(sb_t_err) sb_image_info_remove_project(const char* const image_file, const char* const project_uuid);
12003
12028SB_PUBLIC(sb_t_err) sb_image_info_load(SB_HANDLE* image_info, const char* const image_file, SB_HANDLE module_handle);
12029
12038
12047
12058SB_PUBLIC(sb_t_err) sb_image_info_clone(SB_HANDLE src, SB_HANDLE* pdst, SB_HANDLE module_handle);
12059
12080SB_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);
12081
12089SB_PUBLIC(sb_t_err) sb_image_info_add_sample(SB_HANDLE image_info, const sb_t_sample* const sample);
12090
12099SB_PUBLIC(sb_t_err) sb_image_info_set_samples(SB_HANDLE image_info, const sb_t_samples* const samples);
12100
12113SB_PUBLIC(sb_t_err) sb_image_info_get_samples(SB_HANDLE image_info, sb_t_samples** const samples);
12114
12123
12138
12151SB_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);
12152
12165
12173
12182SB_PUBLIC(sb_t_err) sb_image_info_set_notes(SB_HANDLE image_info, const char* const str);
12183
12194SB_PUBLIC(sb_t_err) sb_image_info_get_notes(SB_HANDLE image_info, char** const str);
12195
12204SB_PUBLIC(sb_t_err) sb_image_info_get_name(SB_HANDLE image_info, char* const str, int str_size);
12205
12215SB_PUBLIC(sb_t_err) sb_image_info_set_results(SB_HANDLE image_info, const sb_t_res* const res);
12216
12227SB_PUBLIC(sb_t_err) sb_image_info_get_results(SB_HANDLE image_info, sb_t_res** const res, int compressed);
12228
12237SB_PUBLIC(sb_t_err) sb_image_info_set_project_name(SB_HANDLE image_info, const char* const project_name);
12238
12249
12259SB_PUBLIC(sb_t_err) sb_image_info_set_roi(SB_HANDLE image_info, const sb_t_roi* const roi);
12260
12283SB_PUBLIC(sb_t_err) sb_image_info_get_roi(SB_HANDLE image_info, sb_t_roi** const roi, int width, int height, int compressed);
12284
12296SB_PUBLIC(sb_t_err) sb_image_info_set_roi_defects(SB_HANDLE image_info, const sb_t_roi* const defects);
12297
12321SB_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);
12322
12348 // group_image_info
12350
12351
12366SB_PUBLIC(sb_t_err) sb_folder_filter_images(sb_t_folder* const folder, SB_HANDLE module, sb_t_image_info_type image_info_type);
12367 // group_folder_2
12369
12370
12382typedef enum
12383{
12388
12398
12403
12408
12425
12445
12466
12473typedef struct
12474{
12476 char file_name[2][512];
12477 float scale[2];
12479 char model_name[2][SB_PAR_STRING_LEN];
12480 int sample_index[2];
12481 sb_t_point centre[2];
12482 float dist;
12483 float min_dist;
12485
12486#define SB_CLS_0 "cls0"
12487#define SB_CLS_1 "cls1"
12488
12493#define SB_FEATURE_0A "0A"
12494#define SB_FEATURE_0B "0B"
12495#define SB_FEATURE_0A_RI "0A_RI"
12496#define SB_FEATURE_0B_RI "0B_RI"
12497#define SB_FEATURE_2A "2A"
12498#define SB_FEATURE_2B "2B"
12499#define SB_FEATURE_2C "2C"
12500#define SB_FEATURE_2D "2D"
12501#define SB_FEATURE_2A_R "2A.R"
12502#define SB_FEATURE_2AA_R "2AA.R"
12503#define SB_FEATURE_2B_R "2B.R"
12504#define SB_FEATURE_2C_R "2C.R"
12505#define SB_FEATURE_2D_R "2D.R"
12506#define SB_FEATURE_2A_G "2A.G"
12507#define SB_FEATURE_2AA_G "2AA.G"
12508#define SB_FEATURE_2B_G "2B.G"
12509#define SB_FEATURE_2C_G "2C.G"
12510#define SB_FEATURE_2D_G "2D.G"
12511#define SB_FEATURE_2A_B "2A.B"
12512#define SB_FEATURE_2AA_B "2AA.B"
12513#define SB_FEATURE_2B_B "2B.B"
12514#define SB_FEATURE_2C_B "2C.B"
12515#define SB_FEATURE_2D_B "2D.B"
12516#define SB_FEATURE_2A_RI "2A_RI"
12517#define SB_FEATURE_2B_RI "2B_RI"
12518#define SB_FEATURE_2C_RI "2C_RI"
12519#define SB_FEATURE_2A_RI_R "2A_RI.R"
12520#define SB_FEATURE_2AA_RI_R "2AA_RI.R"
12521#define SB_FEATURE_2B_RI_R "2B_RI.R"
12522#define SB_FEATURE_2C_RI_R "2C_RI.R"
12523#define SB_FEATURE_2A_RI_G "2A_RI.G"
12524#define SB_FEATURE_2AA_RI_G "2AA_RI.G"
12525#define SB_FEATURE_2B_RI_G "2B_RI.G"
12526#define SB_FEATURE_2C_RI_G "2C_RI.G"
12527#define SB_FEATURE_2A_RI_B "2A_RI.B"
12528#define SB_FEATURE_2AA_RI_B "2AA_RI.B"
12529#define SB_FEATURE_2B_RI_B "2B_RI.B"
12530#define SB_FEATURE_2C_RI_B "2C_RI.B"
12531#define SB_FEATURE_3A "3A"
12532#define SB_FEATURE_3B "3B"
12533#define SB_FEATURE_3C "3C"
12534#define SB_FEATURE_3D "3D"
12535#define SB_FEATURE_3E "3E"
12536#define SB_FEATURE_4A "4A" //group_features
12538
12540#define SB_FEATURES SB_FEATURE_0A SB_DELIMITER \
12541 SB_FEATURE_0B SB_DELIMITER \
12542 SB_FEATURE_0A_RI SB_DELIMITER \
12543 SB_FEATURE_0B_RI SB_DELIMITER \
12544 SB_FEATURE_2A SB_DELIMITER \
12545 SB_FEATURE_2A_R SB_DELIMITER \
12546 SB_FEATURE_2A_G SB_DELIMITER \
12547 SB_FEATURE_2A_B SB_DELIMITER \
12548 SB_FEATURE_2AA_R SB_DELIMITER \
12549 SB_FEATURE_2AA_G SB_DELIMITER \
12550 SB_FEATURE_2AA_B SB_DELIMITER \
12551 SB_FEATURE_2B SB_DELIMITER \
12552 SB_FEATURE_2B_R SB_DELIMITER \
12553 SB_FEATURE_2B_G SB_DELIMITER \
12554 SB_FEATURE_2B_B SB_DELIMITER \
12555 SB_FEATURE_2C SB_DELIMITER \
12556 SB_FEATURE_2C_R SB_DELIMITER \
12557 SB_FEATURE_2C_G SB_DELIMITER \
12558 SB_FEATURE_2C_B SB_DELIMITER \
12559 SB_FEATURE_2D SB_DELIMITER \
12560 SB_FEATURE_2D_R SB_DELIMITER \
12561 SB_FEATURE_2D_G SB_DELIMITER \
12562 SB_FEATURE_2D_B SB_DELIMITER \
12563 SB_FEATURE_2A_RI SB_DELIMITER \
12564 SB_FEATURE_2A_RI_R SB_DELIMITER \
12565 SB_FEATURE_2A_RI_G SB_DELIMITER \
12566 SB_FEATURE_2A_RI_B SB_DELIMITER \
12567 SB_FEATURE_2AA_RI_R SB_DELIMITER \
12568 SB_FEATURE_2AA_RI_G SB_DELIMITER \
12569 SB_FEATURE_2AA_RI_B SB_DELIMITER \
12570 SB_FEATURE_2B_RI SB_DELIMITER \
12571 SB_FEATURE_2B_RI_R SB_DELIMITER \
12572 SB_FEATURE_2B_RI_G SB_DELIMITER \
12573 SB_FEATURE_2B_RI_B SB_DELIMITER \
12574 SB_FEATURE_2C_RI SB_DELIMITER \
12575 SB_FEATURE_2C_RI_R SB_DELIMITER \
12576 SB_FEATURE_2C_RI_G SB_DELIMITER \
12577 SB_FEATURE_2C_RI_B SB_DELIMITER \
12578 SB_FEATURE_3A SB_DELIMITER \
12579 SB_FEATURE_3B SB_DELIMITER \
12580 SB_FEATURE_3C SB_DELIMITER \
12581 SB_FEATURE_3D SB_DELIMITER \
12582 SB_FEATURE_3E SB_DELIMITER \
12583 SB_FEATURE_4A
12584
12598SB_PUBLIC(const char*) sb_feature_description(const char* const feature);
12599
12603typedef struct
12604{
12605 char image_name[SB_IMAGE_NAME_STRING_LEN];
12608
12612typedef struct
12613{
12615 int size;
12617
12622typedef struct
12623{
12631 float loss;
12668
12672typedef struct
12673{
12677 int size;
12679
12695typedef struct
12696{
12716 float score;
12721 int tp;
12726 int fp;
12731 int tn;
12736 int fn;
12741 int op;
12746 int on;
12785 char classificator[32];
12797 char features_available[SB_PAR_FEATURES_NAMES_LEN];
12801 char* warning;
12808
12813typedef struct
12814{
12816 int size;
12818
12822typedef struct
12823{
12835
12839typedef struct
12840{
12849 int size;
12851
12852#define SB_SVL_STEP_INITIALIZATION "initializing data for svl"
12853#define SB_SVL_STEP_SEARCHING_RECIPE "choosing recipe"
12854#define SB_SVL_STEP_TRAINING_RECIPE "training recipe"
12855#define SB_SVL_STEP_FINALIZATION "finalization of svl"
12856#define SB_SVL_STEP_FINISHED "svl has finished"
12857
12881
12907 char running_step[256];
12973 long long time_ms;
12984 long long time_left_ms;
12993};
12994
13029SB_PUBLIC(sb_t_err) sb_svl_run(SB_HANDLE handle);
13030
13039
13047
13058SB_PUBLIC(sb_t_err) sb_svl_get_res(SB_HANDLE handle, sb_t_svl_res** const res);
13059
13067
13075SB_PUBLIC(sb_t_err) sb_svl_clone_res(sb_t_svl_res** const dst, const sb_t_svl_res* const src);
13076 // group_svl
13078
13107SB_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);
13108
13109 // group_surface // group_cpp
13112#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_err sb_blob_format_par(const sb_t_blob_par *const par, char *const str, int str_size)
Formats the blob analysis parameters structure.
sb_t_blob_distance_mode
Enumerates the algorithm for calculating the distance between blobs.
Definition: sb.h:8547
sb_t_blob_deleted
Defines the deleted blob.
Definition: sb.h:8641
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:8515
sb_t_err sb_blobs_destroy(sb_t_blobs **const blobs)
Destroys the blobs structure.
sb_t_err sb_blob_copy(sb_t_blob *const dst, const sb_t_blob *const src)
Blob copy.
sb_t_err sb_blob_init_par(sb_t_blob_par *const par)
Initializes the fields of the structure.
sb_t_err sb_blobs_clone(sb_t_blobs **const dst, const sb_t_blobs *const src)
Blobs structure clone.
sb_t_err sb_blob_destroy(sb_t_blob *const blob)
Destroys the blob.
sb_t_err sb_blob_intersect(const sb_t_blob *const blob1, const sb_t_blob *const blob2, int extract_blob_seg, sb_t_blob **const res)
Blob intersection.
sb_t_err sb_blobs_create(sb_t_blobs **const blobs)
Creates the blobs structure.
sb_t_err sb_blobs_detection(sb_t_blobs **const blobs, const sb_t_image *const image, const sb_t_roi *const roi, const sb_t_blob_par *const par, sb_t_image_circularity_type circularity_type)
Blob analysis.
@ SB_BLOB_DISTANCE_MODE_CONTOUR
The distance between blobs is calculated using the contour.
Definition: sb.h:8556
@ SB_BLOB_DISTANCE_MODE_BOUNDING_BOX
The distance between blobs is calculated using the unrotated bounding box.
Definition: sb.h:8551
@ SB_BLOB_OK
Blob is not deleted.
Definition: sb.h:8642
@ SB_BLOB_DELETED_AFTER_MERGE
Blob is deleted after merge.
Definition: sb.h:8644
@ SB_BLOB_DELETED_BEFORE_MERGE
Blob is deleted before merge.
Definition: sb.h:8643
@ 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:8533
@ SB_PIXEL_CONNECTION_4
4 connection.
Definition: sb.h:8523
sb_t_err
Errors code enum.
Definition: sb.h:5541
const char * sb_err_format(sb_t_err code)
Returns the error message.
sb_t_err sb_trace(int trace_enable, int date_time_enable, int line_enable, int trace_win_enable, const char *const filename, sb_fp_trace_callback trace_callback)
Sets the options for the messages trace.
void(* sb_fp_trace_callback)(const char *const msg)
Definition of the callback for message trace.
Definition: sb.h:5706
@ SB_ERR_SVL_VALIDATION_DATASET
The SVL images dataset is too small to extract a validation dataset.
Definition: sb.h:5689
@ SB_ERR_IMAGE_CREATE
An error occurred creating the image.
Definition: sb.h:5584
@ SB_ERR_FILE_READ
An error occurred reading the file.
Definition: sb.h:5575
@ SB_ERR_MACHINE_ID
Machine id has a wrong format.
Definition: sb.h:5623
@ SB_ERR_LICENSE_MACHINE_ID_MATCH
Machine id doesn't match.
Definition: sb.h:5612
@ SB_ERR_IMAGE_WARP
Image warp function returns an error.
Definition: sb.h:5594
@ SB_ERR_FILE_WRITE
An error occurred writing the file.
Definition: sb.h:5580
@ SB_ERR_PATH_SIZE
the path name exceeds the maximum size
Definition: sb.h:5640
@ SB_ERR_SOCKET_CREATE
An error occurred creating the socket.
Definition: sb.h:5666
@ SB_ERR_IMAGE_FORMAT
The image format is wrong.
Definition: sb.h:5588
@ SB_ERR_MODEL_NOT_TRAINED
The model is not trained.
Definition: sb.h:5629
@ SB_ERR_LICENSE_NOT_FOUND
License key not found.
Definition: sb.h:5616
@ SB_ERR_IMAGE_DEPTH
The image has a wrong bit depth.
Definition: sb.h:5586
@ SB_ERR_FILE_COPY
Error copying a file.
Definition: sb.h:5567
@ SB_ERR_DL_INPAINTER_NOT_ASSIGNED
Deep Learning inpainter network path is not assigned.
Definition: sb.h:5557
@ SB_ERR_VERSION
Unmanaged version.
Definition: sb.h:5692
@ SB_ERR_MODEL_DISABLED
A model is disabled.
Definition: sb.h:5626
@ SB_ERR_SAMPLE_NOT_FOUND
No sample found.
Definition: sb.h:5649
@ SB_ERR_IMAGE_RESIZE
Image resize function returns an error.
Definition: sb.h:5590
@ SB_ERR_MODEL_NAME
There are two models with the same name.
Definition: sb.h:5627
@ SB_ERR_LICENSE_VERSION
License is incompatible with the library version.
Definition: sb.h:5620
@ SB_ERR_IMAGE_DECODE
An error occurred decoding image.
Definition: sb.h:5585
@ SB_ERR_SVL_CHOOSE_FEATURES_FAST
Choose features failed to find a common combination for fast.
Definition: sb.h:5688
@ SB_ERR_MODEL_NOT_FOUND
The model of the sample is unknown or not assigned.
Definition: sb.h:5628
@ SB_ERR_IMAGE_CHANNELS
The image has a wrong number of channels.
Definition: sb.h:5581
@ SB_ERR_SAMPLE_BACKGROUND
Too few background samples to execute the training. Increase the analysis ROI or reduce the scale.
Definition: sb.h:5648
@ SB_ERR_SOCKET_INVALID_IP
IP address is invalid.
Definition: sb.h:5667
@ SB_ERR_FILE_REMOVE
Error removing a file.
Definition: sb.h:5576
@ SB_ERR_SOCKET_INVALID_PORT
Port isn't a valid number.
Definition: sb.h:5668
@ SB_ERR_FILE_VERSION
The file has no version.
Definition: sb.h:5579
@ SB_ERR_LIBRARY_DEPENDENCIES
Library dependencies not satisfied to execute the requested operation.
Definition: sb.h:5602
@ SB_ERR_SOCKET_LISTEN
Socket listen function has returned an error.
Definition: sb.h:5670
@ SB_ERR_SAMPLE_DISTANCE
There are two samples closer than the minimum distance set.
Definition: sb.h:5653
@ SB_ERR_ENCRYPT
An error occurred encrypting data.
Definition: sb.h:5566
@ SB_ERR_DIR_REMOVE
An error occurred removing the folder.
Definition: sb.h:5554
@ SB_ERR_DL_NETWORK_FILE_NOT_FOUND
Deep Learning Network file not found.
Definition: sb.h:5560
@ SB_ERR_LICENSE_EXPIRED
License is expired.
Definition: sb.h:5609
@ SB_ERR_SOCKET_SELECT
Socket select function has returned an error.
Definition: sb.h:5673
@ SB_ERR_SOCKET_SEND
Socket send function has returned an error.
Definition: sb.h:5674
@ SB_ERR_DECRYPT
An error occurred decrypting data.
Definition: sb.h:5550
@ SB_ERR_SVL_WAS_NOT_DONE
The SVL wasn't done.
Definition: sb.h:5685
@ SB_ERR_FILE_EMPTY
File is empty.
Definition: sb.h:5568
@ SB_ERR_DIR_NOT_EXIST
The directory doesn't exist.
Definition: sb.h:5553
@ SB_ERR_SOCKET_SET_PARAMETER
Set socket parameter has returned an error.
Definition: sb.h:5675
@ SB_ERR_LICENSE_MODELS_NUMBER
Number of models is greater than the maximum allowed for the current license configuration.
Definition: sb.h:5615
@ SB_ERR_FILE_NAME_EMPTY
File name is empty.
Definition: sb.h:5572
@ SB_ERR_SOCKET_CONNECT
An error occurred connecting the socket.
Definition: sb.h:5664
@ SB_ERR_BUFFER_SIZE
The buffer has an insufficient size.
Definition: sb.h:5544
@ SB_ERR_LICENSE_SAME_MACHINE_ID
Two licences have the same machine id.
Definition: sb.h:5617
@ SB_ERR_IMAGE_LOAD
An error occurred loading the image.
Definition: sb.h:5589
@ SB_ERR_INTERNAL
Internal error.
Definition: sb.h:5598
@ SB_ERR_IMAGE_RESOLUTION
The image has a wrong resolution.
Definition: sb.h:5591
@ SB_ERR_DL_INTERNAL
Internal Deep Learning error.
Definition: sb.h:5559
@ SB_ERR_FILE_FORMAT
Wrong data file format.
Definition: sb.h:5570
@ SB_ERR_PROJECT_LOAD_MODE
The project was loaded with the wrong load parameter.
Definition: sb.h:5641
@ SB_ERR_SOCKET
A socket function has returned an error.
Definition: sb.h:5661
@ SB_ERR_INVALID_MAIL_ADDRESS
Mail address has a wrong format.
Definition: sb.h:5599
@ SB_ERR_NO_FILE_FOUND
No file found in the folder.
Definition: sb.h:5636
@ SB_ERR_SVL_PERTURBATION
A perturbation has not been defined properly.
Definition: sb.h:5684
@ SB_ERR_SOCKET_BIND
An error occurred binding the socket.
Definition: sb.h:5663
@ SB_ERR_SENTINEL_TOO_MANY_KEYS
Too many keys connected to the pc.
Definition: sb.h:5659
@ SB_ERR_LICENSE_DISABLED
License is disabled.
Definition: sb.h:5608
@ SB_ERR_MODELS_ENABLED
There are no models enabled.
Definition: sb.h:5630
@ SB_ERR_LICENSE_CORRUPTED
License file is corrupted.
Definition: sb.h:5607
@ SB_ERR_SENTINEL
Sentinel key returns an error.
Definition: sb.h:5657
@ SB_ERR_PROJECT_NOT_FOUND
Project not found.
Definition: sb.h:5642
@ SB_ERR_FILE_NAME
Wrong file name: too long or unknown extension.
Definition: sb.h:5571
@ SB_ERR_LIBRARY_FUNCTION_ADDRESS
Could not locate the function.
Definition: sb.h:5603
@ 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:5601
@ SB_ERR_FILE_EXTENSION
Wrong file extension.
Definition: sb.h:5569
@ SB_ERR_XML
Error parsing xml file.
Definition: sb.h:5696
@ SB_ERR_FILE_OPEN
An error occurred opening the file.
Definition: sb.h:5577
@ SB_ERR_SAMPLES_GT_TOO_MANY
Too many ground truth samples.
Definition: sb.h:5655
@ SB_ERR_IMAGE_CIRCULARITY
The image circularity type is wrong.
Definition: sb.h:5582
@ SB_ERR_IMAGE_SIZE
Image has a wrong data size.
Definition: sb.h:5592
@ SB_ERR_IMAGE_WIDTH_STEP
Image has a wrong width_step value.
Definition: sb.h:5595
@ SB_ERR_FILE_NAME_LENGHT
File name too long.
Definition: sb.h:5573
@ SB_ERR_CLS_CREATE
The function for the creation of the classifier has returned an error.
Definition: sb.h:5546
@ SB_ERR_STRUCT_HEADER_WRONG_VERSION
The version of the structure sb_t_struct_header is wrong.
Definition: sb.h:5683
@ SB_ERR_SAMPLE_WRONG
The sample has wrong data.
Definition: sb.h:5652
@ SB_ERR_DIR_EXIST
Checking the existence of the folder gave error.
Definition: sb.h:5552
@ SB_ERR_IMAGE_COMPRESSION
The image compression type is wrong.
Definition: sb.h:5583
@ SB_ERR_NO_POINT_FOUND
Point isn't found.
Definition: sb.h:5637
@ SB_ERR_IMAGE_TYPE
Unknown image type, should be a sb_t_image_info_type enum value.
Definition: sb.h:5593
@ SB_ERR_STRING_EMPTY
String empty.
Definition: sb.h:5679
@ SB_ERR_NO_FEATURES_AVAILABLE
No features available for the data set.
Definition: sb.h:5634
@ SB_ERR_PROJECT_TYPE
Wrong project type.
Definition: sb.h:5643
@ SB_ERR_LICENSE_WAIT_SERVER
Waiting to contact the license server.
Definition: sb.h:5622
@ SB_ERR_SVL_CHOOSE_FEATURES
Choose features failed to find a good combination.
Definition: sb.h:5687
@ SB_ERR_CLS
The function of a classifier has returned an error.
Definition: sb.h:5545
@ SB_ERR_INITIALIZE
You must call the initialize function.
Definition: sb.h:5596
@ SB_ERR_ROI
The ROI is wrong.
Definition: sb.h:5645
@ SB_ERR_LICENSE_FEATURES_NUMBER
Number of features is greater than the maximum allowed for the current license configuration.
Definition: sb.h:5610
@ SB_ERR_LIBRARY_OPEN
Could not load the dynamic library or the shared object.
Definition: sb.h:5604
@ SB_ERR_WARP_POINT_NOT_FOUND
Point isn't found in the lut.
Definition: sb.h:5694
@ SB_ERR_FILE_SAVE
An error occurred saving the file.
Definition: sb.h:5578
@ SB_ERR_SENTINEL_MASTER_KEY
Sentinel LDK Master key not present.
Definition: sb.h:5658
@ SB_ERR_MALLOC
The function that allocates memory gave error
Definition: sb.h:5624
@ SB_ERR_BASE64_SIZE
The dimension of the base64 buffer isn't 4 bytes aligned.
Definition: sb.h:5543
@ SB_ERR_THREAD
Thread management error.
Definition: sb.h:5690
@ SB_ERR_MEMORY_LEAK
There is a memory leak.
Definition: sb.h:5625
@ SB_ERR_DL_TRAINING_DATA_MISSING
Deep Learning training data missing.
Definition: sb.h:5565
@ SB_ERR_INSUFFICIENT_FREE_MEMORY
Insufficient free memory to complete the svl.
Definition: sb.h:5597
@ SB_ERR_UUID
The generation of UUID has returned an error or invalid UUID.
Definition: sb.h:5691
@ SB_ERR_XML_NODE_NOT_FOUND
An xml node was not found.
Definition: sb.h:5697
@ SB_ERR_NONE
No errors.
Definition: sb.h:5542
@ SB_ERR_NULL_POINTER
Function has been called with a NULL pointer.
Definition: sb.h:5632
@ SB_ERR_LICENSE_TYPE
The license type is unknown.
Definition: sb.h:5619
@ 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:5564
@ SB_ERR_LICENSE
The license isn't valid.
Definition: sb.h:5605
@ SB_ERR_STRUCT_HEADER_WRONG_SIZE
The dimension of the structure sb_t_struct_header is wrong.
Definition: sb.h:5682
@ SB_ERR_CLS_TRAINING
The training function has returned an error.
Definition: sb.h:5549
@ SB_ERR_LICENSE_CODE
Code of the TCP/IP license protocol is wrong.
Definition: sb.h:5606
@ SB_ERR_DL_INPAINTER_NOT_FOUND
Deep Learning inpainter network file not found.
Definition: sb.h:5558
@ SB_ERR_STRUCT_HEADER_WRONG_CODE
The code of the structure sb_t_struct_header is wrong.
Definition: sb.h:5681
@ SB_ERR_WRONG_PARAMETER
The function has been called with a parameter with a wrong value.
Definition: sb.h:5695
@ SB_ERR_LICENSE_FILE
License file error (not exist, not readable, wrong format, wrong mail address)
Definition: sb.h:5611
@ SB_ERR_DIR_CREATE
An error occurred creating the folder.
Definition: sb.h:5551
@ SB_ERR_NVIDIA_NVML
Nvidia NVML returns an error getting gpu information.
Definition: sb.h:5639
@ SB_ERR_LICENSE_VM
License isn't allowed on Virtual Machine.
Definition: sb.h:5621
@ SB_ERR_SVL_WRONG
SVL is wrong.
Definition: sb.h:5686
@ SB_ERR_NO_LEVELS_AVAILABLE
No levels available to be processed.
Definition: sb.h:5635
@ SB_ERR_IMAGE_ENCODE
An error occurred encoding image.
Definition: sb.h:5587
@ SB_ERR_SOCKET_IOCTL
Socket ioctl function has returned an error.
Definition: sb.h:5669
@ SB_ERR_ROI_DEFECTS
The defects ROI is wrong.
Definition: sb.h:5647
@ SB_ERR_LICENSE_TRAINING
License error: training is disabled.
Definition: sb.h:5618
@ SB_ERR_SOCKET_TIMEOUT
Timeout sending or receiving data on socket.
Definition: sb.h:5676
@ SB_ERR_VERSION_FORMAT
Version is not formatted properly.
Definition: sb.h:5693
@ SB_ERR_DL_PRE_TRAINED_FILE_NOT_FOUND
Deep Learning pre-trained file not found.
Definition: sb.h:5562
@ SB_ERR_DL_NOT_SUPPORTED
Deep Learning modules are not supported.
Definition: sb.h:5561
@ SB_ERR_DL_CUDA_OUT_OF_MEMORY
CUDA Out Of Memory (OOM). Insufficient free GPU memory to execute the operation. Try reducing the bat...
Definition: sb.h:5555
@ SB_ERR_RPF_NAME_EMPTY
The name of solution file is empty.
Definition: sb.h:5644
@ SB_ERR_SOCKET_RECEIVE
Socket receive function has returned an error.
Definition: sb.h:5672
@ SB_ERR_NO_CLASSIFIED_IMAGE
There aren't classified images.
Definition: sb.h:5633
@ SB_ERR_CLS_PREDICT
The predict function has returned an error.
Definition: sb.h:5548
@ SB_ERR_SCALE_NOT_FOUND
The scale is not found.
Definition: sb.h:5656
@ SB_ERR_LICENSE_MAIL_ADDRESS
Mail address in the license file is wrong.
Definition: sb.h:5613
@ SB_ERR_ROI_BOUNDING_BOX
Wrong roi bounding box.
Definition: sb.h:5646
@ SB_ERR_FILE_NOT_EXIST
The file doesn't exist.
Definition: sb.h:5574
@ SB_ERR_SENTINEL_RUN_TIME
Sentinel_LDK_Run-time is not running.
Definition: sb.h:5660
@ SB_ERR_SAMPLE_SCALE
The sample scale is wrong.
Definition: sb.h:5654
@ SB_ERR_SAMPLE_OUT_OF_IMAGE
The sample is out of image.
Definition: sb.h:5651
@ 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:5631
@ SB_ERR_STRING_UTF8
String does not conform to UTF-8 format.
Definition: sb.h:5680
@ SB_ERR_SOCKET_CLOSED
Socket is closed.
Definition: sb.h:5665
@ SB_ERR_SOCKET_MAC
Error while looking for a valid MAC address.
Definition: sb.h:5671
@ SB_ERR_CLS_NOT_TRAINED
The training wasn't done.
Definition: sb.h:5547
@ SB_ERR_LEVELS_ENABLED
There are no levels enabled.
Definition: sb.h:5600
@ SB_ERR_DL_FRAMEWORK
Impossible to execute the requested operation: Deep Learning Framework not installed or corrupted.
Definition: sb.h:5556
@ SB_ERR_NOT_IMPLEMENTED
The function isn't implemented.
Definition: sb.h:5638
@ SB_ERR_LICENSE_MARKER
Marker of the TCP/IP license protocol is wrong.
Definition: sb.h:5614
@ SB_ERR_SAMPLE_NUMBER
Too few samples to execute the training.
Definition: sb.h:5650
@ SB_ERR_SOCKET_ACCEPT
Socket accept has returned an error.
Definition: sb.h:5662
@ SB_ERR_DL_PRE_TRAINED_FILE_NOT_VALID
Deep Learning pre-trained file is not valid.
Definition: sb.h:5563
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:6262
#define SB_PAR_PERTURBATIONS_NUM
Maximum number of perturbation of a sample.
Definition: sb.h:6263
sb_t_err sb_destroy_info(sb_t_info **const info)
Destroys the structure.
sb_t_err sb_init_dl(const char *const search_path)
Initialize the Deep Learning library.
sb_t_err sb_release(void)
Releases all the resources allocates in the library.
sb_t_floating_point_op_type
Enumerates the floating point precision types to perform operations.
Definition: sb.h:6389
sb_t_err sb_init(const char *const license_file)
Initializes the SB library.
SB_INLINE sb_t_bgra sb_bgra(unsigned char b, unsigned char g, unsigned char r, unsigned char a)
Inline constructor of structure sb_t_bgra.
Definition: sb.h:6214
#define SB_PAR_LEVELS_NUM
Maximum scales levels number to be used for Surface.
Definition: sb.h:6266
#define SB_IMAGE_NAME_STRING_LEN
Maximum length, in byte, of the image name string.
Definition: sb.h:6265
sb_t_device_type
Defines computing device types.
Definition: sb.h:6107
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:6064
void * SB_HANDLE
HANDLE definition.
Definition: sb.h:6042
sb_t_interpolation_mode
Enumerates the interpolation modes.
Definition: sb.h:6379
#define SB_PAR_STRING_LEN
Maximum length, in byte, of a parameter string.
Definition: sb.h:6264
int sb_version_check(sb_t_version version1, sb_t_version version2)
Compares two version.
sb_t_err sb_get_info(sb_t_info **const info, int gpu_info)
The function gets information about the sb library and the available computational devices.
SB_INLINE sb_t_rgba sb_rgba(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Inline constructor of structure sb_t_rgba.
Definition: sb.h:6247
sb_t_err sb_get_file_version(sb_t_version *const ver, const char *const file)
Get the version of a file.
int sb_is_valid_utf8(const char *string)
Check if a string conforms to UTF-8 format.
sb_t_err sb_get_uuid(char *const str, size_t size)
Creates a new uuid.
@ SB_FLOATING_POINT_OPS_TYPE_SINGLE_PRECISION
Single Precision (FP32).
Definition: sb.h:6390
@ SB_FLOATING_POINT_OPS_TYPE_HALF_PRECISION
Half Precision (FP16).
Definition: sb.h:6391
@ SB_DEVICE_GPU
GPU device.
Definition: sb.h:6109
@ SB_DEVICE_CPU
CPU device.
Definition: sb.h:6108
@ SB_INTERPOLATION_MODE_NN
Nearest Neighbor pixel interpolation.
Definition: sb.h:6381
@ SB_INTERPOLATION_MODE_BILINEAR
Bilinear interpolation.
Definition: sb.h:6380
SB_INLINE sb_t_point2d_f sb_point2d_f(float x, float y)
Inline constructor of structure sb_t_point2d_f.
Definition: sb.h:5846
SB_INLINE sb_t_range sb_range(int min, int max)
Inline constructor of structure sb_t_range.
Definition: sb.h:5888
SB_INLINE sb_t_range_flt sb_range_flt(float min, float max)
Inline constructor of structure sb_t_range_flt.
Definition: sb.h:5902
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:5832
SB_INLINE sb_t_size sb_size(int width, int height)
Inline constructor of structure sb_t_size.
Definition: sb.h:5860
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:5918
SB_INLINE sb_t_size_flt sb_size_flt(float width, float height)
Inline constructor of structure sb_t_size_flt.
Definition: sb.h:5874
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:11928
sb_t_err sb_image_info_destroy_details(sb_t_image_info_details **const details)
Destroys the array of the images info details.
sb_t_err sb_image_info_set_type(SB_HANDLE image_info, sb_t_image_info_type type)
Sets the type of the SqueezeBrains image info.
sb_t_err sb_image_info_set_notes(SB_HANDLE image_info, const char *const str)
Set a note into SqueezeBrains image info handle.
sb_t_err sb_image_info_get_type(SB_HANDLE image_info, const char *const model_name, sb_t_image_info_type *const type)
Retrieves the SqueezeBrains image info handle type.
sb_t_err sb_image_info_change_project(const char *const image_file, const sb_t_project_info *const project_info_old, SB_HANDLE module_handle_new)
Change the project to the data associated to the image.
sb_t_err sb_image_info_set_results(SB_HANDLE image_info, const sb_t_res *const res)
Set the results of the detection in the image info handle.
sb_t_err sb_image_info_get_name(SB_HANDLE image_info, char *const str, int str_size)
Retrieves the name of the image.
sb_t_err sb_image_info_add_sample(SB_HANDLE image_info, const sb_t_sample *const sample)
Adds a sample into the SqueezeBrains image info handle.
sb_t_err sb_image_info_get_project_info(SB_HANDLE handle, sb_t_project_info *const project_info)
Retrieves the project information.
sb_t_err sb_image_info_get_roi(SB_HANDLE image_info, sb_t_roi **const roi, int width, int height, int compressed)
Gets the ROI from a SqueezeBrains image info handle.
sb_t_err sb_image_info_copy_labeling(SB_HANDLE dst, const char *const image_file, const sb_t_project_info *src_prj, int roi, int ground_truth, int *copied)
Copies the labeling information from the src project into the destination image info.
sb_t_err sb_image_info_clone(SB_HANDLE src, SB_HANDLE *pdst, SB_HANDLE module_handle)
Clones the SqueezeBrains image info.
sb_t_err sb_image_info_get_details(const char *const image_file, sb_t_image_info_details **details)
Load the file and get the array of the image info details.
sb_t_err sb_image_info_get_roi_defects(SB_HANDLE image_info, sb_t_roi **const defects, int width, int height, int compressed)
Gets the surface defects ROI from a SqueezeBrains image info handle.
sb_t_err sb_image_info_load(SB_HANDLE *image_info, const char *const image_file, SB_HANDLE module_handle)
Creates a SqueezeBrains image info handle.
sb_t_err sb_image_info_set_samples(SB_HANDLE image_info, const sb_t_samples *const samples)
Saves the samples in the corresponding SqueezeBrains image info handle.
sb_t_err sb_image_info_set_project_name(SB_HANDLE image_info, const char *const project_name)
Set the project name in the image info handle.
sb_t_err sb_image_info_remove_project(const char *const image_file, const char *const project_uuid)
Remove the project with the specified UUID from the data associated to the image.
sb_t_err sb_image_info_apply_par_changes(SB_HANDLE image_info, const sb_t_par_changes_info *info)
Apply the par changes to the SqueezeBrains image info handle.
sb_t_err sb_image_info_set_roi_defects(SB_HANDLE image_info, const sb_t_roi *const defects)
Sets the surface defects ROI on a SqueezeBrains image info handle.
sb_t_err sb_image_info_get_tiles_svl(SB_HANDLE handle, sb_t_tiles_info **const ptiles)
Retrieves the svl tiles information.
sb_t_err sb_image_info_get_custom_par_root(SB_HANDLE handle, SB_HANDLE *node_root)
Returns the xml root node of your own custom parameters.
sb_t_err sb_image_info_reset(SB_HANDLE image_info)
Erases all the data from the SqueezeBrains image info handle.
sb_t_err sb_image_info_destroy(SB_HANDLE *image_info)
Destroys the SqueezeBrains image info handle.
sb_t_err sb_image_info_save(SB_HANDLE image_info)
Saves the SqueezeBrains image info handle into the image file.
@ SB_IMAGE_INFO_TYPE_SVL_USED
Read-only value. Image is used for SVL and for training.
Definition: sb.h:11932
@ SB_IMAGE_INFO_TYPE_TEST
Image is used for test.
Definition: sb.h:11930
@ SB_IMAGE_INFO_TYPE_SVL
Image is used for SVL and not used for training.
Definition: sb.h:11931
@ SB_IMAGE_INFO_TYPE_NONE
Image is not used.
Definition: sb.h:11929
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:7582
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:7694
sb_t_err sb_image_read_size(sb_t_size *const size, const char *const file)
Get the image size from a file.
const char * sb_image_format(sb_t_image_format format)
Returns the string of the image format.
sb_t_err sb_image_shift(const sb_t_image *const src, sb_t_image *const dst, int x_shift, int y_shift)
Shifts the image.
const char * sb_image_circularity_type_format(sb_t_image_circularity_type type)
Returns the string of the image circularity type.
sb_t_err sb_image_flip(const sb_t_image *const src, sb_t_image *const dst, sb_t_image_flip_mode mode)
Flips the image.
sb_t_image_compress_type
Type of image compression.
Definition: sb.h:7278
sb_t_err sb_image_change_contrast(const sb_t_image *const src, sb_t_image *const dst, float delta_contrast)
Changes the image contrast by the percentage amount specified.
sb_t_err sb_image_set_clip_blend(sb_t_image *const img, int x, int y, const sb_t_rgba *const color)
Set the pixel (x,y) with the color using also alpha blending.
sb_t_err sb_image_get_pixel(sb_t_image *const img, int x, int y, sb_t_rgba *const color)
Get the pixel (x,y).
sb_t_err sb_image_copy(const sb_t_image *const src, sb_t_image *const dst)
Copies the image.
sb_t_err sb_image_get_sample(const sb_t_image *const src, sb_t_point centre, double angle_rad, float scale, sb_t_image *const dst)
Copies, rotates, resizes a rectangular roi of the source image to the destination one.
sb_t_err sb_image_destroy(sb_t_image **const pimg)
Destroys the image.
sb_t_err sb_image_save(const sb_t_image *const img, const char *const file, const int *const params)
Saves the image in a file.
sb_t_err sb_image_rotate(const sb_t_image *const src, sb_t_point centre, double angle, sb_t_interpolation_mode interpolation_mode, sb_t_image *const dst)
Rotates an image.
sb_t_err sb_image_clone(sb_t_image **const dst, const sb_t_image *const src)
Clones the image.
sb_t_err sb_image_set_data(sb_t_image *const img, unsigned char *const data)
Sets the pointer to a block of memory for image data.
sb_t_err sb_image_create_header(sb_t_image **const pimg, int width, int height, int width_step, sb_t_image_format format)
Creates an image but doesn't allocate memory for the data.
sb_t_err sb_image_decompress(sb_t_image **const dst, sb_t_image *const src)
Decompress the image.
sb_t_err sb_image_clean(sb_t_image *const img)
Cleans the image.
sb_t_err sb_image_copy_rect(const sb_t_image *const src, sb_t_rect rect, sb_t_image **const dst)
Copies a rectangular ROI of an image into another one.
sb_t_err sb_image_resize(const sb_t_image *const src, sb_t_rect rect, float scale, sb_t_interpolation_mode interpolation_mode, sb_t_image *const dst)
Resizes the image.
sb_t_err sb_image_load(sb_t_image **const img, const char *const file)
Loads an image from a file.
sb_t_image_compress_par
Definitions of parameters used by the image encoders.
Definition: sb.h:7392
sb_t_err sb_image_compress(sb_t_image **const dst, sb_t_image *const src, sb_t_image_compress_type compression, const void *const params)
Compress the image with the compression method specified.
sb_t_image_format
Format of image pixel.
Definition: sb.h:7257
@ SB_IMAGE_FLIP_VERTICAL
flips the image around vertical axis.
Definition: sb.h:7585
@ SB_IMAGE_FLIP_HORIZONTAL
flips the image around horizontal axis.
Definition: sb.h:7584
@ SB_IMAGE_FLIP_BOTH
flips the image around both horizontal and vertical axises, it is a rotation of 180 degrees.
Definition: sb.h:7583
@ SB_IMAGE_CIRCULARITY_TYPE_HORIZONTAL
Horizontal image circularity.
Definition: sb.h:7696
@ SB_IMAGE_CIRCULARITY_TYPE_NONE
No image circularity.
Definition: sb.h:7695
@ SB_IMAGE_CIRCULARITY_TYPE_VERTICAL
Vertical image circularity, not implemented yet.
Definition: sb.h:7697
@ SB_IMAGE_COMPRESS_JPEG
JPEG compression.
Definition: sb.h:7281
@ SB_IMAGE_COMPRESS_NONE
uncompressed or raw images
Definition: sb.h:7279
@ SB_IMAGE_COMPRESS_RLE
RLE (Run Lenght Encoding) lossless compression.
Definition: sb.h:7280
@ SB_IMAGE_COMPRESS_PNG
PNG compression.
Definition: sb.h:7282
@ SB_IMAGE_COMPRESS_PAR_JPEG_QUALITY
Quality of jpeg image.
Definition: sb.h:7393
@ SB_IMAGE_FORMAT_BW8
BW: one channel, 8 bit per channel.
Definition: sb.h:7258
@ SB_IMAGE_FORMAT_BGR888
BGR: three channel, 8 bit per channel.
Definition: sb.h:7259
@ SB_IMAGE_FORMAT_RGB888
RGB: three channel, 8 bit per channel.
Definition: sb.h:7260
@ SB_IMAGE_FORMAT_UI32
unsigned int 32 bit
Definition: sb.h:7261
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:6788
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:6829
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:6945
sb_t_license_configuration_id
Enumerations of the license configurations.
Definition: sb.h:6813
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:6800
@ SB_LICENSE_MODULE_STATUS_ACTIVE
The license is valid and active.
Definition: sb.h:6790
@ SB_LICENSE_MODULE_STATUS_DISABLED
The license is disabled.
Definition: sb.h:6791
@ SB_LICENSE_MODULE_STATUS_ERR
There is an error. See the field sb_t_license_module::err.
Definition: sb.h:6792
@ SB_LICENSE_MODULE_STATUS_NULL
The license status is undefined.
Definition: sb.h:6789
@ SB_LICENSE_MODULE_RETINA
Retina.
Definition: sb.h:6831
@ SB_LICENSE_MODULE_NUMBER
Number of modules.
Definition: sb.h:6839
@ SB_LICENSE_MODULE_NONE
Module type not defined.
Definition: sb.h:6830
@ SB_LICENSE_MODULE_SURFACE
Surface.
Definition: sb.h:6832
@ SB_LICENSE_MODULE_DEEP_CORTEX
Deep Cortex.
Definition: sb.h:6833
@ SB_LICENSE_MODULE_DEEP_SURFACE
Deep Surface.
Definition: sb.h:6834
@ SB_LICENSE_BASIC
Basic configuration.
Definition: sb.h:6816
@ SB_LICENSE_CONFIGURATION_NUMBER
Number of configurations.
Definition: sb.h:6821
@ SB_LICENSE_PREMIUM
Premium configuration.
Definition: sb.h:6814
@ SB_LICENSE_STANDARD
Standard configuration.
Definition: sb.h:6815
@ SB_LICENSE_NOT_PRESENT
License is not present.
Definition: sb.h:6805
@ SB_LICENSE_DISABLED
License is disabled.
Definition: sb.h:6802
@ SB_LICENSE_MASTER
Master license: hasn't an expiry date.
Definition: sb.h:6804
@ SB_LICENSE_NULL
License type isn't defined.
Definition: sb.h:6801
@ SB_LICENSE_DEMO
Demo license: has an expiry date.
Definition: sb.h:6803
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:6749
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:6750
@ SB_MALLOC_CHECK_SECOND_COUNTER
The second counter.
Definition: sb.h:6751
const char * sb_interpolation_mode_format(sb_t_interpolation_mode mode)
Returns the string of the interpolation mode.
const char * sb_device_type_format(sb_t_device_type type)
Returns the string of the device type.
sb_t_err sb_par_add_level(sb_t_par *const par, const char *const model_name, float scale)
Adds the level to the parameter structure.
sb_t_err sb_par_auto_tiling_get_img_range(sb_t_range *const range, int net_input_size, float scale, int tile)
Calculates the scale range of the images to be processed compatible with the input size of the networ...
sb_t_err sb_par_remove_model(sb_t_par *const par, const char *const model_name)
Removes the model from the structure of the project parameters.
sb_t_err sb_par_format(const sb_t_par *const par, char *const str, int str_size)
Formats the parameters structure.
sb_t_err sb_par_get_collaboration(sb_t_par *par, const char *const model_name_1, const char *const model_name_2, int *const value)
Retreives the collaboration between two models.
sb_t_err sb_par_add_model(sb_t_par *const par, const char *const model_name)
Adds the model to the parameter structure.
sb_t_err sb_par_set_collaboration(sb_t_par *par, const char *const model_name_1, const char *const model_name_2, int value)
Sets collaboration between two models.
sb_t_err sb_par_init(sb_t_par *const par, sb_t_project_type project_type)
Initializes the fields of the structure.
sb_t_err sb_par_remove_level(sb_t_par *const par, const char *const model_name, float scale)
Removes the l-th level from the structure of the project parameters.
const char * sb_floating_point_precision_type_format(sb_t_floating_point_op_type type)
Returns the string of the floating point precision type.
sb_t_err sb_project_set_par(SB_HANDLE handle, const sb_t_par *const par)
Sets the parameters structure into the project handle.
sb_t_err sb_project_set_name(SB_HANDLE handle, const char *const name)
Sets the name into the project handle.
sb_t_err sb_project_get_par(SB_HANDLE handle, sb_t_par *const par)
Retrieves the project parameters structure.
sb_t_project_mode
Defines the loading or saving mode of a project.
Definition: sb.h:9025
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:8874
sb_t_err sb_project_load(SB_HANDLE *phandle, const char *const solution_file, const char *const project_uuid, sb_t_project_mode mode)
Loads an existing project from file.
sb_t_err sb_project_detection(SB_HANDLE handle, const sb_t_image *const img, const sb_t_roi *const roi, const sb_t_roi *const roi_defects, const sb_t_samples *const samples)
Detection function.
sb_t_err sb_project_check_trained(SB_HANDLE handle, const char *const model_name, float scale, int *const is_trained)
Checks if the project is trained.
sb_t_err sb_project_get_scale_offset(SB_HANDLE handle, sb_t_size_flt *const scale_offset)
Gets the scale offset from the project handle.
sb_t_err sb_project_get_res(SB_HANDLE handle, sb_t_res **const res, int details)
Retrieves the results of the last elaborated image.
const char * sb_project_type_format(sb_t_project_type type)
Returns the string of the project type.
sb_t_err sb_project_destroy(SB_HANDLE *phandle)
Frees all the resources of the project handle.
sb_t_err sb_project_set_scale_offset(SB_HANDLE handle, sb_t_size_flt scale_offset)
Sets in the project handle the scale offset used at detection time.
sb_t_err sb_project_copy_labeling(const char *const path_solution_dst, const char *const path_solution_src, int copy_roi, int copy_labeling, int verbosity)
Copies the analysis roi and the labeling between two current projects of two different solutions.
sb_t_err sb_project_get_svl_version(SB_HANDLE handle, sb_t_version *const version, char *const version_str, int size_version_str)
Returns the version of the SB library when the last SVL was made.
sb_t_err sb_project_clone(SB_HANDLE src, SB_HANDLE *pdst, sb_t_project_mode mode, int regenerate_uuid)
Clones the SqueezeBrains project.
sb_t_err sb_project_change_type(const char *const solution_file, const char *const project_uuid, sb_t_project_type project_type)
Change the project type.
sb_t_err sb_project_reset_stat(SB_HANDLE handle)
Resets the internal statistics of the elaborations.
sb_t_err sb_project_get_default_features(SB_HANDLE handle, char *str, int size)
Get the project default features depending on the project type (Retina or Surface)
sb_t_err sb_project_invalidate(SB_HANDLE handle, const char *const model_name, float scale)
Eliminates the training of the models.
sb_t_err sb_project_get_stat(SB_HANDLE handle, sb_t_stat **const stat)
Gets the statistics from the handle.
sb_t_err sb_project_get_notes(SB_HANDLE handle, char **const note)
Gets the note from the project handle.
sb_t_err sb_project_get_sensitivity(SB_HANDLE handle, const char *const model_name, float scale, float *const sensitivity)
Gets the classification threshold from the project handle.
sb_t_err sb_project_get_name(SB_HANDLE handle, char **const name)
Gets the name from the project handle.
@ SB_PROJECT_MODE_DETECTION_ONLY
Load/save the minimum module information to allow detection.
Definition: sb.h:9026
@ SB_PROJECT_MODE_DETECTION_AND_SVL
Load/save all the module information.
Definition: sb.h:9027
@ SB_PROJECT_TYPE_RETINA
Project Retina.
Definition: sb.h:8875
@ SB_PROJECT_TYPE_SURFACE
Project Surface.
Definition: sb.h:8876
@ SB_PROJECT_TYPE_DEEP_SURFACE
Project Deep Surface.
Definition: sb.h:8877
@ SB_PROJECT_TYPE_DEEP_CORTEX
Project Deep Cortex.
Definition: sb.h:8878
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:10919
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:11152
sb_t_err sb_res_compress(sb_t_res *const res)
Compress the results, in particular the Surface plane images.
sb_t_err sb_tiles_info_no_overlap(sb_t_tiles_info *const tiles, sb_t_size img_size, int offset)
Rearranges the tiles so that they do not go out of the picture and do not overlap.
sb_t_err sb_res_destroy(sb_t_res **const res)
Destroys the module results structure.
const char * sb_tile_type_format(sb_t_tile_type type)
Returns the string of the tile type.
sb_t_err sb_tiles_info_clone(sb_t_tiles_info **const pdst, const sb_t_tiles_info *const src)
Clones the tiles information structure.
sb_t_err sb_res_clone(sb_t_res **const dst, const sb_t_res *const src)
Copies the results of image elaboration.
@ SB_IMAGE_TRUTH_OVERKILL
False defects found.
Definition: sb.h:10935
@ SB_IMAGE_TRUTH_UNDEFINED
Undefined truth.
Definition: sb.h:10923
@ SB_IMAGE_TRUTH_GOOD
No defects.
Definition: sb.h:10927
@ SB_IMAGE_TRUTH_NO_GOOD
Defects found.
Definition: sb.h:10931
@ SB_IMAGE_TRUTH_ESCAPE
Defects not found.
Definition: sb.h:10939
@ SB_TILE_TYPE_NOT_USED
The tile is not used because it has no pixels in the ROI analysis.
Definition: sb.h:11156
@ SB_TILE_TYPE_USED
The tile is used.
Definition: sb.h:11161
@ SB_TILE_TYPE_USED_SVL
The tile is used for svl by sb_svl_run function.
Definition: sb.h:11165
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:7971
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:8050
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:7983
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:7973
@ SB_OBJ_TEST
Object is not used for learning.
Definition: sb.h:7972
@ SB_SAMPLE_OPTIONAL
Definition: sb.h:8063
@ SB_SAMPLE_REQUIRED
Definition: sb.h:8055
@ SB_TRUTH_MODEL_DISABLED
A sample of a disabled model.
Definition: sb.h:8041
@ SB_TRUTH_TRUE_NEGATIVE
Truth True Negative.
Definition: sb.h:8005
@ SB_TRUTH_FALSE_NEGATIVE
Truth False Negative.
Definition: sb.h:8017
@ SB_TRUTH_TRUE_POSITIVE
Truth True Positive.
Definition: sb.h:7993
@ SB_TRUTH_UNDEFINED
Truth not defined.
Definition: sb.h:7987
@ SB_TRUTH_OPTIONAL_POSITIVE
Truth Optional Positive.
Definition: sb.h:8023
@ SB_TRUTH_OPTIONAL_NEGATIVE
Truth Optional Negative.
Definition: sb.h:8029
@ SB_TRUTH_FALSE_POSITIVE
Truth False Positive.
Definition: sb.h:8011
@ SB_TRUTH_OUT_OF_ROI
Truth Out Of ROI.
Definition: sb.h:8036
sb_t_err sb_solution_set_current_project(const char *const solution_file, const char *const project_uuid)
Set current project in the solution_file.
sb_t_err sb_solution_get_info(const char *const solution_file, sb_t_solution_info **const solution)
Returns the information contained in the solution_file.
sb_t_err sb_solution_remove_project(const char *const solution_file, const char *const project_uuid)
Delete the project with the specified uuid from file.
sb_t_err sb_solution_get_version(const char *const solution_file, sb_t_version *version, char *const version_str, int size_version_str)
Gets the version of the solution file.
sb_t_err sb_solution_destroy_info(sb_t_solution_info **const solution)
Destroys the structure of the solution information.
sb_t_err sb_stat_from_res(sb_t_stat *const stat, const sb_t_res *const res)
Computes the sb_t_stat from sb_t_res.
sb_t_err sb_stat_destroy(sb_t_stat **const stat)
Destroys the sb_t_stat structure.
sb_t_err sb_stat_format(const sb_t_stat *const stat, char *const str, int str_size)
Formats the sb_t_stat structure.
sb_t_err sb_stat_reset(sb_t_stat *const stat, const sb_t_par *const par)
Resets the sb_t_stat structure.
sb_t_err sb_surface_model_to_gl(const sb_t_par *const par, const char *const model_name, unsigned char *const gl, unsigned char *const gl_opt)
Gets the model defects gray level for both required and optional model defects.
#define SB_DEVICES_MAX_NUMBER
Maximum number of computational devices managed by the sb library.
Definition: sb.h:10088
sb_t_svl_command
Enumerates the actions that SVL has to do after a stop.
Definition: sb.h:9403
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:9489
sb_t_perturbation_mode
Enumerates the mode of the perturbations.
Definition: sb.h:9704
#define SB_PAR_FEATURES_NAMES_LEN
Maximum lenght, in byte, of the features names string.
Definition: sb.h:9371
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:9446
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:9501
sb_t_perturbation_type
Enumerates the range of application of the perturbations.
Definition: sb.h:9737
const char * sb_perturbation_type_format(sb_t_perturbation_type type)
Returns the string of the Deep Learning SVL image perturbation type.
sb_t_err sb_svl_reset(SB_HANDLE handle)
Resets the history of previous executions of the SVL.
sb_t_loss_fn_type
Enumerates the loss functions.
Definition: sb.h:9649
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:9514
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:9520
sb_t_err sb_svl_run(SB_HANDLE handle)
Runs the SVL.
const char * sb_svl_command_format(sb_t_svl_command command)
Returns the string of the SVL command.
const char * sb_network_type_format(sb_t_network_type type)
Returns the string of the network type.
sb_t_err sb_svl_get_res(SB_HANDLE handle, sb_t_svl_res **const res)
Retrieves the results of SVL.
sb_t_err sb_svl_clone_res(sb_t_svl_res **const dst, const sb_t_svl_res *const src)
Copies the structure of the results of SVL.
sb_t_svl_stop_reason
Enumerates the reasons why SVL is terminated or why the callback sb_t_svl_par::fp_command has been ca...
Definition: sb.h:12383
const char * sb_svl_par_optimization_mode_format(sb_t_svl_par_optimization_mode mode)
Returns the string of the SVL optimization mode.
@ SB_SVL_COMMAND_CONTINUE_NO_RESET
The SVL continues without reset.
Definition: sb.h:9421
@ SB_SVL_COMMAND_NEXT_STEP
The SVL go to next step.
Definition: sb.h:9425
@ SB_SVL_COMMAND_STOP
The SVL stops and exits, applying the training to the module.
Definition: sb.h:9408
@ SB_SVL_COMMAND_CONTINUE
The SVL continues and, if necessary, resets the training.
Definition: sb.h:9412
@ SB_SVL_COMMAND_ABORT
The SVL stops and exits, without applying the training reached to the module.
Definition: sb.h:9417
@ SB_PERTURBATION_MODE_OFFLINE
Offline perturbation.
Definition: sb.h:9715
@ SB_PERTURBATION_MODE_ONLINE
Online perturbation.
Definition: sb.h:9709
@ SB_PERTURBATION_MODE_BOTH
Both online and offline perturbations.
Definition: sb.h:9720
@ SB_SVL_PAR_OPTIMIZATION_TIME_SLOW
Definition: sb.h:9452
@ SB_SVL_PAR_OPTIMIZATION_USE_SELECTED
Definition: sb.h:9467
@ SB_SVL_PAR_OPTIMIZATION_TIME_MEDIUM
Definition: sb.h:9457
@ SB_SVL_PAR_OPTIMIZATION_TIME_FAST
Definition: sb.h:9462
@ SB_PERTURBATION_TYPE_IMAGE
The whole image is perturbated.
Definition: sb.h:9741
@ SB_PERTURBATION_TYPE_BOTH
Both image and defects perturbation type.
Definition: sb.h:9750
@ SB_PERTURBATION_TYPE_DEFECTS
Only the defect area is perturbated.
Definition: sb.h:9745
@ SB_LOSS_FN_TYPE_BCE
SB Binary Cross Entropy loss.
Definition: sb.h:9677
@ SB_LOSS_FN_TYPE_CCE
Categorical Cross Entropy loss.
Definition: sb.h:9658
@ SB_LOSS_FN_TYPE_FOCAL
Focal loss.
Definition: sb.h:9667
@ SB_NETWORK_TYPE_EFFICIENTNET_B1
Deep Learning EfficientNet b1.
Definition: sb.h:9531
@ SB_NETWORK_TYPE_SDINET0_331x128
Deep Learning Surface Defects Inspection Network 0 with input size 331x128.
Definition: sb.h:9546
@ SB_NETWORK_TYPE_EFFICIENTNET_B2
Deep Learning EfficientNet b2.
Definition: sb.h:9536
@ SB_NETWORK_TYPE_EFFICIENTNET_B0
Deep Learning EfficientNet b0.
Definition: sb.h:9526
@ SB_NETWORK_TYPE_SDINET0_400x160
Deep Learning Surface Defects Inspection Network 0 with input size 400x160.
Definition: sb.h:9551
@ SB_NETWORK_TYPE_SDINET0_331
Deep Learning Surface Defects Inspection Network 0 with input size 331x331.
Definition: sb.h:9541
@ SB_NETWORK_TYPE_ICNET0_128
Deep Learning Image Classification Network 0 with input size 128x128.
Definition: sb.h:9568
@ SB_NETWORK_TYPE_ICNET0_64
Deep Learning Image Classification Network 0 with input size 64x64.
Definition: sb.h:9563
@ SB_SVL_STOP_WARNING
Send a warning message.
Definition: sb.h:12464
@ SB_SVL_STOP_RESET_MANDATORY
Request for a mandatory reset of SVL.
Definition: sb.h:12424
@ SB_SVL_STOP_RESET_OPTIONAL
Ask for an optional reset of SVL.
Definition: sb.h:12444
@ SB_SVL_STOP_USER_REQUEST
The user has stopped the SVL.
Definition: sb.h:12402
@ SB_SVL_STOP_CONFLICT
There are errors which can not be eliminated.
Definition: sb.h:12397
@ SB_SVL_STOP_NONE
SVL finishes without errors.
Definition: sb.h:12387
@ SB_SVL_STOP_MEMORY
Insufficient memory to complete the SVL.
Definition: sb.h:12407
sb_t_err sb_xml_node_remove_itself(SB_HANDLE node)
Removes the current node.
sb_t_err sb_xml_node_count(SB_HANDLE parent, const char *const name, int *const cnt)
Gets the number of child nodes with the specified name.
sb_t_err sb_xml_node_set_attribute(SB_HANDLE node, const char *const attribute_name, const char *const content)
Sets the content of the attribute with the specified name.
SB_HANDLE sb_xml_node_add(SB_HANDLE parent, const char *const name, const char *const content)
Adds the node to the parent node.
SB_HANDLE sb_xml_node_get_child(SB_HANDLE parent)
Gets the first child of the node.
sb_t_err sb_xml_node_get_string_malloc(SB_HANDLE parent, const char *const name, char **const str)
Gets the content of the node with the specified name, allocating the string of the needed lenght.
SB_HANDLE sb_xml_node_next(SB_HANDLE node)
Gets the next sibling node.
sb_t_err sb_xml_node_get_attribute(SB_HANDLE node, const char *const attribute_name, char *const str, size_t str_size)
Gets the content of the attribute with the specified name.
sb_t_err sb_xml_node_get_name(SB_HANDLE node, char *const str, size_t str_size)
Gets the name of the current node.
SB_HANDLE sb_xml_node_previous(SB_HANDLE node)
Gets the previous sibling node.
sb_t_err sb_xml_node_remove(SB_HANDLE parent, const char *const name)
Removes the node with the specified name.
sb_t_err sb_xml_node_set_itself(SB_HANDLE node, const char *const content)
Sets the content of the node.
SB_HANDLE sb_xml_node_get(SB_HANDLE parent, const char *const name)
Gets the handle of the xml node with the specified name.
sb_t_err sb_xml_node_get_string(SB_HANDLE parent, const char *const name, char *const str, size_t str_size)
Gets the content of the node with the specified name.
sb_t_err sb_xml_node_set(SB_HANDLE parent, const char *const name, const char *const content)
Sets the content of the node with the specified name. The function checks if the node exists and othe...
Defines the color in the format BGRA.
Definition: sb.h:6195
unsigned char g
green component of color
Definition: sb.h:6197
unsigned char r
red component of color
Definition: sb.h:6198
unsigned char a
trasparency of color
Definition: sb.h:6203
unsigned char b
blue component of color
Definition: sb.h:6196
Defines the parameters for blob analysis.
Definition: sb.h:8563
int verbosity
Verbosity level.
Definition: sb.h:8608
sb_t_range width
Range of weight, value in pixel.
Definition: sb.h:8576
int blob_contour
Set to 1 if you want the contour of each blob.
Definition: sb.h:8587
sb_t_range area
Range of area, value in pixel.
Definition: sb.h:8574
sb_t_range height
Range of height, value in pixel.
Definition: sb.h:8575
sb_t_blob_distance_mode blob_distance_mode
Selection of the algorithm for calculating the distance between blobs.
Definition: sb.h:8597
int keep_deleted
If different than 0, deleted blobs are kept in the list and marked as deleted.
Definition: sb.h:8607
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:8604
int blob_min_rot_rect
For each blob it enables the calculation of the smaller rotated rectangle containing the blob.
Definition: sb.h:8592
int blob_rle
Set to 1 if you want the rle of each blob.
Definition: sb.h:8582
int merge_distance
Blobs with a distance inferior or equal to the value are merged together.
Definition: sb.h:8603
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:8606
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:8605
sb_t_pixel_connection connection_type
Pixel connection type.
Definition: sb.h:8577
Defines a blob.
Definition: sb.h:8651
sb_t_point2d_f bar
blob baricenter.
Definition: sb.h:8652
float m_xy
Moment of inertia about the x and y axes.
Definition: sb.h:8715
sb_t_truth truth
Truth value of the blob computed by the blob analysis routine, otherwise SB_TRUTH_UNDEFINED.
Definition: sb.h:8670
int contour_size
Number of point of the blob contour, ie the number of elements of the array contour.
Definition: sb.h:8669
sb_t_point * contour
Pointer to the array of the points of the blob contour.
Definition: sb.h:8668
sb_t_rle rle
Pointer to RLE buffer.
Definition: sb.h:8662
float m_yy
Moment of inertia about the y axis.
Definition: sb.h:8708
sb_t_rect rect
Bounding box of the blob.
Definition: sb.h:8656
int od
Value not evaluated.
Definition: sb.h:8654
float angle
Rotation angle of the smaller rotated rectangle.
Definition: sb.h:8690
int area
Area of the blob, number of the pixel.
Definition: sb.h:8653
sb_t_blob_deleted deleted
Blob is marked as deleted.
Definition: sb.h:8678
int lut
Value of the lut.
Definition: sb.h:8655
float m_xx
Moment of inertia about the x axis.
Definition: sb.h:8702
Defines the information about the blob analysis.
Definition: sb.h:8615
long long time_export
blobs esporting time, in us.
Definition: sb.h:8621
int deleted_for_area_min
Number of blobs deleted for an area too small, both during analysis and during merging.
Definition: sb.h:8626
int deleted_for_width_max
Number of blobs deleted for a width too big, both during analysis and during merging.
Definition: sb.h:8627
int deleted_for_area_max
Number of blobs deleted for an area too big, both during analysis and during merging.
Definition: sb.h:8625
long long time_blob
time, in us, of the blobs extraction.
Definition: sb.h:8617
int merged
Number of blobs merged with another blob.
Definition: sb.h:8623
int deleted_for_height_min
Number of blobs deleted for an height too small, both during analysis and during merging.
Definition: sb.h:8630
long long time_rle
time, in us, of the rle extraction.
Definition: sb.h:8616
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:8633
int deleted_for_height_max
Number of blobs deleted for an height too big, both during analysis and during merging.
Definition: sb.h:8629
long long time_sort
blobs sorting time, in us.
Definition: sb.h:8620
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:8631
int deleted_for_width_min
Number of blobs deleted for a width too small, both during analysis and during merging.
Definition: sb.h:8628
long long time_contour
time, in us, of the blobs contour estraction.
Definition: sb.h:8618
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:8632
int deleted
Number of blobs deleted, both during analysis and during merging.
Definition: sb.h:8624
long long time_merge
blobs merging time, in us.
Definition: sb.h:8619
long long time_total
total time, in us.
Definition: sb.h:8622
Defines a blobs list.
Definition: sb.h:8722
sb_t_blob * blob
Array of the blobs.
Definition: sb.h:8724
sb_t_blobs_info info
Information about the blob analysis.
Definition: sb.h:8725
sb_t_blobs_info info_gt
Information about the blob analysis of the ground truth areas.
Definition: sb.h:8726
int size
Number of blobs, ie number of elements of the array sb_t_blobs::blob .
Definition: sb.h:8723
Information about a computing device.
Definition: sb.h:6118
sb_t_memory_info memory
Memory information about the device and its process.
Definition: sb.h:6149
int available
Indicates if the device is available on the PC in use.
Definition: sb.h:6155
int id
Identifier of the device.
Definition: sb.h:6144
sb_t_device_type type
Device type.
Definition: sb.h:6122
List of computing devices available on the machine.
Definition: sb.h:6163
int size
Number of available devices.
Definition: sb.h:6173
sb_t_device_info * device
Array of devices.
Definition: sb.h:6168
Property of computational devices.
Definition: sb.h:10095
sb_t_device_type type
Device type.
Definition: sb.h:10099
Defines the single file.
Definition: sb.h:6577
char * fname
Name of file excluded the path.
Definition: sb.h:6579
defines the list of the file in a folder.
Definition: sb.h:6586
int path_length
Number of characters of the path.
Definition: sb.h:6589
sb_t_file * file
Array of files.
Definition: sb.h:6587
int n
Number of elements of the array file.
Definition: sb.h:6588
Image information details structure.
Definition: sb.h:11939
sb_t_image_info_type type
Type of the image.
Definition: sb.h:11941
sb_t_project_info project_info
Project information data.
Definition: sb.h:11940
Array of the image information details structure.
Definition: sb.h:11948
sb_t_image_info_detail * details
Array of sb_t_image_info_detail.
Definition: sb.h:11949
Defines an image.
Definition: sb.h:7310
int free_rle
Definition: sb.h:7331
int bytes_per_pixel
Number of bytes of each pixel.
Definition: sb.h:7328
int width
Width, in pixel, of the image.
Definition: sb.h:7314
unsigned char * data
Pointer to the data.
Definition: sb.h:7311
unsigned char * free_data
Definition: sb.h:7312
sb_t_image_format format
Format of the image pixel.
Definition: sb.h:7320
int height
Height, in pixel, of the image.
Definition: sb.h:7315
sb_t_rle rle
Image rle data (valid in case the image compression type is SB_IMAGE_COMPRESS_RLE)
Definition: sb.h:7333
int size
Dimension, in bytes, of the vector sb_t_image::data .
Definition: sb.h:7317
int width_step
Number of bytes to move the pointer to one row to the next one.
Definition: sb.h:7316
sb_t_image_compress_type compression
Image compression type.
Definition: sb.h:7330
int free_data_size
Definition: sb.h:7318
General information about sb library and computing devices like CPU and GPUs.
Definition: sb.h:6180
sb_t_devices_info devices
List of available computing devices.
Definition: sb.h:6188
sb_t_version version
Version of the sb library.
Definition: sb.h:6181
signed long long malloc_size
Current allocated memory, expressed in bytes, by sb the library.
Definition: sb.h:6185
int dl_modules_enabled
Value is different from 0 if Deep Learning modules are enabled.
Definition: sb.h:6187
signed long long malloc_size_max
Maximum allocated memory, expressed in bytes, by sb the library.
Definition: sb.h:6186
Defines the configurations of the license.
Definition: sb.h:6849
float speed_boost
Maximum detection speed boost allowed with the current license configuration.
Definition: sb.h:6879
int num_features
Maximum number of features allowed with the current license configuration.
Definition: sb.h:6863
int num_models
Maximum number of models allowed with the current license configuration.
Definition: sb.h:6856
sb_t_license_configuration_id id
License configuration identifier.
Definition: sb.h:6850
int num_threads
Maximum number of threads allowed with the current license configuration.
Definition: sb.h:6872
Defines all the attributes and properties of a license module.
Definition: sb.h:6887
int training
Training status.
Definition: sb.h:6902
signed long long time_start
Start date of the license.
Definition: sb.h:6913
sb_t_license_module_status status
The license status.
Definition: sb.h:6930
signed long long time_end
End date of the license.
Definition: sb.h:6919
sb_t_err err
The license error.
Definition: sb.h:6936
signed long long remain
Number of second before expiration.
Definition: sb.h:6924
sb_t_version version
Version of the module when the license was created.
Definition: sb.h:6907
sb_t_license_configuration configuration
License configuration.
Definition: sb.h:6896
sb_t_license_type type
License type of the module.
Definition: sb.h:6891
Defines the license and its properties.
Definition: sb.h:6951
signed long long time_modify
Last modification date.
Definition: sb.h:6977
signed long long time_save
Last save date.
Definition: sb.h:6982
signed long long time_create
Creation date.
Definition: sb.h:6972
Struct that defines the coordinates of a point of a lut.
Definition: sb.h:7142
unsigned short y
ordinate of the point.
Definition: sb.h:7144
unsigned short x
abscissa of the point.
Definition: sb.h:7143
Memory information.
Definition: sb.h:6092
signed long long system_free
system free physical memory, in bytes
Definition: sb.h:6100
signed long long proc_virtual_used
virtual memory used by process, in bytes
Definition: sb.h:6093
signed long long proc_physical_used
physical memory used by the process, in bytes
Definition: sb.h:6096
signed long long system_total
system physical memory, in bytes
Definition: sb.h:6098
signed long long system_used
system used physical memory, in bytes
Definition: sb.h:6099
signed long long proc_virtual_used_max
maximum virtual memory used by the process, in bytes
Definition: sb.h:6094
signed long long proc_virtual_max
maximum virtual memory usable by the process, in bytes
Definition: sb.h:6095
signed long long proc_physical_used_max
maximum physical memory used by the process, in bytes
Definition: sb.h:6097
Results of OCR analysis.
Definition: sb.h:10949
int lines
Number of the lines identified.
Definition: sb.h:10956
char * string
ocr result in string format
Definition: sb.h:10954
int words
Number of the words identified.
Definition: sb.h:10955
Information on what sb_project_set_par and sb_image_info_apply_par_changes do when they apply the new...
Definition: sb.h:11686
char * models
String of the name of the models to be invalidated.
Definition: sb.h:11691
sb_t_par par_cur
The current parameters of the project.
Definition: sb.h:11703
sb_t_par par_new
The new parameters that the user wants to set in the project.
Definition: sb.h:11704
Level parameters.
Definition: sb.h:10312
float scale
Scale factor.
Definition: sb.h:10324
int enabled
Enabling flag of the level.
Definition: sb.h:10319
Levels parameter array.
Definition: sb.h:10333
int size
Number of levels that is number of elements of the array level.
Definition: sb.h:10343
Information about mapping between old and new models and levels in the sb_t_par structure.
Definition: sb.h:11674
int index
Index of the corresponding model, -1 if not present.
Definition: sb.h:11675
Parameters of a model.
Definition: sb.h:10351
sb_t_par_perturbations perturbations
Perturbations of the samples.
Definition: sb.h:10460
sb_t_size obj_size
Model size.
Definition: sb.h:10426
int num_occurrences
Number of occurrences of the model that the function sb_project_get_res should export.
Definition: sb.h:10554
sb_t_size obj_stride_coarse
Coarse search step.
Definition: sb.h:10518
float defect_area_threshold
Threshold weight value for the bad area of the sample.
Definition: sb.h:10576
sb_t_rgba color_opt
Color of the optional defects.
Definition: sb.h:10476
sb_t_rgba color
Color of the defects.
Definition: sb.h:10468
float defect_area_percentage
Threshold percentage bad area of the sample to discard it as an occurrency.
Definition: sb.h:10566
sb_t_size obj_stride_fine
Fine search step.
Definition: sb.h:10532
int enabled
Enabling status of the model.
Definition: sb.h:10442
sb_t_par_levels levels
Array of levels parameters for this model.
Definition: sb.h:10454
sb_t_size obj_min_distance
Minimum distance between two samples.
Definition: sb.h:10503
Array of models parameters.
Definition: sb.h:10583
int size
Number of models that is number of elements of the array model.
Definition: sb.h:10594
Describes the perturbation of a sample.
Definition: sb.h:10248
sb_t_range angle_range
Angular range, in degrees, for random rotation.
Definition: sb.h:10277
int flip_vertical
Flip around x-axis. 3th operation.
Definition: sb.h:10269
int angle
Rotation angle, in degrees, of the sample. 1th operation.
Definition: sb.h:10253
int flip_horizontal
Flip around y-axis. 2th operation.
Definition: sb.h:10261
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:10284
List of the perturbations of a sample.
Definition: sb.h:10294
int size
Number of used elements of the array perturbation.
Definition: sb.h:10303
Shallow Learning modules parameters.
Definition: sb.h:10601
float speed_boost
Detection speed boost.
Definition: sb.h:10625
int detection_out_of_roi
Allow the detection of occurrencies at the extremities or partially outside the analysis roi.
Definition: sb.h:10639
Project parameters.
Definition: sb.h:10647
int surface_blob_analysis
Enables the blob analysis.
Definition: sb.h:10751
sb_t_devices_par devices
Devices used for detection.
Definition: sb.h:10714
sb_t_par_sl sl
Shallow Learning modules parameters.
Definition: sb.h:10757
sb_t_par_models models
Models parameters.
Definition: sb.h:10654
int num_threads
Maximum number of OpenMP threads that detection can use.
Definition: sb.h:10701
sb_t_floating_point_op_type floating_point_precision
Floating Point precision used to run operations.
Definition: sb.h:10732
sb_t_svl_par svl
SVL parameters.
Definition: sb.h:10763
sb_t_project_type project_type
Project type.
Definition: sb.h:10648
sb_t_interpolation_mode resize_mode
Interpolation mode used to resize the images.
Definition: sb.h:10721
sb_t_rgba color_opt
Color of the optional defects for all models.
Definition: sb.h:10740
sb_t_blob_par blob_par
Surface blob analysis parameters.
Definition: sb.h:10707
Represents an ordered pair of float x and y coordinates that defines a point in a two-dimensional pla...
Definition: sb.h:5774
Represents an ordered pair of integer x and y coordinates that defines a point in a two-dimensional p...
Definition: sb.h:5765
int x
abscissa of the point
Definition: sb.h:5766
int y
ordinate of the point
Definition: sb.h:5767
Project info structure.
Definition: sb.h:8899
sb_t_project_type type
Project type.
Definition: sb.h:8900
Array of the projects info.
Definition: sb.h:8910
sb_t_project_info * info
Array of solution project information.
Definition: sb.h:8911
int size
Number of projects.
Definition: sb.h:8912
Represents an ordered pair of float minimum and maximum values that defines a range.
Definition: sb.h:5810
float max
maximum value
Definition: sb.h:5812
float min
minimum value
Definition: sb.h:5811
Represents an ordered pair of 32 bits signed integer minimum and maximum values that defines a range.
Definition: sb.h:5801
int max
maximum value
Definition: sb.h:5803
int min
minimum value
Definition: sb.h:5802
Defines the position and size of a rectangle in a two-dimensional plane.
Definition: sb.h:5819
int y
y coordinate of the upper left corner of the rectangle
Definition: sb.h:5821
int x
x coordinate of the upper left corner of the rectangle
Definition: sb.h:5820
int width
width of the rectangle
Definition: sb.h:5822
int height
height of the rectangle
Definition: sb.h:5823
Defines the results of a model.
Definition: sb.h:11058
sb_t_surface_res * surface
Surface model analysis result.
Definition: sb.h:11135
int out_of_roi
Count of Out Of ROI.
Definition: sb.h:11120
int disabled
Count of samples with model disabled.
Definition: sb.h:11128
int tp
Count of True Positive.
Definition: sb.h:11066
int on
Count of Optional Negative.
Definition: sb.h:11111
int fp
Count of False Positive.
Definition: sb.h:11084
int tn
Count of True Negative.
Definition: sb.h:11075
int op
Count of Optional Positive.
Definition: sb.h:11102
int fn
Count of False Negative.
Definition: sb.h:11093
Defines the results of the models.
Definition: sb.h:11143
int size
Number of element of the array sb_t_res_models::model.
Definition: sb.h:11145
sb_t_res_model * model
Array of the models result.
Definition: sb.h:11144
Results of detection.
Definition: sb.h:11276
int is_valid
It is 1 when the fields of the structure are valid, otherwise it is 0.
Definition: sb.h:11283
sb_t_tiles_info * tiles
Information about the tiles used to process the image.
Definition: sb.h:11342
sb_t_samples samples
Samples found in the image.
Definition: sb.h:11296
long long time_us
Elaboration time of the image, in us.
Definition: sb.h:11329
sb_t_err err
Error of last image processing with sb_project_detection function .
Definition: sb.h:11349
sb_t_par par
Project parameters.
Definition: sb.h:11289
sb_t_ocr_res ocr
Result of OCR analysis.
Definition: sb.h:11302
sb_t_devices_par devices
The devices used to compute the current results.
Definition: sb.h:11334
sb_t_res_model global
Global results.
Definition: sb.h:11310
int img_width_circular
Original width of the image, before the extension in the x-axis.
Definition: sb.h:11323
sb_t_res_models models
Models results.
Definition: sb.h:11316
Defines the color in the format RGBA.
Definition: sb.h:6228
unsigned char r
red component of color
Definition: sb.h:6229
unsigned char g
green component of color
Definition: sb.h:6230
unsigned char b
blue component of color
Definition: sb.h:6231
unsigned char a
trasparency of color
Definition: sb.h:6236
Define a RLE segment.
Definition: sb.h:7289
int offset
Offset of the segment from the beginning of the uncompressed buffer, in bytes.
Definition: sb.h:7294
int x
x-coordinate of the beginning of the segment
Definition: sb.h:7291
int length
Length of the segment.
Definition: sb.h:7293
unsigned int value
Value of the segment.
Definition: sb.h:7290
int y
y-coordinate of the beginning of the segment
Definition: sb.h:7292
Defines a RLE.
Definition: sb.h:7301
sb_t_rle_seg * seg
Pointer to RLE buffer.
Definition: sb.h:7302
int size
Number of elements of seg array.
Definition: sb.h:7303
Defines a roi.
Definition: sb.h:7730
sb_t_rect bounding_box
Bounding box of the roi (Not used for defects roi)
Definition: sb.h:7731
sb_t_rgba color
Color RGBA of the roi (Not used for defects roi)
Definition: sb.h:7732
sb_t_image * img
8bit BW image.
Definition: sb.h:7734
Image of weights of the sample.
Definition: sb.h:8102
float max
maximum weight corresponding, in the image, the to value 255.
Definition: sb.h:8104
sb_t_image * img
Image of the weights of the sample, format is SB_IMAGE_FORMAT_BW8.
Definition: sb.h:8103
float min
minimum weight corresponding, in the image, the to value 1.
Definition: sb.h:8105
Sample of an image.
Definition: sb.h:8118
float IoU
Definition: sb.h:8327
sb_t_point centre_warp
Coordinates of the centre in the warped image.
Definition: sb.h:8148
sb_t_point centre
Coordinates of the centre of the sample.
Definition: sb.h:8126
void * user_data
Pointer to the user data.
Definition: sb.h:8280
float defect_area_percentage
Definition: sb.h:8332
sb_t_truth truth
Truth of the sample.
Definition: sb.h:8245
int user_data_size
Size, in bytes, of sb_t_sample::user_data buffer.
Definition: sb.h:8284
float scale
Scale factor.
Definition: sb.h:8204
int is_near
FALSE NEGATIVE with some other sample close to it.
Definition: sb.h:8294
sb_t_sample_weights_image weights_image
Image of the weights of the sample.
Definition: sb.h:8238
sb_t_sample_classify_mode classify_mode
Classification mode.
Definition: sb.h:8273
sb_t_obj_type type
Sample type.
Definition: sb.h:8209
float weight
Weight of classification.
Definition: sb.h:8223
Samples of an image.
Definition: sb.h:8377
int size
Number of samples that is number of elements of the array sb_t_samples::sample .
Definition: sb.h:8379
sb_t_sample * sample
Pointer to the array of sample. The number of element is sb_t_samples::size .
Definition: sb.h:8378
Represents an ordered pair of float x and y length that defines a rectangle in a two-dimensional plan...
Definition: sb.h:5792
float height
height
Definition: sb.h:5794
float width
width
Definition: sb.h:5793
Represents an ordered pair of integer x and y length that defines a rectangle in a two-dimensional pl...
Definition: sb.h:5783
int height
height
Definition: sb.h:5785
int width
width
Definition: sb.h:5784
Solution info structure.
Definition: sb.h:8931
sb_t_version version
Version of the solution.
Definition: sb.h:8934
sb_t_projects_info projects
Array of the projects info.
Definition: sb.h:8932
int current_project
Index of the current project in the projects array.
Definition: sb.h:8933
Statistics of a model.
Definition: sb.h:11398
sb_t_range_flt fp_weight
Range of classification weight of the False Positive samples.
Definition: sb.h:11477
int fn
Count of False Negative.
Definition: sb.h:11438
int on
Count of Optional Negative.
Definition: sb.h:11457
float recall
recall
Definition: sb.h:11493
int tp
Count of True Positive.
Definition: sb.h:11407
float specificity
specificity
Definition: sb.h:11505
sb_t_range_flt op_weight
Range of classification weight of the Optional Positive samples.
Definition: sb.h:11479
sb_t_range_flt or_weight
Range of classification weight of the out of the ROI samples.
Definition: sb.h:11481
float score
Level score.
Definition: sb.h:11513
int op
Count of Optional Positive.
Definition: sb.h:11448
int mod_disabled
Count of samples with model disabled.
Definition: sb.h:11474
int fp
Count of False Positive.
Definition: sb.h:11428
sb_t_range_flt tp_weight
Range of classification weight of the True Positive samples.
Definition: sb.h:11475
sb_t_range_flt fn_weight
Range of classification weight of the False Negative samples.
Definition: sb.h:11478
sb_t_range_flt on_weight
Range of classification weight of the Optional Negative samples.
Definition: sb.h:11480
float accuracy
accuracy
Definition: sb.h:11499
sb_t_range_flt tn_weight
Range of classification weight of the True Negative samples.
Definition: sb.h:11476
int out_of_roi
Count of Out Of ROI.
Definition: sb.h:11466
float precision
precision
Definition: sb.h:11487
int tn
Count of True Negative.
Definition: sb.h:11418
Statistics of a model.
Definition: sb.h:11521
int size
Number of models that is number of elements of the array model.
Definition: sb.h:11531
Statistics of the elaborations done with the function sb_project_detection .
Definition: sb.h:11544
long long time_res_us
Total sb_project_get_res time in microsecond. This time is included in the time_us.
Definition: sb.h:11615
float specificity
Specificity.
Definition: sb.h:11609
int good
Counter of "Good" images.
Definition: sb.h:11567
long long time_us
Total analysis time in microsecond.
Definition: sb.h:11611
long long time_blob_us
Total blob analysis time in microsecond. This time is included in the time_us.
Definition: sb.h:11613
float accuracy
Accuracy.
Definition: sb.h:11602
float recall
Recall.
Definition: sb.h:11595
int no_good
Counter of "No Good" images.
Definition: sb.h:11559
long long time_us_average
Average analyis time in microsecond.
Definition: sb.h:11612
int elaborated
Count of the elaborated images.
Definition: sb.h:11617
sb_t_stat_model global
Global statistics.
Definition: sb.h:11552
int overkill
Counter of "Overkill" images.
Definition: sb.h:11574
sb_t_stat_models models
Array of the statistics of the models.
Definition: sb.h:11551
long long time_res_us_average
Average sb_project_get_res time in microsecond.
Definition: sb.h:11616
int escape
Counter of "Escape" images.
Definition: sb.h:11581
sb_t_par par
Project parameters.
Definition: sb.h:11550
float precision
Precision.
Definition: sb.h:11588
long long time_blob_us_average
Average blob analyis time in microsecond.
Definition: sb.h:11614
Defines the result of the Surface analysis.
Definition: sb.h:10967
sb_t_point ul
Coordinates of the upper left corner.
Definition: sb.h:10968
sb_t_image * model
Model plane image.
Definition: sb.h:10977
sb_t_blobs * blobs
Defects blobs extracted.
Definition: sb.h:11020
sb_t_image * truth
Truth plane image.
Definition: sb.h:10991
sb_t_image * weight
Image of the voting plan.
Definition: sb.h:11010
sb_t_surface_image_truth image_truth
Truth of the image.
Definition: sb.h:11026
Deep Learning modules parameters.
Definition: sb.h:9588
float features_multiplier
Features multiplier factor of the network.
Definition: sb.h:9642
sb_t_image_format image_format
Network input image format.
Definition: sb.h:9625
int n_channels
Network input channels.
Definition: sb.h:9633
sb_t_size input_size
Network input size.
Definition: sb.h:9616
sb_t_network_type type
Network type.
Definition: sb.h:9608
Describes the perturbation of the image / defect.
Definition: sb.h:9767
sb_t_range angle_range
Angular range, in degrees, for random rotation.
Definition: sb.h:9829
float shift_horizontal
Maximum shift along x-axis.
Definition: sb.h:9813
sb_t_perturbation_type type
Select the perturbation type.
Definition: sb.h:9787
int flip_horizontal
Flip around y-axis.
Definition: sb.h:9796
float stretch_contrast
Maximum variation for histogram stretching.
Definition: sb.h:9846
float shift_vertical
Maximum shift along y-axis.
Definition: sb.h:9821
sb_t_perturbation_mode mode
Select the perturbation mode.
Definition: sb.h:9780
int flip_vertical
Flip around x-axis.
Definition: sb.h:9805
float delta_scale
Maximum variation for defects scaling.
Definition: sb.h:9853
float delta_brightness
Maximum delta of brightness.
Definition: sb.h:9838
SVL parameters to configure the Deep Learning training.
Definition: sb.h:9866
int batch_size
Size of the batch used during SVL.
Definition: sb.h:9922
int save_best
At the end of the training, the best internal parameters configuration is recovered.
Definition: sb.h:9949
sb_t_size tile_factor
Number of horizontal and vertical tiles used to process the image.
Definition: sb.h:9973
float learning_rate
Learning rate.
Definition: sb.h:9906
sb_t_size_flt scale
Scale to applied to the image before the processing.
Definition: sb.h:10012
int pre_trained
The network is loaded as pre-trained, i.e. network parameters are not randomly initialized before tra...
Definition: sb.h:9889
int auto_tiling
Enable the automatic tiling for image processing.
Definition: sb.h:9998
sb_t_svl_dl_par_network network
Network parameters.
Definition: sb.h:9880
int num_epochs
Number of epochs.
Definition: sb.h:9912
sb_t_loss_fn_type loss_fn
Loss function.
Definition: sb.h:10021
sb_t_svl_dl_par_perturbation perturbations
Perturbations for deep learning training.
Definition: sb.h:9895
float validation_percentage
Validation percentage.
Definition: sb.h:9941
Contains information regarding the error of the SVL.
Definition: sb.h:12474
sb_t_err err
Error code sb_t_err.
Definition: sb.h:12475
float dist
Distance, in pixel, between the samples.
Definition: sb.h:12482
float min_dist
Minimum allowed distance between samples.
Definition: sb.h:12483
int num_samples
Number of samples.
Definition: sb.h:12478
SVL parameters.
Definition: sb.h:10117
sb_fp_svl_progress fp_progress
The SVL calls this callback to notify the user the results of SVL.
Definition: sb.h:10128
int num_threads
Maximum number of OpenMP threads that SVL can use.
Definition: sb.h:10169
sb_t_svl_sl_par sl
Shallow Learning SVL parameters.
Definition: sb.h:10198
sb_fp_svl_pre_elaboration fp_pre_elaboration
Callback to execute an image pre elaboration.
Definition: sb.h:10122
float free_memory_percentage
Percentage of system memory that the svl tries to leave free.
Definition: sb.h:10160
sb_t_devices_par devices
Devices used for SVL/training.
Definition: sb.h:10192
sb_t_image_circularity_type image_circularity_type
Image circularity.
Definition: sb.h:10233
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:10134
void * user_data
Pointer to data which is passed to the callbacks.
Definition: sb.h:10140
sb_t_svl_dl_par dl
Deep Learning SVL parameters.
Definition: sb.h:10204
int reproducibility
Enable the reproducibility of the training.
Definition: sb.h:10185
Contains the results of the image pre-processing.
Definition: sb.h:9380
sb_t_image * image
Pre processed image, that is the warped image.
Definition: sb.h:9388
SB_HANDLE warped2ori
lut of the samples coordinates from warped image to the original one.
Definition: sb.h:9391
sb_t_roi * roi
Image elaboration ROI.
Definition: sb.h:9389
sb_t_roi * roi_defects
Image defects ROI.
Definition: sb.h:9390
Results of a training epoch.
Definition: sb.h:12623
float validation_accuracy
SVL validation accuracy metric.
Definition: sb.h:12666
float loss
SVL loss.
Definition: sb.h:12631
float validation_loss
SVL validation loss.
Definition: sb.h:12640
float accuracy
SVL accuracy metric.
Definition: sb.h:12657
Results of the training epochs.
Definition: sb.h:12673
sb_t_svl_res_epoch * epoch
Array of the results of the training epochs.
Definition: sb.h:12674
int size
Number of the elements of the array epoch .
Definition: sb.h:12677
Defines the results of the elaboration of the SVL of an image.
Definition: sb.h:12604
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:12606
Defines the results of the elaboration of the SVL images.
Definition: sb.h:12613
int size
Number of images that is number of elements of the array sb_t_svl_res_images::image .
Definition: sb.h:12615
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:12614
Results of the SVL of a level per model.
Definition: sb.h:12696
int num_img_l
Number of images of the training dataset used for learning.
Definition: sb.h:12775
int num_samples_l
Number of samples of the training dataset used for learning.
Definition: sb.h:12766
int out_of_roi
Number of Out Of ROI samples, both optional and required.
Definition: sb.h:12751
int reset
1 if the SVL of the model has been resetted or when the user reset the SVL, 0 otherwise.
Definition: sb.h:12761
int mod_disabled
Number of samples with disabled model, both optional and required.
Definition: sb.h:12756
int op
Number of OPTIONAL POSITIVE samples.
Definition: sb.h:12741
sb_t_svl_par_optimization_mode optimization_mode
Optimization mode.
Definition: sb.h:12780
float accuracy
Accuracy.
Definition: sb.h:12711
sb_t_svl_res_epochs epochs
Results of training of module based on Deep Learning.
Definition: sb.h:12806
float goodness
Goodness of the training.
Definition: sb.h:12701
int fn
Number of FALSE NEGATIVE samples.
Definition: sb.h:12736
int tn
Number of TRUE NEGATIVE samples.
Definition: sb.h:12731
int num_samples_t
Number of samples of the training dataset not used for learning.
Definition: sb.h:12771
int tp
Number of TRUE POSITIVE samples.
Definition: sb.h:12721
int on
Number of OPTIONAL NEGATIVE samples.
Definition: sb.h:12746
int fp
Number of FALSE POSITIVE samples.
Definition: sb.h:12726
char * warning
Warning in string format occurred during the training.
Definition: sb.h:12801
float score
Level score.
Definition: sb.h:12716
Results of the SVL of a levels processed.
Definition: sb.h:12814
int size
Number of the elements of the array level.
Definition: sb.h:12816
Results of the SVL of a specific model.
Definition: sb.h:12823
sb_t_svl_res_levels levels
Specific results for each level.
Definition: sb.h:12829
sb_t_svl_res_level global
Cumulative results of all levels.
Definition: sb.h:12833
Results of the SVL of a models processed.
Definition: sb.h:12840
int size
Number of the elements of the array model.
Definition: sb.h:12849
Defines the results of SVL.
Definition: sb.h:12877
sb_t_svl_res_models models
Results for each model.
Definition: sb.h:12916
sb_t_samples * list_op
List of Optional Positive samples.
Definition: sb.h:12945
int num_img_test
Number of test images of the project.
Definition: sb.h:12969
sb_t_samples * list_out_of_roi
List of samples out of the ROI.
Definition: sb.h:12955
sb_t_samples * list_on
List of Optional Negative samples.
Definition: sb.h:12950
sb_t_svl_res_images * list_img_elab
Results for each images.
Definition: sb.h:12961
sb_t_svl_err err
Error details.
Definition: sb.h:12912
sb_t_svl_res_level global
Cumulative results of all levels of all models.
Definition: sb.h:12920
sb_t_svl_command last_command
Command executed by SVL after a stop that is detailed with the parameter stop_reason.
Definition: sb.h:12880
sb_t_samples * list_tn
List of True Negative samples.
Definition: sb.h:12930
long long time_ms_last_improvement
Time, in ms, when there was the last improvement.
Definition: sb.h:12979
long long time_ms
Execution time, in ms, of SVL.
Definition: sb.h:12973
sb_t_par par
Project parameters.
Definition: sb.h:12878
int num_img_svl
Number of svl images of the project.
Definition: sb.h:12965
int reset_done
The SVL reset has been done or no training has been done yet.
Definition: sb.h:12988
sb_t_samples * list_tp
List of True Positive samples.
Definition: sb.h:12925
sb_t_svl_stop_reason stop_reason
It describes the reason why the SVL is finished.
Definition: sb.h:12879
long long time_left_ms
Estimated time, in ms, left to the end of the SVL.
Definition: sb.h:12984
sb_t_devices_par devices
The devices used to compute the current SVL results.
Definition: sb.h:12992
sb_t_samples * list_fn
List of False Negative samples.
Definition: sb.h:12940
char running_step[256]
Description of the current step of the training.
Definition: sb.h:12907
sb_t_samples * list_fp
List of False Positive samples.
Definition: sb.h:12935
SVL parameters that configure the Shallow Learning training.
Definition: sb.h:10029
int auto_levels
Enable the automatic Surface levels training.
Definition: sb.h:10081
sb_t_svl_par_optimization_mode optimization_mode
Optimization mode.
Definition: sb.h:10068
float goodness_target
Goodness target of the training.
Definition: sb.h:10046
Defines a tile.
Definition: sb.h:11181
sb_t_rect rect
Rectangle of the tile on the elaborated image.
Definition: sb.h:11182
sb_t_tile_type type
Tile type.
Definition: sb.h:11183
Information about the tiles used to process the image.
Definition: sb.h:11199
sb_t_tiles tiles
Tiles list.
Definition: sb.h:11202
sb_t_size_flt scale
Scale factor.
Definition: sb.h:11201
sb_t_size factor
Number of horizontal and vertical tiles used to process the image.
Definition: sb.h:11200
Tiles list.
Definition: sb.h:11190
sb_t_tile * tile
Tiles array.
Definition: sb.h:11191
int size
Number of elements of the array sb_t_tiles::tile.
Definition: sb.h:11192
Defines the version.
Definition: sb.h:6049
int vminor
vminor number, changes on internal improvement which doesn't modify the interface
Definition: sb.h:6052
int build_major
build_major number, changes every time the library is built
Definition: sb.h:6053
int minor
minor number, changes when the interface is no longer compatible
Definition: sb.h:6051
int major
major number, changes when there are new features
Definition: sb.h:6050