Screen Recording: Ubuntu


I have used CamStudio in Windows, and I am happy with it but, there are times when we have to make the most of what is available.This time, I needed to record screen-cast in Ubuntu.

# add-apt-repository ppa:maarten-baert/simplescreenrecorder
# apt update
# apt install simplescreenrecorder

Despite of being simple, it has all essential features of CamStudio for Windows or QuickTime for macOS, and it recorded very good quality of audio and video! Making itself my new favorite screen recording application.

Earlier, I tried using VLC for screen capturing, because it helps me to avoid yet another software program on my computer on my computer and, VLC also lets me choose file formats to save my recording to.

Here are the steps:

Continue reading “Screen Recording: Ubuntu”

Install OpenCV: ~10 min!


Disclaimers

  1. Tested on: Windows 7, Windows 10
  2. There could be other ways to get Open CV working on your Windows computer

Before installation

  1. Find you OS architecture
  2. Decide the Python version (e.g. 2.7 or 3.x)
  3. Install Anaconda, open terminal as administrator and , Continue reading “Install OpenCV: ~10 min!”

IsClose() in python


This post tries to answer whether given numbers are comparatively close to each other. This can help if you are using Python for data science or in the area of computer vision doing computing with images. A quick stack-overflow search shows discussion around finding “nearest” value from a set of given values for any given number [1] [2] [3]. However, there could be a need to limit how much further the nearest number could be. I’d call this limit a “threshold”.

Quite a few times, in my Python (esp. in computer vision related) programming I come across scenarios when I want to tell if the two numbers are close to each other. Some might ask, “Well define close!?” or “How close?”, well … comparatively close.

Now Continue reading “IsClose() in python”

numpy.argmin() alternative


While there are some interesting conversations about numpy.argmin() function’s performance (e.g. here, here and here), Continue reading “numpy.argmin() alternative”

Python Numpy count elements


As you already know, in order to calculate non-zero elements in your np array, you can use numpy.count_nonzero. But how about 0? How about an expression? Well, Continue reading “Python Numpy count elements”

Python reverse and splice a tuple



""" About:
img is an OpenCV 2 object. img.shape prints a tuple as (height, width, channels) e.g. (512, 768, 3)
We need a tuple as (width, height) e.g. (768, 512)
"""
import cv2
image_path = './image.jpg'
img = cv2.imread(image_path, flags=cv2.CV_LOAD_IMAGE_COLOR)
print img.shape # (512, 768, 3)
print img.shape[::1] # (3, 768, 512)
print img.shape[1::1] # (768, 512)

view raw

code.py

hosted with ❤ by GitHub

C# Split CSV string


string str = "Tom Cruise, Scott, ,Bob | at";
IEnumerable<string> names = str
.Split(new char[]{',', '|'})
.Where(x=>x!=null && x.Trim().Length > 0)
.Select(x=>x.Trim());

Output

Tom
Cruise
Scott
Bob
at

Stackoverflow post:
https://stackoverflow.com/a/45799171/799593

What’s Machine Learning?


What is Machine Learning? from E*D Films (Daniel Gies) on Vimeo.