#VSCode – 20 lines to display a webcam camera feed with #Python using #OpenCV

Hi !

I always write this from scratch, so it seems that I’ll drop this one here. So next time I search for this, I’ll find myself.

And with some extra lines, we can even detect faces and display some face landmarks:

This is the base of some many image recognition scenarios, so I hope this will save me some local search time 😀

Happy coding!

Greetings @ Toronto

El Bruno

References

My posts on Face Recognition using Python

  1. Detecting Faces with 20 lines in Python
  2. Face Recognition with 20 lines in Python
  3. Detecting Facial Features with 20 lines in Python
  4. Facial Features and Face Recognition with 20 lines in Python
  5. Performance improvements with code
  6. More performance improvements, lowering the camera resolution

And some general Python posts

Advertisements

#Python – Detecting #Hololens in realtime in webcam feed using #ImageAI and #OpenCV with performance improvements

Hi!

In my previous post I created a sample on how to use ImageAI and OpenCV to detect Hololens from a webcam frame (see references). I added some code to the last sample, and I found that the performance was not very good.

python using imageai to detect hololens less than 1 fps

With the previous sample code, I couldn’t process more than 1 frame per second. So, I started to make some improvements and I got this result

python using imageai to detect hololens little more than 1 fps

Not an amazing one, but still is nice to have more than 1 frame per second analyzed.

I even remove all the camera preview and still works in less than 1FPS.

python using imageai to detect hololens no opencv camera preview

So, now it’s time to read and learn of the deep code on ImageAI. Fun times!

Happy coding!

Greetings @ Burlington

El Bruno

References