Skip to content

Commit

Permalink
Merge pull request #76 from S-Canister/master
Browse files Browse the repository at this point in the history
fix:修复兑换站检测
  • Loading branch information
shitoujie committed Mar 25, 2024
2 parents b0f9fdd + fc1733b commit 0e31121
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/rmus_solution/scripts/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import onnxruntime
import numpy as np

onnx_model_path = os.path.join(os.path.dirname(__file__), "model/CNN_v5.onnx")
onnx_model_path = os.path.join(os.path.dirname(__file__), "model/CNN_v6.onnx")
# 创建ONNX Runtime会话
session = onnxruntime.InferenceSession(onnx_model_path)

Expand Down Expand Up @@ -59,9 +59,9 @@ def preprocessing_exchange(frame):
np.logical_and(
np.logical_and(
np.logical_or(hsvImg[:, :, 0] <= 10, hsvImg[:, :, 0] >= 150),
hsvImg[:, :, 1] >= 60,
hsvImg[:, :, 1] >= 30,
),
hsvImg[:, :, 2] >= 75,
hsvImg[:, :, 2] >= 70,
)
* 255
).astype(np.uint8)
Expand Down Expand Up @@ -133,8 +133,8 @@ def square_detection(frame, grayImg, camera_matrix, area_filter_size=30, height_
area = cv2.contourArea(contour)
if area < 100.0:
continue
if area < 200:
approx = cv2.approxPolyDP(contour, 4, True)
if area < 1500:
approx = cv2.approxPolyDP(contour, 8, True)
else:
approx = cv2.approxPolyDP(contour, 8, True)

Expand Down
1 change: 1 addition & 0 deletions src/rmus_solution/scripts/img_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def update_uint32_data(self, blockid):
area_filter_size=1200,
verbose=self.verbose,
height_range=(0.00, 0.06),
exchange_station=True
)

elif blockid == 11:
Expand Down
Binary file removed src/rmus_solution/scripts/model/CNN_v4.onnx
Binary file not shown.
Binary file removed src/rmus_solution/scripts/model/CNN_v5.onnx
Binary file not shown.
Binary file added src/rmus_solution/scripts/model/CNN_v6.onnx
Binary file not shown.

0 comments on commit 0e31121

Please sign in to comment.