From e2b229f4fb25fffab5a03dc6f9277318d5dc9637 Mon Sep 17 00:00:00 2001 From: Sallee1 <885331635@qq.com> Date: Fri, 2 Jun 2023 09:42:02 +0800 Subject: [PATCH] =?UTF-8?q?test:=E5=AE=8C=E6=88=90=E5=8F=AF=E8=A7=86?= =?UTF-8?q?=E5=8C=96=E8=B0=83=E8=AF=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cvAutoTrack/src/AutoTrack.cpp | 18 ++++++++++++++---- cvAutoTrack/src/version/version_tag.tag | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/cvAutoTrack/src/AutoTrack.cpp b/cvAutoTrack/src/AutoTrack.cpp index 5c258c0d..257ab3d7 100644 --- a/cvAutoTrack/src/AutoTrack.cpp +++ b/cvAutoTrack/src/AutoTrack.cpp @@ -883,13 +883,23 @@ inline void AutoTrack::showMatchResult(float x, float y, int mapId, float angle, //转换到绝对坐标 if (mapId == 0) pos = TianLi::Utils::TransferAxes_inv(pos, user_world_center, user_world_scale); + //获取附近的地图 cv::Mat gi_map = resource->MapTemplate; - cv::Mat subMap = TianLi::Utils::get_some_map(gi_map, pos, 100); - //绘制箭头(没有素材就先用直线代替) - cv::Point2d center(subMap.size[1] / 2,subMap.size[0] / 2); - cv::Point2d direct(0, 0); + cv::Mat subMap = TianLi::Utils::get_some_map(gi_map, pos, 150).clone(); + + cv::Point2i center(subMap.size[1] / 2, subMap.size[0] / 2); + //绘制扇形 + cv::Mat sectorMask = subMap.clone(); + cv::ellipse(sectorMask, center, cv::Size2i(100, 100), -rotate - 135, 0, 90, cv::Scalar(255, 255, 255, 100), -1, cv::LINE_AA); + cv::addWeighted(subMap, 0.75, sectorMask,0.25,0,subMap); + + //绘制玩家方向 + cv::Point2i direct(0, 0); + direct.x = -(30 * sin((angle / 180.0) * _Pi)) + center.x; + direct.y = -(30 * cos((angle / 180.0) * _Pi)) + center.y; + cv::arrowedLine(subMap, center, direct, cv::Scalar(255, 255, 0), 5,cv::LINE_AA,0,0.5); //在图中显示坐标信息 cv::imshow("Visual Debug", subMap); diff --git a/cvAutoTrack/src/version/version_tag.tag b/cvAutoTrack/src/version/version_tag.tag index 8c973aa8..547d9ac7 100644 --- a/cvAutoTrack/src/version/version_tag.tag +++ b/cvAutoTrack/src/version/version_tag.tag @@ -1 +1 @@ -7.8.90 +7.8.103