48#include "../common/common.h"
65 printf(
"Initialize the SqueezeBrains library\n");
73 printf(
"wait for license...\n");
115 printf(
"Release SqueezeBrains library\n");
118 printf(
"Press ENTER to terminate\n");
EXTERN_C sb_t_err wait_license(void)
The functions wait until the license status is active.
#define CHECK_FN_GOTO(function)
sb_t_err
Errors code enum.
sb_t_err sb_destroy_info(sb_t_info **const info)
Destroys the structure.
sb_t_err sb_release(void)
Releases all the resources allocates in the library.
sb_t_err sb_get_info(sb_t_info **const info, int dl_devices_info)
The function gets information about the sb library and the available computational devices.
sb_t_err sb_init(const char *const license_file)
Initializes the SB library.
void * SB_HANDLE
HANDLE definition.
SB_INLINE sb_t_rect sb_rect(int x, int y, int width, int height)
Inline constructor of structure sb_t_rect.
sb_t_err sb_image_destroy(sb_t_image **const pimg)
Destroys 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_err sb_par_destroy(sb_t_par **const par)
Destroys the project parameters structure.
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_load(SB_HANDLE *phandle, const char *const solution_file, const char *const project_uuid, sb_t_project_mode mode)
Loads an existing project from a solution file.
sb_t_err sb_project_detection(SB_HANDLE handle, const sb_t_image *const img, const sb_t_roi *const roi, const sb_t_roi *const roi_defects, const sb_t_samples *const samples)
Detection function.
sb_t_err sb_project_get_res(SB_HANDLE handle, sb_t_res **const res, int details)
Retrieves the results of the last elaborated image.
sb_t_err sb_project_destroy(SB_HANDLE *phandle)
Frees all the resources of the project handle.
sb_t_err sb_project_get_par(SB_HANDLE handle, sb_t_par **const par)
Retrieves the project parameters structure.
@ SB_PROJECT_MODE_DETECTION_ONLY
Load/save the minimum module information to allow detection.
sb_t_err sb_res_destroy(sb_t_res **const res)
Destroys the module results structure.
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_create(sb_t_roi **const roi, int width, int height)
Creates a ROI.
sb_t_err sb_roi_destroy(sb_t_roi **const roi)
Destroys the ROI.
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.
#define SB_SOLUTION_EXT
Extension of the SqueezeBrains solution file.
sb_t_err sb_solution_destroy_info(sb_t_solution_info **const solution)
Destroys the structure of the solution information.
int blob_contour
Set to 1 if you want the contour of each blob.
sb_t_range area
Range of area, value in pixel.
sb_t_range merge_area
Range of area after merge, value in pixel. Used only if sb_t_blob_par::merge_distance is greater than...
int blob_rle
Set to 1 if you want the rle of each blob.
int merge_distance
Blobs with a distance inferior or equal to the value are merged together.
sb_t_rect rect
Bounding box of the blob.
int area
Area of the blob, number of the pixel.
sb_t_blob * blob
Array of the blobs.
int size
Number of blobs, ie number of elements of the array sb_t_blobs::blob .
int width
Width, in pixel, of the image.
int height
Height, in pixel, of the image.
General information about sb library and computing devices like CPU and GPUs.
char compile_time[32]
String with the compilation time of the sb library.
char compile_date[32]
String with the compilation date of the sb library.
char version_str[16]
String with the version of the sb library.
int surface_blob_analysis
Enables the blob analysis.
sb_t_blob_par blob_par
Surface blob analysis parameters.
char uuid[SB_PROJECT_UUID_LEN]
Project UUID.
sb_t_project_info * info
Array of solution project information.
int y
y coordinate of the upper left corner of the rectangle
int x
x coordinate of the upper left corner of the rectangle
int width
width of the rectangle
int height
height of the rectangle
sb_t_surface_res * surface
Surface model analysis result.
sb_t_res_model global
Global results.
sb_t_projects_info projects
Array of the projects info.
int current_project
Index of the current project in the projects array.
sb_t_blobs * blobs
Defects blobs extracted.