SqueezeBrains SDK 1.13
sb.h File Reference

SqueezeBrains libraries header file. More...

#include <time.h>
#include <stdio.h>
Include dependency graph for sb.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sb_t_point
 Represents an ordered pair of integer x and y coordinates that defines a point in a two-dimensional plane. More...
 
struct  sb_t_point2d_f
 Represents an ordered pair of float x and y coordinates that defines a point in a two-dimensional plane. More...
 
struct  sb_t_size
 Represents an ordered pair of integer x and y length that defines a rectangle in a two-dimensional plane. More...
 
struct  sb_t_size_flt
 Represents an ordered pair of float x and y length that defines a rectangle in a two-dimensional plane. More...
 
struct  sb_t_range
 Represents an ordered pair of 32 bits signed integer minimum and maximum values that defines a range. More...
 
struct  sb_t_range_flt
 Represents an ordered pair of float minimum and maximum values that defines a range. More...
 
struct  sb_t_rect
 Defines the position and size of a rectangle in a two-dimensional plane. More...
 
struct  sb_t_version
 Defines the version. More...
 
struct  sb_t_memory_info
 Memory information. More...
 
struct  sb_t_device_info
 Information about a computing device. More...
 
struct  sb_t_devices_info
 List of computing devices available on the machine. More...
 
struct  sb_t_info
 General information about sb library and computing devices like CPU and GPUs. More...
 
struct  sb_t_bgra
 Defines the color in the format BGRA. More...
 
struct  sb_t_rgba
 Defines the color in the format RGBA. More...
 
struct  sb_t_file
 Defines the single file. More...
 
struct  sb_t_folder
 defines the list of the file in a folder. More...
 
struct  sb_t_license_configuration
 Defines the configurations of the license. More...
 
struct  sb_t_license_module
 Defines all the attributes and properties of a license module. More...
 
struct  sb_t_license
 Defines the license and its properties. More...
 
struct  sb_t_lut_point
 Struct that defines the coordinates of a point of a lut. More...
 
struct  sb_t_rle_seg
 Define a RLE segment. More...
 
struct  sb_t_rle
 Defines a RLE. More...
 
struct  sb_t_image
 Defines an image. More...
 
struct  sb_t_roi
 Defines a roi. More...
 
struct  sb_t_sample_weights_image
 Image of weights of the sample. More...
 
struct  sb_t_sample
 Sample of an image. More...
 
struct  sb_t_samples
 Samples of an image. More...
 
struct  sb_t_blob_par
 Defines the parameters for blob analysis. More...
 
struct  sb_t_blobs_info
 Defines the information about the blob analysis. More...
 
struct  sb_t_blob
 Defines a blob. More...
 
struct  sb_t_blobs
 Defines a blobs list. More...
 
struct  sb_t_project_info
 Project info structure. More...
 
struct  sb_t_projects_info
 Array of the projects info. More...
 
struct  sb_t_solution_info
 Solution info structure. More...
 
struct  sb_t_svl_pre_elaboration
 Contains the results of the image pre-processing. More...
 
struct  sb_t_svl_dl_par_network
 Deep Learning modules parameters. More...
 
struct  sb_t_svl_dl_par_perturbation
 Describes the perturbation of the image / defect. More...
 
struct  sb_t_svl_dl_par
 SVL parameters to configure the Deep Learning training. More...
 
struct  sb_t_svl_sl_par
 SVL parameters that configure the Shallow Learning training. More...
 
struct  sb_t_devices_par
 Property of computational devices. More...
 
struct  sb_t_svl_par
 SVL parameters. More...
 
struct  sb_t_par_perturbation
 Describes the perturbation of a sample. More...
 
struct  sb_t_par_perturbations
 List of the perturbations of a sample. More...
 
struct  sb_t_par_level
 Level parameters. More...
 
struct  sb_t_par_levels
 Levels parameter array. More...
 
struct  sb_t_par_model
 Parameters of a model. More...
 
struct  sb_t_par_models
 Array of models parameters. More...
 
struct  sb_t_par_sl
 Shallow Learning modules parameters. More...
 
struct  sb_t_par
 Project parameters. More...
 
struct  sb_t_ocr_res
 Results of OCR analysis. More...
 
struct  sb_t_surface_res
 Defines the result of the Surface analysis. More...
 
struct  sb_t_res_model
 Defines the results of a model. More...
 
struct  sb_t_res_models
 Defines the results of the models. More...
 
struct  sb_t_tile
 Defines a tile. More...
 
struct  sb_t_tiles
 Tiles list. More...
 
struct  sb_t_tiles_info
 Information about the tiles used to process the image. More...
 
struct  sb_t_res
 Results of detection. More...
 
struct  sb_t_stat_model
 Statistics of a model. More...
 
struct  sb_t_stat_models
 Statistics of a model. More...
 
struct  sb_t_stat
 Statistics of the elaborations done with the function sb_project_detection . More...
 
struct  sb_t_par_model_lut
 Information about mapping between old and new models and levels in the sb_t_par structure. More...
 
struct  sb_t_par_changes_info
 Information on what sb_project_set_par and sb_image_info_apply_par_changes do when they apply the new parameters. More...
 
struct  sb_t_image_info_detail
 Image information details structure. More...
 
struct  sb_t_image_info_details
 Array of the image information details structure. More...
 
struct  sb_t_svl_err
 Contains information regarding the error of the SVL. More...
 
struct  sb_t_svl_res_image
 Defines the results of the elaboration of the SVL of an image. More...
 
struct  sb_t_svl_res_images
 Defines the results of the elaboration of the SVL images. More...
 
struct  sb_t_svl_res_epoch
 Results of a training epoch. More...
 
struct  sb_t_svl_res_epochs
 Results of the training epochs. More...
 
struct  sb_t_svl_res_level
 Results of the SVL of a level per model. More...
 
struct  sb_t_svl_res_levels
 Results of the SVL of a levels processed. More...
 
struct  sb_t_svl_res_model
 Results of the SVL of a specific model. More...
 
struct  sb_t_svl_res_models
 Results of the SVL of a models processed. More...
 
struct  sb_t_svl_res
 Defines the results of SVL. More...
 

Macros

#define SB_INIT_ONLY_HW_LICENSE_KEY   "ONLY_HW_KEY"
 Use this define with sb_init in order to manage only hardware license keys. More...
 
#define SB_INIT_ONLY_SB_LICENSE_KEY   "ONLY_SB_KEY"
 Use this define with sb_init in order to manage only SqueezeBrains software license keys. More...
 
#define SB_INIT_NO_LICENSE_KEY   "NO_KEY"
 Use this define with sb_init in order to not manage license keys. More...
 
#define SB_DELIMITER   ";"
 Use this define as delimiter. More...
 
#define SB_VALUE_NOT_SET   1000000.0f
 Value of the prediction in case it is undefined. More...
 
#define SB_PAR_MODELS_NUM   64
 Maximum number of models.
 
#define SB_PAR_PERTURBATIONS_NUM   16
 Maximum number of perturbation of a sample.
 
#define SB_PAR_STRING_LEN   64
 Maximum length, in byte, of a parameter string.
 
#define SB_IMAGE_NAME_STRING_LEN   128
 Maximum length, in byte, of the image name string.
 
#define SB_PAR_LEVELS_NUM   32
 Maximum scales levels number to be used for Surface.
 
#define SB_PAR_LEVEL_SCALE_GRANULARITY   0.50f
 Scale granularity for multi-scale defects detection.
 
#define SB_PAR_LEVEL_SCALE_MIN   1.0f
 Minimum scale factor of surface.
 
#define SB_PAR_LEVEL_SCALE_MAX   16.0f
 Maximum scale factor of surface.
 
#define SB_PAR_RETINA_OBJ_SIZE_MIN   24
 Minimum value of sb_t_par_model::obj_size.
 
#define SB_PAR_RETINA_OBJ_SIZE_MAX   1024
 Maximum value of sb_t_par_model::obj_size.
 
#define SB_PAR_RETINA_OBJ_STRIDE_COARSE_MIN   4
 Minimum value of sb_t_par_model::obj_stride_coarse.
 
#define SB_PAR_RETINA_OBJ_STRIDE_COARSE_MAX   32
 Maximum value of sb_t_par_model::obj_stride_coarse.
 
#define SB_PAR_RETINA_OBJ_STRIDE_FINE_MIN   1
 Minimum value of sb_t_par_model::obj_stride_fine.
 
#define SB_PAR_RETINA_OBJ_STRIDE_FINE_MAX   8
 Maximum value of sb_t_par_model::obj_stride_fine.
 
#define SB_PAR_RETINA_OBJ_DISTANCE_MIN   4
 Minimum value of sb_t_par_model::obj_min_distance.
 
#define SB_PAR_RETINA_NUM_OCCURRENCES_MIN   -1
 Minimum value of sb_t_par_model::num_occurrences.
 
#define SB_SAMPLE_SCALE_GRANULARITY   0.25f
 Scale granularity for multi-scale objects detection.
 
#define SB_SAMPLE_SCALE_MIN   1.0f
 Minimum scale factor of samples.
 
#define SB_SAMPLE_SCALE_MAX   32.0f
 Maximum scale factor of samples.
 
#define SB_SVL_DL_BATCH_SIZE_MIN   4
 Minimum value of sb_t_svl_dl_par::batch_size parameter.
 
#define SB_SVL_DL_BATCH_SIZE_MAX   512
 Maximum value of sb_t_svl_dl_par::batch_size parameter.
 
#define SB_SVL_DL_VALIDATION_PERCENTAGE_MIN   0.0f
 Minimum value of sb_t_svl_dl_par::validation_percentage parameter.
 
#define SB_SVL_DL_VALIDATION_PERCENTAGE_MAX   0.5f
 Maximum value of sb_t_svl_dl_par::validation_percentage parameter.
 
#define SB_SVL_DL_LEARNING_RATE_MIN   0.000001f
 Minimum value of sb_t_svl_dl_par::learning_rate parameter.
 
#define SB_SVL_DL_LEARNING_RATE_MAX   0.01f
 Maximum value of sb_t_svl_dl_par::learning_rate parameter.
 
#define SB_SVL_DL_LEARNING_RATE_DEFAULT   0.001f
 Default value of sb_t_svl_dl_par::learning_rate parameter.
 
#define SB_SVL_DL_TILE_FACTOR_MIN   1
 Minimum value of sb_t_svl_dl_par::tile_factor parameter.
 
#define SB_SVL_DL_TILE_FACTOR_MAX   64
 Maximum value of sb_t_svl_dl_par::tile_factor parameter.
 
#define SB_SVL_DL_FEATURES_MULTIPLIER_MIN   0.5f
 Minimum value of sb_t_svl_dl_par_network::features_multiplier parameter.
 
#define SB_SVL_DL_FEATURES_MULTIPLIER_MAX   1.5f
 Maximum value of sb_t_svl_dl_par_network::features_multiplier parameter.
 
#define SB_SVL_DL_FEATURES_MULTIPLIER_GRANULARITY   0.1f
 Granularity of sb_t_svl_dl_par_network::features_multiplier parameter.
 
#define SB_SVL_DL_FEATURES_MULTIPLIER_DEFAULT   1.0f
 Default value of sb_t_svl_dl_par_network::features_multiplier parameter.
 
#define SB_SVL_DL_SCALE_MIN   1.0f
 Minimum value of sb_t_svl_dl_par::scale parameter.
 
#define SB_SVL_DL_SCALE_MAX   16.0f
 Maximum value of sb_t_svl_dl_par::scale parameter.
 
#define SB_SVL_DL_SCALE_GRANULARITY   0.01f
 Granularity of the value of sb_t_svl_dl_par::scale parameter.
 
#define SB_SVL_DL_PERTURBATION_SHIFT_MIN   0.0f
 Minimum value of sb_t_svl_dl_par_perturbation::shift_horizontal and sb_t_svl_dl_par_perturbation.shift_vertical parameters.
 
#define SB_SVL_DL_PERTURBATION_SHIFT_MAX   0.5f
 Maximum value of sb_t_svl_dl_par_perturbation::shift_horizontal and sb_t_svl_dl_par_perturbation.shift_vertical parameters.
 
#define SB_SVL_DL_PERTURBATION_STRETCH_CONTRAST_MIN   0.0f
 Minimum value of sb_t_svl_dl_par_perturbation::stretch_contrast parameter.
 
#define SB_SVL_DL_PERTURBATION_STRETCH_CONTRAST_MAX   0.5f
 Maximum value of sb_t_svl_dl_par_perturbation::stretch_contrast parameter.
 
#define SB_SVL_DL_PERTURBATION_DELTA_BRIGHTNESS_MIN   0.0f
 Minimum value of sb_t_svl_dl_par_perturbation::delta_brightness parameter.
 
#define SB_SVL_DL_PERTURBATION_DELTA_BRIGHTNESS_MAX   0.5f
 Maximum value of sb_t_svl_dl_par_perturbation::delta_brightness parameter.
 
#define SB_SURFACE_OPTIONAL_GRAY_LEVEL   128
 Gray level for "all model" optional defects. More...
 
#define SB_LICENSE_VENDOR_CODE_SIZE   32
 Size, in bytes, of the string of the vendor code.
 
#define SB_LUT_POINT_NOT_EXIST   0xFFFF
 Special value to identify coordinates of not existing points. More...
 
#define SB_IMAGE_FILE_EXTENSIONS
 List of the possible extensions of the image.
 
#define SB_SOLUTION_EXT   "rprj"
 Extension of the SqueezeBrains solution file.
 
#define SB_PAR_FEATURES_NAMES_LEN   256
 Maximum lenght, in byte, of the features names string.
 
#define SB_DL_WEIGHTS_EXT   "weights"
 Extension of the SqueezeBrains pre-trained network weights file.
 
#define SB_DEVICES_MAX_NUMBER   4
 Maximum number of computational devices managed by the sb library. More...
 
#define SB_IMAGE_INFO_EXT   "rtn"
 Extension of the image information file associated to an image. More...
 
#define SB_CLS_0   "cls0"
 classificator type 0
 
#define SB_CLS_1   "cls1"
 classificator type 1
 
#define SB_FEATURE_0A   "0A"
 feature 0, configuration A
 
#define SB_FEATURE_0B   "0B"
 feature 0, configuration B
 
#define SB_FEATURE_0A_RI   "0A_RI"
 feature 0, configuration A
 
#define SB_FEATURE_0B_RI   "0B_RI"
 feature 0, configuration B
 
#define SB_FEATURE_2A   "2A"
 feature 2, configuration A
 
#define SB_FEATURE_2B   "2B"
 feature 2, configuration B
 
#define SB_FEATURE_2C   "2C"
 feature 2, configuration C
 
#define SB_FEATURE_2D   "2D"
 feature 2, configuration D
 
#define SB_FEATURE_2A_R   "2A.R"
 feature 2 R, configuration A
 
#define SB_FEATURE_2AA_R   "2AA.R"
 feature 2 R, configuration A
 
#define SB_FEATURE_2B_R   "2B.R"
 feature 2 R, configuration B
 
#define SB_FEATURE_2C_R   "2C.R"
 feature 2 R, configuration C
 
#define SB_FEATURE_2D_R   "2D.R"
 feature 2 R, configuration D
 
#define SB_FEATURE_2A_G   "2A.G"
 feature 2 G, configuration A
 
#define SB_FEATURE_2AA_G   "2AA.G"
 feature 2 G, configuration A
 
#define SB_FEATURE_2B_G   "2B.G"
 feature 2 G, configuration B
 
#define SB_FEATURE_2C_G   "2C.G"
 feature 2 G, configuration C
 
#define SB_FEATURE_2D_G   "2D.G"
 feature 2 G, configuration D
 
#define SB_FEATURE_2A_B   "2A.B"
 feature 2 B, configuration A
 
#define SB_FEATURE_2AA_B   "2AA.B"
 feature 2 B, configuration A
 
#define SB_FEATURE_2B_B   "2B.B"
 feature 2 B, configuration B
 
#define SB_FEATURE_2C_B   "2C.B"
 feature 2 B, configuration C
 
#define SB_FEATURE_2D_B   "2D.B"
 feature 2 B, configuration D
 
#define SB_FEATURE_2A_RI   "2A_RI"
 feature 2, configuration A
 
#define SB_FEATURE_2B_RI   "2B_RI"
 feature 2, configuration B
 
#define SB_FEATURE_2C_RI   "2C_RI"
 feature 2, configuration C
 
#define SB_FEATURE_2A_RI_R   "2A_RI.R"
 feature 2 R, configuration A
 
#define SB_FEATURE_2AA_RI_R   "2AA_RI.R"
 feature 2 R, configuration A
 
#define SB_FEATURE_2B_RI_R   "2B_RI.R"
 feature 2 R, configuration B
 
#define SB_FEATURE_2C_RI_R   "2C_RI.R"
 feature 2 R, configuration C
 
#define SB_FEATURE_2A_RI_G   "2A_RI.G"
 feature 2 G, configuration A
 
#define SB_FEATURE_2AA_RI_G   "2AA_RI.G"
 feature 2 G, configuration A
 
#define SB_FEATURE_2B_RI_G   "2B_RI.G"
 feature 2 G, configuration B
 
#define SB_FEATURE_2C_RI_G   "2C_RI.G"
 feature 2 G, configuration C
 
#define SB_FEATURE_2A_RI_B   "2A_RI.B"
 feature 2 B, configuration A
 
#define SB_FEATURE_2AA_RI_B   "2AA_RI.B"
 feature 2 B, configuration A
 
#define SB_FEATURE_2B_RI_B   "2B_RI.B"
 feature 2 B, configuration B
 
#define SB_FEATURE_2C_RI_B   "2C_RI.B"
 feature 2 B, configuration C
 
#define SB_FEATURE_3A   "3A"
 feature 3, configuration A
 
#define SB_FEATURE_3B   "3B"
 feature 3, configuration B
 
#define SB_FEATURE_3C   "3C"
 feature 3, configuration C
 
#define SB_FEATURE_3D   "3D"
 feature 3, configuration D
 
#define SB_FEATURE_3E   "3E"
 feature 3, configuration E
 
#define SB_FEATURE_4A   "4A"
 feature 4, configuration A
 
#define SB_FEATURES
 < List of all the features separated by SB_DELIMITER
 
#define SB_SVL_STEP_INITIALIZATION   "initializing data for svl"
 SVL step: initialization.
 
#define SB_SVL_STEP_SEARCHING_RECIPE   "choosing recipe"
 SVL step: choosing recipe.
 
#define SB_SVL_STEP_TRAINING_RECIPE   "training recipe"
 SVL step: training recipe.
 
#define SB_SVL_STEP_FINALIZATION   "finalization of svl"
 SVL step: finalization of svl.
 
#define SB_SVL_STEP_FINISHED   "svl has finished"
 SVL step: svl has finished.
 

Typedefs

typedef void(* sb_fp_trace_callback) (const char *const msg)
 Definition of the callback for message trace. More...
 
typedef void * SB_HANDLE
 HANDLE definition.
 
typedef 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. More...
 
typedef 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. More...
 
typedef 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. More...
 

Enumerations

enum  sb_t_err {
  SB_ERR_NONE = 0 , SB_ERR_BASE64_SIZE = 10000 , SB_ERR_BUFFER_SIZE = 20000 , SB_ERR_CLS = 30000 ,
  SB_ERR_CLS_CREATE = 30010 , SB_ERR_CLS_NOT_TRAINED = 30020 , SB_ERR_CLS_PREDICT = 30030 , SB_ERR_CLS_TRAINING = 30040 ,
  SB_ERR_DECRYPT = 40000 , SB_ERR_DIR_CREATE = 50000 , SB_ERR_DIR_EXIST = 50010 , SB_ERR_DIR_NOT_EXIST = 50020 ,
  SB_ERR_DIR_REMOVE = 50030 , SB_ERR_DL_CUDA_OUT_OF_MEMORY = 50250 , SB_ERR_DL_FRAMEWORK = 50500 , SB_ERR_DL_INPAINTER_NOT_ASSIGNED = 51000 ,
  SB_ERR_DL_INPAINTER_NOT_FOUND = 51250 , SB_ERR_DL_INTERNAL = 51375 , SB_ERR_DL_NETWORK_FILE_NOT_FOUND = 51500 , SB_ERR_DL_NOT_SUPPORTED = 51750 ,
  SB_ERR_DL_PRE_TRAINED_FILE_NOT_FOUND = 52000 , SB_ERR_DL_PRE_TRAINED_FILE_NOT_VALID = 52500 , SB_ERR_DL_ROI_NOT_SET = 52625 , SB_ERR_DL_TRAINING_DATA_MISSING = 53000 ,
  SB_ERR_ENCRYPT = 60000 , SB_ERR_FILE_COPY = 69000 , SB_ERR_FILE_EMPTY = 69500 , SB_ERR_FILE_EXTENSION = 70000 ,
  SB_ERR_FILE_FORMAT = 70010 , SB_ERR_FILE_NAME = 70020 , SB_ERR_FILE_NAME_EMPTY = 70030 , SB_ERR_FILE_NAME_LENGHT = 70035 ,
  SB_ERR_FILE_NOT_EXIST = 70040 , SB_ERR_FILE_READ = 70050 , SB_ERR_FILE_REMOVE = 70055 , SB_ERR_FILE_OPEN = 70060 ,
  SB_ERR_FILE_SAVE = 70070 , SB_ERR_FILE_VERSION = 70075 , SB_ERR_FILE_WRITE = 70080 , SB_ERR_IMAGE_CHANNELS = 80000 ,
  SB_ERR_IMAGE_CIRCULARITY = 80002 , SB_ERR_IMAGE_COMPRESSION = 80005 , SB_ERR_IMAGE_CREATE = 80010 , SB_ERR_IMAGE_DECODE = 80015 ,
  SB_ERR_IMAGE_DEPTH = 80020 , SB_ERR_IMAGE_ENCODE = 80025 , SB_ERR_IMAGE_FORMAT = 80030 , SB_ERR_IMAGE_LOAD = 80040 ,
  SB_ERR_IMAGE_RESIZE = 80045 , SB_ERR_IMAGE_RESOLUTION = 80050 , SB_ERR_IMAGE_SIZE = 80070 , SB_ERR_IMAGE_TYPE = 80085 ,
  SB_ERR_IMAGE_WARP = 80100 , SB_ERR_IMAGE_WIDTH_STEP = 800150 , SB_ERR_INITIALIZE = 90000 , SB_ERR_INSUFFICIENT_FREE_MEMORY = 95000 ,
  SB_ERR_INTERNAL = 100000 , SB_ERR_INVALID_MAIL_ADDRESS = 110000 , SB_ERR_LEVELS_ENABLED = 115000 , SB_ERR_LEVELS_NUMBER = 115100 ,
  SB_ERR_LIBRARY_DEPENDENCIES = 116000 , SB_ERR_LIBRARY_FUNCTION_ADDRESS = 117000 , SB_ERR_LIBRARY_OPEN = 11800 , SB_ERR_LICENSE = 120000 ,
  SB_ERR_LICENSE_CODE = 120010 , SB_ERR_LICENSE_CORRUPTED = 120020 , SB_ERR_LICENSE_DISABLED = 120025 , SB_ERR_LICENSE_EXPIRED = 120030 ,
  SB_ERR_LICENSE_FEATURES_NUMBER = 120035 , SB_ERR_LICENSE_FILE = 120040 , SB_ERR_LICENSE_MACHINE_ID_MATCH = 120050 , SB_ERR_LICENSE_MAIL_ADDRESS = 120055 ,
  SB_ERR_LICENSE_MARKER = 120060 , SB_ERR_LICENSE_MODELS_NUMBER = 120063 , SB_ERR_LICENSE_NOT_FOUND = 120065 , SB_ERR_LICENSE_SAME_MACHINE_ID = 120070 ,
  SB_ERR_LICENSE_TRAINING = 120075 , SB_ERR_LICENSE_TYPE = 120080 , SB_ERR_LICENSE_VERSION = 120090 , SB_ERR_LICENSE_VM = 120100 ,
  SB_ERR_LICENSE_WAIT_SERVER = 120110 , SB_ERR_MACHINE_ID = 130000 , SB_ERR_MALLOC = 140000 , SB_ERR_MEMORY_LEAK = 150000 ,
  SB_ERR_MODEL_DISABLED = 154500 , SB_ERR_MODEL_NAME = 155000 , SB_ERR_MODEL_NOT_FOUND = 160000 , SB_ERR_MODEL_NOT_TRAINED = 162500 ,
  SB_ERR_MODELS_ENABLED = 165000 , SB_ERR_MODELS_NUMBER = 170000 , SB_ERR_NULL_POINTER = 180000 , SB_ERR_NO_CLASSIFIED_IMAGE = 190000 ,
  SB_ERR_NO_FEATURES_AVAILABLE = 195000 , SB_ERR_NO_LEVELS_AVAILABLE = 196000 , SB_ERR_NO_FILE_FOUND = 200000 , SB_ERR_NO_POINT_FOUND = 205000 ,
  SB_ERR_NOT_IMPLEMENTED = 210000 , SB_ERR_NVIDIA_NVML = 212500 , SB_ERR_PATH_SIZE = 215000 , SB_ERR_PROJECT_LOAD_MODE = 217500 ,
  SB_ERR_PROJECT_NOT_FOUND = 217600 , SB_ERR_PROJECT_TYPE = 218500 , SB_ERR_RPF_NAME_EMPTY = 220000 , SB_ERR_ROI = 230000 ,
  SB_ERR_ROI_BOUNDING_BOX = 230005 , SB_ERR_ROI_DEFECTS = 230010 , SB_ERR_SAMPLE_BACKGROUND = 239000 , SB_ERR_SAMPLE_NOT_FOUND = 240000 ,
  SB_ERR_SAMPLE_NUMBER = 240010 , SB_ERR_SAMPLE_OUT_OF_IMAGE = 240020 , SB_ERR_SAMPLE_WRONG = 240030 , SB_ERR_SAMPLE_DISTANCE = 240040 ,
  SB_ERR_SAMPLE_SCALE = 240050 , SB_ERR_SAMPLES_GT_TOO_MANY = 240200 , SB_ERR_SCALE_NOT_FOUND = 240500 , SB_ERR_SENTINEL = 241000 ,
  SB_ERR_SENTINEL_MASTER_KEY = 241500 , SB_ERR_SENTINEL_TOO_MANY_KEYS = 242000 , SB_ERR_SENTINEL_RUN_TIME = 242500 , SB_ERR_SOCKET = 250000 ,
  SB_ERR_SOCKET_ACCEPT = 250010 , SB_ERR_SOCKET_BIND = 250020 , SB_ERR_SOCKET_CONNECT = 250030 , SB_ERR_SOCKET_CLOSED = 250040 ,
  SB_ERR_SOCKET_CREATE = 250050 , SB_ERR_SOCKET_INVALID_IP = 250060 , SB_ERR_SOCKET_INVALID_PORT = 250070 , SB_ERR_SOCKET_IOCTL = 250080 ,
  SB_ERR_SOCKET_LISTEN = 250090 , SB_ERR_SOCKET_MAC = 250095 , SB_ERR_SOCKET_RECEIVE = 250100 , SB_ERR_SOCKET_SELECT = 250110 ,
  SB_ERR_SOCKET_SEND = 250120 , SB_ERR_SOCKET_SET_PARAMETER = 250130 , SB_ERR_SOCKET_TIMEOUT = 250140 , SB_ERR_STRING_EMPTY = 253000 ,
  SB_ERR_STRING_UTF8 = 254000 , SB_ERR_STRUCT_HEADER_WRONG_CODE = 260000 , SB_ERR_STRUCT_HEADER_WRONG_SIZE = 260010 , SB_ERR_STRUCT_HEADER_WRONG_VERSION = 260020 ,
  SB_ERR_SVL_PERTURBATION = 270000 , SB_ERR_SVL_WAS_NOT_DONE = 270010 , SB_ERR_SVL_WRONG = 270020 , SB_ERR_SVL_CHOOSE_FEATURES = 270040 ,
  SB_ERR_SVL_CHOOSE_FEATURES_FAST = 270100 , SB_ERR_SVL_VALIDATION_DATASET = 277000 , SB_ERR_THREAD = 280000 , SB_ERR_UUID = 290000 ,
  SB_ERR_VERSION = 300000 , SB_ERR_VERSION_FORMAT = 300010 , SB_ERR_WARP_POINT_NOT_FOUND = 310000 , SB_ERR_WRONG_PARAMETER = 320000 ,
  SB_ERR_XML = 330000 , SB_ERR_XML_NODE_NOT_FOUND = 330010
}
 Errors code enum. More...
 
enum  sb_t_device_type { SB_DEVICE_CPU = 0 , SB_DEVICE_GPU }
 Defines computing device types. More...
 
enum  sb_t_interpolation_mode { SB_INTERPOLATION_MODE_BILINEAR = 0 , SB_INTERPOLATION_MODE_NN }
 Enumerates the interpolation modes. More...
 
enum  sb_t_floating_point_op_type { SB_FLOATING_POINT_OPS_TYPE_SINGLE_PRECISION = 0 , SB_FLOATING_POINT_OPS_TYPE_HALF_PRECISION }
 Enumerates the floating point precision types to perform operations. More...
 
enum  sb_t_malloc_check { SB_MALLOC_CHECK_MAIN_COUNTER = 0 , SB_MALLOC_CHECK_SECOND_COUNTER }
 Type of counter for the memory leak check. More...
 
enum  sb_t_license_module_status { SB_LICENSE_MODULE_STATUS_NULL = 0 , SB_LICENSE_MODULE_STATUS_ACTIVE , SB_LICENSE_MODULE_STATUS_DISABLED , SB_LICENSE_MODULE_STATUS_ERR }
 Enumerations of status of a module of the license. More...
 
enum  sb_t_license_type {
  SB_LICENSE_NULL = 0 , SB_LICENSE_DISABLED , SB_LICENSE_DEMO , SB_LICENSE_MASTER ,
  SB_LICENSE_NOT_PRESENT
}
 Enumerations of the license types. More...
 
enum  sb_t_license_configuration_id { SB_LICENSE_PREMIUM = 0 , SB_LICENSE_STANDARD , SB_LICENSE_BASIC , SB_LICENSE_CONFIGURATION_NUMBER }
 Enumerations of the license configurations. More...
 
enum  sb_t_license_module_id {
  SB_LICENSE_MODULE_NONE = -1 , SB_LICENSE_MODULE_RETINA , SB_LICENSE_MODULE_SURFACE , SB_LICENSE_MODULE_DEEP_CORTEX ,
  SB_LICENSE_MODULE_DEEP_SURFACE , SB_LICENSE_MODULE_NUMBER
}
 Enumerations of modules of the SB library. More...
 
enum  sb_t_image_format { SB_IMAGE_FORMAT_BW8 = 0 , SB_IMAGE_FORMAT_BGR888 , SB_IMAGE_FORMAT_RGB888 , SB_IMAGE_FORMAT_UI32 }
 Format of image pixel. More...
 
enum  sb_t_image_compress_type { SB_IMAGE_COMPRESS_NONE = 0 , SB_IMAGE_COMPRESS_RLE , SB_IMAGE_COMPRESS_JPEG , SB_IMAGE_COMPRESS_PNG }
 Type of image compression. More...
 
enum  sb_t_image_compress_par { SB_IMAGE_COMPRESS_PAR_JPEG_QUALITY = 1 }
 Definitions of parameters used by the image encoders. More...
 
enum  sb_t_image_flip_mode { SB_IMAGE_FLIP_BOTH = -1 , SB_IMAGE_FLIP_HORIZONTAL = 0 , SB_IMAGE_FLIP_VERTICAL = 1 }
 Enumeration of the flip mode. More...
 
enum  sb_t_image_circularity_type { SB_IMAGE_CIRCULARITY_TYPE_NONE = 0 , SB_IMAGE_CIRCULARITY_TYPE_HORIZONTAL , SB_IMAGE_CIRCULARITY_TYPE_VERTICAL }
 Enumeration of the image circularity type. More...
 
enum  sb_t_obj_type { SB_OBJ_TEST = 0 , SB_OBJ_LEARNING }
 Defines the type of the object. More...
 
enum  sb_t_truth {
  SB_TRUTH_UNDEFINED = 0 , SB_TRUTH_TRUE_POSITIVE , SB_TRUTH_TRUE_NEGATIVE , SB_TRUTH_FALSE_POSITIVE ,
  SB_TRUTH_FALSE_NEGATIVE , SB_TRUTH_OPTIONAL_POSITIVE , SB_TRUTH_OPTIONAL_NEGATIVE , SB_TRUTH_OUT_OF_ROI ,
  SB_TRUTH_MODEL_DISABLED
}
 Type of truth of a sample. More...
 
enum  sb_t_sample_classify_mode { SB_SAMPLE_REQUIRED = 0 , SB_SAMPLE_OPTIONAL }
 Enumeration of the classification modes of a sample. More...
 
enum  sb_t_pixel_connection { SB_PIXEL_CONNECTION_4 = 0 , SB_PIXEL_CONNECTION_8 }
 Defines the pixel connection. More...
 
enum  sb_t_blob_distance_mode { SB_BLOB_DISTANCE_MODE_BOUNDING_BOX = 0 , SB_BLOB_DISTANCE_MODE_CONTOUR }
 Enumerates the algorithm for calculating the distance between blobs. More...
 
enum  sb_t_blob_deleted { SB_BLOB_OK = 0 , SB_BLOB_DELETED_BEFORE_MERGE , SB_BLOB_DELETED_AFTER_MERGE }
 Defines the deleted blob. More...
 
enum  sb_t_project_type { SB_PROJECT_TYPE_RETINA = 0 , SB_PROJECT_TYPE_SURFACE , SB_PROJECT_TYPE_DEEP_SURFACE , SB_PROJECT_TYPE_DEEP_CORTEX }
 Project types enum. More...
 
enum  sb_t_project_mode { SB_PROJECT_MODE_DETECTION_ONLY = 0 , SB_PROJECT_MODE_DETECTION_AND_SVL }
 Defines the loading or saving mode of a project. More...
 
enum  sb_t_svl_command {
  SB_SVL_COMMAND_STOP = 0 , SB_SVL_COMMAND_CONTINUE , SB_SVL_COMMAND_ABORT , SB_SVL_COMMAND_CONTINUE_NO_RESET ,
  SB_SVL_COMMAND_NEXT_STEP
}
 Enumerates the actions that SVL has to do after a stop. More...
 
enum  sb_t_svl_par_optimization_mode { SB_SVL_PAR_OPTIMIZATION_TIME_SLOW = 0 , SB_SVL_PAR_OPTIMIZATION_TIME_MEDIUM , SB_SVL_PAR_OPTIMIZATION_TIME_FAST , SB_SVL_PAR_OPTIMIZATION_USE_SELECTED }
 Describes the optimization mode of SVL. More...
 
enum  sb_t_network_type {
}
 Deep learning network types. More...
 
enum  sb_t_loss_fn_type { SB_LOSS_FN_TYPE_CCE = 0 , SB_LOSS_FN_TYPE_FOCAL , SB_LOSS_FN_TYPE_BCE }
 Enumerates the loss functions. More...
 
enum  sb_t_perturbation_mode { SB_PERTURBATION_MODE_ONLINE = 0 , SB_PERTURBATION_MODE_OFFLINE , SB_PERTURBATION_MODE_BOTH }
 Enumerates the mode of the perturbations. More...
 
enum  sb_t_perturbation_type { SB_PERTURBATION_TYPE_IMAGE = 0 , SB_PERTURBATION_TYPE_DEFECTS , SB_PERTURBATION_TYPE_BOTH }
 Enumerates the range of application of the perturbations. More...
 
enum  sb_t_surface_image_truth {
  SB_IMAGE_TRUTH_UNDEFINED =0 , SB_IMAGE_TRUTH_GOOD , SB_IMAGE_TRUTH_NO_GOOD , SB_IMAGE_TRUTH_OVERKILL ,
  SB_IMAGE_TRUTH_ESCAPE
}
 Defines the surface image truth. More...
 
enum  sb_t_tile_type { SB_TILE_TYPE_NOT_USED = 0 , SB_TILE_TYPE_USED , SB_TILE_TYPE_USED_SVL }
 Enumerates the tile types. More...
 
enum  sb_t_image_info_type { SB_IMAGE_INFO_TYPE_NONE = 0 , SB_IMAGE_INFO_TYPE_TEST , SB_IMAGE_INFO_TYPE_SVL , SB_IMAGE_INFO_TYPE_SVL_USED }
 Defines the type of the image. More...
 
enum  sb_t_svl_stop_reason {
  SB_SVL_STOP_NONE = 0 , SB_SVL_STOP_CONFLICT , SB_SVL_STOP_USER_REQUEST , SB_SVL_STOP_MEMORY ,
  SB_SVL_STOP_RESET_MANDATORY , SB_SVL_STOP_RESET_OPTIONAL , SB_SVL_STOP_WARNING
}
 Enumerates the reasons why SVL is terminated or why the callback sb_t_svl_par::fp_command has been called. More...
 

Functions

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. More...
 
const char * sb_err_format (sb_t_err code)
 Returns the error message. More...
 
SB_INLINE sb_t_point sb_point (int x, int y)
 Inline constructor of structure sb_t_point. More...
 
SB_INLINE sb_t_point2d_f sb_point2d_f (float x, float y)
 Inline constructor of structure sb_t_point2d_f. More...
 
SB_INLINE sb_t_size sb_size (int width, int height)
 Inline constructor of structure sb_t_size. More...
 
SB_INLINE sb_t_size_flt sb_size_flt (float width, float height)
 Inline constructor of structure sb_t_size_flt. More...
 
SB_INLINE sb_t_range sb_range (int min, int max)
 Inline constructor of structure sb_t_range. More...
 
SB_INLINE sb_t_range_flt sb_range_flt (float min, float max)
 Inline constructor of structure sb_t_range_flt. More...
 
SB_INLINE sb_t_rect sb_rect (int x, int y, int width, int height)
 Inline constructor of structure sb_t_rect. More...
 
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. More...
 
sb_t_err sb_init (const char *const license_file)
 Initializes the SB library. More...
 
sb_t_err sb_init_dl (const char *const search_path)
 Initialize the Deep Learning library. More...
 
sb_t_err sb_release (void)
 Releases all the resources allocates in the library. More...
 
SB_INLINE sb_t_version sb_version (int major, int minor, int vminor, int build_major)
 Inline constructor of structure sb_t_version. More...
 
int sb_version_check (sb_t_version version1, sb_t_version version2)
 Compares two version. More...
 
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. More...
 
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. More...
 
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. More...
 
sb_t_err sb_destroy_info (sb_t_info **const info)
 Destroys the structure. More...
 
sb_t_err sb_format_info (const sb_t_info *const info, char *const str, int str_size)
 Formats the sb library information structure. More...
 
sb_t_err sb_get_uuid (char *const str, size_t size)
 Creates a new uuid. More...
 
sb_t_err sb_get_file_version (sb_t_version *const ver, const char *const file)
 Get the version of a file. More...
 
int sb_is_valid_utf8 (const char *string)
 Check if a string conforms to UTF-8 format. More...
 
SB_HANDLE sb_xml_node_get (SB_HANDLE parent, const char *const name)
 Gets the handle of the xml node with the specified name. More...
 
SB_HANDLE sb_xml_node_get_child (SB_HANDLE parent)
 Gets the first child of the node. More...
 
SB_HANDLE sb_xml_node_previous (SB_HANDLE node)
 Gets the previous sibling node. More...
 
SB_HANDLE sb_xml_node_next (SB_HANDLE node)
 Gets the next sibling node. More...
 
SB_HANDLE sb_xml_node_add (SB_HANDLE parent, const char *const name, const char *const content)
 Adds the node to the parent node. More...
 
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 otherwise creates it. If the node exists, the value is updated. More...
 
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. More...
 
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. More...
 
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. More...
 
sb_t_err sb_xml_node_set_itself (SB_HANDLE node, const char *const content)
 Sets the content of the node. More...
 
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. More...
 
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. More...
 
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. More...
 
sb_t_err sb_xml_node_remove (SB_HANDLE parent, const char *const name)
 Removes the node with the specified name. More...
 
sb_t_err sb_xml_node_remove_itself (SB_HANDLE node)
 Removes the current node. More...
 
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. More...
 
sb_t_err sb_folder_destroy (sb_t_folder **folder)
 Frees all the resources of the sb_t_folder structure. More...
 
sb_t_err sb_folder_erase (sb_t_folder *folder, int index)
 Removes the file with the specified index from the list. More...
 
sb_t_err sb_folder_create (const char *const path)
 Creates the folder with the specified path. More...
 
sb_t_err sb_folder_remove (const char *const path)
 Deletes a folder and all the files and subfolder contained. More...
 
sb_t_err sb_folder_exist (const char *const path, int *const exist)
 Checks if the folder with the specified path exists. More...
 
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. More...
 
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. More...
 
void sb_free (void *ptr)
 Deallocates a memory block. More...
 
void * sb_malloc (size_t size)
 Allocates a memory block. More...
 
void * sb_calloc (size_t count, size_t size)
 Allocates and zero-initialize an array. More...
 
void * sb_realloc (void *ptr, size_t size)
 Reallocates a memory block. More...
 
sb_t_err sb_malloc_check_memory_leak (sb_t_malloc_check check)
 Checks if the library has a memory leak. More...
 
sb_t_err sb_malloc_check_memory_leak_reset (sb_t_malloc_check check)
 Resets the memory leak control. More...
 
sb_t_err sb_license_get_hw_info (char **const str)
 Returns the hardware information. More...
 
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. More...
 
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. More...
 
sb_t_err sb_license_get_info (sb_t_license *const info)
 Returns the license information. More...
 
sb_t_err sb_license_format_info (const sb_t_license *const info, char *const str, int str_size)
 Formats the license structure. More...
 
const char * sb_license_format_module_id (sb_t_license_module_id code)
 Returns the string of the module id. More...
 
const char * sb_license_format_module_status (sb_t_license_module_status status)
 Returns the string of the feature status. More...
 
const char * sb_license_format_type (sb_t_license_type type)
 Returns the string of the license type. More...
 
const char * sb_license_format_configuration (sb_t_license_configuration_id configuration)
 Returns the string of the license configuration. More...
 
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. More...
 
sb_t_err sb_lut_create (SB_HANDLE *phandle, int width, int height)
 Creates the handle of the lut. More...
 
sb_t_err sb_lut_destroy (SB_HANDLE *phandle)
 Destroys the handle of the lut. More...
 
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. More...
 
sb_t_err sb_lut_get_size (SB_HANDLE phandle, int *const width, int *const height)
 Retrieves the size of the lut. More...
 
sb_t_err sb_lut_save (SB_HANDLE phandle, const char *const file_path)
 Saves the lut in a file. More...
 
sb_t_err sb_lut_load (SB_HANDLE *phandle, const char *const file_path)
 Loads the lut from a file. More...
 
sb_t_err sb_lut_warp_point (SB_HANDLE phandle, const sb_t_point *const src, sb_t_point *const dst)
 Warps the point. More...
 
const char * sb_image_format (sb_t_image_format format)
 Returns the string of the image format. More...
 
sb_t_err sb_image_create (sb_t_image **const pimg, int width, int height, sb_t_image_format format)
 Creates an image. More...
 
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. More...
 
sb_t_err sb_image_destroy (sb_t_image **const pimg)
 Destroys the image. More...
 
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. More...
 
sb_t_err sb_image_decompress (sb_t_image **const dst, sb_t_image *const src)
 Decompress the image. More...
 
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. More...
 
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). More...
 
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. More...
 
sb_t_err sb_image_clone (sb_t_image **const dst, const sb_t_image *const src)
 Clones the image. More...
 
sb_t_err sb_image_copy (const sb_t_image *const src, sb_t_image *const dst)
 Copies the image. More...
 
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. More...
 
sb_t_err sb_image_clean (sb_t_image *const img)
 Cleans the image. More...
 
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. More...
 
sb_t_err sb_image_load (sb_t_image **const img, const char *const file)
 Loads an image from a file. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
const char * sb_image_circularity_type_format (sb_t_image_circularity_type type)
 Returns the string of the image circularity type. More...
 
sb_t_err sb_image_read_size (sb_t_size *const size, const char *const file)
 Get the image size from a file. More...
 
sb_t_err sb_roi_create (sb_t_roi **const roi, int width, int height)
 Creates a ROI. More...
 
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. More...
 
sb_t_err sb_roi_destroy (sb_t_roi **const roi)
 Destroys the ROI. More...
 
sb_t_err sb_roi_reset (sb_t_roi *const roi)
 Resets the ROI. More...
 
sb_t_err sb_roi_evaluate_bounding_box (sb_t_roi *const roi)
 Calculates the bounding box of the roi depending by the lut. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
sb_t_err sb_roi_clone (sb_t_roi **const dst, const sb_t_roi *const src)
 Copies a roi. More...
 
sb_t_err sb_roi_compress (sb_t_roi *const roi)
 Compresses the ROI and deletes the uncompressed version. More...
 
sb_t_err sb_roi_decompress (sb_t_roi *const roi)
 Decompresses the ROI and deletes the compressed version. More...
 
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. More...
 
sb_t_err sb_roi_apply_lut (sb_t_roi *const roi, unsigned char *lut)
 Applies the gray level lut to the roi image. More...
 
const char * sb_format_truth (sb_t_truth truth)
 Returns the string of the truth of the object. More...
 
sb_t_err sb_sample_clone (const sb_t_sample *const src, sb_t_sample *const dst)
 Copies a single sample. More...
 
sb_t_err sb_sample_destroy (sb_t_sample *const sample)
 Destroys the content of sample structure. More...
 
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. More...
 
sb_t_err sb_samples_create (sb_t_samples **const samples)
 Creates a samples structure. More...
 
sb_t_err sb_samples_destroy (sb_t_samples **const samples)
 Destroy the samples structure. More...
 
sb_t_err sb_samples_clone (sb_t_samples **const dst, const sb_t_samples *const src)
 Copies the samples of an image. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
sb_t_err sb_blobs_create (sb_t_blobs **const blobs)
 Creates the blobs structure. More...
 
sb_t_err sb_blob_init_par (sb_t_blob_par *const par)
 Initializes the fields of the structure. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
sb_t_err sb_blobs_clone (sb_t_blobs **const dst, const sb_t_blobs *const src)
 Blobs structure clone. More...
 
sb_t_err sb_blobs_destroy (sb_t_blobs **const blobs)
 Destroys the blobs structure. More...
 
sb_t_err sb_blob_destroy (sb_t_blob *const blob)
 Destroys the blob. More...
 
sb_t_err sb_blob_copy (sb_t_blob *const dst, const sb_t_blob *const src)
 Blob copy. More...
 
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. More...
 
const char * sb_project_type_format (sb_t_project_type type)
 Returns the string of the project type. More...
 
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. More...
 
sb_t_err sb_solution_destroy_info (sb_t_solution_info **const solution)
 Destroys the structure of the solution information. More...
 
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. More...
 
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. More...
 
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. More...
 
sb_t_err sb_project_get_info (SB_HANDLE handle, sb_t_project_info *project_info)
 Gets the project information from the handle. More...
 
sb_t_err sb_project_destroy (SB_HANDLE *phandle)
 Frees all the resources of the project handle. More...
 
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. More...
 
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. More...
 
sb_t_err sb_project_save (SB_HANDLE handle, const char *const solution_file, sb_t_project_mode mode)
 Saves the project to file. More...
 
sb_t_err sb_project_clone (SB_HANDLE src, SB_HANDLE *pdst, sb_t_project_mode mode, int regenerate_uuid)
 Clones the SqueezeBrains project. More...
 
sb_t_err sb_project_invalidate (SB_HANDLE handle, const char *const model_name, float scale)
 Eliminates the training of the models. More...
 
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. More...
 
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_set_sensitivity (SB_HANDLE handle, const char *const model_name, float scale, float sensitivity)
 Sets the sensitivity of the detection in the project handle. More...
 
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. More...
 
sb_t_err sb_project_get_notes (SB_HANDLE handle, char **const note)
 Gets the note from the project handle. More...
 
sb_t_err sb_project_set_notes (SB_HANDLE handle, const char *const note)
 Sets the note into the project handle. More...
 
sb_t_err sb_project_get_name (SB_HANDLE handle, char **const name)
 Gets the name from the project handle. More...
 
sb_t_err sb_project_set_name (SB_HANDLE handle, const char *const name)
 Sets the name into the project handle. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
const char * sb_svl_command_format (sb_t_svl_command command)
 Returns the string of the SVL command. More...
 
const char * sb_svl_par_optimization_mode_format (sb_t_svl_par_optimization_mode mode)
 Returns the string of the SVL optimization mode. More...
 
const char * sb_network_type_format (sb_t_network_type type)
 Returns the string of the network type. More...
 
const char * sb_loss_fn_type_format (sb_t_loss_fn_type type)
 Returns the string of the loss function type. More...
 
const char * sb_perturbation_mode_format (sb_t_perturbation_mode mode)
 Returns the string of the Deep Learning SVL image perturbation mode. More...
 
const char * sb_perturbation_type_format (sb_t_perturbation_type type)
 Returns the string of the Deep Learning SVL image perturbation type. More...
 
sb_t_err sb_par_init (sb_t_par *const par, sb_t_project_type project_type)
 Initializes the fields of the structure. More...
 
sb_t_err sb_par_add_model (sb_t_par *const par, const char *const model_name)
 Adds the model to the parameter structure. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
sb_t_err sb_par_format (const sb_t_par *const par, char *const str, int str_size)
 Formats the parameters structure. More...
 
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 network, the scale factor and the number of tiles set. More...
 
const char * sb_floating_point_precision_type_format (sb_t_floating_point_op_type type)
 Returns the string of the floating point precision type. More...
 
const char * sb_interpolation_mode_format (sb_t_interpolation_mode mode)
 Returns the string of the interpolation mode. More...
 
const char * sb_device_type_format (sb_t_device_type type)
 Returns the string of the device type. More...
 
const char * sb_tile_type_format (sb_t_tile_type type)
 Returns the string of the tile type. More...
 
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. More...
 
sb_t_err sb_tiles_info_destroy (sb_t_tiles_info **const ptiles)
 Destroy the tiles information. More...
 
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. More...
 
sb_t_err sb_res_destroy (sb_t_res **const res)
 Destroys the module results structure. More...
 
sb_t_err sb_res_clone (sb_t_res **const dst, const sb_t_res *const src)
 Copies the results of image elaboration. More...
 
sb_t_err sb_res_compress (sb_t_res *const res)
 Compress the results, in particular the Surface plane images. More...
 
sb_t_err sb_res_decompress (sb_t_res *const res)
 Decompress thre results. More...
 
sb_t_err sb_stat_format (const sb_t_stat *const stat, char *const str, int str_size)
 Formats the sb_t_stat structure. More...
 
sb_t_err sb_stat_destroy (sb_t_stat **const stat)
 Destroys the sb_t_stat structure. More...
 
sb_t_err sb_stat_reset (sb_t_stat *const stat, const sb_t_par *const par)
 Resets the sb_t_stat structure. More...
 
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. More...
 
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 apply the new parameters. More...
 
sb_t_err sb_project_destroy_par_changes_info (sb_t_par_changes_info **const par_changes_info)
 Destroys the structure. More...
 
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. More...
 
sb_t_err sb_project_get_par (SB_HANDLE handle, sb_t_par *const par)
 Retrieves the project parameters structure. More...
 
sb_t_err sb_project_set_par (SB_HANDLE handle, const sb_t_par *const par)
 Sets the parameters structure into the project handle. More...
 
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. More...
 
sb_t_err sb_project_reset_stat (SB_HANDLE handle)
 Resets the internal statistics of the elaborations. More...
 
sb_t_err sb_project_get_stat (SB_HANDLE handle, sb_t_stat **const stat)
 Gets the statistics from the handle. More...
 
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. More...
 
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. More...
 
sb_t_err sb_image_info_destroy_details (sb_t_image_info_details **const details)
 Destroys the array of the images info details. More...
 
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. More...
 
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. More...
 
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. More...
 
sb_t_err sb_image_info_destroy (SB_HANDLE *image_info)
 Destroys the SqueezeBrains image info handle. More...
 
sb_t_err sb_image_info_save (SB_HANDLE image_info)
 Saves the SqueezeBrains image info handle into the image file. More...
 
sb_t_err sb_image_info_clone (SB_HANDLE src, SB_HANDLE *pdst, SB_HANDLE module_handle)
 Clones the SqueezeBrains image info. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
sb_t_err sb_image_info_reset (SB_HANDLE image_info)
 Erases all the data from the SqueezeBrains image info handle. More...
 
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. More...
 
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. More...
 
sb_t_err sb_image_info_get_tiles_svl (SB_HANDLE handle, sb_t_tiles_info **const ptiles)
 Retrieves the svl tiles information. More...
 
sb_t_err sb_image_info_get_project_info (SB_HANDLE handle, sb_t_project_info *const project_info)
 Retrieves the project information. More...
 
sb_t_err sb_image_info_set_notes (SB_HANDLE image_info, const char *const str)
 Set a note into SqueezeBrains image info handle. More...
 
sb_t_err sb_image_info_get_notes (SB_HANDLE image_info, char **const str)
 Gets the note from the SqueezeBrains image info handle. More...
 
sb_t_err sb_image_info_get_name (SB_HANDLE image_info, char *const str, int str_size)
 Retrieves the name of the image. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
const char * sb_feature_description (const char *const feature)
 Returns a string with a brief description of a feature. More...
 
sb_t_err sb_svl_run (SB_HANDLE handle)
 Runs the SVL. More...
 
sb_t_err sb_svl_reset (SB_HANDLE handle)
 Resets the history of previous executions of the SVL. More...
 
sb_t_err sb_svl_stop_request (SB_HANDLE handle)
 Sends a request to the SVL for stop. More...
 
sb_t_err sb_svl_get_res (SB_HANDLE handle, sb_t_svl_res **const res)
 Retrieves the results of SVL. More...
 
sb_t_err sb_svl_destroy_res (sb_t_svl_res **const res)
 Destroys the structure of the results of SVL. More...
 
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. More...
 
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. More...
 

Detailed Description

SqueezeBrains libraries header file.

Definition in file sb.h.