diff --git a/imgproc/algs/image_encoder.cpp b/imgproc/algs/image_encoder.cpp index a918bde..2199d78 100644 --- a/imgproc/algs/image_encoder.cpp +++ b/imgproc/algs/image_encoder.cpp @@ -99,9 +99,12 @@ std::shared_ptr> img_encoder::encode(LPPACKIMAGE head, cv::Ma } else { + cv::Mat out; + + cv::flip(mat, out, 0); ptr.reset(new std::vector()); head->format = fmt_ == ".jpg" ? IMG_FMT_JPEG : IMG_FMT_PNG; - cv::imencode(fmt_.c_str(), mat, *ptr, param_); + cv::imencode(fmt_.c_str(), out, *ptr, param_); head->prc_time = watch.elapse_ms(); printf("encode to '%s' in %ums: %u\n", fmt_.c_str(), head->prc_time, ptr->size()); }