{"id":146115,"date":"2024-03-27T17:08:47","date_gmt":"2024-03-27T17:08:47","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=146115"},"modified":"2024-03-27T17:45:45","modified_gmt":"2024-03-27T17:45:45","slug":"set-up-usb-camera-opencv-raspberry-pi","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/set-up-usb-camera-opencv-raspberry-pi\/","title":{"rendered":"Set Up USB Camera for OpenCV Projects with Raspberry Pi"},"content":{"rendered":"\n<p>This guide shows how to set up a USB camera for your OpenCV projects with Raspberry Pi. OpenCV can be used with the Raspberry Pi camera and with regular USB cameras (also known as webcams). In all our OpenCV projects, we will be using a USB camera.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-Set-Up-USB-Camera-OpenCV.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Raspberry Pi Set Up USB Camera for OpenCV Projects\" class=\"wp-image-147279\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-Set-Up-USB-Camera-OpenCV.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-Set-Up-USB-Camera-OpenCV.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-Set-Up-USB-Camera-OpenCV.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-Set-Up-USB-Camera-OpenCV.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>Before proceeding, make sure you check all the following prerequisites: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You need a <a href=\"https:\/\/makeradvisor.com\/best-raspberry-pi-starter-kits\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Raspberry Pi board<\/a> and a <a href=\"https:\/\/makeradvisor.com\/tools\/usb-camera-logitech\/\" target=\"_blank\" rel=\"noopener\" title=\"\">USB Camera<\/a>.<\/li>\n\n\n\n<li>You should have a <a href=\"https:\/\/randomnerdtutorials.com\/installing-raspbian-lite-enabling-and-connecting-with-ssh\/#install-raspberry-pi-os\">Raspberry Pi running Raspberry Pi OS<\/a> (32-bit or 64-bit).<\/li>\n\n\n\n<li>You should be able to <a href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-remote-desktop-connection-rdp-windows\/\">establish a Remote Desktop Connection with your Raspberry Pi<\/a> &#8211; <a href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-remote-desktop-connection-rdp-mac-os\/\">click here for Mac OS instructions<\/a>.<\/li>\n\n\n\n<li>You should have <a href=\"https:\/\/randomnerdtutorials.com\/install-opencv-raspberry-pi\/\">OpenCV installed on your Raspberry Pi<\/a>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Raspberry Pi with USB Camera<\/h2>\n\n\n\n<p>In our OpenCV projects, we will be using the Raspberry Pi with a regular <a href=\"https:\/\/makeradvisor.com\/tools\/usb-camera-logitech\/\" target=\"_blank\" rel=\"noopener\" title=\"\">USB camera<\/a>, like the one shown in the picture below.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"393\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/USB-Camera-Webcam-Raspberry-Pi-compatible.jpg?resize=750%2C393&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"USB Camera Webcam Raspberry Pi compatible\" class=\"wp-image-146968\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/USB-Camera-Webcam-Raspberry-Pi-compatible.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/USB-Camera-Webcam-Raspberry-Pi-compatible.jpg?resize=300%2C157&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>Here are a few advantages and disadvantages of using a USB camera:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If you already have a USB camera, you can try to use it with your OpenCV projects and you don&#8217;t need to spend any extra money on a <a href=\"https:\/\/makeradvisor.com\/tools\/raspberry-pi-camera-v2-module\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Raspberry Pi-specific camera<\/a>.<\/li>\n\n\n\n<li>If your OpenCV application requires high-quality image\/video, you can buy a USB camera that can offer more quality or other specific features that are required for your project needs (higher image quality, faster frame rates, and more flexibility in terms of mounting and lens options).<\/li>\n\n\n\n<li>However, USB cameras might be a bit more tricky to set up since they can have driver incompatibility issues when used with the Raspberry Pi.<\/li>\n\n\n\n<li>For Raspberry Pi projects using OpenCV, we recommend using a <a href=\"https:\/\/makeradvisor.com\/tools\/usb-camera-logitech\/\" target=\"_blank\" rel=\"noopener\" title=\"\">webcam from a well-known brand like Logitech<\/a> to prevent driver incompatibility issues.<\/li>\n<\/ul>\n\n\n\n<p>In summary, the best choice for you will depend on your project requirements. In this guide, we&#8217;ll show you how to set up OpenCV with a USB camera. <\/p>\n\n\n\n<p>Connect your camera to the Raspberry Pi USB port before proceeding.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-USB-Camera-webcam-connected.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Raspberry Pi USB Camera webcam connected\" class=\"wp-image-146967\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-USB-Camera-webcam-connected.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-USB-Camera-webcam-connected.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">List Your USB Devices<\/h2>\n\n\n\n<p>On a Terminal window on your Raspberry Pi, run the next command to list all video devices:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>v4l2-ctl --list-devices<\/code><\/pre>\n\n\n\n<p>In our case, we are using an <a href=\"https:\/\/makeradvisor.com\/tools\/usb-camera-logitech\/\" target=\"_blank\" rel=\"noopener\" title=\"\">HD Pro Webcam C920 by Logitech<\/a> and we&#8217;ve highlighted it in the screenshot below.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"832\" height=\"640\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-list-all-USB-devices-to-find-id.png?resize=832%2C640&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Raspberry Pi list all USB devices to find id of webcam\" class=\"wp-image-146962\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-list-all-USB-devices-to-find-id.png?w=832&amp;quality=100&amp;strip=all&amp;ssl=1 832w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-list-all-USB-devices-to-find-id.png?resize=300%2C231&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-list-all-USB-devices-to-find-id.png?resize=768%2C591&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 832px) 100vw, 832px\" \/><\/figure><\/div>\n\n\n<p>Even though it lists three video devices, usually the USB camera id is the one at the first line. In our case:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/dev\/video0<\/code><\/pre>\n\n\n\n<p>This means that for our OpenCV projects the camera id is <span class=\"rnthl rntliteral\">0<\/span>, yours might be different.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">OpenCV Test USB Camera &#8211; Python Script<\/h2>\n\n\n\n<p>We&#8217;ve created a simple OpenCV Python script to test if your USB camera is compatible with the Raspberry Pi and can be used in future projects.<\/p>\n\n\n\n<p>Start by creating a new file called <em>opencv_test_usb_camera.py<\/em>, run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano opencv_test_usb_camera.py<\/code><\/pre>\n\n\n\n<p>Copy the code to your newly created file:<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-python\"># Rui Santos &amp; Sara Santos - Random Nerd Tutorials\n# Complete project details at https:\/\/RandomNerdTutorials.com\/set-up-usb-camera-opencv-raspberry-pi\/\n\nimport cv2\n\nvideo_capture = cv2.VideoCapture(0)\n\nwhile True:\n    result, video_frame = video_capture.read()  # read frames from the video\n    if result is False:\n        break  # terminate the loop if the frame is not read successfully\n\n    cv2.imshow(\n        &quot;USB Camera Test&quot;, video_frame\n    )\n\n    if cv2.waitKey(1) &amp; 0xFF == ord(&quot;q&quot;):\n        break\n\nvideo_capture.release()\ncv2.destroyAllWindows()\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/Raspberry-Pi\/OpenCV\/opencv_test_usb_camera.py\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<p><strong>You need to change the id<\/strong> of the <span class=\"rnthl rntliteral\">VideoCapture(id)<\/span> to the one you&#8217;ve found in the previous section. In our case, the camera id is <span class=\"rnthl rntliteral\">0<\/span> and it looks as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>video_capture = cv2.VideoCapture(0)<\/code><\/pre>\n\n\n\n<p>Once you&#8217;ve made all the changes, press <strong>Ctrl<\/strong>+<strong>X<\/strong> to save your file, type <strong>Y<\/strong> and <strong>Enter<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"505\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-OpenCV-script-edit-camera-id.png?resize=739%2C505&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Raspberry Pi OpenCV Python script edit device capture id\" class=\"wp-image-147065\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-OpenCV-script-edit-camera-id.png?w=739&amp;quality=100&amp;strip=all&amp;ssl=1 739w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-OpenCV-script-edit-camera-id.png?resize=300%2C205&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 739px) 100vw, 739px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">How the Script Works<\/h3>\n\n\n\n<p>Let&#8217;s take a quick look at how the code works. Start by importing the OpenCV library.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>import cv2<\/code><\/pre>\n\n\n\n<p>Create a <span class=\"rnthl rntliteral\">cv2.VideoCapture(0)<\/span> object with your USB&#8217;s camera id called <span class=\"rnthl rntliteral\">video_capture<\/span>.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>video_capture = cv2.VideoCapture(0)<\/code><\/pre>\n\n\n\n<p>Create a loop that keeps capturing new frames from the USB camera and displays them in the preview window. You can also stop the script at any time by pressing the <strong>q<\/strong> key on your keyboard.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>while True:\n    result, video_frame = video_capture.read()  # read frames from the video\n    if result is False:\n        break  # terminate the loop if the frame is not read successfully\n\n    cv2.imshow(\n        \"USB Camera Test\", video_frame\n    )\n\n    if cv2.waitKey(1) &amp; 0xFF == ord(\"q\"):\n        break<\/code><\/pre>\n\n\n\n<p>When you stop the Python script it will stop the USB camera and close all the preview windows.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>video_capture.release()\ncv2.destroyAllWindows()<\/code><\/pre>\n\n\n\n<p>With your OpenCV Python environment activated, in our case:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>source projectsenv\/bin\/activate<\/code><\/pre>\n\n\n\n<p>Start your script by running the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python opencv_test_usb_camera.py<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"833\" height=\"202\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-OpenCV-run-opencv-test-usb-camera-python-script.png?resize=833%2C202&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Raspberry Pi OpenCV run test USB camera Python script\" class=\"wp-image-146964\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-OpenCV-run-opencv-test-usb-camera-python-script.png?w=833&amp;quality=100&amp;strip=all&amp;ssl=1 833w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-OpenCV-run-opencv-test-usb-camera-python-script.png?resize=300%2C73&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-OpenCV-run-opencv-test-usb-camera-python-script.png?resize=768%2C186&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 833px) 100vw, 833px\" \/><\/figure><\/div>\n\n\n<p>A preview window opens and the webcam will be streaming in your Raspberry Pi desktop.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"643\" height=\"566\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-OpenCV-test-USB-camera-webcam.png?resize=643%2C566&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Raspberry Pi OpenCV test USB camera webcam\" class=\"wp-image-146966\" style=\"width:643px;height:auto\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-OpenCV-test-USB-camera-webcam.png?w=643&amp;quality=100&amp;strip=all&amp;ssl=1 643w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-OpenCV-test-USB-camera-webcam.png?resize=300%2C264&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 643px) 100vw, 643px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting<\/h2>\n\n\n\n<p>It might be a bit tricky to set up your USB camera, so we&#8217;ve compiled a list with 3 common issues that you might encounter and how to fix them.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Wrong Camera ID<\/h3>\n\n\n\n<p>If your camera fails to start, you might be using the wrong camera id. You can try the second listed <span class=\"rnthl rntliteral\">\/dev\/video<\/span> option, in our case 1.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/dev\/video1<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"832\" height=\"211\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-list-all-USB-devices-try-different-id.png?resize=832%2C211&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Raspberry Pi list all USB devices try different id for webcam\" class=\"wp-image-146973\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-list-all-USB-devices-try-different-id.png?w=832&amp;quality=100&amp;strip=all&amp;ssl=1 832w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-list-all-USB-devices-try-different-id.png?resize=300%2C76&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-list-all-USB-devices-try-different-id.png?resize=768%2C195&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 832px) 100vw, 832px\" \/><\/figure><\/div>\n\n\n<p>Then, pass <span class=\"rnthl rntliteral\">1<\/span> as the camera id in the video capture initialization and run the script again.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>video_capture = cv2.VideoCapture(1)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Low Voltage<\/h3>\n\n\n\n<p>If you see the following message &#8220;Low voltage warning&#8221; at the top right corner of your Raspberry Pi Desktop, you might be using a power adapter that doesn&#8217;t provide enough power for the USB camera to run properly. Try to use a new power adapter that can provide enough power for your Raspberry Pi and camera.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"311\" height=\"179\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-low-voltage-warning-check-power-supply.png?resize=311%2C179&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Raspberry Pi low voltage warning check power supply\" class=\"wp-image-146963\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-low-voltage-warning-check-power-supply.png?w=311&amp;quality=100&amp;strip=all&amp;ssl=1 311w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-low-voltage-warning-check-power-supply.png?resize=300%2C173&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 311px) 100vw, 311px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">USB Camera is not Compatible<\/h3>\n\n\n\n<p>As we&#8217;ve mentioned earlier, some USB cameras might not be compatible with the Raspberry Pi OS due to driver incompatibilities. That&#8217;s why we recommend using a <a href=\"https:\/\/makeradvisor.com\/tools\/usb-camera-logitech\/\" target=\"_blank\" rel=\"noopener\" title=\"\">webcam from a well-known brand like Logitech<\/a> to prevent driver issues.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>In this quick guide, you learned how to set up a USB camera for your OpenCV projects with the Raspberry Pi. This will be useful for future OpenCV projects like face recognition, object detection, gesture detection, and more.<\/p>\n\n\n\n<p>We hope you\u2019ve found this tutorial useful. You can check all our Raspberry Pi projects on the following link:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/projects-raspberry-pi\/\" title=\"\">Free Raspberry Pi Tutorials and Guides<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This guide shows how to set up a USB camera for your OpenCV projects with Raspberry Pi. OpenCV can be used with the Raspberry Pi camera and with regular USB &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Set Up USB Camera for OpenCV Projects with Raspberry Pi\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/set-up-usb-camera-opencv-raspberry-pi\/#more-146115\" aria-label=\"Read more about Set Up USB Camera for OpenCV Projects with Raspberry Pi\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":147279,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[301,264,190,268],"tags":[],"class_list":["post-146115","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-0-raspberrypi","category-project","category-raspberry-pi","category-raspberry-pi-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/02\/Raspberry-Pi-Set-Up-USB-Camera-OpenCV.jpg?fit=1280%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/146115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=146115"}],"version-history":[{"count":17,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/146115\/revisions"}],"predecessor-version":[{"id":151260,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/146115\/revisions\/151260"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/147279"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=146115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=146115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=146115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}