# Project export: Remote Surgical

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: TreeHacks 2026
- Tagline: innovating for the future of remote surgery & medical procedures
- Devpost: https://devpost.com/software/remote-surgical
- GitHub: https://github.com/zlj8800/remote-surgical
- Demo: https://www.canva.com/design/DAHBZzkRtH4/0UrUlkYT-f6FWRrnBA8OOg/view?utm_content=DAHBZzkRtH4&utm_campaign=designshare&utm_medium=link2&utm_source=uniquelinks&utlId=ha87ce9968d
- Video: https://www.youtube.com/embed/0R2GtTaas3s?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 1 GitHub contributor(s) — zlj8800 (3 commits)

## Devpost submission (written by the team)

### Overview

Presentation here: https://www.canva.com/design/DAHBZzkRtH4/0UrUlkYT-f6FWRrnBA8OOg/view?utm_content=DAHBZzkRtH4&utm_campaign=designshare&utm_medium=link2&utm_source=uniquelinks&utlId=ha87ce9968d

### Inspiration

How can we control hardware remotely? Routine medical procedures and surgeries are often inaccessible in third world countries and rural communities: this is our attempt at tinkering with robotics to build an accessible remotely controlled hand/arm prototype

### What it does

This robotic hand links to OpenCV, a computer vision library to sync with your hand movements from a camera and corresponds the action seen on camera to the hardware. This technology applies to the future of remote robotics. Grace's model is engineering the detailed articulating joints that can be microcontrolled in future models. How it was built The arm model was 3D printed by Bambu printers using white PLA, servo motors were attached and ribbon was used for the joints along with the twill string. Hot glue to secure, Arduino UNO, OpenCV to run the software side and camera from a laptop. Grace's model prototype: Duron laser cut parts for the body, wooden 3D printed spaces and attached with plastic lock nuts, and bolts, knuckles are jointed with sectioned/layered duron plates, and rubber bands from her sister's drawer! Challenges The hardware and material components I had planned to build this with were all unavailable. I had to pivot in every aspect the day of including incorporating a different microcontroller, materials, and control mechanisms for the tendons (flexing of the fingers) and limitations on range of motion and capability of the movement. I also am doing this for the first time, coming from a Health Sciences background and being a beginner at tinkering rather than having formal engineering background/education/training. Grace struggled a lot designing each component because it was either overextended/underextended and it was challenging envisioning the final prototype of what it looks like because each joint, knuckle had to articulate together as a system. There were multiple iterations!!! Accomplishments that I'm proud of Being able to adapt on the fly when everything went off the plan but persevering to still get the base mechanism to work. Being able to work software CV computer vision and linking that to control the hardware Grace: I'm proud of somehow the arm is WORKING! Being able to do hardware when I haven't done it in a while and get it working ! What I learned how to run python script, engineering the hand using different materials and adapting to alternate materials and 3D printing the hand, working with scripts for servos. Learned that the anatomy of the human body is amazing and more about mechatronics engineering. Grace learned to use OpenCV, joints and ligaments are challenging to work with.

### What's next

rewiring the mechanism to control 5 individual joints separately, and potential individual phalanges control with multiple servos, potential elbow joint rotation integration. more advanced syncing of camera actions to hardware output potential use of overlay/frontend Shoutout to: Stanford PRL CAs: Ahmed, Finnley, Zach, Rima, MJ Isaac Yu Jag Jerry Thank you for the support in troubleshooting. Credits and inspiration: https://blog.arduino.cc/2014/07/17/a-low-cost-robotic-hand-tutorial-mirroring-your-own-fingers/ https://www.computersciencecafe.com/arduino-robotic-hand.html STL (Hand CAD Shell file): https://www.thingiverse.com/thing:4807141 Assembly: https://www.youtube.com/watch?v=zDDg-aSAReo&t=878s https://www.instructables.com/OPERATION-MIMIC-Bionic-Hand/

## README (from the GitHub repository)

No README available.

## Detected evidence (automated analysis)

Indexed codebase: 1 recognized source files, 2 KB.
- Python (language) — detected in the code
- C++ (language) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (4 of 4)

```
.gitattributes
arduinocoderemotesurgical
hand_marker.task
pythoncv2.py
```

### Dependencies

No dependency index available.

### Recent commits (newest first)

- arduino code
- hardware code opencv
- Initial commit

## Key source files (fetched from GitHub, selected and truncated for size)

### pythoncv2.py

```python
import cv2
import mediapipe as mp
from mediapipe.tasks import python
from mediapipe.tasks.python import vision
import serial
import time

# ===== SERIAL =====
arduino = serial.Serial('/dev/cu.usbserial-1110', 9600)
time.sleep(2)

# ===== LOAD MODEL =====
base_options = python.BaseOptions(model_asset_path="hand_landmarker.task")
options = vision.HandLandmarkerOptions(
    base_options=base_options,
    num_hands=1
)

detector = vision.HandLandmarker.create_from_options(options)

cap = cv2.VideoCapture(0, cv2.CAP_AVFOUNDATION)

last_state = "OPEN"

while True:
    ret, frame = cap.read()
    if not ret:
        break

    frame = cv2.flip(frame, 1)
    rgb_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)

    mp_image = mp.Image(image_format=mp.ImageFormat.SRGB, data=rgb_frame)
    result = detector.detect(mp_image)

    current_state = "OPEN"

    if result.hand_landmarks:
        landmarks = result.hand_landmarks[0]

        tips = [8, 12, 16, 20]
        knuckles = [5, 9, 13, 17]

        fingers_curled = 0

        for tip, knuckle in zip(tips, knuckles):
            if landmarks[tip].y > landmarks[knuckle].y:
                fingers_curled += 1

        if fingers_curled >= 3:
            current_state = "FIST"

        # Draw landmarks
        for lm in landmarks:
            h, w, _ = frame.shape
            cx, cy = int(lm.x * w), int(lm.y * h)
            cv2.circle(frame, (cx, cy), 5, (0, 255, 0), -1)

    # Send only on state change
    if current_state != last_state:
        if current_state == "FIST":
            arduino.write(b'C')
        else:
            arduino.write(b'O')
        last_state = current_state

    # Display text
    if current_state == "FIST":
        text = "FIST DETECTED"
        color = (0, 0, 255)
    else:
        text = "HAND OPEN"
        color = (0, 255, 0)

    cv2.putText(frame, text, (30, 50),
                cv2.FONT_HERSHEY_SIMPLEX,
                1, color, 3)

    cv2.imshow("Robotic Hand Control", frame)

    if cv2.waitKey(1) & 0xFF == 27:
        break

cap.release()
cv2.destroyAllWindows()

```