<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/judging-freehand-circle-drawing-competitions/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://staff.math.su.se/hoehle/blog/2018/07/31/circle.html"> Theory meets practice...</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<h2>Abstract:</h2>
<p>In 2007 Alexander Overwijk went viral with his ‘Perfect Circle’ video. The same year a World Freehand Circle Drawing Championship was organized, which he won. In this post we show how a mobile camera, R and the imager package can be used to develop an image analysis based method to judge future instances of the championship.</p>
<p><center><br>
<img src="https://i1.wp.com/staff.math.su.se/hoehle/blog/figure/source/2018-07-31-circle/HUD-1.png?w=456" data-recalc-dims="1"><br>
</center></p>
<p> <a rel="nofollow" href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank"><img alt="Creative Commons License" src="https://i1.wp.com/i.creativecommons.org/l/by-sa/4.0/88x31.png?w=456&ssl=1" data-recalc-dims="1"></a> This work is licensed under a <a rel="nofollow" href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Creative Commons Attribution-ShareAlike 4.0 International License</a>. The markdown+Rknitr source code of this blog is available under a <a rel="nofollow" href="https://www.gnu.org/licenses/gpl-3.0.html" target="_blank">GNU General Public License (GPL v3)</a> license from github.</p>
<h2>Introduction</h2>
<p>A few years back I watched with awe the 2007 video of <a rel="nofollow" href="https://twitter.com/AlexOverwijk" target="_blank">Alexander Overwijk</a>‘s freehand drawing a 1m diameter circle:</p>
<p><center><br>
<iframe width="450" allowfullscreen src="https://www.youtube.com/embed/eAhfZUZiwSE"><br>
</iframe><br>
</center><br>
<font color="bbbbbb">Note: Depending on your browser you might need to click &quot;<a rel="nofollow" href="https://www.youtube.com/watch?v=eAhfZUZiwSE" target="_blank">Watch on Youtube</a>&quot; to see the video.</font></p>
<p><p>Ever since watching that video I have wondered how one would go about to judge the winner of such an alleged <a rel="nofollow" href="https://www.youtube.com/watch?v=u1J5ANnq0T8" target="_blank">World Freehand Circle Drawing Championship</a> (WFHCDC). While researching for this post I finally figured it out. On his web page Alexander in the story behind the video <a rel="nofollow" href="http://slamdunkmath.blogspot.com/" target="_blank">&quot;reveals&quot;</a>:</p>
<p><em>They have a laser machine called the <strong>circleometer</strong> that creates the perfect circle closest to the one you drew. The circleometer then calculates the difference in area between the laser circle and the circle that you drew. The machine then calibrates the area difference as if you had drawn a circle with radius one meter. The person with the smallest area difference is declared the world freehand circle drawing champion.</em></p>
<p>Aha! Imaginary circleometers are expensive and my dean of study most likely isn’t open for investing in perfect circle measurement equipment… So here is a cheaper solution involving a mobile device camera, <a rel="nofollow" href="https://www.r-project.org/" target="_blank">R</a> and the <a rel="nofollow" href="https://cran.r-project.org/web/packages/imager/index.html" target="_blank"><code>imager</code></a> package by <a rel="nofollow" href="https://sites.google.com/site/simonbarthelme/" target="_blank">Simon Barthelmé</a> et al. Altogether a combination of modern <strong>data science</strong> tools, which my dean of study is most likely to approve! We’ll use a screenshot from the perfect circle video as motivating example to guide through the 3 phases of the method:</p>
<ol type="1">
<li>Image Rectification</li>
<li>Freehand circle identification and perfect circle estimation</li>
<li>Quantifying deviation from the perfect circle</li>
</ol>
<p>We start by loading the screenshot into R using <code>imager</code>:</p>
<div>
<pre><code><span>library</span>(<span>&quot;imager&quot;</span>)
file &lt;-<span> &quot;circle2.png&quot;</span>
img &lt;-<span> </span>imager<span>::</span><span>load.image</span>(<span>file.path</span>(fullFigPath, file))</code></pre>
</div>
<p><img src="https://i0.wp.com/staff.math.su.se/hoehle/blog/figure/source/2018-07-31-circle/PLOTSCREENSHOT-1.png?w=456" data-recalc-dims="1"></p>
<h2>Image Rectification</h2>
<p>The image clearly suffers from perspective distortions caused by the camera being positioned to the right of the circle and, hence, not being orthogonal to the blackboard plane. Furthermore, small lense distortions are also visible – for example the right vertical line of the blackboard arcs slightly. Since the video contains no details about what sort of lense equipment was used, for the sake of simplicity, we will ignore lense distortions in this post. If such information is available one can use a program such as <a rel="nofollow" href="http://rawtherapee.com/" target="_blank">RawTherapee</a> (available under a GNU GPL v3 license) to read the EXIF information in the meta data of the image and automatically correct for lens distortion.</p>
<p>To rectify the image we estimate the parameters of the 2D projection based on 4 ground control points (GPC). We use R’s <code>locator</code> function to determine the pixel location of the four corner points of the blackboard in the image, but could just as well use any image analysis program such as <a rel="nofollow" href="https://www.gimp.org/" target="_blank">Gimp</a>. Furthermore, we need the true object coordinates of these GPC. Unfortunately, these are only approximately available to due lack of knowledge of the size of the blackboard in the classroom. As a consequence a <em>guesstimate</em> of the horizontal length is used.</p>
<div>
<pre><code><span>plot</span>(img)
p &lt;-<span> </span><span>locator</span>(<span>4</span>)
p &lt;-<span> </span><span>round</span>(<span>cbind</span>(p<span>$</span>x, p<span>$</span>y))
<span>dump</span>(<span>list=</span><span>c</span>(<span>&quot;p&quot;</span>), <span>&quot;&quot;</span>)</code></pre>
</div>
<p>These points are now used to rectify the image by a Direct Linear Transformation (DLT) based on exactly 4 control points <span data-cites="hartley_zisserman2004">(Hartley and Zisserman 2004, Chapter 4)</span><a rel="nofollow" href="http://staff.math.su.se/hoehle/blog/2018/07/31/circle.html#fn1" target="_blank"><sup>1</sup></a>. That is the parameters of the 3×3 transformation matrix <span>\(H\)</span> in homogeneous coordinates are estimated such that <span>\(p' = H p\)</span>, see the <a rel="nofollow" href="https://raw.githubusercontent.com/hoehleatsu/hoehleatsu.github.io/master/_source/2018-07-31-circle.Rmd" target="_blank">code</a> on github for details.</p>
<p>We can implement the rectifying transformation using the <code>imager::warp</code> function:</p>
<div>
<pre><code>##Transform image coordinates (x',y') to (x,y), i.e. note we specify
##the back transformation p = H * p', so H here is the inverse.
map.persp.inv &lt;-<span> </span><span>function</span>(x,y, H) {
  out_image &lt;-<span> </span>H <span>%*%</span><span> </span><span>rbind</span>(x,y,<span>1</span>)
  <span>list</span>(<span>x=</span>out_image[<span>1</span>,]<span>/</span>out_image[<span>3</span>,], <span>y=</span>out_image[<span>2</span>,]<span>/</span>out_image[<span>3</span>,])
}
##Pad dx_blackboard pixels to the right to make space for blackboard
img_padded &lt;-<span> </span><span>pad</span>(img, <span>nPix=</span>dx_blackboard, <span>axes=</span><span>&quot;x&quot;</span>, <span>pos=</span><span>1</span>)
##Warp image
warp &lt;-<span> </span><span>imwarp</span>(img_padded, <span>map=</span><span>function</span>(x,y) <span>map.persp.inv</span>(x,y,<span>solve</span>(H)),<span>coordinates=</span><span>&quot;absolute&quot;</span>, <span>direction=</span><span>&quot;backward&quot;</span>)</code></pre>
</div>
<p>The result looks as follows: <img src="https://i1.wp.com/staff.math.su.se/hoehle/blog/figure/source/2018-07-31-circle/PLOTRECTIFICATION-1.png?w=456" data-recalc-dims="1"> Please notice the different x-axes of the two images when comparing them. For faster computation and better visualization in the remainder of this post, we crop the x-axis of the image to the relevant parts of the circle.</p>
<div>
<pre><code>warp &lt;-<span> </span><span>imsub</span>(warp, x <span>%inr%</span><span> </span><span>c</span>(dx_blackboard, <span>nrow</span>(warp)))</code></pre>
</div>
<p><img src="https://i1.wp.com/staff.math.su.se/hoehle/blog/figure/source/2018-07-31-circle/PLOTRECTIFIED-1.png?w=456" data-recalc-dims="1"></p>
<h2>Freehand circle identification</h2>
<p>As described in the <code>imager</code> <a rel="nofollow" href="https://dahtah.github.io/imager/canny.html" target="_blank">edge detection tutorial</a> we use length of the gradient to determine the edges in the image. This can be done by applying filters to the image.</p>
<div>
<pre><code>##Edge detection function. Sigma is the size of the blur window.
detect.edges &lt;-<span> </span><span>function</span>(im, <span>sigma=</span><span>1</span>) {
  <span>isoblur</span>(im,sigma) <span>%>%</span><span> </span><span>imgradient</span>(<span>&quot;xy&quot;</span>) <span>%>%</span><span> </span><span>enorm</span>() <span>%>%</span><span> </span><span>imsplit</span>(<span>&quot;c&quot;</span>) <span>%>%</span><span> </span>add
}
<span>#Edge detection filter sequence.</span>
edges &lt;-<span> </span><span>detect.edges</span>(warp,<span>1</span>) <span>%>%</span><span> </span>sqrt</code></pre>
</div>
<p>To detect the circle from this we specify a few seed points for a <a rel="nofollow" href="https://en.wikipedia.org/wiki/Watershed_%28image_processing%29" target="_blank">watershed</a> algorithm with a priority map inverse proportional to gradient magnitude. This includes a few points outside the circle and a few points inside the circle. Note: a perfect circle would have no border, but when drawing a circle with a piece of chalk it’s destined to have a thin border line.</p>
<p><img src="https://i2.wp.com/staff.math.su.se/hoehle/blog/figure/source/2018-07-31-circle/SEGMENTATION-1.png?w=456" data-recalc-dims="1"> We can now extract the circle by:</p>
<div>
<pre><code>##Just the circle
freehandCircle &lt;-<span> </span>(warp <span>*</span><span> </span>(mask<span>==</span><span>2</span>) <span>></span><span> </span><span>0</span>) <span>%>%</span><span> </span>grayscale
##Total area covered by the circle
freehandDisc &lt;-<span> </span><span>label</span>(freehandCircle, <span>high_connectivity=</span><span>TRUE</span>) <span>></span><span> </span><span>0</span></code></pre>
</div>
<div>
<pre><code>dilatedDisc &lt;-<span> </span>freehandDisc <span>%>%</span><span> </span><span>dilate_rect</span>(<span>sx=</span><span>3</span>,<span>sy=</span><span>3</span>)
freehandCircleThinBorder &lt;-<span> </span>(freehandDisc <span>-</span><span> </span>dilatedDisc) <span>!=</span><span> </span><span>0</span></code></pre>
</div>
<p><img src="https://i0.wp.com/staff.math.su.se/hoehle/blog/figure/source/2018-07-31-circle/PLOTTHINBORDER-1.png?w=456" data-recalc-dims="1"></p>
<h2>Perfect circle estimation</h2>
<p>Once the freehand circle path in the image has been identified, we need to find the best fitting <em>perfect</em> circle matching this path. This problem is elegantly solved by <span data-cites="coope1993">Coope (1993)</span>, who formulates the problem as finding center and radius of the circle minimizing the squared Euclidean distance to <span>\(m\)</span> data points <span>\(a_j\)</span>, <span>\(j=1,\ldots,m\)</span>. Denoting by <span>\(c\)</span> the center of the circle and by <span>\(r>0\)</span> the radius we want to find the solution of</p>
<p><span>\[<br>
\min_{c\in \mathbb{R^2}, r>0} \sum_{j=1}^m F_j(c,r)^2, \quad\text{where}\quad F_j(c,r) = \left|r – ||c-a_j||_2\right|,<br>
\]</span></p>
<p>and <span>\(||x||_2\)</span> denotes Euclidean distance. Because the curve fitting minimizes the distance between an observed point <span>\(a_j\)</span> and its closest point on the circle and thus involves both the <span>\(x\)</span> and the <span>\(y\)</span> direction , this is a so called <strong><a rel="nofollow" href="https://en.wikipedia.org/wiki/Total_least_squares" target="_blank">total least squares</a></strong> problem. The problem is non-linear and can only be solved by iterative numerical methods. However, the dimension of the parameter space can be reduced by one, because given the center <span>\(c\)</span> we can determine that <span>\(r(c)=\frac{1}{m} \sum_{j=1}^m ||c-a_j||_2\)</span>.</p>
<div>
<pre><code>##Compute radius given center
radius_given_center &lt;-<span> </span><span>function</span>(center, <span>dist=</span><span>NULL</span>) {
  <span>if</span> (<span>is.null</span>(dist)) {
    a &lt;-<span> </span><span>as.matrix</span>(<span>where</span>(freehandCircleThinBorder <span>></span><span> </span><span>0</span>))
    dist &lt;-<span> </span><span>sqrt</span>((a[,<span>1</span>] <span>-</span><span> </span>center[<span>1</span>])<span>^</span><span>2</span> <span>+</span><span> </span>(a[,<span>2</span>] <span>-</span><span> </span>center[<span>2</span>])<span>^</span><span>2</span>)
  }
  <span>return</span>(<span>mean</span>(dist))
}

##Target functin of the total least squares criterion of Coope (1993)
target_tls &lt;-<span> </span><span>function</span>(theta) {
  ##Extract parameters
  center &lt;-<span> </span><span>exp</span>(theta[<span>1</span><span>:</span><span>2</span>])

  ##Total least squares criterion from Coope (1993)
  a &lt;-<span> </span><span>as.matrix</span>(<span>where</span>(freehandCircleThinBorder <span>></span><span> </span><span>0</span>))
  dist &lt;-<span> </span><span>sqrt</span>((a[,<span>1</span>] <span>-</span><span> </span>center[<span>1</span>])<span>^</span><span>2</span> <span>+</span><span> </span>(a[,<span>2</span>] <span>-</span><span> </span>center[<span>2</span>])<span>^</span><span>2</span>)
  ##Compute radius given center
  radius &lt;-<span> </span><span>radius_given_center</span>(center, dist)

  F &lt;-<span> </span><span>abs</span>( radius <span>-</span><span> </span>dist)
  <span>sum</span>(F<span>^</span><span>2</span>)
}


res_tls &lt;-<span> </span><span>optim</span>(<span>par=</span><span>log</span>(<span>c</span>(<span>x=</span>background[<span>1</span>,<span>1</span>], <span>y=</span>background[<span>1</span>,<span>2</span>])), <span>fn=</span>target_tls)
center &lt;-<span> </span><span>exp</span>(res_tls<span>$</span>par)
fit_tls &lt;-<span> </span><span>c</span>(center,<span>radius=</span><span>radius_given_center</span>(center))
fit_tls</code></pre>
</div>
<pre><code>##        x        y   radius 
## 894.3885 707.3191 518.4119</code></pre>
<p>We illustrate the freehand circle (in black) and the fitted circle (magenta) on top of each other using the alpha channel. You have to study the image carefully to detect differences between the two curves!</p>
<p><img src="https://i1.wp.com/staff.math.su.se/hoehle/blog/figure/source/2018-07-31-circle/DRAWCIRCLE-1.png?w=456" data-recalc-dims="1"></p>
<h2>Quantifying the circularness of the freehand circle</h2>
<p>We quantify the <strong>circularness</strong> of the freehand circle by contrasting the area covered by it with the area of the fitted perfect circle. The closer this ratio is to 1 the more perfect is the freehand circle.</p>
<div>
<pre><code>##Area of the freehand drawn disc
areaFreehandDisc &lt;-<span> </span><span>sum</span>(freehandDisc)

##Area of the disc corresponding to the idealized circle fitted
##to the freehand circle
areaIdealDisc &lt;-<span> </span>pi <span>*</span><span> </span>fit_tls[<span>&quot;radius&quot;</span>]<span>^</span><span>2</span>

##Ratio between the two areas
ratio_area &lt;-<span> </span><span>as.numeric</span>(areaFreehandDisc  <span>/</span><span> </span>areaIdealDisc)
ratio_area</code></pre>
</div>
<pre><code>## [1] 0.9971778</code></pre>
<p>Yup, it’s a pretty perfect circle! Note also that the calibration is to a circle with an area of 1 pixel unit and not a circle with diameter of 1m as described in the above text about the &quot;circleometer&quot;. Since the fitted circle already takes the desired shape into account, my intuition is that this ratio is a pretty good way to quantify circularness. However, to avoid <strong>measurehacks</strong>, we use as backup measure the circleometer approach: for each point on the freehand circle we measure its distance to the freehand circle and integrate/sum this up over the path of the freehand circle. We can approximate this integration using image pixels as follows.</p>
<div>
<pre><code>##Create a pixel based circle in an image of the same size as the
##freehandCircle img. For visibility we use a border of 'border' pixels
##s.t. circle goes [radius - border/2, radius + border/2].
Circle &lt;-<span> </span><span>function</span>(center, radius, border) {
  <span>as.cimg</span>(<span>function</span>(x,y) {
    lhs &lt;-<span> </span>(x<span>-</span>center[<span>1</span>])<span>^</span><span>2</span> <span>+</span><span> </span>(y<span>-</span>center[<span>2</span>])<span>^</span><span>2</span>
    <span>return</span>( (lhs <span>>=</span><span> </span>(radius<span>-</span>border<span>/</span><span>2</span>)<span>^</span><span>2</span>) <span>&amp;</span><span> </span>(lhs <span>&lt;=</span><span> </span>(radius<span>+</span>border<span>/</span><span>2</span>)<span>^</span><span>2</span>))
  }, <span>dim=</span><span>dim</span>(freehandCircle))
}

##Build pixel circle based on the fitted parameters
C_tls &lt;-<span> </span><span>Circle</span>(fit_tls[<span>1</span><span>:</span><span>2</span>], fit_tls[<span>3</span>], <span>border=</span><span>1</span>)
##Calculate Euclidean distance to circle for each pixel in the image
dist &lt;-<span> </span><span>distance_transform</span>(C_tls, <span>value=</span><span>1</span>, <span>metric=</span><span>2</span>)
##Distance between outer border of freehand circle and perfect circle
area_difference &lt;-<span> </span><span>sum</span>(dist[freehandCircleThinBorder<span>></span><span>0</span>])

##Compute area difference and scaled it by the area of the fitted disc
ratio_areadifference &lt;-<span> </span><span>as.numeric</span>(area_difference <span>/</span><span> </span>areaIdealDisc)</code></pre>
</div>
<p>The image below illustrates this by overlaying the result on top of the distance map. For better visualization we zoom in on the 270-300 degree part of the circle (i.e. the bottom right). In magenta is the fitted perfect circle, in gray the freehand circle and the area between the two paths is summed up over the entire path of the freehand circle:</p>
<p><img src="https://i0.wp.com/staff.math.su.se/hoehle/blog/figure/source/2018-07-31-circle/PLOTAREADIFF-1.png?w=456" data-recalc-dims="1"></p>
<p>We obtain <code>ratio_areadifference</code>= 0.01735. Thus also this measure tells us: it’s a pretty perfect circle! To summarise: The output on the display of the judge’s Circle-O-Meter App (available under a GPL v3 license) at the World Freehand Circle Drawing Championship would be as follows: <img alt="😉" src="https://s.w.org/images/core/emoji/2.4/72x72/1f609.png" class="wp-smiley"></p>
<p><img src="https://i1.wp.com/staff.math.su.se/hoehle/blog/figure/source/2018-07-31-circle/HUD-1.png?w=456" data-recalc-dims="1"></p>
<h2>Discussion</h2>
<p>We took elements of computer vision, image analysis and total least squares to segment a chalk-drawn circle on a blackboard and provided measures of it’s circularness. Since we did not have direct access to the measurements of the blackboard in object space, a little guesstimation was necessary, nevertheless, the results show that it was a pretty circular freehand circle!</p>
<p>With the machinery in place for judging freehand circles, its time to send out the call for contributions to the <strong>2nd World Freehand Circle Drawing Championship</strong> (online edition!). Stay tuned for the call: participants would upload their photo plus minor modifications of a general analysis R-script computing the two area ratios measures and submit their contribution by a pull request the <a rel="nofollow" href="https://github.com/hoehleatsu/worldfreehandcirclechampionship" target="_blank">github WFHCDC repository</a>. You can spend the anxious waiting time practicing your freehand 1m diameter circles – it’s a good way to loosen up long &amp; unproductive meetings!</p>
<h2>Appendix</h2>
<p>If we instead of the total sum of squares criterion involving <span>\(F_j(c,r)\)</span> mentioned in the text solve the related criterion <span>\[<br>
\sum_{j=1}^m f_j(c,r)^2, \quad\text{where}\quad f_j(c,r) =<br>
||c-a_j||_2^2 – r^2,<br>
\]</span> then a much simpler solution emerges. <span data-cites="coope1993">Coope (1993)</span> explains that this alternative criterion geometrically corresponds to minimizing the product</p>
<p><span>\[<br>
\text{(distance to the closest point on the circle)}\times \text{(distance to<br>
the furthest away point point on the circle)}<br>
\]</span></p>
<p>over the measurement point. In order to obtain the solution write the residuals <span>\(f_j\)</span> as <span>\(f_j(c,r) = c^T c – 2 c^T a_j + a_j^T a_j – r^2\)</span> and perform a change of variables from <span>\((c_1, c_2, r)'\)</span> to <span>\[<br>
y =<br>
\left[<br>
\begin{matrix}<br>
2 c_1 \\<br>
2 c_2 \\<br>
r^2 – c^T c \\<br>
\end{matrix}<br>
\right]<br>
\quad \text{and let} \quad<br>
b_j =<br>
\left[<br>
\begin{matrix}<br>
a_{j1} \\<br>
a_{j2} \\<br>
1<br>
\end{matrix}<br>
\right].<br>
\]</span> The minimization problem then becomes <span>\[<br>
\min_{y \in \mathbb{R}^3} \sum_{j=1}^m \left\{ a_j^T a_j – b_j^T y \right\},<br>
\]</span> which can be written as a linear least square (LLS) expression <span>\[<br>
\min_y ||By – d||_2^2,<br>
\]</span> where <span>\(B\)</span> is a <span>\(3\times m\)</span> matrix with the <span>\(b_j\)</span>-vectors as columns and <span>\(d=||a_j||_2^2\)</span>. This expression is then easily solved using the standard least squares machinery.</p>
<div>
<pre><code>##Fast linear least squares problem as described in Coope (1993)
fitCircle_lls &lt;-<span> </span><span>function</span>(freehandCircle) {
  a &lt;-<span> </span><span>as.matrix</span>(<span>where</span>(freehandCircle <span>></span><span> </span><span>0</span>))
  b &lt;-<span> </span><span>cbind</span>(a,<span>1</span>)
  B &lt;-<span> </span>b
  d &lt;-<span> </span>a[,<span>1</span>]<span>^</span><span>2</span> <span>+</span><span> </span>a[,<span>2</span>]<span>^</span><span>2</span>
  y &lt;-<span> </span><span>solve</span>(<span>t</span>(B) <span>%*%</span><span> </span>B) <span>%*%</span><span> </span><span>t</span>(B) <span>%*%</span><span> </span>d
  x &lt;-<span> </span><span>1</span><span>/</span><span>2</span><span>*</span>y[<span>1</span><span>:</span><span>2</span>]
  r &lt;-<span> </span><span>as.numeric</span>(<span>sqrt</span>(y[<span>3</span>] <span>+</span><span> </span><span>t</span>(x) <span>%*%</span><span> </span>x))
  <span>return</span>(<span>c</span>(<span>x=</span>x[<span>1</span>], <span>y=</span>x[<span>2</span>], <span>radius=</span>r))
}

##Fit using linear least squares procedure of Coole (1993)
fit_lls &lt;-<span> </span><span>fitCircle_lls</span>(freehandCircleThinBorder)

##Compare TLS and LLS fit
<span>rbind</span>(<span>lls=</span>fit_lls,<span>tls=</span>fit_tls)</code></pre>
</div>
<pre><code>##            x        y   radius
## lls 894.3666 707.3901 518.4295
## tls 894.3885 707.3191 518.4119</code></pre>
<p>In other words: the results are nearly identical.</p>
<h2>Literature</h2>
<div>
<div>
<p>Coope, I.D. 1993. “Circle Fitting by Linear and Nonlinear Least Squares.” <em>Journal of Optimization Theory and Applications</em> 76 (2): 381–88. doi:<a rel="nofollow" href="https://doi.org/10.1007/BF00939613." target="_blank">10.1007/BF00939613.</a></p>
</div>
<div>
<p>Hartley, R., and A. Zisserman. 2004. <em>Multiple View Geometry in Computer Vision</em>. 2nd ed. Cambridge University Press. <a rel="nofollow" href="http://www.robots.ox.ac.uk/~vgg/hzbook/" target="_blank">http://www.robots.ox.ac.uk/~vgg/hzbook/</a>.</p>
</div>
</div>
<section>
<hr>
<ol>
<li>
<p>Alternatively, see slide 18 and onward in https://ags.cs.uni-kl.de/fileadmin/inf_ags/3dcv-ws11-12/3DCV_WS11-12_lec04.pdf<a rel="nofollow" href="http://staff.math.su.se/hoehle/blog/2018/07/31/circle.html#fnref1" target="_blank"><img alt="↩" src="https://s.w.org/images/core/emoji/2.4/72x72/21a9.png" class="wp-smiley"></a></p>
</li>
</ol>
</section>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://staff.math.su.se/hoehle/blog/2018/07/31/circle.html"> Theory meets practice...</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/FulJAZb64NE" height="1"></a></div>