# Posts

### OpenCV on Android: practices and tips

Transfer MAT objects from Android to NDK The main idea is to use the address of an MAT object in order to manipulate the data. Basically, we have a function playing as a bridge between Java APIs and NDK: public native void function_name(long matAddress); To call the function, we use Mat’s address by calling getNativeObjAddr(). All computations in NDK will affect the content of MAT in both Java and NDK layers.

### Setup OpenCV and Android Studio with NDK support

In this tutorial, I will demonstrate how to configurate the renowned computer vision libary, OpenCV, with the current Android Studio version (3.0.1). Let get started. The compiled version of OpenCV which supports Android is available at OpenCV Homepage. Download and extract it. Please note that to test the application properly on the mobile devices, the OpenCV Manager has to be installed. In another tutorial, I will talk about how to compile our own OpenCV library and put it to Android Studio since the pre-compiled library misses some interesting and important components, e.

### Programming Pearls

Programing Pearls - Jon Bentley Excellent. Until now, there is no such book which makes me shout out like this after receiving from Amazon. Let brieftly review some favoriate books: CLRS: theoretically, this really is an “introduction” textbook about algorithms. Nonetheless, it still is an extensive reference and full of details. However, I am not impressed by the writing style and the pseudo-code. Algorithms, Sedgewick: one of the best textbooks ever.

### Latin squares and a story of computer science history

The content of this note mostly belongs to the first section of TAoCP, Vol4A. Definition Given a square matrix of size $M$ and each element is $\{0, 1, \cdots, M-1 \}$, we construct a matrix such that for the element $i$ in the set $\{0, 1, \cdots, M-1\}$ only appears exactly 1 time on every row and column. Examples We have 16 cards which comprises a combination of 4 ranks, i.

### History of Computer Vision - Part 1

[It is such a long time since I wrote a dedicated technical post about computer vision.] Introduction Since Computer Vision is an interdisciplinary research which involves different fields such as physics, biology, computer science, neuroscience, etc. For this reason, there are different approaches when people consider about the history of computer science. In this post, I summarize two viewpoints of Prof. Fei-Fei Li, and Prof. Richard Szeliski from their courses [1] and textbooks [1].

### Generate the inversion table from an integer sequence

The programming exercise is from TAoCP, Vol3, 5.1.1-6: Design an algorithm that computes the inversion table $b_1, b_2 \cdots b_n$ corresponding to a given permutation $a_1a_2 \cdots a_n$ of ${1, 2, \cdots , n}$, where the running time is essentially proportional to $n\ log n$ on typical computers. I was really stuck on the solution Knuth given in the book. The author also mentioned another approach which actually is a modifination of merge sort.

### Selected Papers on Computer Science (Don Knuth) and the current state of Deep Learning

Book Info: Description Title Selected Papers on Computer Science [Amazon] Author Donald Knuth Pages 276 This is the most accessible book from Don Knuth. Although I was published nearly 20 years ago, it still is a classic computer science book. In Amazon, there is an interesting comment about the book from Peter Norvig (Director of Google Research).

### The repertoire method

The repertoire method is an approach to find a closed-form for recurrence relations and sum of series. The method is introduced in Chapter 1 of ConMath but most readers at the first time struggled with it. Through the book, especially in Chapter 1 and 2, the repertoire method demonstrates its ability to solve many sums and recurrences. However, I honestly admit that it is quite difficult to apply and do not fully understand how it works.

### Miscellaneous notes

Therer are some not-so-serious miscellaneous thoughts, comments of mine about everything in an informal format using Vietnamese and English. Table of Contents Deep Learning and truely science researching “Thời gian trôi như chó chạy ngoài đồng” How to classify images of fruit Chuyện fake news, fake quotes và toxic information. References Deep Learning and truely science researching “too often where people will something against their own gut instincts because they think the community wants them to do it that way, so people will work on a certain subject even though they aren’t terribly interested in it because they think that they’ll get more prestige by working on it.

### Why Ubuntu on Windows?

For programming purposes, I prefer Linux to Windows. However, Windows is really good at entertaining and office works. I admit that Microsoft Office is the best office suited I ever have experienced. Besides, OneNote is one of my favorite note-taking software, not to mention my beloved Bilizzard games such as Diablo, Starcraft. One solution to combine Windows and Linux is to install dual-boot in the machine. However, I am tired of switching between 2 OSs.