0%

Camera Model

Pinhole Camera

This pinhole camera system consists of a barrier and a small aperture between the 3D object and a photographic film/image plane. \(f\) is the focal length that between the pinhole and the film; \(O\) is the aperture/center of the camera. Sometimes, the image plane is placed between \(O\) and the 3D object at a distance \(f\) from \(O\). In this case, it is called the virtual image.

Read more »

In real cameras, the image plane is actually behind the focal center, and produces an image that is symmetric about the focal center of the lens. The problem is usually simplified by placing a virtual image plane in front of the focal center.

Read more »

Projective geometry exists in \(\mathbb R^n\), same as Euclidean geometry. A projective line \(\cal P^{1}\) is analogous to a 1D Euclidean world; a projective plane \(\cal P^2\) corresponds to the Euclidean plane and a projective space \(\cal P^{3}\) is related to a 3D Euclidean space. Under such notions, imaging could be treated as a process that projecting from \(\cal P^3\) to \(\cal P^2\).

Euclidean geometry is actually a subset of projective geometry. And there are two geometries between them: similarity and affine. Projective geometry models well the imaging process of a camera because it allows a much larger class of transformations than others mentioned above. As tradeoff, the drawback is that fewer measures are preserved -- certainly not lengths, angles, or parallelism. Projective transformations preserve type (e.g. points remain points and lines remain lines), incidence (e.g. whether a point lies on a line), and cross ratio only.

Read more »

Graphics API

Every graphics program needs to be able to use two related APIs: a graphics API for visual output and a user-interface API to get input from the user. In Java, the graphics and user-interface toolkits are integrated and fully supported as part of the language. In C++, graphics API like DirectX and OpenGL are used to draw shapes, whereas the user-interface API is an independent entity that vary from system to system. In this approach, it is problematic to write portable code, therefore it's common to adopt a third layer to encapsulate the system specific user-interface code.

Graphics Pipeline

The graphics pipeline can be roughly divided into three part:

  1. Vertex Processing
  2. Primitive Processing
  3. Fragment Processing
Read more »

The impact of GIL

Before talking about multi-threading in python, you must know the term GIL first. GIL, short for Global Interpreter Lock, is a mutex that allows only one thread to hold the control of the Python interpreter.

GIL guarantees the thread-safty of Reference Counting ---- the memory management mechanism adoped by Python with low overhead and few performance loss of single-threaded programme. C libraries that are not thread-safe also become easier to integrate.

However, the nature of GIL that prevents CPU-bound threads from executing in parellel results of a performance bottleneck of multi-threaded CPU-bound code.

Read more »

A space consists of a set of selected points, with a set of selected relationships between those points. The points could be elements of a set, functions on another space, or subspaces of another space. The relationships define the nature of the space.

According to Kevin Carlson,

You could think of "structures" as places we do algebra, and "spaces" as places we do geometry. Then a lot of great mathematics has come from passing from structures to spaces and vice versa, as when we look at the fundamental group of a topological space or the spectrum of a ring.

As mentioned in TAB1, space and structure share similar definition; I just copy the definition of structure here.

A structure can be defined as a triple \(\mathcal{A} = (A, \sigma, I)\) where \(A\) means domain, \(\sigma\) means signature, and \(I\) means interpretation function.

  1. The domain is an arbitrary set. Sometimes the notation \(\operatorname{dom}(\mathcal A)\) or \(|\mathcal{A}|\) is used for the domain of \(\mathcal {A}\); Whereas sometimes \(\mathcal {A}\) refers both to the structure and its domain.

  2. The signature \(\sigma =(S,\operatorname {ar} )\) is a set \(S\) of function symbols (like +, ×, 0, 1) and relation symbols (like \(\ge\), \(\in\)) along with a function \(\text{ar:}\ S\to \mathbb {N}_{0}\) that assign a natural number \(n\) as arity to each symbol. A nullary function symbol is called a constant symbol.

  3. The interpretation function assigns functions and relations to each symbol of the signature.

Read more »

This article is the supplementary material of Build using CMake.

Command Invocations

A CMake source file is just a sequence of Command Invocations. A command invocation is an identifier followed by paren-enclosed arguments. Arguments are seperated by space. For examlpe:

1
add_executable(hello world.c)
Read more »

Building is a fairly general term without strict definition; It usually refers to the whole process that outputing the final product (an executable or a library) from source materials. Depending on the requirements, building will involve several of the following: pre-processing, compiling, linking, converting data files, automatically testing, packaging.

Among the tools that defining the building behaviors for Platform Dependent products whose programming language usually be C or C++, CMake is the most popular one as it is open-source and cross-platform. The building process with CMake takes place in two stages:

  1. Given abstract, platform and compiler independent building procedures defined by developers, generating standard Makefile or Project Files for IDEs (Visual Studio, Xcode etc.) .
  2. Invoke the desired native build tool to undertake the actual building process.

Here we introduce the usage of CMake. The environment of this tutorial is Windows 10; The output of each command will be different from that running on Linux. For the syntax of CMake Language, you may visit CMake Syntax for details.

Read more »

Eigen is a very versatile library in C++ that helps to solve matrix-related problems in efficient approaches. The functions it supports includes but not limited to:

  • Process arbitrary fixed-size or dynamic-size (unknown in compile-time) dense matrices and sparse matrices of all standard numeric types.
  • Perform matrix decompositions and geometry transforms.
  • Other extendable modules like non-linear optimization, a polynomial solver, FFT etc.

For further details, please visit http://eigen.tuxfamily.org/dox/

Read more »

Hexo is a prominent framework for building personal websites, with a good compatibility with Markdown, MathJax and NPM packages. As a matural ecosystem, there're hundreds of easy-to-use themes and plugins with detailed documentations available on the official website.

Among them, NexT is the preferable one as it not only provides a elegent and customizable appearance, it also integrates with tons of commonly-used tools like git-commit, google analytics, quicklink, Valine etc. In most cases, modifying config file is enough to activate those functions.

In this article, I will not repeat the contents that have already been well-informed on the official website; Just links towards such contents will be provided. Instead, I will introduce some add-on functions and emphasize on the points where I used to get stuck in.

Read more »