Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1d1059f
figured out how to potientally get the camera output to be smaller, n…
ma4848 Jun 11, 2026
5155560
WIP crop pub/sub implemented
ma4848 Jun 13, 2026
50da0ed
changed frame height and width
ma4848 Jun 13, 2026
d5a8be2
Merge branch 'main' into shrink-camera-output
ma4848 Jun 13, 2026
525aeb8
test with video widget
ma4848 Jun 13, 2026
a98542c
changed on pilot
ma4848 Jun 13, 2026
9305a4a
wip used img.copy
ma4848 Jun 13, 2026
ac06ff5
WIP scale correctly
ma4848 Jun 13, 2026
6a79a93
WIP fix how it cropped
ma4848 Jun 13, 2026
9626580
WIP try to fix freexzing issues
ma4848 Jun 13, 2026
4564f47
WIP fix latency
ma4848 Jun 13, 2026
2de307e
WIP fix latency again
ma4848 Jun 13, 2026
2b42cf2
WIP switched to cv cropping
ma4848 Jun 13, 2026
a222ddf
WIP added timers to investigate
ma4848 Jun 13, 2026
eb13d82
Found camera settings
cwrubotix-rov Jun 15, 2026
6b410fe
reverting to other way
ma4848 Jun 20, 2026
b7afbb0
fixed dimensions
ma4848 Jun 20, 2026
1589c1c
added it to switchable thing
ma4848 Jun 20, 2026
4e5b2e1
fixed squareness and stereo being cropped
ma4848 Jun 20, 2026
92d9645
fixing errors
cwrubotix-rov Jun 20, 2026
229e7e4
formated code a little
ma4848 Jun 20, 2026
3dc76af
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 20, 2026
81f0c36
formatted code and removed things that didn't work
cwrubotix-rov Jun 21, 2026
72c8b67
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 21, 2026
2bcaf8e
Fixed error
cwrubotix-rov Jun 21, 2026
fa181fc
replaced an accidentally deleted line
cwrubotix-rov Jun 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/surface/gui/gui/operator_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def __init__(self) -> None:
super().__init__('operator_gui_node')

self.setWindowTitle('Operator GUI - CWRUbotix ROV 2025')

# Main tab
main_tab = QWidget()
main_layout = QHBoxLayout()
Expand Down
13 changes: 13 additions & 0 deletions src/surface/gui/gui/pilot_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def make_video_widgets(
frame_width,
frame_height,
CameraManager('manage_flir', CameraManage.Request.FLIR_FRONT),
False,
),
),
'switch_left_stream',
Expand All @@ -181,6 +182,16 @@ def make_video_widgets(
frame_width,
frame_height,
CameraManager('manage_flir', CameraManage.Request.FLIR_DOWN),
False,
),
CameraDescription(
mono_cam_type,
CAM1_TOPIC,
'Cropped Down Camera',
frame_height,
frame_height,
CameraManager('manage_flir', CameraManage.Request.FLIR_DOWN),
True,
),
CameraDescription(
CameraType.DEPTH,
Expand All @@ -189,6 +200,7 @@ def make_video_widgets(
frame_width,
frame_height,
CameraManager('manage_luxonis', CameraManage.Request.LUX_LEFT),
False,
),
CameraDescription(
CameraType.DEPTH,
Expand All @@ -197,6 +209,7 @@ def make_video_widgets(
frame_width,
frame_height,
CameraManager('manage_luxonis', CameraManage.Request.LUX_RIGHT),
False,
),
),
'switch_right_stream',
Expand Down
31 changes: 28 additions & 3 deletions src/surface/gui/gui/widgets/video_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
HEIGHT = 541
# 1 Pixel larger than actual pixel dimensions


COLOR = 3
GREY_SCALE = 2

Expand Down Expand Up @@ -79,6 +78,8 @@ class CameraDescription(NamedTuple):
The height of the Camera Stream, by default HEIGHT constant.
manager: CameraManager | None
Used for toggling cam streams in SwitchableVideoWidgets
is_crop: bool
Used for cropping the down cam and not the other cams

"""

Expand All @@ -88,6 +89,7 @@ class CameraDescription(NamedTuple):
width: int = WIDTH
height: int = HEIGHT
manager: CameraManager | None = None
is_crop: bool = False


class ClickableLabel(QLabel):
Expand Down Expand Up @@ -141,12 +143,35 @@ def __init__(
@pyqtSlot(Image)
def handle_frame(self, frame: Image) -> None:
cv_image = self.cv_bridge.imgmsg_to_cv2(frame, desired_encoding='passthrough')

qt_image: QImage = self.convert_cv_qt(
cv_image, self.camera_description.width, self.camera_description.height
)
# for cropped down cam
if self.camera_description.is_crop:
w = self.camera_description.width
h = self.camera_description.height

zoom = 1.5

crop_h = int(h / zoom)
crop_w = crop_h

x = (w - crop_w) // 2
y = (h - crop_h) // 2 - 60

self.set_pixmap(QPixmap.fromImage(qt_image))
cropped = qt_image.copy(x, y, crop_w, crop_h)

zoomed = cropped.scaled(
w,
h,
Qt.AspectRatioMode.IgnoreAspectRatio,
Qt.TransformationMode.FastTransformation,
)

self.set_pixmap(QPixmap.fromImage(zoomed))

else:
self.set_pixmap(QPixmap.fromImage(qt_image))

def get_pixmap(self) -> QPixmap:
return self.video_frame_label.pixmap()
Expand Down
6 changes: 5 additions & 1 deletion src/surface/luxonis_cam/luxonis_cam/cam_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,11 @@ def deploy_pipeline(self) -> None:
):
input_name = meta.script_topics.script_input_name
node.requestOutput(
(FRAME_WIDTH, FRAME_HEIGHT), type=depthai.ImgFrame.Type.RGB888p
# I think we can just change frame width and frame height
# If this doesn't work, we can try size=(width, height),
# not sure what size we need to make it
(FRAME_WIDTH, FRAME_HEIGHT),
type=depthai.ImgFrame.Type.RGB888p,
).link(script.inputs[input_name])
script.inputs[input_name].setBlocking(False)
script.inputs[input_name].setMaxSize(1)
Expand Down
Loading