MCPcopy Create free account
hub / github.com/LBANN/lbann / write_bin_image

Function write_bin_image

tools/compute_mean/uniform_mean.cpp:94–107  ·  view source on GitHub ↗

* Write the data of a cv::Mat object into a binary file, and encode the * specifics of the image into the filename. */

Source from the content-addressed store, hash-verified

92 * specifics of the image into the filename.
93 */
94void 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
110void show_help(std::string cmd) {

Callers 1

mainFunction · 0.85

Calls 2

write_fileFunction · 0.70
to_stringFunction · 0.50

Tested by

no test coverage detected