aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/.gitignore1
-rw-r--r--doc/base.tex20
-rw-r--r--doc/dui.md105
-rw-r--r--doc/makefile5
-rw-r--r--doc/pandoc.tex57
-rw-r--r--doc/refs.bib100
-rwxr-xr-xdoc/versiontable.awk15
7 files changed, 243 insertions, 60 deletions
diff --git a/doc/.gitignore b/doc/.gitignore
index e5139ef..8e7ebcc 100644
--- a/doc/.gitignore
+++ b/doc/.gitignore
@@ -17,3 +17,4 @@
# ignore output files
*.pdf
+versionctl.tex
diff --git a/doc/base.tex b/doc/base.tex
index edadce3..74bb57a 100644
--- a/doc/base.tex
+++ b/doc/base.tex
@@ -19,13 +19,14 @@
style=apa
]{biblatex}
\addbibresource{refs.bib}
+\usepackage{fancyvrb}
+\usepackage[nottoc]{tocbibind}
+\usepackage[en-US]{datetime2}
+
+\input{pandoc.tex}
\setmainfont{TeX Gyre Schola}
\setmathfont{TeX Gyre Schola Math}
-\sisetup{
- group-separator = {.},
- output-decimal-marker = {,}
-}
\bigskipamount=7mm
\medskipamount=4mm
@@ -56,6 +57,8 @@
\begin{titlepage}
\maketitle
\thispagestyle{empty}
+\vfill
+\input{versionctl.tex}
\end{titlepage}
\tableofcontents
@@ -63,10 +66,11 @@
\input{\jobname.md.tex}
-% \printbibliography[heading=bibintoc]
-% \printglossaries
-% \listoftables
-% \listoffigures
+\newpage
+\printbibliography[heading=bibintoc]
+\printglossaries
+\listoftables
+\listoffigures
\end{document}
diff --git a/doc/dui.md b/doc/dui.md
index cbe99e9..6260fb5 100644
--- a/doc/dui.md
+++ b/doc/dui.md
@@ -71,8 +71,7 @@ description in section \ref{problem-statement}.
## Overview
-![Architecture overview (level 0)
-\label{fig:architecture-level-0}](../assets/architecture-level-0.pdf)
+![Architecture overview (level 0)](../assets/architecture-level-0.pdf){#fig:architecture-level-0}
Figure \ref{fig:architecture-level-0} shows the hardware used in this project.
Both the Pololu Zumo 32U4 (referred to as just "Zumo"), and the Arduino Nicla
@@ -196,10 +195,10 @@ This is a popular algorithm used to detect straight lines in an image. It works
For more information about Hough Transform algorithms check the below links:
-- [Wiki hough](https://en.wikipedia.org/wiki/Hough_transform )
-- [Science article](https://www.sciencedirect.com/topics/computer-science/hough-transforms)
-- [OpenCV Hough](https://docs.opencv.org/3.4/d9/db0/tutorial_hough_lines.html)
-- [OpenMV find_lines](https://docs.openmv.io/library/omv.image.html)
+- \citetitle{wikipedia:hough}
+- \citetitle{sciencedirect:hough}
+- \citetitle{opencv:hough}
+- \citetitle{openmv:find_lines}
#### EDlines
@@ -207,10 +206,10 @@ EDLines, short for Edge Drawing Lines, is a feature-based algorithm that detects
For more information about EDlines algorithms check the below links:
-- [github library](https://github.com/CihanTopal/ED_Lib)
-- [Science article](https://www.sciencedirect.com/science/article/abs/pii/S0167865511001772)
-- [EDLINES: REAL-TIME LINE SEGMENT DETECTION BY EDGE DRAWING (ED)](https://projet.liris.cnrs.fr/imagine/pub/proceedings/ICIP-2011/papers/1569406487.pdf)
-- [OpenCV EDlines doc](https://docs.opencv.org/3.4/d4/d8b/group__ximgproc__edge__drawing.html)
+- \citetitle{gh:ed_lib}
+- \citetitle{sciencedirect:edlines}
+- \citetitle{paper:edlines}
+- \citetitle{opencv:edgedrawing}
#### Line Segment Detector
@@ -222,10 +221,10 @@ Once the line segments are detected, they are refined using a line merging algor
For more information about Line Segment Detector algorithms check the below links:
-- [LSD: a Line Segment Detector pdf](http://www.ipol.im/pub/art/2012/gjmr-lsd/article.pdf)
-- [Working behind LSD](https://saiwa.ai/blog/line-segment-detection-2/)
-- [OpenCV LSD doc](https://docs.opencv.org/3.4/db/d73/classcv_1_1LineSegmentDetector.html)
-- [OpenMV find_line_segments](https://docs.openmv.io/library/omv.image.html)
+- \citetitle{paper:lsd}
+- \citetitle{saiwa:lsd}
+- \citetitle{opencv:lsd}
+- \citetitle{openmv:lsd}
#### Radon transform
@@ -233,10 +232,10 @@ Radon transform is another popular algorithm used for line detection. It works b
For more information about Radon transform algorithms check the below links:
-- [Science article](https://www.sciencedirect.com/science/article/abs/pii/0031320396000155)
-- [matlab Radon](https://stackoverflow.com/questions/35412573/radon-transform-line-detection)
-- [Matlab elaboration Radon](https://www.kevinpolisano.com/Doctorat/doc-matlab-exemple/radon_lines_detection.html)
-- [OpenCV Radon doc](https://docs.opencv.org/4.x/d5/d89/radon__transform_8hpp.html)
+- \citetitle{sciencedirect:radon}
+- \citetitle{stackoverflow:radon}
+- \citetitle{matlab:radon}
+- \citetitle{opencv:radon}
### Which algorithm is suitable for our project?
@@ -244,7 +243,7 @@ We have identified four different types of line detection algorithms that could
#### OpenMV
-The only two algorithms that work with OpenMV are Hough Transform, the function find_lines, and Line Segment Detector, also known as find_line_segments. Both of these have their ups and downs and could be used for our project. find_lines has the most ups whereas find_line_segemtns has the most negative. As the result here below is decently optimized, it is first grayscaled, and then canny edge detection is done to it.
+The only two algorithms that work with OpenMV are Hough Transform, the function `find_lines`, and Line Segment Detector, also known as `find_line_segments`. Both of these have their ups and downs and could be used for our project. `find_lines` has the most ups whereas `find_line_segments` has the most negative. As the result here below is decently optimized, it is first grayscaled, and then canny edge detection is done to it.
For the test are the straight lines pictures used with different lighting additionality the left lane represents a whitish line and the right lane is drawn with a more darker color. here below are the pictures used:
@@ -252,9 +251,9 @@ For the test are the straight lines pictures used with different lighting additi
![picture 2](../RealTime_pictures/rtStraightLines.class/00018.jpg)
-##### find_lines
+##### `find_lines`
-The find_lines is a very fast function where you can handle straight lines and other lines with at least 45 FPS or more. Also, have a lot of control over the different types of parameters.
+The `find_lines` is a very fast function where you can handle straight lines and other lines with at least 45 FPS or more. Also, have a lot of control over the different types of parameters.
This is the outcome of picture 1:
![outcome_picture_1](../assets/hough_straightLines_Pic_0.png)
@@ -264,9 +263,9 @@ This is the outcome of picture 2:
As you can see there isn't much of a difference between the two pictures.
-##### find_line_segments
+##### `find_line_segments`
-The find_line_segments is a very slow function where you can find segments from a line. This is a easier to use function because it only has two parameters but the frame rate drops significantly. Additionally, the size of the image to run the algorithm on needs to be smaller because of memory.
+The `find_line_segments` is a very slow function where you can find segments from a line. This is a easier to use function because it only has two parameters but the frame rate drops significantly. Additionally, the size of the image to run the algorithm on needs to be smaller because of memory.
This is the outcome of picture 1:
@@ -286,7 +285,7 @@ All the above algorithms could be used with OpenCV, But the Radon transform need
In order to make the Zumo robot both detect where it is on a road, and steer to
keep driving on said road, some sort of communication needs to exist between
-the Nicla and Zumo. As mentioned earlier\footnote{dit is nog niet benoemd}, all
+the Nicla and Zumo. As mentioned in section \ref{distribution-of-features}, all
machine vision-related tasks will happen on the Nicla board. Because the Nicla
board is the first to know how much to steer the cart, it makes sense to have
it control the cart by giving the Nicla a 'steering wheel' of sorts.
@@ -353,8 +352,8 @@ The complete protocol consists of single byte commands. A byte can either
change the cart speed or steering direction, both will apply gradually. When no
commands have been received for more than 2 seconds, the Zumo robot will
gradually slow down until it is stopped. Exact specifications of commands are
-provided in the protocol specification document\footnote{dit document bestaat
-nog niet}.
+provided in the protocol specification in section
+\ref{niclazumo-communication-protocol}.
}
\communicationConclusion
@@ -395,6 +394,7 @@ The distinct color characteristics of traffic signs can attract drivers’ atten
One can easily look at the RGB values to detect a certain color. Although the r,g and b values are heavily effected by different illuminations, therefore this isn't a reliable solution in variating lighting conditions.
+\needspace{5cm}
An example implementation:
```py
@@ -408,6 +408,7 @@ if(B >= thB)
if((R + G) >= ThY)
```
+\needspace{4cm}
It is possible to enhance the colors with maximum and minimum operations:
```py
@@ -416,13 +417,18 @@ fB(i) = max(0, min(iB − iR, iB − iG)/s),
fY(i) = max(0, min(iR − iB, iG − iB)/s).
```
-This method can result in some issues on the blue channel (see source 1 page 86583 for more explanation). As a solution to this issue use the following formula for the blue channel instead:
+\needspace{2cm}
+This method can result in some issues on the blue channel
+\footcite[86583]{ieee:sign-detection}. As a solution to this issue use the
+following formula for the blue channel instead:
+
```py
-f′B(i) = max((0, iB − iR)/s).
+_fB(i) = max((0, iB − iR)/s).
```
#### HSV
+\needspace{6cm}
The HSV/HSI color space is more immune to the illumination challenges of RGB. The hue and saturation channels can be calculated using RGB, which increases the processing time.
The following pseudo code shows how to detect the red, blue and yellow colors in this space.
@@ -450,12 +456,13 @@ This color space is used for finding uncorrelated color components, the L\*a\*b\
This method avoids the use of fixed thresholds that might need adjusting at times. In order to resolve this some authors tried to transfer the problem into pixel classification where a neural network classifies every pixel in the input image, the pixel classification algorithms are often slower than other color extraction methods.
-#### results
-
-\def\signDetectionColor{
-The above described methods where also applied to a database in order to compare each method. This resulted in the conclusion that, using a normalized RGB space is giving the a mixture of most detections and least false-positve results. See source 1 page 86584 for the full report.
+\def\signDetectionColorConclusion{
+All color-based detection methods where also applied to a database in order to
+compare each method. Experiments concluded that using a normalized RGB space is
+giving the a mixture of most detections and least false-positve
+results\footcite{ieee:sign-detection}.
}
-\signDetectionColor
+\signDetectionColorConclusion
### Shape based
@@ -484,17 +491,17 @@ For example, using a color based detection to find a ROI and using shape detecti
### Neural networks
<!-- TODO: -->
-### results
-
-\def\signDetectionShape{
-Most shape based recognition methods are more complex than using a color based detection. But the method 'Fourier' seems the most useful as it can also deal with rotated and occluded objects.
+\def\signDetectionShapeConclusion{
+Most shape based recognition methods are more complex than using a color based
+detection. But the method `Fourier' seems the most useful as it can also deal
+with rotated and occluded objects.
}
-\signDetectionShape
+\signDetectionShapeConclusion
## Traffic Sign Recognition (TSR)
After traffic sign detection or tracking, traffic sign recognition is performed to classify the detected traffic signs into correct classes.
-![signs example](../assets/signs.png)
+![signs example](../assets/signs.png){#fig:signs-example}
### Binary tree
The binary-tree-based classification method usually classify traffic signs according to the shapes and colors in a coarse-to-fine tree process.
@@ -502,22 +509,18 @@ The binary-tree-based classification method usually classify traffic signs accor
### Support Vector Machine (SVM)
As a binary-classification method, SVM classifies traffic signs using one-vs-one or one-vs-others classification process.
-## results
-
-\def\signRecognition{
-While making a binary tree is seemingly the most simple, yet effective solution. Using the 'Fourier' method is a bit more complex, it may be a better solution (this requires testing).
+\def\signRecognitionConclusion{
+While making a binary tree is seemingly the most simple, yet effective
+solution. Using the `Fourier' method is a bit more complex, it may be a better
+solution (this requires testing).
}
-\signRecognition
+\signRecognitionConclusion
# Conclusion
\communicationConclusion
\buildSystemConclusion
-\signDetectionColor
-\signDetectionShape
-\signRecognition
-
-## Sources:
-
-1. [IEEE, Digital Object Identifier June 26, 2019 (pages 86578 - 86596)](https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8746141)
+\signDetectionColorConclusion
+\signDetectionShapeConclusion
+\signRecognitionConclusion
diff --git a/doc/makefile b/doc/makefile
index 3446eeb..fbc2d82 100644
--- a/doc/makefile
+++ b/doc/makefile
@@ -8,13 +8,16 @@ dui.pdf: ../assets/LSD_straightLines_Pic_1.png
dui.pdf: ../assets/hough_straightLines_Pic_0.png
dui.pdf: ../assets/hough_straightLines_Pic_1.png
+versionctl.tex:
+ git tag -l 'doc-*' --format='%(refname:short) %(*objectname:short) %(contents:subject) %(*authordate:format:%s)' | ./versiontable.awk -F' ' > $@
+
%.png: %.bmp
convert $< $@
%.pdf: %.svg
rsvg-convert -f pdf -o $@ $<
-%.pdf: %.tex base.tex %.md.tex
+%.pdf: %.tex base.tex %.md.tex versionctl.tex
latexmk $< -shell-escape -halt-on-error -lualatex -f -g
%.md.tex: %.md
diff --git a/doc/pandoc.tex b/doc/pandoc.tex
new file mode 100644
index 0000000..2561a57
--- /dev/null
+++ b/doc/pandoc.tex
@@ -0,0 +1,57 @@
+\newcommand{\VerbBar}{|}
+\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
+\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
+% Add ',fontsize=\small' for more characters per line
+\newenvironment{Shaded}{}{}
+\newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}}
+\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
+\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.49,0.56,0.16}{#1}}
+\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
+\newcommand{\BuiltInTok}[1]{\textcolor[rgb]{0.00,0.50,0.00}{#1}}
+\newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
+\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{#1}}}
+\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
+\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.53,0.00,0.00}{#1}}
+\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{#1}}}
+\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{#1}}
+\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
+\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.73,0.13,0.13}{\textit{#1}}}
+\newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}}
+\newcommand{\ExtensionTok}[1]{#1}
+\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
+\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{#1}}
+\newcommand{\ImportTok}[1]{\textcolor[rgb]{0.00,0.50,0.00}{\textbf{#1}}}
+\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
+\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{#1}}}
+\newcommand{\NormalTok}[1]{#1}
+\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}}
+\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{#1}}
+\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.74,0.48,0.00}{#1}}
+\newcommand{\RegionMarkerTok}[1]{#1}
+\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
+\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.73,0.40,0.53}{#1}}
+\newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
+\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.10,0.09,0.49}{#1}}
+\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
+\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
+
+\makeatletter
+\def\fig@maxwidth{10cm}
+\def\fig@maxheight{10cm}
+\def\ScaleWidthIfNeeded{%
+ \ifdim\Gin@nat@width>\fig@maxwidth
+ \fig@maxwidth
+ \else
+ \Gin@nat@width
+ \fi
+}
+\def\ScaleHeightIfNeeded{%
+ \ifdim\Gin@nat@height>0.9\fig@maxheight
+ \fig@maxheight
+ \else
+ \Gin@nat@width
+ \fi
+}
+\makeatother
+
+\setkeys{Gin}{width=\ScaleWidthIfNeeded,height=\ScaleHeightIfNeeded,keepaspectratio}%
diff --git a/doc/refs.bib b/doc/refs.bib
index e69de29..e8a2277 100644
--- a/doc/refs.bib
+++ b/doc/refs.bib
@@ -0,0 +1,100 @@
+@article{ieee:sign-detection,
+ author = {Chunsheng Liu and Shuang Li and Faliang Chang and Yinhai Wang},
+ title = {Machine Vision Based Traffic Sign Detection Methods: Review,
+ Analyses and Perspectives},
+ year = {2019},
+ url = {https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8746141}
+}
+
+@online{wikipedia:hough,
+ title = {Hough transform},
+ url = {https://en.wikipedia.org/wiki/Hough_transform}
+}
+
+@article{sciencedirect:hough,
+ author = {Mark S. Nixon and Alberto S and Aguado},
+ title = {Feature Extraction and Image Processing for Computer Vision},
+ year = {2020},
+ url = {https://www.sciencedirect.com/topics/computer-science/hough-transforms}
+}
+
+@manual{opencv:hough,
+ title = {Hough Line Transform},
+ url = {https://docs.opencv.org/3.4/d9/db0/tutorial_hough_lines.html}
+}
+
+@manual{openmv:find_lines,
+ title = {image — machine vision},
+ url = {https://docs.openmv.io/library/omv.image.html}
+}
+
+@manual{gh:ed_lib,
+ title = {Implementations of edge (ED, EDColor, EDPF), line (EDLines),
+ circle and low eccentric ellipse (EDCircles) detection algorithms.},
+ author = {Cihan Topal},
+ url = {https://github.com/CihanTopal/ED_Lib}
+}
+
+@article{sciencedirect:edlines,
+ title = {EDLines: A real-time line segment detector with a false detection control},
+ author = {Cuneyt Akinlar},
+ url = {https://www.sciencedirect.com/science/article/abs/pii/S0167865511001772}
+}
+
+@article{paper:edlines,
+ title = {EDLines: real-time line segment detection by edge drawing (ED)},
+ author = {Cuneyt Akinlar and Cihan Topal},
+ year = {2011},
+ url = {https://projet.liris.cnrs.fr/imagine/pub/proceedings/ICIP-2011/papers/1569406487.pdf}
+}
+
+@manual{opencv:edgedrawing,
+ title = {OpenCV EDlines doc},
+ url = {https://docs.opencv.org/3.4/d4/d8b/group__ximgproc__edge__drawing.html}
+}
+
+@article{paper:lsd,
+ title = {LSD: a Line Segment Detector},
+ author = {Rafael Grompone von Gioi and Jérémie Jakubowicz and Jean-Michel Morel and Gregory Randall},
+ year = {2012},
+ url = {http://www.ipol.im/pub/art/2012/gjmr-lsd/article.pdf}
+}
+
+@online{saiwa:lsd,
+ title = {line Segment Detection | A Comprehensive Guide},
+ year = {2023},
+ url = {https://saiwa.ai/blog/line-segment-detection-2/}
+}
+
+@manual{opencv:lsd,
+ title = {OpenCV LSD doc},
+ url = {https://docs.opencv.org/3.4/db/d73/classcv_1_1LineSegmentDetector.html}
+}
+
+@online{openmv:lsd,
+ title = {OpenMV find\_line\_segments},
+ url = {https://docs.openmv.io/library/omv.image.html}
+}
+
+@online{sciencedirect:radon,
+ title = {A fast digital radon transform -- an efficient means for evaluating the hough transform},
+ year = {1996},
+ author = {W.A. Götz and H.J. Druckmüller},
+ url = {https://www.sciencedirect.com/science/article/abs/pii/0031320396000155}
+}
+
+@online{stackoverflow:radon,
+ title = {Radon Transform Line Detection},
+ url = {https://stackoverflow.com/questions/35412573/radon-transform-line-detection}
+}
+
+@online{matlab:radon,
+ title = {Radon transform applied to lines detection},
+ author = {Kévin Polisano},
+ url = {https://www.kevinpolisano.com/Doctorat/doc-matlab-exemple/radon_lines_detection.html}
+}
+
+@online{opencv:radon,
+ title = {OpenCV Radon doc},
+ url = {https://docs.opencv.org/4.x/d5/d89/radon__transform_8hpp.html}
+}
diff --git a/doc/versiontable.awk b/doc/versiontable.awk
new file mode 100755
index 0000000..96108fd
--- /dev/null
+++ b/doc/versiontable.awk
@@ -0,0 +1,15 @@
+#!/bin/awk -f
+BEGIN {
+ print "\\noindent\\begin{tabularx}{\\linewidth}{llXr}"
+ print "\\toprule"
+ print "Version & Commit & Notes & Date\\\\"
+ print "\\midrule"
+}
+{
+ sub("doc-", "", $1)
+ print $1" & \\texttt{"$2"} & "$3" & \\DTMdisplaydate"strftime("{%Y}{%m}{%d}{-1}", $4)"\\\\"
+}
+END {
+ print "\\bottomrule"
+ print "\\end{tabularx}"
+}