Compare commits
2 commits
922f0faaa9
...
ae4f2317f9
Author | SHA1 | Date | |
---|---|---|---|
ae4f2317f9 | |||
f9da770bb1 |
2 changed files with 13 additions and 4 deletions
|
@ -2,6 +2,7 @@ from mower.utils import config
|
|||
from mower.utils.graph import SceneGraphSolver
|
||||
from mower.utils.recognize import Scene
|
||||
|
||||
from .sss_navi import SSSNaviSolver
|
||||
from .utils import is_full
|
||||
|
||||
|
||||
|
@ -45,4 +46,4 @@ class SSSOpeSolver(SceneGraphSolver):
|
|||
return
|
||||
self.tap("sss/ope/use")
|
||||
else:
|
||||
self.scene_graph_step(Scene.SSS_START)
|
||||
SSSNaviSolver().run()
|
||||
|
|
|
@ -243,7 +243,7 @@ def template(
|
|||
cv2.rectangle(
|
||||
disp, max_loc, (max_loc[0] + w, max_loc[1] + h), (0, 255, 0), 3
|
||||
)
|
||||
plt.imshow(disp)
|
||||
plt.imshow(disp, cmap="gray", vmin=0, vmax=255)
|
||||
plt.show()
|
||||
return score, scope
|
||||
except Exception as e:
|
||||
|
@ -312,8 +312,16 @@ def horizontal_stitch(images: list) -> np.ndarray:
|
|||
prev_img = stitched_image
|
||||
curr_img = images[i]
|
||||
# 转为灰度图,用于计算重叠区域
|
||||
gray_prev = cv2.cvtColor(prev_img, cv2.COLOR_RGB2GRAY)
|
||||
gray_curr = cv2.cvtColor(curr_img, cv2.COLOR_RGB2GRAY)
|
||||
gray_prev = (
|
||||
prev_img
|
||||
if len(prev_img.shape) == 2
|
||||
else cv2.cvtColor(prev_img, cv2.COLOR_RGB2GRAY)
|
||||
)
|
||||
gray_curr = (
|
||||
curr_img
|
||||
if len(curr_img.shape) == 2
|
||||
else cv2.cvtColor(curr_img, cv2.COLOR_RGB2GRAY)
|
||||
)
|
||||
# 匹配 prev_img 的右侧区域和 curr_img 的左侧区域
|
||||
match_width = min(800, gray_prev.shape[1]) # 假设重叠区域宽度最大为 800 像素
|
||||
prev_region = gray_prev[:, -match_width:] # 取 prev_img 的右侧区域
|
||||
|
|
Loading…
Add table
Reference in a new issue