When working on my beer recognition project BiBirra I’ve encountered problems loading images that had a transparent background. OpenCV by default mess this images up, and this is especially problematic when we extract SURF features from the loaded image.

The key idea is to load the image with the flag cv2.IMREAD_UNCHANGED that tells OpenCV to keep the alpha (transparency) channel. Then we save separately the alpha channel as a binary mask for latter use.

Notice that when the original image has no alpha channel the mask will be simply returned as None.

Now it is possible to correctly extract SURF features from the masked image


Image for post
Image for post

A few weeks ago I was in a supermarket with my girlfriend, we were invited to a dinner and we wanted to bring wine. Neither of us is a wine expert but she had a fantastic ace in the hole, she pulled out her phone, took a picture of the wine label and immediately got a description and a review of that bottle. I was impressed by the power of that app (it is called ViVino) and she challenged me to build something similar.

I accepted the challenge but added a few personalizations to it:

  • Since I prefer beer to…


I often find myself in a situation where I need to get data from a website that has no API or RSS feed. There exists many different web scraping libraries but I’m unsatisfied, I want something capable of:

  • Using CSS selectors. I have worked as a fullstack developer so I prefer using CSS selectors than XPath.
  • Creating a working scraper in almost no time. Most of the times I don’t need something very complex or advanced, I just need to make a simple scraper very quickly.

This motivated me to create a simple scraping library called Raschietto (the Italian word…


Image for post
Image for post
The final result

One of my favorite painting techniques is pointillism, a technique of painting in which small distinct dots of color are applied in patterns to form an image.

This technique relies on the ability of the eye and mind of the viewer to blend the color spots into a fuller range of tones. The juxtaposition of different colors make them more vivid, giving the whole image more vibrancy.

Matteo Ronchetti

Italian | Computer Vision | Machine Learning | https://matteo.ronchetti.xyz

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store