Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
uva
Commits
1d7e5c00
Commit
1d7e5c00
authored
Oct 09, 2011
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ImProc: Added machine specs and reformatted paragraphs.
parent
eb66faab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
31 deletions
+36
-31
improc/ass3/report/report.tex
improc/ass3/report/report.tex
+36
-31
No files found.
improc/ass3/report/report.tex
View file @
1d7e5c00
...
@@ -147,13 +147,15 @@ So, using the HSV color model does improve the results.
...
@@ -147,13 +147,15 @@ So, using the HSV color model does improve the results.
\subsection
{
Finding Waldo
}
\subsection
{
Finding Waldo
}
The assignment is to find Waldo (
\emph
{
waldo.tiff
}
) in a large image containing
The assignment is to find Waldo (
\emph
{
waldo.tiff
}
) in a large image containing
Waldo and many other characters (
\emph
{
waldo
\_
env.tiff
}
) using Histogram Backprojection.
Waldo and many other characters (
\emph
{
waldo
\_
env.tiff
}
) using Histogram
Backprojection.
The idea of Histogram Backprojection is explained in the paper by Swain and Ballard,
The idea of Histogram Backprojection is explained in the paper by Swain and
so we will not explain it here. The algorithm as described in the paper is as follows:
Ballard, so we will not explain it here. The algorithm as described in the
paper is as follows:
Given histograms
$
M
$
(model, Waldo) and
$
I
$
(environment), create the back
projection
Given histograms
$
M
$
(model, Waldo) and
$
I
$
(environment), create the back
$
b
$
in the following steps:
projection
$
b
$
in the following steps:
\begin{enumerate}
\begin{enumerate}
\item
for each histogram bin
$
j
$
do
$
R
_
j :
=
frac
{
M
_
j
}{
I
_
j
}$
\item
for each histogram bin
$
j
$
do
$
R
_
j :
=
frac
{
M
_
j
}{
I
_
j
}$
...
@@ -183,46 +185,49 @@ the following result:
...
@@ -183,46 +185,49 @@ the following result:
\subsection
{
Basic algorithm
}
\subsection
{
Basic algorithm
}
The algorithm is implemented in the function
\texttt
{
hbp
}
:
The algorithm is implemented in the function
\texttt
{
hbp
}
:
First,
$
M
$
and
$
I
$
First,
$
M
$
and
$
I
$
are created using
\texttt
{
colHist
}
.
$
R
$
is then created by
are created using
\texttt
{
colHist
}
.
$
R
$
is then created by division (step 1).
division (step 1). Afterwards, the back projection is created using the loop in step 2.
Afterwards, the back projection is created using the loop in step 2. Finally,
Finally,
a convolution function is used to soften the back projection. To create the
a convolution function is used to soften the back projection. To create the
convolution, we have used the function
\texttt
{
scipy.ndimage.correlate
}
with a
circular
convolution, we have used the function
\texttt
{
scipy.ndimage.correlate
}
with a
weight mask.
circular
weight mask.
The following result is generated with 64 bins in each color dimension and a
convolution
The following result is generated with 64 bins in each color dimension and a
radius of 15 pixels:
convolution
radius of 15 pixels:
\begin{figure}
[H]
\begin{figure}
[H]
\hspace
{
-4cm
}
\hspace
{
-4cm
}
\includegraphics
[width=20cm]
{
found
_
waldo.png
}
\includegraphics
[width=20cm]
{
found
_
waldo.png
}
\caption
{
\emph
{
found
\_
waldo.tiff
}
: Back projection of Waldo in the larger
image, the
\caption
{
\emph
{
found
\_
waldo.tiff
}
: Back projection of Waldo in the larger
red spot is Waldo's location.
}
image, the
red spot is Waldo's location.
}
\end{figure}
\end{figure}
This result is created in roughly 27 seconds on a laptop from 2009.
This result is created in roughly 27 seconds on a laptop from 2009, with an
Intel dual core and 4 GB RAM.
\subsection
{
Experimental cluster detection using K-means
}
\subsection
{
Experimental cluster detection using K-means
}
In addition to the assignment, we thought it would be interesting to be able to draw a
In addition to the assignment, we thought it would be interesting to be able to
rectangle around possible occurences of Waldo in the image. Therefore, we created the
draw a rectangle around possible occurences of Waldo in the image. Therefore,
function
\texttt
{
find
\_
peaks
}
, which returns a number of possible locations averages.
we created the function
\texttt
{
find
\_
peaks
}
, which returns a number of
To do this, we eliminate all pixels in the back projection which are below a certain
possible locations averages. To do this, we eliminate all pixels in the back
threshold (which is given as e number from 0 to 1, and then multiplied by the maximum
projection which are below a certain threshold (which is given as e number from
value in the projection). This leaves us with a number of pixels clusters, of which we
0 to 1, and then multiplied by the maximum value in the projection). This
can calculate the centers using K-means
leaves us with a number of pixels clusters, of which we can calculate the
algorithm
\footnote
{
\url
{
http://en.wikipedia.org/wiki/K-means
\_
clustering
}}
(function
centers using K-means
\texttt
{
scipy.cluster.vq.kmeans
}
). To find the initial estimators, we find all pixels
algorithm
\footnote
{
\url
{
http://en.wikipedia.org/wiki/K-means
\_
clustering
}}
that are further away from all other estimators than the diagonal of the model image
(function
\texttt
{
scipy.cluster.vq.kmeans
}
). To find the initial estimators, we
(
\emph
{
waldo.png
}
). Around each center pixel, a rectangle with the size of the model
find all pixels that are further away from all other estimators than the
image is drawn over the larger image. With 32 bins in each color dimension, a threshold
diagonal of the model image (
\emph
{
waldo.png
}
). Around each center pixel, a
of 0.25 and a convolution radius of 10 pixels, the result is as follows:
rectangle with the size of the model image is drawn over the larger image. With
32 bins in each color dimension, a threshold of 0.25 and a convolution radius
of 10 pixels, the result is as follows:
\begin{figure}
[H]
\begin{figure}
[H]
\hspace
{
-4cm
}
\hspace
{
-4cm
}
\includegraphics
[width=20cm]
{
k-means.png
}
\includegraphics
[width=20cm]
{
k-means.png
}
\caption
{
\emph
{
k-means.png
}
: Multiple possible locations using a low
threshold
\caption
{
\emph
{
k-means.png
}
: Multiple possible locations using a low
and convolution radius.
}
threshold
and convolution radius.
}
\end{figure}
\end{figure}
\end{document}
\end{document}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment