{"id":26274451,"url":"https://github.com/exios66/primary_experiment","last_synced_at":"2025-08-09T23:12:14.992Z","repository":{"id":280365897,"uuid":"941746810","full_name":"Exios66/Primary_Experiment","owner":"Exios66","description":"PsychoJS \u0026 PsychoPy Experimentation File","archived":false,"fork":false,"pushed_at":"2025-03-03T21:23:56.000Z","size":387,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T09:19:48.318Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://exios66.github.io/Primary_Experiment/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Exios66.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-03T01:22:12.000Z","updated_at":"2025-03-03T20:39:34.000Z","dependencies_parsed_at":"2025-03-03T02:27:38.724Z","dependency_job_id":"d321778d-ed12-456c-a168-d7f7439a0a0f","html_url":"https://github.com/Exios66/Primary_Experiment","commit_stats":null,"previous_names":["exios66/primary_experiment"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Exios66/Primary_Experiment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Exios66%2FPrimary_Experiment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Exios66%2FPrimary_Experiment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Exios66%2FPrimary_Experiment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Exios66%2FPrimary_Experiment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Exios66","download_url":"https://codeload.github.com/Exios66/Primary_Experiment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Exios66%2FPrimary_Experiment/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269649848,"owners_count":24453541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-14T09:19:50.347Z","updated_at":"2025-08-09T23:12:14.956Z","avatar_url":"https://github.com/Exios66.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Real-Time Eye Tracking Experiment\n\nA comprehensive PsychoPy experiment for real-time eye tracking with webcam-based pupil detection and calibration.\n\n## Overview\n\nThis experiment implements a complete eye tracking solution using standard webcams and computer vision techniques. It includes:\n\n- Real-time pupil detection using OpenCV and Haar cascades\n- Interactive calibration procedure\n- Coordinate transformation from webcam space to screen space\n- Gaze recording with visual feedback\n- Data logging to CSV format\n\n## Requirements\n\n- Python 3.6+\n- OpenCV (`cv2`)\n- NumPy\n- PsychoPy\n- Webcam with clear view of participant's face\n\n## How It Works\n\n1. **Initialization**: The experiment starts by initializing the webcam and loading Haar cascade classifiers for face and eye detection.\n\n2. **Calibration Phase**:\n   - Displays targets at 9 predefined screen positions\n   - Captures multiple pupil position samples at each target\n   - Computes an affine transformation between raw pupil coordinates and screen coordinates\n\n3. **Recording Phase**:\n   - Detects pupil position in real-time\n   - Maps raw coordinates to screen coordinates using the calibration transform\n   - Provides visual feedback with a green dot at the estimated gaze position\n   - Logs timestamped gaze data to a CSV file\n\n## Usage\n\nRun the experiment with:\n\n```bash\npython main_experiment.py\n```\n\n## Notes\n\n- The calibration phase is interactive and requires the participant to fixate on targets at the specified screen positions.\n- The recording phase continues until the participant looks away from the screen or the timer runs out.\n- The CSV file is saved with timestamped gaze data in the format: `timestamp,x,y`\n\n## Future Improvements\n\n- Integrate more advanced eye detection models (e.g., Convolutional Neural Networks)\n- Add support for different screen resolutions and aspect ratios\n- Implement head pose estimation for more robust tracking\n- Include noise reduction and smoothing techniques\n- Add support for different screen resolutions and aspect ratios\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexios66%2Fprimary_experiment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexios66%2Fprimary_experiment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexios66%2Fprimary_experiment/lists"}