-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
57 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import os | ||
import time | ||
import hashlib | ||
from pathlib import Path | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import argparse | ||
import sys | ||
|
||
sys.path.append("./") | ||
|
||
import numpy as np | ||
import cv2 | ||
import colorsys | ||
from lib.led_map_2d import LEDMap2D | ||
|
||
|
||
def render_2d_model(led_map): | ||
display = np.ones((640, 640, 3)) * 0.2 | ||
|
||
max_id = max(led_map.get_detections().keys()) | ||
|
||
for led_id in led_map.get_detections(): | ||
col = colorsys.hsv_to_rgb(led_id / max_id, 0.5, 1) | ||
pos = np.array((led_map.get_detection(led_id).u, led_map.get_detection(led_id).v)) | ||
image_point = (pos * 640).astype(int) | ||
cv2.drawMarker(display, image_point, color=col) | ||
cv2.putText( | ||
display, | ||
str(led_id), | ||
image_point, | ||
cv2.FONT_HERSHEY_SIMPLEX, | ||
1, | ||
color=col, | ||
) | ||
|
||
cv2.imshow("MariMapper", display) | ||
cv2.waitKey(0) | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
parser = argparse.ArgumentParser(description="Visualises 2D maps") | ||
|
||
parser.add_argument( | ||
"filename", | ||
type=str, | ||
help="The 2d_map file to visualise", | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
map_data = LEDMap2D(filepath=args.filename) | ||
|
||
render_2d_model(map_data) |
This file was deleted.
Oops, something went wrong.
Submodule MariMapper-Test-Data
updated
8 files
+0 −0 | highbeam/led_map_2d_0.csv | |
+0 −0 | highbeam/led_map_2d_1.csv | |
+0 −0 | highbeam/led_map_2d_2.csv | |
+0 −0 | highbeam/led_map_2d_3.csv | |
+0 −0 | highbeam/led_map_2d_4.csv | |
+0 −0 | highbeam/led_map_2d_5.csv | |
+0 −0 | highbeam/led_map_2d_6.csv | |
+0 −0 | highbeam/led_map_2d_7.csv |