SOD C/C++ API - Convolutional/Recurrent Neural Networks (CNN/RNN)


float *  sod_cnn_prepare_image(sod_cnn *pNet, sod_img input);


Prepare a sod_img object for detection. An input image or video frame must be resized to the appropriate network dimension before the detection process via sod_cnn_predict(). You can query a network for its input dimensions via sod_cnn_get_network_size(). This operation is always fast, SOD internally caches all the resources necessarily for fast image/frame resizing.


sod_cnn    *pNet

A pointer to a valid sod_cnn object obtained from a prior successful call to sod_cnn_create().

sod_img    input

Input picture/video frame to be resized to the appropriate network dimension. The image can be loaded from disk using sod_img_load_from_file(), from memory (i.e. network socket) via sod_img_load_from_mem(), dynamically created via sod_make_image() or frame captured via the OpenCV integration interfaces such as sod_img_load_from_cv_stream() and so on.

Return Value

float vector ready to be passed verbatim to sod_cnn_predict() for prediction on success. NULL is returned on failure (i.e. running out-of-memory, not supported image format for this architecture, etc.).


Checkout the introduction course, the C/C++ samples on the download page or refer to the SOD Github Repository.

See also