I’m playing a lot with OpenCV and object recognition recently (I started from Python, but now I’ve moved to C++) and what I wanted to do to make my life easier was putting 4 different video frames (original, thresholded, grayscaled & thresholded and original with marked face). Even if it’s not very difficult task, it took me a while to do it, because – definitely – I’m not an OpenCV expert. This article shows how I did it using the new 2.3 (or – actually – 2.X) OpenCV API.
One thing that most Python users learn at the very beginning are list slices – defining a part of the list using the
samplelist[begin:end] syntax. It’s great thing, but – surprisingly – many people don’t even know, that there’s different syntaxt for this, containing one additional parameter – “step”:
samplelist[begin:end:step]. How does it work?
The reason why I like Python so much is the way I can solve some simple problems – solutions are simple and good looking. One of the examples I use to give when asked “what does it mean that code is good looking” is checking if word is a palindrome.
Few days ago I was talking with my friend about most useful Python features we use almost every day. It was not about any sophisticated tools or libraries, but about the things we use often and which are “given” by the language and its syntax itself – the ones which we like just because they’re “pythonic”. I’ve picked and some of them, which are easy to describe in short devblog article. Even if most of these things should be known for most of the Python developers, I bet that many of you don’t know about at least one of them or just use to forget about using it ;)