Function robosoft_openai::convert_image_to_base_64

Function Documentation

std::string robosoft_openai::convert_image_to_base_64(const std::optional<const std::string> &image_path, const std::optional<const cv::Mat> &image_cv_mat)

Convert jpeg to base64 encoding. There are 2 possible input types.

Parameters:
  • image_path – path to image on disk

  • image_cv_mat – an image

Returns:

image encoded as string. If there was an error, it will be empty.