Race to the Finish: Python vs C++ in OpenCV and Computer Vision Speed and Performance Test

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ต.ค. 2024
  • Inside my school and program, I teach you my system to become an AI engineer or freelancer. Life-time access, personal help by me and I will show you exactly how I went from below average student to making $250/hr. Join the High Earner AI Career Program here 👉 www.nicolai-ni... (PRICES WILL INCREASE SOON)
    You will also get access to all the technical courses inside the program, also the ones I plan to make in the future! Check out the technical courses below 👇
    _____________________________________________________________
    In this video 📝 we are going to do a Python vs C++ OpenCV Test. We will run some of the methods and applications that we have implemented during this tutorial and compare the performance in Python with C++. We will evaluate and talk about the results we get and why we get exactly those results in both Python and C++ with OpenCV. We will be going over some of the differences between using python or C++ for your computer vision implementation or application.
    If you enjoyed this video, be sure to press the 👍 button so that I know what content you guys like to see.
    _____________________________________________________________
    🛠️ Freelance Work: www.nicolai-ni...
    _____________________________________________________________
    💻💰🛠️ High Earner AI Career Program: www.nicolai-ni...
    ⚙️ Real-world AI Technical Courses: (www.nicos-scho...)
    📗 OpenCV GPU in Python: www.nicos-scho...
    📕 YOLOv7 Object Detection: www.nicos-scho...
    📒 Transformer & Segmentation: www.nicos-scho...
    📙 YOLOv8 Object Tracking: www.nicos-scho...
    📘 Research Paper Implementation: www.nicos-scho...
    📔 CustomGPT: www.nicos-scho...
    _____________________________________________________________
    📞 Connect with Me:
    🌳 linktr.ee/nico...
    🌍 My Website: www.nicolai-ni...
    🤖 GitHub: github.com/nic...
    👉 LinkedIn: / nicolaiai
    🐦 X/Twitter: / nielsencv_ai
    🌆 Instagram: / nicolaihoeirup
    _____________________________________________________________
    🎮 My Gear (Affiliate links):
    💻 Laptop: amzn.to/49LJkTW
    🖥️ Desktop PC:
    NVIDIA RTX 4090 24GB: amzn.to/3Uc7yAM
    Intel I9-14900K: amzn.to/3W4Z5Cb
    Motherboard: amzn.to/4aR6wBC
    32GB RAM: amzn.to/3Jt2XVR
    🖥️ Monitor: amzn.to/4aLP8hh
    🖱️ Mouse: amzn.to/3W501GH
    ⌨️ Keyboard: amzn.to/3xUGz5b
    🎙️ Microphone: amzn.to/3w1F1WK
    📷 Camera: amzn.to/4b4Ryr9
    _____________________________________________________________
    Tags:
    #PythonOpenCV #CppOpenCV #PythonVsCpp #OpenCV #ComputerVision #PythonComputerVision #CppComputerVision

ความคิดเห็น • 23

  • @NicolaiAI
    @NicolaiAI  ปีที่แล้ว +1

    Join My AI Career Program
    www.nicolai-nielsen.com/aicareer
    Enroll in My School and Technical Courses
    www.nicos-school.com

  • @arifaltiok216
    @arifaltiok216 3 ปีที่แล้ว +3

    I think your visual studio mode is debug, although I can't see it exactly. Why didn't you run the release mod? I think opencv's release mode will work more than debug mode. Thanks for sharing.

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      Yes unfortunately it was in debug mode, should definitely redo it in release mode. Thanks for watching!

  • @gwamoniakable
    @gwamoniakable 3 ปีที่แล้ว +2

    Typical problem of the runtime external libraries, similar problem occurs with Matlab (ImageProcesing toolbox) and C++ integration. A solution can be crate a function where you initialize the runtime library first and then call a desired algorithm. Another question would be how the OpenCV has been compiled along OpenCL? At the industrial level if the OpenCL has been chosen as the main GPU library I would check maybe SYCL implementation and create my own representation of the algorithm. Thanks for the test...

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      Thank you for some ideas on why that result was a bit weird, will try to check them out. But it's still a bit weird that it seems to only be with the haar Cascade classifier. I will try a couple more algorithms/methods and see if the same result occurs

  • @stefanAH97
    @stefanAH97 3 ปีที่แล้ว +7

    interesting and hard to understand, why for loop affects python performance so much
    any idea how to integrate cython in python application? :) maybe that will help the issue

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว +3

      It's because python is interpreted and c++ i compiled, so it's way faster. Not only for loops are faster, pretty much all the things but often forloops is the worst. I haven't actually worked with cython before. Often i just use python or c++ depending on the application. But my guess would be that it would not be easy to use modules/frameworks with cython

    • @jesuschrist1501
      @jesuschrist1501 3 ปีที่แล้ว +5

      dont be lazy and just pick up c++, spend that energy learning cython on it. ;) you'd also become a better programmer too!

    • @jcbritobr
      @jcbritobr 3 ปีที่แล้ว

      @@jesuschrist1501 or pyo3 with rust. I prefer rust over cpp for produce native python modules.

  • @赛尼木
    @赛尼木 3 ปีที่แล้ว +1

    Was wondering about this until seeing your video. Thx a lot!

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      Ur welcome! Thanks for watching

  • @leosmi1
    @leosmi1 3 ปีที่แล้ว

    Is there a way to integrate Lua (python lupa) with openCV? Lua is based on C

  • @isaacdavid3334
    @isaacdavid3334 3 ปีที่แล้ว +1

    i've checked and you are running c++ in debug mode :V

    • @NicolaiAI
      @NicolaiAI  3 ปีที่แล้ว

      Thanks for mentioning it! Should try in release

    • @isaacdavid3334
      @isaacdavid3334 3 ปีที่แล้ว

      @@NicolaiAI hehe, no problem. Great content.
      1. change the build type to release
      2. and also launch it in without a debugging session(ctrl+F5 or go to debug->start without debugging

    • @golfscienceguru
      @golfscienceguru 3 ปีที่แล้ว

      @@NicolaiAI "Must" try in release builds, as "debug" builds using OpenCV "....d.lib's" rather than " .....lib's" noticeably slower even to the naked eye with objects moving with at least some noticeable stuttering on the screen.

  • @xcoderliu4787
    @xcoderliu4787 2 ปีที่แล้ว +1

    thank you, amazing sharing~~

    • @NicolaiAI
      @NicolaiAI  2 ปีที่แล้ว

      Thank you very much!

  • @jimxu1825
    @jimxu1825 ปีที่แล้ว +1

    Great work! and where can I find the code?

    • @NicolaiAI
      @NicolaiAI  ปีที่แล้ว

      Thanks a lot for watching! All the code should be available on my GitHub

  • @Elektro768
    @Elektro768 3 ปีที่แล้ว

    Great!!!!

  • @ranjansapkota5008
    @ranjansapkota5008 3 ปีที่แล้ว

    Really Great
    I hope you will soon make videos for geospatial data too... arcpy and gdal libraries