fix webp saving on xenial
This commit is contained in:
parent
0f2a892f43
commit
71af908519
|
@ -68,14 +68,23 @@ void image_save_worker() {
|
||||||
|
|
||||||
while (!stop_workers) {
|
while (!stop_workers) {
|
||||||
if (image_save_queue.try_pop(img)) {
|
if (image_save_queue.try_pop(img)) {
|
||||||
|
#if CV_VERSION_MAJOR >= 3
|
||||||
std::string filename = dataset_folder + "mav0/cam" +
|
std::string filename = dataset_folder + "mav0/cam" +
|
||||||
std::to_string(img->cam_id) + "/data/" +
|
std::to_string(img->cam_id) + "/data/" +
|
||||||
std::to_string(img->timestamp) + ".webp";
|
std::to_string(img->timestamp) + ".webp";
|
||||||
|
|
||||||
std::vector<int> compression_params = {cv::IMWRITE_WEBP_QUALITY,
|
std::vector<int> compression_params = {cv::IMWRITE_WEBP_QUALITY,
|
||||||
webp_quality};
|
webp_quality};
|
||||||
|
|
||||||
cv::imwrite(filename, img->image, compression_params);
|
cv::imwrite(filename, img->image, compression_params);
|
||||||
|
#else
|
||||||
|
std::string filename = dataset_folder + "mav0/cam" +
|
||||||
|
std::to_string(img->cam_id) + "/data/" +
|
||||||
|
std::to_string(img->timestamp) + ".jpg";
|
||||||
|
|
||||||
|
std::vector<int> compression_params = {cv::IMWRITE_JPEG_QUALITY,
|
||||||
|
webp_quality};
|
||||||
|
cv::imwrite(filename, img->image, compression_params);
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue