{"id":26248377,"url":"https://github.com/nick8592/opencv-framebuffer","last_synced_at":"2026-05-14T12:36:10.743Z","repository":{"id":279187699,"uuid":"937980290","full_name":"nick8592/opencv-framebuffer","owner":"nick8592","description":"This project captures live video from the default camera, stores the last 10 frames in a buffer, calculates and displays the FPS (Frames Per Second), and prints memory addresses of the frames. It uses OpenCV for video capture and processing, providing a simple example of real-time video processing and frame management.","archived":false,"fork":false,"pushed_at":"2025-02-24T09:26:26.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-24T00:26:38.684Z","etag":null,"topics":["cpp","opencv"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"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/nick8592.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":"2025-02-24T08:25:18.000Z","updated_at":"2025-02-24T09:31:34.000Z","dependencies_parsed_at":"2025-02-24T09:41:05.088Z","dependency_job_id":null,"html_url":"https://github.com/nick8592/opencv-framebuffer","commit_stats":null,"previous_names":["nick8592/opencv_framebuffer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nick8592/opencv-framebuffer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nick8592%2Fopencv-framebuffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nick8592%2Fopencv-framebuffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nick8592%2Fopencv-framebuffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nick8592%2Fopencv-framebuffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nick8592","download_url":"https://codeload.github.com/nick8592/opencv-framebuffer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nick8592%2Fopencv-framebuffer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33025334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"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":["cpp","opencv"],"created_at":"2025-03-13T14:18:15.380Z","updated_at":"2026-05-14T12:36:10.094Z","avatar_url":"https://github.com/nick8592.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenCV Frame Buffer Example\n\nThis project demonstrates how to capture video from the default camera, store the last 10 frames in a buffer, calculate and display the FPS (Frames Per Second), and print memory addresses of the frames in the buffer.\n\n## Requirements\n\n- **C++ Compiler** (e.g., GCC)\n- **OpenCV** library (for computer vision tasks)\n\n### Installation of OpenCV\n\nFollow the instructions below to install OpenCV for your platform.\n\n#### On Ubuntu:\n\n```bash\nsudo apt update\nsudo apt install libopencv-dev\n```\n\n### Building the Code\n\nTo build and compile this C++ program, follow the steps below:\n\n1. Ensure OpenCV is installed and configured correctly on your system.\n\n2. Clone this repository.\n\n```bash\ngit clone https://github.com/nick8592/opencv_framebuffer.git\n```\n\n3. Navigate to the directory.\n\n```bash\ncd opencv-framebuffer\n```\n\n4. Build the project:\n\n```bash\ng++ -o capture_and_display capture_and_display.cpp `pkg-config --cflags --libs opencv4`\n```\n\nThis will generate an executable called `capture_and_display` in the `opencv_framebuffer` directory.\n\n### Running the Code\n\nAfter building the program, run it with the following command:\n\n```bash\n./capture_and_display\n```\n\nThe program will open the default camera, display the live camera feed in a window, and print the following in the terminal:\n\n- **FPS (Frames per second)**: The real-time frame rate calculated based on the time between frames.\n- **Memory addresses** of the frames stored in the buffer.\n\nYou can press the **Ctrl+C** key at any time to quit the program.\n\n### Code Explanation\n\n- **OpenCV VideoCapture**: Captures the frames from the default camera (camera index `0`).\n- **cv::Mat**: Used to store the captured frames as matrices.\n- **frameBuffer**: A vector storing the last 10 frames.\n- **FPS Calculation**: Uses `cv::getTickCount()` to calculate the FPS in real-time.\n- **Memory Addresses**: Prints the memory addresses of the stored frames and their raw data.\n\n### Example Output\n\n```bash\nFPS: 30.2563\n\nPrinting memory addresses of frames in the buffer:\nAddress of frame 1 (cv::Mat object): 0x7f8f6a0f23f0\nAddress of raw data (frameBuffer[0].data): 0x7f8f6a0f2400\nAddress of frame 2 (cv::Mat object): 0x7f8f6a0f23b0\nAddress of raw data (frameBuffer[1].data): 0x7f8f6a0f2400\n...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnick8592%2Fopencv-framebuffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnick8592%2Fopencv-framebuffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnick8592%2Fopencv-framebuffer/lists"}