Skip to main content

Teaching Machines to Locate Objects in Photos

How to Create a holographic display and camcorder

In the last part of the series "How to Create a Holographic Display and Camcorder", I talked about how to use the cameras to calculate the disparity between photos.  To do so, we have locate the objects in two photos, but this should be done by a machine.

In this part of the series, I'll talk about how to show a machine to locate objects in photos.




To calculate the depth information or the disparity of an object, we need to locate where the object is in each photo.

[Insert an illustration of an object and a camera by X-axis translation]


How to locate an object in each photo?
In each photo, we need to find the same object.  Then, we should calculate the disparity between the object in the first photo and the object in the second photo.

So, how do we locate the same object in each photo?

Let's say we want to locate a tip of a cat's left ear in two photos.  Each photo shows the same cat, but at the different location.

Can we teach a machine to recognize a cat in a photo, in general, by using the machine learning, but they do find them with about 70% confidence rate, and it takes time to process each image.

For the machine learning, I'll write a blog in another time.

We need a fast locating algorithm to find us the tip of the cat's ear, almost every time.


Using a gradient value between a pixel and its neighboring pixels? 

Going back to the basics of image pixels, we can say, whenever there is a steep difference between the intensity value of the current pixel and the intensity values of the neighboring pixels.

This is called taking a gradient value between pixels.

This should give us nice locating points in an image?

There are multiple issues with this problem.  In this sample, we are using the photos showing the one-axis translation.

But in reality, the object is a photo A may be at a different location entirely in a photo B.  The object may look bigger, rotated or at a different angle.

So, if we taking the gradient values, they would give the same reliable locations, if the object in a photo B is now rotated.


Using a pixel corner as a locating point in an image

To work with the rotation issue, we can use a L-shaped gradient.   In any rotation, it is still a L.  This is called an interest point.






How to find the same locating points in other photos?

Okay, so we locate multiple locating points in a photo A.  How do we find the same interest points in a photo B?

Let's say we have an interest point X in a photo A.

And we want to find the same interest point X' in a photo B.

How do we know if they are indeed identical?

One of the ways is to take the neighboring pixel values of an interest point X and compare the neighboring pixel values of the interest point X'.

These neighboring pixel values of an interest point X is called a descriptor.  

A locating point is called an interest point.

An interest point and the descriptor is called a feature.


  • Interest Point
    • A locating point is called an interest point.
  • Descriptor
    • The neighboring pixel values is a descriptor, for example.
  • Feature
    • A descriptor and an interest point is called a feature.

They are actually multiple ways to define a descriptor.  For this project of creating a Holographic Display and a Holographic Camcorder, we have other options.



Shift Invariant Feature Transform (SIFT)
There are multiple locating feature algorithms to consider. 

SIFT
FAST
HOG
SURF
GOLH
[Briefly explain each of these]

[Todo:  Provide Machine Learning and Deep Learning algorithms in comparison in the future]


[Insert a intersection set of a set A and a set B is common among sets A and B]


How to extract the depth of an interest point in a photo?

To extract the depth of an interest point in a photo A in comparison with a photo B, we will use a method called Triangulation.

In the next part of the series, I'll talk about Triangulation.

Comments

Popular posts from this blog

How to improve the traditional ASR using Connectionist Temporal Classification

The traditional Automatic Speech Recognition (ASR) performs at about 85% accuracy rate.  At this rate, ASR users are often frustrated with the experience with using such a system. The tradition ASR is often fragile: 1) requires extensive modification of parameters, just to make it work. 2) requires extensive understanding of a language model and a acoustic model. 3) doesn't scale well to multiple languages. 4) hyper-sensitive to speaker variants. Deep Learning on the acoustic model has been introduced, but not much of gain in the accuracy. What if, we can do a DL from end to end? Connectionist Temporal Classification (2006) introduces an idea of using FFT on the frequency of a recording of a voice command and constructs a spectrogram at 8kHz.  At each spectrogram interval, a DL neural network can be assigned, individually. The basic idea is to have RNN output neurons to encode distribution over "symbols". The traditional ASR uses a phone...

Calculating camera extrincs

Before we talk about the projection matrix of the depth correspondces, we need to know two things: - Camera extrinsics - Camera intrinsics Camera extrinsics maps the world coorinates to the camera coordinates. For the simplicity of the camera, it is a pinhole camera without lenses.  I'll talk about the lenses, the focal length, the lense aberation, the pixel sensor dimension, etc in Camera intrincs. So, locating an object in two images and projecting in the camera space is not that straight. But, it will be a straight process with the application of Machine Learning. I'll talk about the next part of the series in applying the deep neural network to optimizing the homographic projection and have it robust in low texture settings including low light. Deep Neural Network - Estimating Homography to address: - low texture environment - outside light conditions ( gamma > 2kLs) - robust as or better than SfM or other SLAM techniquese First, we need to locate the ...

How to use Convolution Neural Network to predict SIFT features

A feature locator is essential in all CV domain.  It's the basis of the germetric transformation, epipolar geometry, to 3D mesh reconstruction. Many techniques - SIFT and other SLAM technologies, are available, but they require ideal environments to work in. To address the short comings: - sensitive to low texture environment - sensitive to low light envonrment - sensitive to high light environment (like outdoor day light with above 20k lux) - and many other issues I propose a CNN based neural network to detect 4 correspondences in an image A and an image B. Since it is tricky to have a neural network to predict a 4x4 affine matrix of rotation and translation, I separated the translation vector from the rotation vector. Basically, the ground truth data will be precalcalated with a generic SIFT with RANSAC to calculate the correspondences set P and P'. The L2 (Eucledean) distance will be used between a predicted value.  They are 4 points, so an averaged will ...