The COTBLEDTCID approach to object detection and pose estimation, Part V – Circles detection

Introduction

Let’s do a summary of what we have done so far:

  • COT: colour thresholding. We separated yellow objects from the rest.
  • BLED: blob edge detection. We retrieved the bottom edges of blobs (pawns).
  • T: transformation. We transformed the image’s pixels into game field points (aka. pixels to meters).

And the last step CID: Circles Detection.

As you may have already noticed, pawns and tower of pawns are in fact circles when viewed from above. Therefore, the bottom edges we found with BLED are also circles’ segments when transformed into game field coordinates (step T). This is the property we’re exploiting below.

Continue reading

Advertisements

The COTBLEDTCID approach to object detection and pose estimation, Part IV – Transformation

Introduction

With the last step we know where the bottom edges of the pawn are located on the image, we just need to find a way to transform the coordinates of those pixels into game field coordinates.

Given a point p' from the Image plane, we’d like to transform it into p from the Game field plane. We can write:

p = H \cdot p'

We observe that straight lines are kept straight, thus H is called the homography matrix which can be computed if at least 4 different matching points are given for both planes. (p1 \leftrightarrow p1', p2 \leftrightarrow p2', p3 \leftrightarrow p3', p4 \leftrightarrow p4')

HomographyIt’s worth noticing that both p and p' points are given in homogeneus coordinates.

Continue reading

The Heart Curve present

For those who are in love and (or) those who like maths, this post might be interesting. For those who don’t, be aware: this post is about maths and hearts 😉

Some time ago, I designed a heart with mathematical functions. 14th of February seems the perfect day to offer something like this. It is original, cheap and easy to do. So if you’re in a hurry and forgot to buy a present to your girl/boyfriend, take a piece of paper and write him/her down the Heart Curve.

The Heart Curve is a mathematical relation that, when plotted, has the shape of a heart. This is easily accomplished by the use of several implicit functions.

Let H(x) be the Heart relation defined on [\frac{-\sqrt{13}-3}{5}, \frac{\sqrt{13}+3}{5}], (x, y) \in \mathbb{R}\times\mathbb{R} by:

H(x) : \left\{ \begin{array}{clcr} (x+\frac{3}{5})^2 + (y-\frac{8}{5})^2 = \frac{13}{25}, & \text{if } y > x +2 \\ (x-\frac{3}{5})^2 + (y-\frac{8}{5})^2 = \frac{13}{25}, & \text{if } y > -x + 2\\ y^3 = x^2, & \text{if } x \in [-1,1]\\  \end{array} \right.

The resulting plot without using  the functions’ definitions :
Continue reading

Project Euler

Project Euler is a series of challenging mathematical/computer programming problems, their  difficulty varies from one problem to another and theoretically, they can be solved by anyone. A good mathematical knowledge is required to solve most of them, and good programming skills will make your life easier.

You may however, use the inductive chain learning approach, where solving the first problems will help you solve the next ones and so on by learning new methods and concepts, both in mathematics and in programming.

Continue reading