#Humor – Welcome to the Club …

No fun today, just a big THANK YOU !

Happy coding!

Greetings

El Bruno

#MSTeams – #SnapChat lenses on Microsoft Teams ! (Why not? and #ToiletPaper as a bonus)

Buy Me A Coffee

Hi !

Let’s go with a fun off-topic for a Friday, and let’s use some SnapChat lenses in our camera feed in Microsoft Teams.

Disclaimer: This is not a very useful post, but in this Covid-19 days, you can get some fun with this in all the virtual meetings.

So, simple steps

  • Close Teams App
  • Download the SnapCamera lenses apps for Windows or Mac from https://snapcamera.snapchat.com/download/
  • Perform the installation wizard, 30 seconds later is done!
  • Open the App and select your favorite lens. An toiler paper hat !
  • Open Microsoft Teams and go to Settings
  • In the Devices section, you will see a new camera available: Snap Camera. Select this one.
  • And that’s it ! Now your camera in Teams will have a lot of amazing features.
  • Something like this !

You can change filter on the fly, in SnapCamera app, and it will be reflected on the camera feed. Also, you may need to close all apps before install SnapCamera, in order to allow the apps to detect the new camera. Normal Windows stuff.

Happy coding!

Greetings

El Bruno

Resources

#dotnet – .Net Core Uninstall Tool !

Buy Me A Coffee

Hi !

I’ll hold my drone series to basically repost an amazing news for today:

Announcing the .NET Core Uninstall Tool 1.0!

This is amazing! Mostly because .Net Core versions are a “not-happy experience” to manage. If you work with them a lot, you probably find yourself going to “Add and Remove Programs” and spending from 5 minutes to 3 hours, manually unistalling all the non-required versions.

So, we have a new tool that will allow us to to this, but with an amazing set of commands. And, it works for Windows and Mac !

Let’s take a look. In example, to check my currently installed sdks, I can run a command that we already knows

dotnet --list-sdks

and the result is this one

So cool! And there are several very useful commands to see dependencies, SDKs required by Visual Studio and more (see references). I like the WhatIf version, so in example the following command

dotnet-core-uninstall whatif --all-below 2.2.301 --sdk

Shows the result of a dry run of removing all .NET Core SDKs below the version 2.2.301:

Again, check the documentation for all the possible scenarios. And, as I said, so cool !

Happy coding!

Greetings

El Bruno

References

#Coding4Fun – How to control your #drone with 20 lines of code! (12/N)

Buy Me A Coffee

Hi!

Today code objective is very simple, based on a request I received from internet:

The drone is flying very happy, but if the camera detects a face, the drone will flip out !

Let’s take a look at the program working:

This one is very similar to the previous one. I also realized that I may need a better camera to record the live action side by side with the drone footage, but I think you get the idea. The command to make the drone flip is “flip x”, where “x” is the direction. In example:

"flip l" # flip left
"flip r" # flip right
"flip f" # flip forward
"flip b" # flip back

Here is the code:

As I promised last time, in next posts, I’ll analyze more in details how this works, and a couple of improvements that I can implement.

Happy coding!

Greetings

El Bruno

References

My Posts

#Event – (update) @devdotnext now in virtual mode ! #devdotnext2020

Buy Me A Coffee

Hi!

These are strange days, however we all try to do our best to move forward. An important part of today’s behaviors is to try to avoid big events. That’s why, in the last 2 weeks, we get news about events being cancelled all over the world.

I have a plan to visit Colorado, US, in a couple of weeks for the Dev.Next event. However, due to Covid-19, the event was postponed to August (more information here).

The amazing organizing team, decided to face this with a big smile and organized a mini virtual version of the event. This is the official announcement:

dev.next is happy to announce a mini digital event on March 24, 2020. The event is free to attend. We will post link here on March 24th. Recordings from the event will be available later. Please check back here for links to the recordings.

dev.next digital event

I’ll be part of this Digital / Virtual Days hosting a remote session around AI and Anomaly Detection, with code and without code !

Take a look at the agenda here.

Happy coding!

Greetings

El Bruno

#Coding4Fun – How to control your #drone with 20 lines of code! (11/N)

Buy Me A Coffee

Hi!

Today code objective is very simple:

The drone is flying very happy, but if the camera detects a banana, the drone must land !

Let’s take a look at the program working:

drone flying and when detect a banana lands

And a couple of notes regarding the app

  • Still use Haar Cascades for object detection. I found an article with a Xml file to detect bananas, so I’m working with this one (see references).
  • Using Haar Cascades is not the best technique for object detection. During the testing process, I found a lot of false positives. Mostly with small portions of the frame who were detected as bananas. One solution, was to limit the size of the detected objects using OpenCV (I’ll write more about this in the future)
  • As you can see in the animation, when the drone is a few meters away, the video feed becomes messy. And because the object detection is performed locally, it takes some time to detect the banana.
  • I also implemented some code to take off the drone when the user press the key ‘T’, and land the drone when the user press the key ‘L’
  • The code is starting to become a mess, so a refactoring is needed

Here is the code

In next posts, I’ll analyze more in details how this works, and a couple of improvements that I can implement.

Happy coding!

Greetings

El Bruno

References

My Posts

#Podcast – NTN 44 – CLIs vs GUIs con @jc_quijano y @eiximenis

Buy Me A Coffee

Buenas!

Buenas!
Hoy tengo la suerte de hablar con Eduard Tomas (@eiximenis) y Juan Quijano (@jc_quijano) sobre uno de los temas que ha tenido bastante popularidad en Twitter: CLIs o GUIs. Hablamos sobre las preferencias de cada uno y sobre cómo nos hemos movido hasta el punto actual donde parece que hay CLIs por todos lados.
Juan es Microsoft Certified Trainer, Arquitecto de Soluciones en Azure y Consultor independiente en implantación de DevOps. Eduard es Microsoft MVP y Team Lead en Plain Concept.

Ir a descargar

Bonus

Aquí hay 2 artículos muy interesantes al respecto:

Happy coding!

Greetings

El Bruno

#VSCode – Let’s do some #FaceRecognition with 20 lines in #Python (7/N)

Buy Me A Coffee

Hi!

I’m writing a series of posts about how to control a drone with Python and 20 lines of code, and once I reach to the point to read the camera feed, I’ve added a face detection sample. However this time I didn’t use the face_recognition python package I’ve used in this series, I performed the face detection using OpenCV and Haar Cascades. So, let’s explain a little what’s this.

Let me start quoting an amazing article “Face Detection using Haar Cascades” (see references)

Object Detection using Haar feature-based cascade classifiers is an effective object detection method proposed by Paul Viola and Michael Jones in their paper, “Rapid Object Detection using a Boosted Cascade of Simple Features” in 2001. It is a machine learning based approach where a cascade function is trained from a lot of positive and negative images. It is then used to detect objects in other images.

OpenCV comes with a trainer as well as detector. If you want to train your own classifier for any object like car, planes etc. you can use OpenCV to create one. Its full details are given here: Cascade Classifier Training.

And here we come to the cool part, OpenCV already contains many pre-trained classifiers for face, eyes, smile etc. Those XML files are stored in opencv/data/haarcascades/ folder (see references).

opencv github haar cascades files

Let’s take a look at a really [20 lines] sample code for face detection:

  • Line 6, we use OpenCV to load the haar cascade classifier to detect faces
  • Lines 9-20, main app
  • Lines 10-12, open a frame from the camera, transform the frame to a gray color scaled image and use the face cascade detector to find faces
  • Lines 14-15, iterate thought detected faces and draw a frame
  • Lines 17-20, display the webcam image with the detected faces, and stop the app when ESC key is pressed

And a live sample using a drone camera instead of an USB Camera

Bonus. Viola Jones Face Detection and tracking explained video

This is a long video, however is an amazing entry point to understand how the Viola Jones algorithm works.

Happy coding!

Greetings

El Bruno

Resources

#Coding4Fun – How to control your #drone with 20 lines of code! (10/N)

Buy Me A Coffee

Hi!

Back to some drone posts! I was kind of busy during the last weeks and now I can get back to write about the drone.

OK, in the last posts I described how to connect and work with the drone camera feed using OpenCV. Now with 2 extra lines of code we can also detect faces. Let’s take a look at the final sample.

drone camera and camera view performing face detection

In the previous image we can see 2 camera feeds. My computer webcam, where you can see how I hold the drone with the drone camera pointing to my face. And the drone camera feed, presented using OpenCV and drawing a frame over each detected face.

Let’s share some code insights:

  • As usual, I resize the camera feed to 320 x 240
  • The average processing time is between 40 and 70 FPS
  • I use a haar cascade classifier to detect the faces in each frame

Note: I need to write about Haar Cascades as part of my face detection post series.

In my next posts, I’ll add some drone specific behaviors for each face detected.

Happy coding!

Greetings

El Bruno

References

My Posts