MCPcopy Create free account
hub / github.com/WallBreaker2/op / ImageFromMat

Function ImageFromMat

tests/opencv_test.cpp:76–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76opcv::ImageHandle ImageFromMat(const cv::Mat &image) {
77 opcv::ImageHandle handle;
78 if (image.empty()) {
79 return handle;
80 }
81
82 handle.width = image.cols;
83 handle.height = image.rows;
84 handle.channels = image.channels();
85 handle.bytes.assign(image.data, image.data + static_cast<size_t>(image.total() * image.elemSize()));
86 return handle;
87}
88
89long long MeasureMilliseconds(const std::function<bool()> &operation, bool &ok) {
90 const auto start = std::chrono::steady_clock::now();

Callers 1

TESTFunction · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected