Commit a1cf5e5 1 parent ef0da72 commit a1cf5e5 Copy full SHA for a1cf5e5
File tree 1 file changed +6
-8
lines changed
source/MaaFramework/Vision
1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 9
9
10
10
MAA_VISION_NS_BEGIN
11
11
12
- // | 1 2 3 4 |
13
- // | 5 6 7 8 |
12
+ // | 1 3 5 7 |
13
+ // | 2 4 6 8 |
14
14
template <typename ResultsVec>
15
15
inline static void sort_by_horizontal_ (ResultsVec& results)
16
16
{
17
17
std::ranges::sort (results, [](const auto & lhs, const auto & rhs) -> bool {
18
- // y 差距较小则理解为是同一排的,按x排序
19
- return std::abs (lhs.box .y - rhs.box .y ) < 5 ? lhs.box .x < rhs.box .x : lhs.box .y < rhs.box .y ;
18
+ return lhs.box .x == rhs.box .x ? lhs.box .y < rhs.box .y : lhs.box .x < rhs.box .x ;
20
19
});
21
20
}
22
21
23
- // | 1 3 5 7 |
24
- // | 2 4 6 8 |
22
+ // | 1 2 3 4 |
23
+ // | 5 6 7 8 |
25
24
template <typename ResultsVec>
26
25
inline static void sort_by_vertical_ (ResultsVec& results)
27
26
{
28
27
std::ranges::sort (results, [](const auto & lhs, const auto & rhs) -> bool {
29
- // x 差距较小则理解为是同一排的,按y排序
30
- return std::abs (lhs.box .x - rhs.box .x ) < 5 ? lhs.box .y < rhs.box .y : lhs.box .x < rhs.box .x ;
28
+ return lhs.box .y == rhs.box .y ? lhs.box .x < rhs.box .x : lhs.box .y < rhs.box .y ;
31
29
});
32
30
}
33
31
You can’t perform that action at this time.
0 commit comments