Skip to content

Commit

Permalink
Made adjustments to the mirror data collection.
Browse files Browse the repository at this point in the history
  • Loading branch information
Glas42 committed Jul 7, 2024
1 parent e47469e commit d3f41c6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
3 changes: 3 additions & 0 deletions blog/V1.11.Minor.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ title: Version 1.11 > Minor
This changelog will contain all changes from 1.11.0 onwards before the next major version.
!!!

==- Version 1.11.54
Made adjustments to the mirror data collection.
[!badge variant="dark" text="Glas42"] [!badge variant="ghost" text="VehicleDetection, DataCollection"]
==- Version 1.11.54
Fixed the data collection code to capture the mirrors correctly.
[!badge variant="dark" text="Glas42"] [!badge variant="ghost" text="VehicleDetection, DataCollection"]
Expand Down
2 changes: 1 addition & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Fixed the data collection code to capture the mirrors correctly.
Made adjustments to the mirror data collection.
13 changes: 8 additions & 5 deletions plugins/DataCollection/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ def CalculateMirrorCoordinates(window):
'''

mirrorDistanceFromLeft = 23
mirrorDistanceFromTop = 90
mirrorWidth = 273
mirrorHeight = 362
mirrorDistanceFromTop = 262
mirrorWidth = 210
mirrorHeight = 190
scale = window[3]/1080

xCoord = window[0] + (mirrorDistanceFromLeft * scale)
Expand Down Expand Up @@ -223,16 +223,19 @@ def plugin(data):
if game_coords != last_game_coords:
mirror_coords = CalculateMirrorCoordinates(game_coords)
last_game_coords = game_coords

try:
data["frameFull"]
except:
return data

fullframe = data["frameFull"]
left_mirror = fullframe.copy()[mirror_coords[0][1]:mirror_coords[0][3], mirror_coords[0][0]:mirror_coords[0][2]]
right_mirror = fullframe.copy()[mirror_coords[1][1]:mirror_coords[1][3], mirror_coords[1][0]:mirror_coords[1][2]]

left_mirror = cv2.cvtColor(left_mirror, cv2.COLOR_BGR2GRAY)
right_mirror = cv2.cvtColor(right_mirror, cv2.COLOR_BGR2GRAY)

threading.Thread(target=SendMirrorImages, args=(left_mirror, right_mirror,), daemon=True).start()
last_capture = time.time()

Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.54
1.11.55

0 comments on commit d3f41c6

Please sign in to comment.