MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / draw_roi

Method draw_roi

source/MaaFramework/Vision/VisionBase.cpp:41–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41cv::Mat VisionBase::draw_roi(const cv::Mat& base) const
42{
43 cv::Mat image_draw = base.empty() ? image_.clone() : base;
44 const cv::Scalar color(0, 255, 0);
45
46 cv::putText(image_draw, name_, cv::Point(5, image_.rows - 5), cv::FONT_HERSHEY_SIMPLEX, 1, color, 2);
47
48 cv::rectangle(image_draw, roi_, color, 1);
49 std::string flag = std::format("ROI: [{}, {}, {}, {}]", roi_.x, roi_.y, roi_.width, roi_.height);
50 cv::putText(image_draw, flag, cv::Point(roi_.x, roi_.y - 5), cv::FONT_HERSHEY_PLAIN, 1.2, color, 1);
51
52 return image_draw;
53}
54
55void VisionBase::handle_draw(const cv::Mat& draw) const
56{

Callers

nothing calls this directly

Calls 3

PointClass · 0.85
emptyMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected