Download opencv on raspberrypi

/home/pi/opencv_contrib-4.4.0/modules/rgbd/misc/python/pyopencv_linemod.hpp:59:44: error: template argument 2 is invalid
[100%] Built target example_tutorial_Remap_Demo
[100%] Built target example_tutorial_Sobel_Demo
[100%] Built target example_tutorial_filter2D_demo
[100%] Built target example_tutorial_imageSegmentation
[100%] Built target example_tutorial_generalContours_demo2
[100%] Built target example_tutorial_houghcircles
[100%] Built target example_tutorial_camshift
[100%] Built target example_tutorial_LATCH_match
[100%] Built target example_tutorial_file_input_output
[100%] Built target example_tutorial_HoughLines_Demo
[100%] Built target example_tutorial_compareHist_Demo
[100%] Built target example_tutorial_hull_demo
[100%] Built target example_tutorial_Drawing_2
[100%] Built target example_tutorial_cornerDetector_Demo
[100%] Built target example_tutorial_cornerHarris_Demo
[100%] Built target example_tutorial_goodFeaturesToTrack_Demo
[100%] Built target example_tutorial_how_to_scan_images [100%] Built target example_cpp_image_alignment
[100%] Built target example_tutorial_SURF_FLANN_matching_homography_Demo
[100%] Built target example_tutorial_AddingImages
/home/pi/opencv-4.4.0/modules/python/src2/cv2.cpp: In instantiation of ‘bool pyopencv_to(PyObject*, T&, const ArgInfo&) [with T = cv::line_descriptor::KeyLine; PyObject = _object]’:
/home/pi/opencv-4.4.0/modules/python/src2/cv2.cpp:1464:24: required from ‘bool pyopencv_to_generic_vec(PyObject*, std::vector<_Tp>&, const ArgInfo&) [with _Tp = cv::line_descriptor::KeyLine; PyObject = _object]’
/home/pi/opencv_contrib-4.4.0/modules/line_descriptor/misc/python/pyopencv_LSDDetector.hpp:7:56: required from here
/home/pi/opencv-4.4.0/modules/python/src2/cv2.cpp:71:94: error: ‘to’ is not a member of ‘PyOpenCV_Converter<cv::line_descriptor::KeyLine, void>’
71 | bool pyopencv_to(PyObject* obj, T& p, const ArgInfo& info) { return PyOpenCV_Converter::to(obj, p, info); }
| ~~~~~~~~~~~~~^~
/home/pi/opencv-4.4.0/modules/python/src2/cv2.cpp: In instantiation of ‘PyObject* pyopencv_from(const T&) [with T = cv::line_descriptor::KeyLine; PyObject = _object]’:
/home/pi/opencv-4.4.0/modules/python/src2/cv2.cpp:1476:39: required from ‘PyObject* pyopencv_from_generic_vec(const std::vector<_Tp>&) [with _Tp = cv::line_descriptor::KeyLine; PyObject = _object]’
/home/pi/opencv_contrib-4.4.0/modules/line_descriptor/misc/python/pyopencv_LSDDetector.hpp:12:47: required from here
/home/pi/opencv-4.4.0/modules/python/src2/cv2.cpp:74:75: error: ‘from’ is not a member of ‘PyOpenCV_Converter<cv::line_descriptor::KeyLine, void>’
74 | PyObject* pyopencv_from(const T& src) { return PyOpenCV_Converter::from(src); }
| ~~~~~~~~~~~~~~~~~~~~~~~^
make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/build.make:82: modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:16838: modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
make: *** [Makefile:182: all] Error 2

Hello community!! I’m new here nice to meet you. So I try to download opencv it reaches around 100% and then said make: *** [Makefile:163: all] Error 2, so I use the code make -j $(nproc), but it still said the same thing so I try to redo it several times but the result is still the same, what could I have done wrong? This is where I found the instruction Object and Animal Recognition With Raspberry Pi and OpenCV - Tutorial Australia

1 Like

Hi @Nutchapol260882!

Welcome to the forum!

It looks like you’re encountering an error while trying to install OpenCV on your Raspberry Pi. The error messages you posted indicate there might be issues with specific modules or dependencies during the installation process.

Here are a few steps you can take to troubleshoot and resolve this issue:

  1. Ensure System Update: Before installing OpenCV, make sure your Raspberry Pi is fully updated. Use the commands sudo apt-get update and sudo apt-get upgrade to update your system.

  2. Check Dependencies: OpenCV has several dependencies that need to be installed. Ensure you have all the necessary libraries and tools installed. This typically includes packages like build-essential, cmake, pkg-config, libjpeg-dev, libtiff5-dev, libjasper-dev, libpng-dev, libavcodec-dev, libavformat-dev, libswscale-dev, libv4l-dev, libxvidcore-dev, libx264-dev, libgtk2.0-dev, libgtk-3-dev, libatlas-base-dev, gfortran, and python3-dev.

  3. Follow a Reliable Guide: Ensure you’re following a reliable and up-to-date guide for installing OpenCV on Raspberry Pi. There are several tutorials available online that provide step-by-step instructions.

  4. Use a Virtual Environment (Optional): Consider installing OpenCV within a Python virtual environment. This helps manage dependencies and versions more efficiently.

  5. Check for Specific Errors: The errors in your post seem to be related to template arguments and Python bindings. Research these specific errors to see if others have encountered and resolved similar issues.

If you’re still facing issues after trying these steps, feel free to provide more details or error messages, and we’ll do our best to assist you further!

Cheesy regards, :cheese:


Hello Cheese71011
Thank you very much
Today I try to check for the error, it seems that it starts from the repository.
So I change it to (http|rsync):// from Mythic Beasts
But then this error appears, is this mean I have to wait for 18hr, I use Bard to explain the error to me and it said this

The error messages indicate that the package repositories you are trying to update are not yet available for updating. This is because the release files for the repositories are not yet valid. The release files are used to verify that the packages in the repository are authentic and have not been tampered with.

The error messages also state that updates for the repositories will not be applied. This means that you will not be able to install new packages or update existing packages until the release files become valid.

The reason for the delay in the release files becoming valid could be due to a number of factors, such as a delay in the release of the new packages, a problem with the repository itself, or a network issue.

If you need to install or update packages immediately, you can try using an alternative repository. There are a number of alternative repositories that offer the Raspberry Pi packages. You can search for a list of repositories online.

Otherwise, you will need to wait for the release files to become valid before you can update your packages. The release files should become valid within 18 hours and 33 minutes.

I hope this helps! 

Thank you very much Cheese71011

1 Like