Nov 11, 2023

Calling C++ class methods by its string name

Consider the following cases:
  1. You have an abstract class that you use as an interface for other classes deriving from it. The abstract class just have the bare minimum methods for interacting with it or none at all, derived classes can define new methods, you can only get access to the derived class object by the abstract class. You want to call a method in the derived class from the abstract class.
  2. You have a class where you want to add new methods dynamically, but it's definitions are unknown.

Aug 16, 2016

Otsu threshold

Previously, in my post about Canny edge detector, we had seen that one of the required steps for obtaining perfectly thinned edges was thresholding, in the source code example for that post I've used an arbitrary good enough value for the thersholds. In this post I'll show you an algorithmic way of obtaining all thresholds for a given number of gray levels output, based on the Otsu's method.

Feb 25, 2016

Webcamoid 7.0.0 released

Finally, a new release of Webcamoid arrived! Let me show you what new features it has to offer, and what the future holds.

Dec 29, 2015

Disable Volume and Brightness OSD in KDE

A few days ago Arch linux team decided to dropout support for KDE 4, and force their users to upgrade to KDE Plasma 5. I've tested Plasma 5 around 10 months ago and, to be honest, my experience was not good, Plasma 5 suffered a lot of stability problems, but the problem that most annoyed me was the backlight OSD thing, i've even reported and suggested a patch for it but their developers ignored me and refused to fix this problem. So i had not option but to return to KDE 4.

Yesterday, i had not option but to try Plasma 5 again, and for my surprise (or not), the backlight OSD thing was not fixed, but also KMix is showing OSD again without option for disabling it, and it was supposed to have been fixed 3 years ago. A this point i don't know what KDE developers are thinking, it seems that their are trying to transform KDE into a Nagware. At least i know that i'm not alone because 3 months after my report, other user reported it again, and developers provided just a partial solution making the OSD smaller than before, but for me it was not ok and decided to get rid of the OSD annoyance once for all.

Aug 10, 2015

Canny edge detector

The Canny edge detector, unlike convolutional edge detection filters, produces clear and thin lines when applied to an image.
The algorithm consists of four steps:
  1. Filter edges using a convolutional filter.
  2. Thin edges depending on it's gradient and direction.
  3. Threshold the image so all pixels where it's gradient is below a minimum threshold becomes black, all pixels where it's gradient is above a maximum threshold becomes white, and the rest becomes gray.
  4. Trace the edges so all gray pixels connected to white becomes white, and the rest becomes black.