Skip to content

Commit

Permalink
Sorted formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMariday committed Oct 8, 2024
1 parent c4a40d6 commit 50322bd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
5 changes: 2 additions & 3 deletions marimapper/led_identifier.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import cv2
from marimapper.led_map_2d import LEDDetection
from marimapper import logging


class LedFinder:
Expand All @@ -25,8 +24,8 @@ def find_led(self, image):
img_height = image.shape[0]
img_width = image.shape[1]

center_u = moments["m10"] / max(moments["m00"],0.00001)
center_v = moments["m01"] / max(moments["m00"],0.00001)
center_u = moments["m10"] / max(moments["m00"], 0.00001)
center_v = moments["m01"] / max(moments["m00"], 0.00001)

center_u = center_u / img_width
v_offset = (img_width - img_height) / 2.0
Expand Down
1 change: 1 addition & 0 deletions marimapper/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import open3d
import math


def fix_normals(led_map):

pcd = open3d.geometry.PointCloud()
Expand Down
3 changes: 2 additions & 1 deletion test/test_led_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ def test_none_found():
led_results = led_finder.find_led(frame)
assert led_results is None


def test_draw_results():

led_finder = LedFinder()
mock_camera = Camera("test/MariMapper-Test-Data/9_point_box/cam_0/capture_%04d.png")
frame = mock_camera.read()
led_results = led_finder.find_led(frame)
led_finder.draw_results(frame, led_results)
led_finder.draw_results(frame, led_results)
1 change: 1 addition & 0 deletions test/test_script_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def test_check_camera_cli():
with pytest.raises(SystemExit):
main() # this should fail if no cameras are available


def test_view_2d_map_cli():
from marimapper.scripts.view_2d_map_cli import main

Expand Down

0 comments on commit 50322bd

Please sign in to comment.