* Write the data of a cv::Mat object into a binary file, and encode the * specifics of the image into the filename. */
| 92 | * specifics of the image into the filename. |
| 93 | */ |
| 94 | void write_bin_image(const int height, const int width, |
| 95 | const int cv_type, const cv::Scalar pixel) { |
| 96 | cv::Mat mean_image(height, width, cv_type, pixel); |
| 97 | std::string image_name = "mean_uniform-" |
| 98 | + std::to_string(mean_image.cols) + 'x' |
| 99 | + std::to_string(mean_image.rows) + 'x' |
| 100 | + std::to_string(mean_image.channels()) + '-' |
| 101 | + std::to_string(mean_image.depth()) + ".bin"; |
| 102 | |
| 103 | const size_t sz = mean_image.rows * mean_image.cols |
| 104 | * mean_image.channels() * CV_ELEM_SIZE(mean_image.depth()); |
| 105 | |
| 106 | tools_compute_mean::write_file(image_name, mean_image.data, sz); |
| 107 | } |
| 108 | |
| 109 | |
| 110 | void show_help(std::string cmd) { |
no test coverage detected