<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Muhammadatif on Medium]]></title>
        <description><![CDATA[Stories by Muhammadatif on Medium]]></description>
        <link>https://medium.com/@muhammadatif1434?source=rss-cfbf60e7d3be------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*AjBjrIY8nIIH944j</url>
            <title>Stories by Muhammadatif on Medium</title>
            <link>https://medium.com/@muhammadatif1434?source=rss-cfbf60e7d3be------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 20:31:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@muhammadatif1434/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Install OpenCV python on raspberry pi model 3,4]]></title>
            <link>https://medium.com/@muhammadatif1434/install-opencv-python-on-raspberry-pi-model-3-4-8e65d0408b0f?source=rss-cfbf60e7d3be------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e65d0408b0f</guid>
            <category><![CDATA[install-opencv-using-pi]]></category>
            <category><![CDATA[install-opencv]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[raspberry-pi-opencv]]></category>
            <dc:creator><![CDATA[Muhammadatif]]></dc:creator>
            <pubDate>Thu, 01 Dec 2022 11:22:37 GMT</pubDate>
            <atom:updated>2022-12-01T11:22:37.416Z</atom:updated>
            <content:encoded><![CDATA[<p>TO INSTALL OPENCV ON RASPBERRY PI YOU NEED FOLLOWING STEPS.</p><p>you can follow steps using pi any model</p><p><strong>Step1: run the follow commands in terminal</strong></p><pre>sudo apt-get update &amp;&amp; sudo apt-get upgrade</pre><h3>Step2: <strong>Increase the swap-size.</strong></h3><p>The swap is a file on disk that serves as ‘overflow’ RAM space. By default, raspberry pi swap size is 100Mb.so you need to change it for faster result.</p><p>To increase the swap size, open swapfile by:</p><pre>sudo nano /etc/dphys-swapfile</pre><p>edit the variable CONF_SWAPSIZE :</p><pre>#CONF_SWAPSIZE=100<br> CONF_SWAPSIZE=2048</pre><p>then press ctrl+x</p><h3>Step3:<strong>Install tools and libraries for openCV</strong></h3><pre>sudo apt-get install build-essential cmake pkg-config<br>sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev<br>sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev<br>sudo apt-get install libxvidcore-dev libx264-dev<br>sudo apt-get install libgtk2.0-dev libgtk-3-dev<br>sudo apt-get install libatlas-base-dev gfortran</pre><h3>Step4:<strong> Install Python3 and pip3</strong></h3><p>If you do not have Python installed, you can install it by the following command:</p><pre>sudo apt-get install python3-dev<br>sudo apt-get install python3-pip</pre><h3>Step5:<strong>Get OpenCV 4.1.0 source code</strong></h3><p>You need to download zip file and unzip as follows:</p><pre>wget -O opencv.zip https://github.com/opencv/opencv/archive/4.1.0.zip<br>wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.1.0.zip<br>unzip opencv.zip<br>unzip opencv_contrib.zip</pre><h3><strong>Step 6: Install NumPy</strong></h3><p>Numpy is used to perform array operations in Python.</p><pre>sudo pip3 install numpy</pre><h3><strong>Step 7: Compile OpenCV</strong></h3><p>For this step you need to create a build folder where all the files are created.</p><pre>cd ~/opencv-4.1.0/<br>mkdir build<br>cd build<br>cmake -D CMAKE_BUILD_TYPE=RELEASE \<br> -D CMAKE_INSTALL_PREFIX=/usr/local \<br> -D INSTALL_PYTHON_EXAMPLES=ON \<br> -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-4.1.0/modules \<br> -D BUILD_EXAMPLES=ON ..</pre><h3><strong>Step 8: Build OpenCV</strong></h3><p>This is the most crucial step and it may even take more than 3 hours. To use all four cores on the Raspberry Pi, type in the following:</p><pre>make -j4</pre><p>Make sure the raspberry pi completes this step without any errors.</p><h3><strong>Step 9: Install OpenCV</strong></h3><p>Now finally, you can install OpenCV.</p><pre>sudo make install &amp;&amp; sudo ldconfig</pre><p>At this moment if everything is done without any errors then you can reboot your system</p><pre>sudo reboot</pre><h3><strong>Step 10: Check for OpenCV</strong></h3><p>Open the python console and import the library.</p><pre>python3<br><br>import cv2<br><br><br></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e65d0408b0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>