MCPcopy Create free account
hub / github.com/abreheret/PixelAnnotationTool / qImage2Mat

Function qImage2Mat

src/utils.cpp:12–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10 return dest;
11}
12cv::Mat qImage2Mat(QImage const& src) {
13 cv::Mat tmp(src.height(), src.width(), CV_8UC3, (uchar*)src.bits(), src.bytesPerLine());
14 cv::Mat result; // deep copy just in case (my lack of knowledge with open cv)
15 cv::cvtColor(tmp, result, cv::COLOR_BGR2RGB);
16 return result;
17}
18
19QImage idToColor(const QImage &image_id, const Id2Labels& id_label) {
20 QImage result(image_id.size(), QImage::Format_RGB888);

Callers 2

watershedFunction · 0.85
exchangeLabelMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected