Augmented Reality (AR) Technology to Assist Surgeons in Surgical Procedures using
Description
<class 'pandas.core.frame.DataFrame'> RangeIndex: 500 entries, 0 to 499 Data columns (total 10 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Patient_ID 500 non-null int64 1 Age 500 non-null int64 2 Gender 500 non-null object 3 Heart_Rate 500 non-null int64 4 Blood_Pressure_Systolic 500 non-null int64 5 Blood_Pressure_Diastolic 500 non-null int64 6 Blood_Oxygen_Level 500 non-null float64 7 Surgical_Procedure 500 non-null object 8 Tumor_Size_mm 500 non-null float64 9 Success_Rate_% 500 non-null float64 dtypes: float64(3), int64(5), object(2) memory usage: 39.2+ KB None Patient_ID Age Heart_Rate Blood_Pressure_Systolic \ count 500.000000 500.000000 500.000000 500.000000 mean 250.500000 53.112000 80.338000 115.066000 std 144.481833 20.766559 11.700494 14.304085 min 1.000000 18.000000 60.000000 90.000000 25% 125.750000 35.000000 70.000000 103.000000 50% 250.500000 52.500000 81.500000 116.000000 75% 375.250000 71.000000 91.000000 127.000000 max 500.000000 89.000000 99.000000 139.000000 Blood_Pressure_Diastolic Blood_Oxygen_Level Tumor_Size_mm \ count 500.000000 500.000000 500.000000 mean 73.676000 97.446800 28.166980 std 8.657767 1.470283 13.110961 min 60.000000 95.000000 5.020000 25% 66.000000 96.100000 16.995000 50% 73.000000 97.400000 29.095000 75% 81.000000 98.700000 39.312500 max 89.000000 100.000000 49.980000 Success_Rate_% count 500.0000 mean 92.3164 std 3.8851 min 85.0000 25% 89.4000 50% 92.4000 75% 95.6000 max 98.9000 Patient_ID 0 Age 0 Gender 0 Heart_Rate 0 Blood_Pressure_Systolic 0 Blood_Pressure_Diastolic 0 Blood_Oxygen_Level 0 Surgical_Procedure 0 Tumor_Size_mm 0 Success_Rate_% 0 dtype: int64
Files
Steps to reproduce
import cv2 import mediapipe as mp import pandas as pd import random # Create synthetic data for 500 patients patient_data = pd.DataFrame({ 'Patient_ID': range(1, 501), 'Heart Rate (BPM)': [random.randint(60, 100) for _ in range(500)], # Heart Rate between 60-100 BPM 'Blood Pressure (Systolic)': [random.randint(110, 140) for _ in range(500)], # Systolic BP between 110-140 'Blood Pressure (Diastolic)': [random.randint(70, 90) for _ in range(500)], # Diastolic BP between 70-90 'Temperature (C)': [round(random.uniform(36.0, 37.5), 1) for _ in range(500)] # Temperature between 36.0-37.5°C }) # Initialize MediaPipe Hands for hand tracking mp_hands = mp.solutions.hands hands = mp_hands.Hands() # Start video capture cap = cv2.VideoCapture(0) patient_index = 0 # Variable to iterate through synthetic patient data while cap.isOpened(): ret, frame = cap.read() if not ret: break # Convert frame to RGB for MediaPipe processing rgb_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) result = hands.process(rgb_frame) # Access synthetic patient data patient_1 = patient_data.iloc[patient_index] # Get data for current patient # Display heart rate, blood pressure, and temperature on the frame cv2.putText(frame, f"Heart Rate: {patient_1['Heart Rate (BPM)']} BPM", (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2) cv2.putText(frame, f"Blood Pressure: {patient_1['Blood Pressure (Systolic)']}/{patient_1['Blood Pressure (Diastolic)']}", (10, 60), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2) cv2.putText(frame, f"Temperature: {patient_1['Temperature (C)']} °C", (10, 90), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2) # Draw hand landmarks if detected if result.multi_hand_landmarks: for hand_landmarks in result.multi_hand_landmarks: mp.solutions.drawing_utils.draw_landmarks(frame, hand_landmarks, mp_hands.HAND_CONNECTIONS) # Show the frame with the overlaid patient data cv2.imshow("AR for Surgery", frame) # Move to the next patient patient_index += 1 if patient_index >= len(patient_data): patient_index = 0 # Restart when the dataset ends # Exit when 'q' is pressed if cv2.waitKey(1) & 0xFF == ord('q'): break cap.release() cv2.destroyAllWindows()