<< Chapter < Page Chapter >> Page >
Method to change the image of a coin from a circular collection of pixels to a rectangular matrix of FFTs.

Now that we've identified all the centers of the coins and their radii using the Hough transform, we can begin processing the data of each coin. The problem with comparing coins is that they can be rotated any amount, and because they're circular, there's no way to tell what the orientation is simply by looking at its general shape. To combat this, we can use the FFT and its special properties.

We'll start by converting the pixels of the coin into a rectangular matrix. This effectively changes the coordinate system from Cartesian to Polar, but you can think of it more easily as 'unwrapping' the coin. Start by taking a radius from the center of the coin to the top of the coin. We can use Bresenham's Line Drawing algorithm to calculate which pixels belong in the radius.

Coin unwrapping radius

A image of a radius from the center to the edge, showing which pixels would be captured.

Capture the pixels along this radius by storing them as a row in a matrix, with the center to the left and the outer edge to the right. Then, capture a new radius, this time with the center in the same place, but the outer edge moved slightly. The outer edge coordinate can be computed by calculating the sine and cosine of a circle with a user-defined radius.

One problem with this approach is that as we compute each radius going around the circle, some radii will take fewer pixels than others. Since MATLAB requires that a matrix must have the same number of columns in each row, we must account for this difference. A simple solution is to remove any data that is too large by always using the minimum possible size for the radius. If the radius that you just took has more pixels than the current matrix length, truncate the outermost pixels from the new radius and store it. On the other hand, if the new radius has fewer pixels than the matrix, this means that the current radius is actually the smallest so far, so we must remove the extra data from the matrix rows before we can insert the new radius. The final product should look like this:

Unwrapped coin

The unwrapped version of the coin in Fig. 1

Once radii have been taken for all 2πradians, the matrix contains all the unwrapped data for the coin. If we were to look at this matrix, and then look at the unwrapped version of an identical but rotated coin, the rotated one would be the same, except shifted vertically:

Unwrapped rotated coin

A shifted unwrapped version of the coin.

You can thus think about the rotation of the coin as a delay in time of a periodic signal. We all know from 301 that a delay in the time domain corresponds to a multiplication by a complex exponential in the frequency domain—a change which only affects the phase. Thus, if we take the FFT, the magnitude of the FFT should be the same between the two coins, and we can ignore the phase.

We only need to take the FFT along each circumference, not along the radii. Each circumference is a column in the matrix. Fortunately for us, the FFT() command in MATLAB takes the FFT along each column when given a matrix. Simply passing our unwrapped matrix into the FFT command will return the FFT of the coin, which we can then pass into the ABS() command to find the magnitude.

Questions & Answers

what is microbiology
Agebe Reply
What is a cell
Odelana Reply
what is cell
Mohammed
how does Neisseria cause meningitis
Nyibol Reply
what is microbiologist
Muhammad Reply
what is errata
Muhammad
is the branch of biology that deals with the study of microorganisms.
Ntefuni Reply
What is microbiology
Mercy Reply
studies of microbes
Louisiaste
when we takee the specimen which lumbar,spin,
Ziyad Reply
How bacteria create energy to survive?
Muhamad Reply
Bacteria doesn't produce energy they are dependent upon their substrate in case of lack of nutrients they are able to make spores which helps them to sustain in harsh environments
_Adnan
But not all bacteria make spores, l mean Eukaryotic cells have Mitochondria which acts as powerhouse for them, since bacteria don't have it, what is the substitution for it?
Muhamad
they make spores
Louisiaste
what is sporadic nd endemic, epidemic
Aminu Reply
the significance of food webs for disease transmission
Abreham
food webs brings about an infection as an individual depends on number of diseased foods or carriers dully.
Mark
explain assimilatory nitrate reduction
Esinniobiwa Reply
Assimilatory nitrate reduction is a process that occurs in some microorganisms, such as bacteria and archaea, in which nitrate (NO3-) is reduced to nitrite (NO2-), and then further reduced to ammonia (NH3).
Elkana
This process is called assimilatory nitrate reduction because the nitrogen that is produced is incorporated in the cells of microorganisms where it can be used in the synthesis of amino acids and other nitrogen products
Elkana
Examples of thermophilic organisms
Shu Reply
Give Examples of thermophilic organisms
Shu
advantages of normal Flora to the host
Micheal Reply
Prevent foreign microbes to the host
Abubakar
they provide healthier benefits to their hosts
ayesha
They are friends to host only when Host immune system is strong and become enemies when the host immune system is weakened . very bad relationship!
Mark
what is cell
faisal Reply
cell is the smallest unit of life
Fauziya
cell is the smallest unit of life
Akanni
ok
Innocent
cell is the structural and functional unit of life
Hasan
is the fundamental units of Life
Musa
what are emergency diseases
Micheal Reply
There are nothing like emergency disease but there are some common medical emergency which can occur simultaneously like Bleeding,heart attack,Breathing difficulties,severe pain heart stock.Hope you will get my point .Have a nice day ❣️
_Adnan
define infection ,prevention and control
Innocent
I think infection prevention and control is the avoidance of all things we do that gives out break of infections and promotion of health practices that promote life
Lubega
Heyy Lubega hussein where are u from?
_Adnan
en français
Adama
which site have a normal flora
ESTHER Reply
Many sites of the body have it Skin Nasal cavity Oral cavity Gastro intestinal tract
Safaa
skin
Asiina
skin,Oral,Nasal,GIt
Sadik
How can Commensal can Bacteria change into pathogen?
Sadik
How can Commensal Bacteria change into pathogen?
Sadik
all
Tesfaye
by fussion
Asiina
what are the advantages of normal Flora to the host
Micheal
what are the ways of control and prevention of nosocomial infection in the hospital
Micheal
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Elec 301 projects fall 2006. OpenStax CNX. Sep 27, 2007 Download for free at http://cnx.org/content/col10462/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Elec 301 projects fall 2006' conversation and receive update notifications?

Ask