{"id":23925536,"url":"https://github.com/jenslys/opencv-sec-camera","last_synced_at":"2025-08-21T15:07:48.895Z","repository":{"id":246216467,"uuid":"809351765","full_name":"jenslys/opencv-sec-camera","owner":"jenslys","description":"OpenCV (Computer vision) Security Camera System","archived":false,"fork":false,"pushed_at":"2024-06-04T11:12:56.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-24T00:16:57.186Z","etag":null,"topics":["computer-vision","opencv","python","security-camera"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenslys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-06-02T12:58:31.000Z","updated_at":"2024-06-26T12:27:36.000Z","dependencies_parsed_at":"2024-06-26T16:26:41.701Z","dependency_job_id":null,"html_url":"https://github.com/jenslys/opencv-sec-camera","commit_stats":null,"previous_names":["jenslys/opencv-sec-camera"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jenslys/opencv-sec-camera","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenslys%2Fopencv-sec-camera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenslys%2Fopencv-sec-camera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenslys%2Fopencv-sec-camera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenslys%2Fopencv-sec-camera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenslys","download_url":"https://codeload.github.com/jenslys/opencv-sec-camera/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenslys%2Fopencv-sec-camera/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271499840,"owners_count":24770369,"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-21T02:00:08.990Z","response_time":74,"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":["computer-vision","opencv","python","security-camera"],"created_at":"2025-01-05T20:14:40.527Z","updated_at":"2025-08-21T15:07:48.867Z","avatar_url":"https://github.com/jenslys.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Security Camera System\n\nThis project sets up a security camera system using a Raspberry Pi, AWS S3, and OpenCV for body detection. The system captures video when a body is detected, stores the video locally or uploads it to an S3 bucket, sends a notification via Pushover, and deletes the local video file after uploading.\n\n*This was made as part of the course \"SSS3000R-1\" at USN.*\n\n## Features\n- Real-time body detection using OpenCV's pre-trained Haar cascade model.\n- Video recording with H264 encoding.\n- Option to store videos locally or upload them to AWS S3.\n- Automatic deletion of local files after successful upload to S3.\n- Sending notifications with video links using Pushover.\n- Logging with Loguru for debugging and monitoring.\n\n## Prerequisites\n- Raspberry Pi with a camera module.\n- Python 3.6 or later.\n- AWS S3 account and relevant credentials.\n- Haar cascade model file for body detection.\n- Pushover account and API token.\n\n## Demo\nLink to demo: [Security Camera System Demo](https://youtu.be/YV6XeBje7cA)\n\n## Setup\n\n1. **Install Dependencies**\n\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n2. **Environment Variables**\n\n    Create a `.env` file in the project directory and add the following environment variables:\n\n    ```ini\n    R2_ENDPOINT_URL=\u003cyour_s3_endpoint_url\u003e\n    R2_ACCESS_KEY=\u003cyour_aws_access_key\u003e\n    R2_SECRET_ACCESS_KEY=\u003cyour_aws_secret_access_key\u003e\n    R2_PUBLIC_URL=\u003cyour_public_bucket_url\u003e\n    PUSHOVER_APP_TOKEN=\u003cyour_pushover_app_token\u003e\n    PUSHOVER_USER_KEY=\u003cyour_pushover_user_key\u003e\n    ```\n\n3. **Configure AWS S3**\n\n    Ensure you have an S3 bucket named `detection` or modify the code to suit your bucket name.\n\n4. **Run the script**\n\n    ```bash\n    python main.py [--local]\n    ```\n\n    Use the `--local` flag to store videos locally without uploading to S3.\n\n## Usage\n\n- The system initializes the camera and waits for body detection.\n- When a body is detected, video recording starts and continues until no bodies are detected. Additionally, it has a 7-second buffer before stopping the recording in case the body moves out of the frame.\n- If the `--local` flag is not set, recorded videos are uploaded to the specified S3 bucket and deleted locally after a successful upload.\n- After uploading the video to S3, a notification is sent using the Pushover API with a link to the video.\n\n## File Description\n\n- **main.py**: The main script that sets up the camera, detects bodies, and handles video recording, uploading, and notifications.\n- **.env**: Environment file storing AWS credentials, Pushover credentials, and endpoint URLs.\n\n\n## Acknowledgements\n\n- OpenCV for providing the Haar cascade model for body detection.\n- Loguru for advanced logging.\n- AWS for providing scalable storage solutions.\n- Pushover for providing notification services.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenslys%2Fopencv-sec-camera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenslys%2Fopencv-sec-camera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenslys%2Fopencv-sec-camera/lists"}