Some Linux Commands

Using the command line under Linux is routine; usually we memorize forty or fifty commands, but some rarely used yet useful commands are overlooked by most people. This post collects a small subset of them. sudo !! Some commands report an error when run without superuser privileges, after which sudo !! can be used to invoke the previous command. !! grabs the last command. python command With a simple python command we can produce a simple web page that displays the folder structure over HTTP, accessible from a browser on port 8000 until an interrupt signal is sent. ...

November 7, 2017 · 7 min · Simplestory

Detecting Traffic Violations with Opencv

Opencv contains more than 2500 functions, and almost any mature algorithm you can think of can be implemented by calling Opencv’s functions, which is super convenient. This post combines Python and Opencv to detect cars in surveillance video and check whether they commit a violation (crossing the double yellow line). System environment: Ubuntu16.04LTS+OpenCV3.3.0+Python2.7.12 Background extraction For surveillance the position is relatively fixed, so the background will not change considerably over a long period of time. We can therefore consider using background subtraction to roughly extract the background. ...

November 5, 2017 · 6 min · Simplestory

Installing OpenCV on Linux

Recently, because a project needed computer vision recognition, I started tinkering with OpenCV. Although the installation process was long and winding, the experience of using it together with Python is actually quite good. Here I record the OpenCV installation and compilation process. System environment: Ubuntu16.04 Software installed: OpenCV3.3.0+Python2.7.12 Updating the system packages: $ sudo apt update $ sudo apt upgrade Installing some developer tools: $ sudo apt-get install build-essential cmake pkg-config The pkg-config package is very likely already installed by default, but just in case, add it in as well. The cmake program is used later to compile OpenCV. ...

October 20, 2017 · 4 min · Simplestory

Compiling C/C++ under Vscode

Visual Studio Code is a lightweight editor released by Microsoft; by installing various plugins it can be turned into a powerful multi-language, cross-platform compiler. Recently, because of practical needs, I had to debug some C/C++ code, so I started tinkering with Vscode. Below is a record of the problems that troubled me during the process. The system used in this post is ubuntu16.04LTS I will not go into the details of installing Vscode on linux, as Baidu has plenty of resources on that. ...

October 1, 2017 · 2 min · Simplestory