Skip to content

Commit a71a250

Browse files
author
Gin
committed
fix LZA box cell cursor detection
1 parent 6ed805c commit a71a250

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

SerialPrograms/Scripts/check_detector_regions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
# ==================================================================
3737
# LZA selection arrow
3838
# add_infer_box_to_image(raw_image, 0.654308, 0.481553, 0.295529, 0.312621, image) # restaurant farmer
39-
add_infer_box_to_image(raw_image, 0.543, 0.508, 0.365, 0.253, image) # Jacinthe farmer
39+
# add_infer_box_to_image(raw_image, 0.543, 0.508, 0.365, 0.253, image) # Jacinthe farmer
4040

4141
# ==================================================================
4242
# LZA main menu detector
43-
add_infer_box_to_image(raw_image, 0.87, 0.940, 0.077, 0.044, image) # detect button B
43+
# add_infer_box_to_image(raw_image, 0.87, 0.940, 0.077, 0.044, image) # detect button B
4444

4545

4646
# ==================================================================
@@ -51,12 +51,12 @@
5151
# ==================================================================
5252
# LZA box system cursor detection
5353
# triangle_upper_edge_width = 0.008
54-
# traingle_full_height = 0.03
54+
# traingle_full_height = 0.026
5555
# for row in range(6):
56-
# y = 0.120 if row == 0 else 0.331 + (0.797 - 0.331)/ 4.0 * (row-1)
56+
# y = 0.122 if row == 0 else 0.333 + (0.797 - 0.331)/ 4.0 * (row-1)
5757
# for col in range(6):
5858
# x = 0.058 + col*(0.386 - 0.059)/5.0
59-
# add_infer_box_to_image(raw_image, x, y, 0.020, traingle_full_height, image)
59+
# add_infer_box_to_image(raw_image, x, y, 0.018, traingle_full_height, image)
6060
# Pixel (x,y) = (775, 136), (0.404, 0.126), rgb=[255,188,245,71] hsv=[ 80 181 245]
6161
# Pixel (x,y) = (759, 135), (0.395, 0.125), rgb=[255,182,233,70] hsv=[ 81 178 233]
6262
# Pixel (x,y) = (796, 135), (0.415, 0.125), rgb=[255,181,239,63] hsv=[ 80 188 239]

SerialPrograms/Source/PokemonLZA/Inference/Boxes/PokemonLZA_BoxDetection.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ BoxDetector::BoxDetector(Color color, VideoOverlay* overlay)
7676
for(size_t row = 0; row < 6; row++){
7777
double y = (row == 0 ? 0.122 : 0.333 + (0.797 - 0.331)/ 4.0 * (row-1));
7878
for(size_t col = 0; col < 6; col++){
79-
double x = 0.060 + col * (0.386 - 0.059)/5.0;
80-
m_arrow_boxes.emplace_back(x, y, 0.016, 0.026);
79+
double x = 0.058 + col * (0.386 - 0.059)/5.0;
80+
m_arrow_boxes.emplace_back(x, y, 0.018, 0.026);
8181
}
8282
}
8383
}
@@ -109,6 +109,8 @@ bool BoxDetector::detect_at_cell(const ImageViewRGB32& image_crop){
109109
if (debug_switch){
110110
cout << "detect_at_cell() area threshold " << min_area << " - " << max_area << endl;
111111
cout << "input image size " << image_crop.width() << "x" << image_crop.height() << endl;
112+
cout << "Saving image_crop to input_image_crop.png" << endl;
113+
image_crop.save("input_image_crop.png");
112114
}
113115

114116
bool detected = false;

0 commit comments

Comments
 (0)