L-3 Install OpenCV 4.5 on NVIDIA Jetson Nano | Set Up a Camera for NVIDIA Jetson Nano
ฝัง
- เผยแพร่เมื่อ 27 ก.ย. 2024
- Learn how to set up Python Environment on Jetson Nano.
Learn How to Set Up a Camera for NVIDIA Jetson Nano.
Learn How to Install OpenCV 4.5 on NVIDIA Jetson Nano.
************************************************************************************
For queries: You can comment in comment section or you can mail me at aarohisingla1987@gmail.com
************************************************************************************
LIST OF COMMANDS PINNED IN COMMENT SECTION. Please Check there.
Join this channel to get access to perks:
/ @codewithaarohi
List of commands:
sudo apt-get install python3-pip
pip3 install virtualenv
python3 -m virtualenv -p python3 env --system-site-packages
source env/bin/activate
python -c 'import cv2; print(cv2.__version__)'
Create SwapFile:
sudo fallocate -l 4G /var/swapfile
sudo chmod 600 /var/swapfile
sudo mkswap /var/swapfile
sudo swapon /var/swapfile
sudo bash -c 'echo "/var/swapfile swap swap defaults 0 0" >> /etc/fstab’
Reboot your PC: sudo reboot
After rebooting check swap space by using this command: free -h
Install these Dependencies before installing OpenCV:
sudo sh -c "echo '/usr/local/cuda/lib64' >> /etc/ld.so.conf.d/nvidia-tegra.conf“
sudo ldconfig
sudo apt-get install build-essential cmake git unzip pkg-config
sudo apt-get install libjpeg-dev libpng-dev libtiff-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install libgtk2.0-dev libcanberra-gtk*
sudo apt-get install python3-dev python3-numpy python3-pip
sudo apt-get install libxvidcore-dev libx264-dev libgtk-3-dev
sudo apt-get install libtbb2 libtbb-dev libdc1394-22-dev
sudo apt-get install libv4l-dev v4l-utils
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
sudo apt-get install libavresample-dev libvorbis-dev libxine2-dev
sudo apt-get install libfaac-dev libmp3lame-dev libtheora-dev
sudo apt-get install libopencore-amrnb-dev libopencore-amrwb-dev
sudo apt-get install libopenblas-dev libatlas-base-dev libblas-dev
sudo apt-get install liblapack-dev libeigen3-dev gfortran
sudo apt-get install libhdf5-dev protobuf-compiler
sudo apt-get install libprotobuf-dev libgoogle-glog-dev libgflags-dev
Download OpenCV:
cd ~
wget -O opencv.zip github.com/opencv/opencv/archive/4.5.1.zip
wget -O opencv_contrib.zip github.com/opencv/opencv_contrib/archive/4.5.1.zip
unzip opencv.zip
unzip opencv_contrib.zip
Now rename the directories. Type each command below, one after the other.
mv opencv-4.5.1 opencv
mv opencv_contrib-4.5.1 opencv_contrib
rm opencv.zip
rm opencv_contrib.zip
Lets build OpenCV now:
cd ~/opencv
mkdir build
cd build
copy and paste this entire block of commands below into your terminal.
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules -D EIGEN_INCLUDE_PATH=/usr/include/eigen3 -D WITH_OPENCL=OFF -D WITH_CUDA=ON -D CUDA_ARCH_BIN=5.3 -D CUDA_ARCH_PTX="" -D WITH_CUDNN=ON -D WITH_CUBLAS=ON -D ENABLE_FAST_MATH=ON -D CUDA_FAST_MATH=ON -D OPENCV_DNN_CUDA=ON -D ENABLE_NEON=ON -D WITH_QT=OFF -D WITH_OPENMP=ON -D WITH_OPENGL=ON -D BUILD_TIFF=ON -D WITH_FFMPEG=ON -D WITH_GSTREAMER=ON -D WITH_TBB=ON -D BUILD_TBB=ON -D BUILD_TESTS=OFF -D WITH_EIGEN=ON -D WITH_V4L=ON -D WITH_LIBV4L=ON -D OPENCV_ENABLE_NONFREE=ON -D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_opencv_python3=TRUE -D OPENCV_GENERATE_PKGCONFIG=ON -D BUILD_EXAMPLES=OFF ..
Build OpenCV. This command below will take a long time (around 2 hours), make -j4 # (make then space single dash and then j4)
Finish the install:
cd ~
sudo rm -r /usr/include/opencv4/opencv2
cd ~/opencv/build
sudo make install
sudo ldconfig
make clean
sudo apt-get update
Verify OpenCV Installation
#open python3 shell
python3
import cv2
cv2.__version__
Install jtop, a system monitoring software for Jetson Nano.
cd ~
sudo -H pip3 install -U jetson-stats
sudo reboot
jtop
Test Your Camera on Jetson Nano:
Turn on your Jetson Nano.
Open a new terminal window, and type:
ls /dev/video0 #csi camera
ls /dev/video* # show you a list of cameras
Take a Photo:
nvgstcapture-1.0 --orientation=2 # for testing CSI camera
# V4L2 USB camera
nvgstcapture-1.0 --camsrc=0 --cap-dev-node=1
Hi Aarohi. When i do the "make -j4" process it doesn´t finish, stops at 100%. Already triede 3 times, the same result. Can you help me, please?
@@CANDAL1980 I am also having the same issues. I can't seem to have cv2 installed.
Problem : some commands leave it hanging with >
Error: different font or character style of quote ( " ) or apostrophe ( ' ) at the end of some lines
Solution: Retype the last apostrophe or quote to match the first.
Create SwapFile >> sudo bash -c 'echo "/var/swapfile swap swap defaults 0 0" >> /etc/fstab’
#> sudo sh -c "echo '/usr/local/cuda/lib64' >> /etc/ld.so.conf.d/nvidia-tegra.conf“
#
@@CANDAL1980 same issue did you solved? if you solved pls guide me.
@@Ezlvl1022 Actually, If you kill other task that's unnecessary might help. I tried that it worked
Hello, I am a college student studying Jetson Nano in Korea. I had been struggling for a week because I couldn't install opencv on Jetson Nano, but after watching the video, I succeeded at once. Thank you so much!!!!!!!!!!!!!!!
Glad to hear that my video is helpful 🙂
선생님 저도 도와주세요 😢
Marry me, you saved me years of pain trying to download opencv correctly, fr fr all of the old tutorials were so un-updated that most of the lib files wouldn't install correctly, so opencv would never be fully operational. THANK YOU!!!!
I'm thrilled to hear that my tutorial on installing OpenCV was so helpful to you! It's always great to know that the content is not only useful but also a time-saver. It's true that keeping up with the latest changes and updates can be challenging, so I try my best to provide the most current and efficient methods. If you have any more questions or need further assistance, feel free to ask.
Please tell me how to connect a Q10F User Manual camera
On Jetson nano because I tried and did not succeed, knowing that I used a video capture cable and it shows me /dev/video0 after executing ls /dev/video* knowing that my camera is video capture USB
I never used it. So, don't know.
Thanks you very much for your contribution. We are very happyt because the program aree running on our jetson kit.
Great to hear!
In a video you explained how to update to Python 3.8, I understand that yolov8 can only run on that version of python, is it possible to install opencv as samples in this video to version of python 3.8 in a virtual environment?
Thank you! I know that video was a lot of work. I appreciate it!
Glad it was helpful!
Thank you my lady !! You did a great job!
Glad it was helpful!
hi mam ,
I installed python 3.8 and made it default for python
in python3.6 cv2 module in present of version 4.1.1
when i created virtual environment of python3.8 with --system-packages like as you are mention their cv2 module is not found
please guide me where i am doing wrong
Mam please make video on how to implement yolov5 in jetson nano
Sure, Soon :)
Very Good video, mam, please bring more videos on Jetson nano
Yes, I will. Working on a Jetson. nano playlist
Is this video in graphical mode or headless mode?
Hi Aarohi. I followed your steps, however, I still get CV2 version 4.1.1 at the end. After increasing memory to 4G with swap and rebooting do we install the long list of dependancies in default folder that appears when I open again the terminal, namely user@user-desktop, or do we have to activate the environment again before installing the dependancies? Thank you, I appreciate your help.
You need to activate the environment first. And then install the dependencies.
created a swap file it shows 5.9g
after reboot it shows 1.9g why it show like this why it couldn't save
Lovely video content
Glad you enjoyed it
Hi ma'am! We have encountered error on the code ls/dev/video0, it says no such file or directory. How can we possibly resolve this problem? Thank you.
the system is unable to find the device file for video0 in the /dev directory. This error commonly occurs when the video device is not properly recognized or not connected to the system. Make sure the video device (e.g., webcam) is properly connected. Try running the command with elevated privileges using sudo or ensure that the user has the required permissions to access the device.
Hello ma'am, when i create the swap file
After the © sudo bash -c 'echo "/var/swapfile swap swap defaults 0 0" >> /etc/fstab'
Outputs ">" what to do after this
we have the same issue, plz assist
OK I got it to work... Hope this helps you too.
The font of the final quote or apostrophe does not match the first. Retype the final character to standard ( " or ' )
It assumes the statement is not closed because they don't match.
The lazy copy paste also copies typos.... yes I had this problem too.
I had the same error then i changed ' with " then it worked
I have a problem "Encoder null, cannot set bitrate!". I'am using IXM219 camera so how can i fix it? Please help me
I'm using the same camera but I couldn't get it to work.
Ma'am can't I use jupyter notebook directly here in jetson?
You need to install the jupyter notebook and then you can use it.
after i completed all the steps when i run jtop open cv : 4.5 with cuda : No. and also my cuda version is 11.4.315. what can i do for this?
same issue....
Hi Arohee, why do you have a prefence for virtual environments ? If I want to make an application that runs on a device from startup, surely the use of virtual environments makes things more difficult ? Although I have read that there is a route to deployment even when you use virtual environments, even though I haven't used them. Thanks for your videos, I found them to be a useful starting point.
Glad my video is helpful. Virtual environments are better choice when you are running multiple different kind of applications on same machine. But if you are using jetson nano for only 1 application then there is no need of virtual environment.
Hi Ma'am!
I have been following this video series of yours step by step from the start. You are very good.
But when I execute the command make -j4 and it reaches near to completion, I start facing memory issues. I'm using a 64GB SD card. What should I do?
Although you have a 64GB SD card, it doesn't necessarily mean that you have enough RAM. The SD card is used for storage, not for running processes. If you have too many processes running simultaneously, it can cause memory issues. Check your RAM usage using the command "free -h" and see if you have enough free memory.
Can you do a video on tensorflow installation in jetson nano.. plssssss plssss plsssss
yes yes.... tensorflow instalation with cuda support
Hi Aarohi, thank you for making this video! It has been very helpful. I have run into an issue where it seems following your steps I only have OpenCV with CUDA for Python 2.x and not Python 3.x. When I try run in a Python2 shell I am able to import CV2 and find CUDA devices however Python3 cannot import CV2. When I run jtop I do find OpenCV is 4.5.1 with CUDA: YES. Is there a different way I can get it to work for Python3? I am assuming I need Python 3.x to run YoloV7 later and this cannot all be done with Python 2.x. I have followed all your steps exactly from this video although I have done some work on my Jetson before - this is not a fresh Jetpack installation (although I am using Jetpack 4.6). Thank you!
I understand that you have followed the steps in my video tutorial for installing OpenCV with CUDA, but you are unable to import CV2 in Python 3.x. I apologize for the inconvenience caused and will try my best to help you resolve this issue.One possible reason for this issue could be that the OpenCV package was installed for Python 2.x and not Python 3.x. To resolve this, you can try reinstalling OpenCV with CUDA specifically for Python 3.x by using the following command: sudo apt-get install python3-opencv
This should install OpenCV with CUDA for Python 3.x, and you should be able to import CV2 in Python 3.x.If the issue still persists, you may want to check if the OpenCV package is installed in the correct Python 3.x environment. You can do this by running the following command in your Python 3.x environment: python3 -c "import cv2; print(cv2.__version__)"
@@CodeWithAarohi This will sound odd... but you need to uninstall opencv for python3: sudo apt-get remove python3-opencv ... and then it will use vercion 4.5.1 ... really! it works
@@jorgealfaro7576 The problem is not solved for me.
Hi. My terminal stopped for 1 hour on [100%] Built traget opencv_perf_superres
Do you figure out the reason?(It took about 3 hour to get 0% to 100%)
Yes, It is a time consuming process. Also building OpenCV can consume a significant amount of system resources, including CPU, memory, and disk I/O. If your system is resource-constrained, it can slow down the build process or cause it to hang. You can check your system's resource utilization using tools like top or htop to see if any resources are maxed out.
@@CodeWithAarohi I waited about 30 minutes more and solved
@@112fkdldjs Great 👍
Good Evening ma'am, when I execute the make -j4 command, it runs well but it stops at the 100% & can't go to the further process. What should I do ma'am
When you execute the make -j4 command, it means you are running the make command with four threads to speed up the build process. However, the build process stopping at 100% can indicate that there might be an issue in your build process.
Check system resources: Make sure that your system has enough resources (such as CPU and RAM) to complete the build process. Check the resource utilization using the "top" command or other similar tools to see if there is any resource bottleneck.
Try running the make command with a single thread: Sometimes, running the make command with multiple threads can cause issues. Try running the make command with a single thread to see if the build process completes successfully.
Clean the build directory: Try cleaning the build directory by running the "make clean" command and then re-building the project.
Try running the make command with debug flags: If none of the above steps work, try running the make command with debug flags enabled (e.g., make -j4 VERBOSE=1) to get more detailed output on what's going wrong.
@@CodeWithAarohi Thank You Ma'am. Eventually, I got the OpenCV: 4.5.1 - with CUDA: YES
@@mctmani2261 how you resolved this issue? I have the same issue occurred.
Also the low memory warning occurred.
here typo in your command wrong symbol at the end:
sudo bash -c 'echo "/var/swapfile swap swap defaults 0 0" >> /etc/fstab’
correct way:
sudo bash -c 'echo "/var/swapfile swap swap defaults 0 0" >> /etc/fstab'
this should be at the end ( ' ) not this ( ’ )
same with this command :
sudo sh -c "echo '/usr/local/cuda/lib64' >> /etc/ld.so.conf.d/nvidia-tegra.conf“
you have this a the end ( “ ) has to be ( " )
Please edit your comment with command and stop confusing people !
Thankyou, I appreciate this. I will correct the command.
Oh, I remember now. I don't know what is the reason but I was not able to correct it. Whenever I put double quotes here, it shows like the way you were seeing it.
wo@@CodeWithAarohi I'm a little confused. How should these to lines be written?
thank you very much!!!
Welcome!
Thank you for a great video and for the list of commands. It is working well on my Jetson Nano. Few questions: 1) Why do we have to install dependencies for the OpenCV? Isn't that done automatically when installing the OpenCV? 2) If we do have to install, can't we use a script with the list of all these commands, so no need to run them one by one?
Yes we can do that
Can u please explain how to make script which can install all dependencies collectively@@CodeWithAarohi
This tutorial was very helpful and I was able to compile opencv. However the problem I am facing is that opencv is installed for python2 and not for python3. Any method to solve this?
bro did you solved the problem ?
@@aymeneboucha4974 yea. Generating the build config again fixed it.
@@arhamimran4999 how did you generated it ?
@@aymeneboucha4974 The cmake command generates it.
1 swapping to 4 gb
free -m shows how much memory and swap is available
sudo systemctl disable nvzramconfig
sudo fallocate -l 4G /mnt/4GB.swap
sudo chmod 600 /mnt/4GB.swap
sudo mkswap /mnt/4GB.swap
# it makes the ram to appear 4gb
Sudo vi /etc/fstab
#this command will open a new folder like thing inside the control pannel window
#next we have to add the following line of code
/mnt/4GB.swap swap swap defaults 0 0
#now close this window
:wq
Hello!
Would you mind recommending a good camera for the Jetson nano please?
To give you context, I am working on potato analysis where there are hundreds of potatoes coming out of conveyer belt. I will be performing OpenCV and ML stuff
One option to consider is the Raspberry Pi High Quality Camera, which is compatible with the Jetson Nano and provides 12-megapixel resolution with excellent image quality. Another option is the Sony IMX219 camera, which is commonly used with the Jetson Nano and provides 8-megapixel resolution with good image quality.
@@CodeWithAarohi Noted. Thank you
how to reset the system mam please tell me, i want to reset everything and i wanna follow your videos...please help me out..
You want to perform a factory reset ( reinstall the operating system)?
@@CodeWithAarohi can u help me how to do it mam please.... I'm going to do my project on object detection -self driving vehicle
Hi Aarohi. When i do the "make -j4" process it does not finish,. and don´t complete the task. it is memory problem?
It is possible that the "make -j4" process is not completing due to a memory problem. When you run the "make" command with the "-j" option, it specifies the number of jobs that can be run simultaneously. In this case, the "-j4" option is telling the "make" command to run up to 4 jobs at the same time.
If your system does not have enough memory to handle 4 jobs simultaneously, it could be causing the process to slow down or even stop altogether. To check if this is the case, you can monitor the system resources (such as memory and CPU usage) while the "make" process is running.
If you find that the memory usage is high, you may need to free up some memory by closing other applications or processes running on your system. Alternatively, you could try reducing the number of jobs to a lower value (e.g., "-j2") to see if that helps the process complete successfully.
Another possibility is that there is an issue with the build process itself. In this case, you may want to check the build log for any error messages or warnings that could indicate a problem with the code or the build environment.
My jtop says openCV: 4.5.1 with CUDA: YES instead of "compiled CUDA"
is that the same?
It indicates that OpenCV has been successfully compiled with CUDA support. This means that OpenCV can utilize CUDA-enabled GPUs.
after reboot swap memory is still 1.9G, what shoul i do?
You have to activate the environment you created before after reboot
Hello, I have some problem. On my jetson, it doesn't find packages (like python3-pip for exemple). Do you know why ?
Sometimes, the package lists might be outdated. Try updating them with:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python3-pip
I tried, it doesn't work too. when i write "sudo apt-get update", the jetson write that updates from such a repository cannot be done securely, and are therefore disabled by default. Do you know what can i do ? Thanks @@CodeWithAarohi
Finally it works, i just needed to have a private WiFi, because with a public WiFi, the update doesn't work. Thanks
madam, i checked again, after restarting the swap memory is still 1.9G, what should i do?
Make sure that swap memory is actually enabled on your Jetson Nano. You can check this by running the following command in a terminal: cat /proc/swaps
This should output a list of all the swap partitions or swap files currently in use. If there are no entries in the output, it means that swap is not currently enabled.
2- Ensure that there is enough free space on your Jetson Nano to create a swap file. You can check the amount of available space on your system by running the following command:
df -h
Mam the list of comamnds you shown on white background image before install open cv . Commands need to paste inside config file right
Execute the commands on terminal
@@CodeWithAarohi it's getting cmake error after that big command mam
@@CodeWithAarohi i have jetpack 4.3 ,in my SDK manager official opencv 4 + cuda + deep stream it's showing.can i install like that ,will it work with imx camera's cause it's 4.3 pack so asked
Hello, on the file "info" of Jtop, i don't have the 4.5.1 version of OpenCV but the 4.1.1, and it's written "No" instead of "yes". Can you help me ? Maybe there is a step that i didn't do well, but which one ? Thanks
I get the same issue, any idea on this ?
issue is resolved after done step sudo make install
it say `[100%] Built target opencv_perf_superres` and waiting for 1 hour / what should I do please ansver maam _
It is not normal for the OpenCV installation process to take one hour to build the opencv_perf_superres target. While building OpenCV can take some time, especially on resource-constrained devices like the Jetson Nano, it should not take that long.
There are a few things you can try to speed up the build process:
Increase the swap space on your Jetson Nano: If your Jetson Nano is running out of memory during the build process, increasing the swap space can help. You can follow the instructions in this NVIDIA forum post to increase the swap space: forums.developer.nvidia.com/t/how-to-increase-swap-partition-on-jetson-nano/77429
Limit the number of CPU cores used during the build: You can limit the number of CPU cores used during the build process by adding the -j flag followed by the number of cores to use. For example, -j2 will limit the build process to use only two CPU cores. This can be useful if the Jetson Nano is running out of resources during the build process.
Hello Mam, im getting an error cmake command the error is no cmake script
provided ,cmake error: problem processing arguments. aborting
what to do?
please help..
did you fix the problem and how ?
My opencv version changed from 4.1.1(cuda not comaptible) to 4.1.2(cuda comaptible). But why not to 4.5.1? I followed whole process
Try to download again. Maybe you have downloaded the wrong versions by mistake:
wget -O opencv.zip github.com/opencv/opencv/archive/4.5.1.zip
wget -O opencv_contrib.zip github.com/opencv/opencv_contrib/archive/4.5.1.zip
@@CodeWithAarohi okay I will try again.
Dear Aarohi!! I tried to follow your lecture 5 of this series. There when i cloned the repo of yolov5. the requirement.txt files have many different versions and new things than yours. Which i resolved somehow BUT THERE IS A LIBRARY NAMED ULTRAYLYTICS>=8.0.111 IT IS CONSTINUOUSLY GIVING ME ERROR. ======>couldn't find a version that satisfies the module the requirement ultralytics(from versions: none).
I DID BIT RESEARCH AND WHAT I CAME TO KNOW IS THAT WE NEED PYTHONV3.7 FOR INSTALLING IT. AND YOU SUGGESTED THAT THE DEFAULT PYTHON VERSION SHOULD BE CHANGED.
BUT STILL I TRIED TO UPGRADE PYTHON AND I WASN'T UNABLE TO DO THAT UPGRADE. SO, WHAT SHOULD I DO NOW, PLEASE SUGGEST?
Btw you used jupyter notebook and I wanted to do it in myenv using terminal
@@adnanahmad4168 You can mail me your same query on my email id (aarohisingla1987@gmail.com). I will send you the code which I have.
Hello, after executing long "cmake -D CMAKE_BULD_TYPE..." command I get "Configuring incomplete, errors occured!" I have installed all the dependencies and completed all previous steps without problems. Could you help?
I am not sure why are you getting errors but common reasons are:
1- Incorrect or missing configuration options passed to CMake.
2- Issues with the CMake build files or the project's source code.
Hello, i got the same error. Were you able to fix it?
Where can I get the commands to build the opencv in the directory build?
Commands are pinned in comment section.
hello mam i am getting the following error when i import pandas in my python environment
illegal core dumped .
pls make a video on this issue madam
Make sure you are using compatible versions of Python and pandas.
trying to increase swap file using your steps, now my Jetson Nano is not able to boot
When you try to boot the Jetson Nano, pay close attention to any error messages that appear on the screen. These messages might give you clues about what went wrong during the boot process.
Jetson Nano has a recovery mode that allows you to reflash the operating system. Try booting into recovery mode and flashing the system image again. This should revert your system to a known working state.
My pip is not installing what might be the error?
What is the error message?
Ah that is solved, as i was giving the wrong ip address to my internet. But now i have another problem, i have jetson orin nano, but i installed the old opencv version which is not compatible with my cuda, i should use sudo apt-get install opencv command right?? But my question is, should i uninstall the previous version or just deleting the folder will be enough?
If i have to uninstall then what steps should i follow? Plz guide
hi Aarohi
cmake -D CMAKE_BUILD_........ ı am getting error message
how can ı fix
I am sorry, I can't help you without knowing the exact error.
how can i install this on python 3.7
JetPack SDK 4.6 comes with Python 3.6 as the default Python version. If you want to install Python 3.7 on JetPack SDK 4.6, you can follow these steps:
Add the deadsnakes PPA to your system by running the following command:
sudo add-apt-repository ppa:deadsnakes/ppa
Update the package list by running the following command:
sudo apt-get update
Install Python 3.7 by running the following command:
sudo apt-get install python3.7
Once the installation is complete, you can check the version of Python 3.7 by running the following command:
python3.7 --version
This should output the version number of Python 3.7.
Note that installing Python 3.7 may not be compatible with other software installed on your JetPack SDK 4.6 system, and may cause conflicts or compatibility issues. Therefore, it is recommended to proceed with caution and thoroughly test your system after installing Python 3.7.
make: *** No targets specified and no makefile found. Stop.
Check if you are in the correct directory: Make sure that you are in the correct directory where the Makefile is located. You can use the ls command to list the files in the current directory and check if the Makefile is present.
Check your system for make: Finally, make sure that the make command is installed on your system. If it is not installed, you will need to install it before you can use the make command.
@@CodeWithAarohi yes mam, I am in build file. cmake is in opencv folder.
@@CodeWithAarohi how to install it madam. Thank you
@@CodeWithAarohi make is already installed. Yes mam, CMakeFiles existed in build file. verified through ls command.
sudo sh -c "echo '/usr/local/cuda/lib64' >> /etc/ld.so.conf.d/nvidia-tegra.conf“
this command should be sudo sh -c "echo '/usr/local/cuda/lib64' >> /etc/ld.so.conf.d/nvidia-tegra.conf"
it takes almost 2 hours for me to understand
Hi Aarohi, once I run the code make -j4 it is giving me an error that says "make: *** No targets specified and no makefile found. Stop."
I followed everything the way you have up there not sure why it is giving this error. Any help to solve this will be appreciated.
I am suspecting these two commands might have impacted.
sudo sh -c "echo '/usr/local/cuda/lib64' >> /etc/ld.so.conf.d/nvidia-tegra.conf“
sudo ldconfig
the first one gives you prompts and if you type the rest of the codes they just run and give you nothing so I exited and typed the rest of the dependencies.
In this command please delete the last double quote and write again. sudo sh -c "echo '/usr/local/cuda/lib64' >> /etc/ld.so.conf.d/nvidia-tegra.conf“
@@CodeWithAarohi Got it thanks a lot!
@@CodeWithAarohi after following the steps I have OpenCV version 3.2.0 but when I do jtop it shows me I have 4.7.0 -dev with CUDA: YES. Do you know why that is the case? Thank You!
Hello, I am following your code for builidng opencv, Howerver i ma getting configuring incomplete msg after running this block of code : cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules -D EIGEN_INCLUDE_PATH=/usr/include/eigen3 -D WITH_OPENCL=OFF -D WITH_CUDA=ON -D CUDA_ARCH_BIN=5.3 -D CUDA_ARCH_PTX="" -D WITH_CUDNN=ON -D WITH_CUBLAS=ON -D ENABLE_FAST_MATH=ON -D CUDA_FAST_MATH=ON -D OPENCV_DNN_CUDA=ON -D ENABLE_NEON=ON -D WITH_QT=OFF -D WITH_OPENMP=ON -D WITH_OPENGL=ON -D BUILD_TIFF=ON -D WITH_FFMPEG=ON -D WITH_GSTREAMER=ON -D WITH_TBB=ON -D BUILD_TBB=ON -D BUILD_TESTS=OFF -D WITH_EIGEN=ON -D WITH_V4L=ON -D WITH_LIBV4L=ON -D OPENCV_ENABLE_NONFREE=ON -D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_opencv_python3=TRUE -D OPENCV_GENERATE_PKGCONFIG=ON -D BUILD_EXAMPLES=OFF ..
Kindly help.
Hello, i got the same error. Were you able to fix it?
@@ayseerdansman4779 were you?
sudo sh -c "echo '/usr/local/cuda/lib64' >> /etc/ld.so.conf.d/nvidia-tegra.conf“ , I'm stuck at this command, after executing this command is got this output only " > "
yeah same
The last symbol is wrong: Need ' instead "
while executing make -j4 i am getting error:
desktop:/home/nvidia/opencv/build# make -j4
make; *** No targets specified and no makefile found.
Stop.
How to resolve this, PLeeeessee help 🙏🙏
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D EIGEN_INCLUDE_PATH=/usr/include/eigen3 \
-D WITH_OPENCL=OFF \
-D WITH_CUDA=ON \
-D CUDA_ARCH_BIN=5.3 \
-D CUDA_ARCH_PTX="" \
-D WITH_CUDNN=ON \
-D WITH_CUBLAS=ON \
-D ENABLE_FAST_MATH=ON \
-D CUDA_FAST_MATH=ON \
-D OPENCV_DNN_CUDA=ON \
-D ENABLE_NEON=ON \
-D WITH_QT=OFF \
-D WITH_OPENMP=ON \
-D WITH_OPENGL=ON \
-D BUILD_TIFF=ON \
-D WITH_FFMPEG=ON \
-D WITH_GSTREAMER=ON \
-D WITH_TBB=ON \
-D BUILD_TBB=ON \
-D BUILD_TESTS=OFF \
-D WITH_EIGEN=ON \
-D WITH_V4L=ON \
-D WITH_LIBV4L=ON \
-D OPENCV_ENABLE_NONFREE=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=OFF \
-D BUILD_NEW_PYTHON_SUPPORT=ON \
-D BUILD_opencv_python3=TRUE \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D BUILD_EXAMPLES=OFF ..
use this it will work
Hi Arohi!
I somehow deleted my env after doing all these steps. Now I have open cv 4.5.1 on global but in env its only showing 4.1.1. Any help will be appreciated.
Hello, I met some problem when I tried to install dependencies. It showed a message said, "configuring incomplete, errors occurred!". How can I fix this issue?
Thank you for the good video. I did what you told me to do and also checked that the video came out of the camera. But the window where the camera comes out is so big that there is no 'x' button to close the window. Is there any way to make the camera window appear small on the monitor like you? The camera window I came out of takes up about half of the monitor.
I am following your video series, my task was to install archiconda and yolov5. I installed archiconda but in phase of yolov5. At the end , I need to make some project with jetson nano. Can you give me some ideas? And any flow that how to do it...
After reboot, the swapped memory gets reset and goes back to 1.9gb. I always need to run those 4 swap commands before starting. What's the solution to this?
You have to activate the environment you created before after reboot
HI Aarohi.. did all the steps you mentioned, but my jtop says openCV: 4.5.1 with CUDA: No, please suggest what to do
fixed this issue but there is no space on disk. i used 32GB card, how to free up space
Hello there, this is the error message that I encountered about three hours into my build operation after entering the "make -j4" command. Do you have any suggestions?
[ 84%] Built target opencv_ximgproc
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
Sometimes, build issues can be resolved by cleaning the project and then rebuilding it from scratch. You can try running the following commands to clean the project:
make clean
make distclean
Afterward, try rebuilding the project.Instead of just using "make -j4," you can try "make -j4 VERBOSE=1" to see if it provides additional information about the error.
Hey @CodeWithAarohi, thank you for insightful video. I followed same steps. Unfortunately after it has completed i am getting an error of cv2 module being unavailable in my virtual ent. What fascinates me is that it was able to install the latest opencv for cuda. Do you have an idea how to go about this ?
i get the same issue, were you able to resolve this?
Awesome series!. Any idea which camera is compatible with Jetson Orin NX 16GB (Jetpack 5.1)?
I bought IMX477 (12MP) camera but it is not compatible with JP 5.1.
Sorry, I am not sure.
i find it hard to implement a Region of Intrest Mask for YOLOv7 (to help speed up FPS More) not farmilliar with Argeparss and what variables to use. maybe you could touch on that on a video ?
Have you tried converting your model into tensorrt. That way you can increase fps
should I do the same for Jetson Orin Nano ?
I never tried on Jetson Orin but I think steps should be same.
@@CodeWithAarohi
I had only one problem after I execute make clean I get an error when I import cv2
so I tried agai without cleaning and it worked and also for headless mode I tried hard with your method but It didn't work so I tried No Machine software from jetson hacks channel and it worked at once.
after running make -j4 command to 100%: built target opencv_perf_superres. then it freezes, it's been 1 hour and it's still the same, what can i do to fix it ma'am
madam, can you show me each command to fix dc, i have read the comments but still don't understand because i'm a newbie, sorry for my stupidity, please help
mail me at aarohisingla1987@gmail.com . I will help you. Don't worry
after getting 5.9gb swap, i don't reboot, because reboot will return to 1.9gb swap. then i ran make -j1 instead of make -j4 and it worked, because if i run j4 it will freeze
@minhhnguyen88 Did you found the answer of how to avoid freezing at %
@@akashpatel9884 Sorry, my project was completed a long time ago so I don't remember what I did to it to make it work. after all, I still use the default libraries after installing jetpack. Please comment and wait for admin to answer your questions
Great Work !! Thanks
Welcome!
you are perfect!
Thankyou! Glad my video helped you!
Good Work .. Aarohi..Carry on
Thank you!
Hi, I executed : sudo sh -c "echo '/usr/local/cuda/lib64' >> /etc/ld.so.conf.d/nvidia-tegra.conf“
then the prompt became like this : >
is this correct ? or I did something wrong .... thank you for your hard work
see the double quotes.. its wrong erase and put again
Eres realmente buenisima. Hay mucho trabajo aqui detras de este video y te agradezco muchisimo por tu buena voluntad en publicar este tremendo esfuerzo. Desde Chile, un gran abrazo y muchas gracias¡
Glad you liked my content and Thanks for appreciating my work 🙂
@@CodeWithAarohi Funciona todo realmente a la perfección. Hay un inconveniente, pero que es mio no es de tus instrucciones, que esta asociado a que mi jetson nano 4GB no reconoce a la camara "Near Infrared (NIR) Camera - See3CAM_12CUNIR" th-cam.com/video/WZunwZxxrls/w-d-xo.html , de la empresa E-CON Systems. Saludos y nuevamente muchisimas gracias¡
Acabo de realizar un ajuste en la lectura de frames y ahora funciona todo ok con la camara y la jetson¡. Saludos¡¡¡