Skip to content

Commit 28493eb

Browse files
committed
still unpublished but updates posts
1 parent f787ae8 commit 28493eb

File tree

14 files changed

+97586
-29
lines changed

14 files changed

+97586
-29
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ Changes made to fulfil my needs:
118118
* Added [Latex support](https://talk.jekyllrb.com/t/how-to-use-latex-on-jekyll/4119/2) in _layouts/post.html
119119
* Added customized "Publications" page
120120
* Justified ```<p>``` contents
121+
* Added sass compilation tags in config.xml
122+
* Added [PDF viewer](https://github.com/alesordo/alesordo.github.io)
123+
* Added scss and modified ```portfolYOU.scss```
121124

122125
<div align="center">
123126
<sub><sup>© 2025 Alejandro Garnung Menéndez, licensed under the <a href="./LICENSE">MIT License</a>.</sup></sub>

_config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ url: "https://agarnung.github.io" # En producción
2020

2121

2222

23+
# Jekyll looks for SCSS in _sass to compile them in /asset/css/
24+
sass:
25+
sass_dir: "_sass"
26+
style: compressed
27+
2328

2429

2530
### Plugins ###

_posts/UNPUBLISHED_2025-01-22-geometric-fitting_intuition.md

Lines changed: 80 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,101 @@ color: warning
66
description: A resourceful least-squares Taylor-based torus fitting algorithm.
77
---
88

9-
<!--<img src="../assets/blog_images/2025-01-22-torus-fit/circle.png" alt="circle" width="64" height="64">-->
10-
<img src="../assets/blog_images/2025-01-22-torus-fit/circle.png" alt="circle">
9+
<img src="../assets/blog_images/2025-01-22-geometric-fitting_intuition/circle.png" alt="circle">
1110

1211
## Introduction
1312

14-
Fitting algorithms are a widely spread topic among geometry processing. Circle fitting algorithms like Taubin, Chernov, etc. or plane fitting algorithms with least-squares, are commonly utilized in 2D and 3D computer vision applications to measure geometric entities or perform registration. For a large bibliographic review in this topic, see [1](HREF A REF. [1])
13+
Fitting algorithms are a widely discussed topic in geometry processing. Circle fitting algorithms like Taubin, Chernov, and others, as well as plane fitting algorithms using least-squares, are commonly used in 2D and 3D computer vision applications to measure geometric entities or perform registration. For a comprehensive bibliographic review on this topic, see [1] (HREF A REF. [1]).
1514

16-
Imaginémonos un problema clásico: tenemos un conj8utno de putnos 2D y queremos ajustar una línea recta a ellos. Más aún, la línea que **mejor** se ajuste a ellos, en cierto sentido de la palabra. El enfoque least-squres en forma cerrada es una manera de darle concepción a este sentido de **optimalidad de ajuste**. La ecuación de una recta es:
17-
ax+by+c=0
18-
Y satisface las condiciones de linealidad
15+
Let’s imagine a classic problem: we have a set of 2D points and we want to fit a straight line to them. Furthermore, the line that **best** fits them, in a certain sense of the word. The closed-form least-squares approach is one way of conceptualizing this **optimal fit**. The equation of a line is:
16+
$$
17+
ax + by + c = 0
18+
$$
1919

20-
eL PROBLEMa de ajuste least squres para una recta es por tanto:
21-
E(a, b, c) = sum_i=1^m(ax_i + by_i + c)²
20+
and it is an affine mapping with respect to the $$ x $$ and $$ y $$ variables, meaning that it is not a linear function. However, the mapping is linear with respect to the $$ a $$, $$ b $$, and $$ c $$ variables, which will be useful to us...
2221

23-
y se puede resolver en un solo paso porque representa una parábola, que es estrictamente convexa, pues la función de error es cuadrática en las incógnitas.
22+
Thus, the least-squares fitting problem for a line is:
23+
$$
24+
E(a, b, c) = \sum_{i=1}^{m} (ax_i + by_i + c)^2
25+
$$
2426

25-
Diferenciando E(.) con respscrto a las incognitas e iualando a 0 resulta (por la gracia de la ecuacíon) en tres ecuaciones lineales en sus incógnitas.
27+
This can be solved in one step because it represents a parabola, which is strictly convex, as the error function is quadratic in the unknowns.
2628

27-
SIn embargo, las curvas suelen ser funciones de mayor orden que las recrtas, por lo que la fu cion de error, en forma de suma de distancias perpendiculares a una curva, no es cuadrática usualmente, por lo que esos errores geométricos no se pueden minimizar "en un solo paso", sino empleando métodos no lineales iterativos. SIn embargo, mediante diferentes enfoques se puede aproximar "bastante bien" la minimzación del **error geomértico** por la de un **error algebraico**, típicamente cuadrático· Esto categoriza los métodos de ajuste en dos grandes familias: algebraicos y geométricos. En general, el error algebraico es una buena aproximación del geométrico, incluso la semilla inciial del me´doso iterativo geométrico. Véase [2] para una discusión continuada de estos conceptos.
29+
By differentiating $$E(\cdot)$$ with respect to the unknowns and setting it equal to 0, we get (thanks to the equation) three linear equations in the unknowns.
2830

29-
We will gain some insight about various important geometric fitting algorithm.
31+
However, curves are usually higher-order functions than straight lines, so the error function, in the form of the sum of perpendicular distances to a curve, is not usually quadratic. Therefore, these geometric errors cannot be minimized "in a single step," but rather by using iterative nonlinear methods. However, through different approaches, it is possible to "quite well" approximate the minimization of **geometric error** with that of an **algebraic error**, typically quadratic. This categorizes fitting methods into two main families: algebraic and geometric. In general, algebraic error is a good approximation of geometric error, even as the initial seed for iterative geometric methods. See [2] for a continued discussion of these concepts.
32+
33+
We will gain some insight into various important geometric fitting algorithms.
3034

3135
## Paper
3236

33-
TO the benefict of better visualization, you can access the post main content in the LaTex PDF attached below:
37+
To the benefict of better visualization, you can access the post main content in the LaTex PDF attached below:
38+
39+
<script src="/assets/js/pdf.js"></script>
40+
41+
<div class="container text-center" id="pdf-container" style="min-height: 100%;">
42+
<div id="viewerContainer align-items-center">
43+
<div id="pdf-viewer" class="mt-6"></div>
44+
</div>
45+
<h4 class="font-weight-bold"><a target="_blank" href="{{ '/assets/blog_pdfs/2025-01-22-geometric-fitting_intuition/geometric_fitting_intuition.pdf' }}">Open as PDF</a></h4>
46+
</div>
47+
48+
<script>
49+
var url = '../assets/blog_pdfs/2025-01-22-geometric-fitting_intuition/geometric_fitting_intuition.pdf';
50+
51+
pdfjsLib.getDocument(url).promise.then(function (pdf) {
52+
var viewer = document.getElementById('pdf-viewer');
53+
54+
for (var pageNumber = 1; pageNumber <= pdf.numPages; pageNumber++) {
55+
var pageContainer = document.createElement('div');
56+
pageContainer.className = 'pdf-page';
57+
58+
var canvas = document.createElement('canvas');
59+
canvas.className = 'pdf-page-canvas';
60+
pageContainer.appendChild(canvas);
61+
62+
viewer.appendChild(pageContainer);
63+
64+
renderPage(pageNumber, canvas, pdf);
65+
}
66+
});
67+
68+
function renderPage(pageNumber, canvas, pdf) {
69+
pdf.getPage(pageNumber).then(function (page) {
70+
var viewport = page.getViewport({ scale: 0.2 });
71+
var scale = canvas.clientWidth / viewport.width;
3472

35-
**AQUÍ INSERTAR EL PDF DEL LATEX MEDIANTE SCRIPT.JS**
73+
var scaledViewport = page.getViewport({ scale: scale });
74+
75+
var context = canvas.getContext('2d');
76+
canvas.height = scaledViewport.height;
77+
canvas.width = scaledViewport.width;
78+
79+
var renderContext = {
80+
canvasContext: context,
81+
viewport: scaledViewport,
82+
};
83+
84+
page.render(renderContext);
85+
});
86+
}
87+
</script>
88+
89+
## Conclusions and Future Work
90+
91+
We now have a slightly more formed intuition about this topic, although so far we have only glimpsed the world of geometric fitting.
92+
93+
![torus2](../assets/blog_images/2025-01-22-geometric-fitting_intuition/torus2.jpg)
3694

37-
## COnclusiones and future work.
38-
Ya tenemos una ligera intuición más formada de este tópico, aunque de momento Hemos solamente atisbado el mudno del ajuste geométrico.
39-
<img src="../assets/blog_images/2025-01-22-torus-fit/torus2.png" alt="torus2">
4095
__A work in progress__
4196

4297
## References
4398

44-
[1] Circular and linear regression: fitting circlean and lines by least sqrueas -nikolai chernov.
45-
[2] Stan Birchfield p. 523
46-
[3] Geometry tools for computer graphics - schneider, eberly
47-
[4] RObust and error free goemetric computin schneider and eberly) - dave eberly
48-
49-
...
99+
[1] Chernov, N. (2010). *Circular and Linear Regression: Fitting Circles and Lines by Least Squares*. Boca Raton: Chapman and Hall-CRC. ISBN 978-1-439-83590-6. [Journal of the Royal Statistical Society Series A: Statistics in Society, Volume 174, Issue 3, July 2011, Page 843.](https://doi.org/10.1111/j.1467-985X.2011.00709_4.x)
100+
101+
[2] Birchfield, S. (2017). *Image Processing and Analysis*. 1st Edition. Cengage Learning. ISBN 978-1285179520.
102+
103+
[3] Schneider, P., & Eberly, D. H. (2002). *Geometric Tools for Computer Graphics*. 1st Edition. Morgan Kaufmann. ISBN 978-1558605947.
104+
105+
[4] Eberly, D. (2020). *Robust and Error-Free Geometric Computing*. 1st Edition. CRC Press. ISBN 978-0367352943.
106+

_posts/UNPUBLISHED_2025-01-22-torus-fit.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,16 @@ The workaraound _does the trick_; NOS PERMITE ajustar a una nube de puntos en el
3232

3333
## References
3434

35-
[1] Libro chernov.
36-
[2] Stan Birchfield p. 523
37-
[3] Geometry tools for computer graphics
38-
[4] RObust and error free goemetric computin schneider and eberly)
35+
[1] Chernov, N. (2010). *Circular and Linear Regression: Fitting Circles and Lines by Least Squares*. Boca Raton: Chapman and Hall-CRC. ISBN 978-1-439-83590-6. [Journal of the Royal Statistical Society Series A: Statistics in Society, Volume 174, Issue 3, July 2011, Page 843.](https://doi.org/10.1111/j.1467-985X.2011.00709_4.x)
36+
37+
[2] Birchfield, S. (2017). *Image Processing and Analysis*. 1st Edition. Cengage Learning. ISBN 978-1285179520.
38+
39+
[3] Schneider, P., & Eberly, D. H. (2002). *Geometric Tools for Computer Graphics*. 1st Edition. Morgan Kaufmann. ISBN 978-1558605947.
40+
41+
[4] Eberly, D. (2020). *Robust and Error-Free Geometric Computing*. 1st Edition. CRC Press. ISBN 978-0367352943.
42+
3943
[5] https://mathworld.wolfram.com/Torus.html
44+
4045
[6] https://www.geometrictools.com/Documentation/TorusFitting.pdf
4146

4247
...

_projects/agarnung.github.io.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ name: agarnung.github.io
33
tools: [HTML, SCSS, CSS]
44
image: https://avatars.githubusercontent.com/u/191017814?s=400&u=2f077960138f20824e6286bfd7b7375126c0487d&v=4
55
description: My portfolio. This same webpage. Meta-Internet stuff
6-
external_url: https://agarnung.github.io/
6+
external_url: https://github.com/agarnung/agarnung.github.io
77
---

_sass/_pdf.scss

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#viewerContainer .toolbar {
2+
display: none;
3+
width: 100%;
4+
max-width: 1000px;
5+
margin: 0 auto;
6+
}
7+
8+
#viewerContainer{
9+
width: fit-content;
10+
height: 100%;
11+
}
12+
13+
#pdf-viewer {
14+
width: 100%;
15+
/* height: 100vh; */
16+
max-height: 80vh;
17+
overflow: auto;
18+
/* display: flex; */
19+
justify-content: center;
20+
align-items: center;
21+
}
22+
23+
.pdf-page {
24+
display: flex;
25+
justify-content: center;
26+
align-items: center;
27+
margin-bottom: 10px;
28+
}
29+
30+
.pdf-page-canvas {
31+
max-width: 100%;
32+
max-height: 100%;
33+
border: 1px solid rgba(0, 0, 0, 0.2);
34+
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
35+
}

_sass/portfolYOU.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
"timeline",
1717
"autumn",
1818
"theme",
19-
"theme-dark";
19+
"theme-dark",
20+
"pdf";
Binary file not shown.
-25.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)