## 3 Proposed Methodology
### Control Points Extraction  
After fitting the curve to the black pixel coordinates using the GAM, we have the option to sample the curve in one of two ways: uniformly across the image's horizontal axis (x-axis) or uniformly along the curve. Sampling uniformly along the curve is generally preferred because it will generate a regularly sampled text after dewarping. This method segments the curve into arcs of equal length, preventing the concentration of sample points at the center or edges and ensuring an even distribution along the entire curve. The mathematical principles underlying this process are as follows:  
Figure 3: The padded image, with a red outline indicating the estimated curve, along with a subtle zebra pattern to emphasize the dimensions of the newly padded area. If a planar curve in \(\mathbb{R}^{2}\) is described by the equation \(y=f(x)\), with \(f\) being continuously differentiable, this can be considered a particular case of a parametric equation where \(x=t\) and \(y=f(t)\). The Euclidean distance of each infinitesimal segment of the arc can be calculated as follows:  
\[\sqrt{dx^{2}+dy^{2}}=\sqrt{1+\left(\frac{dy}{dx}\right)^{2}}dx \tag{2}\]  
The total arc length can then be calculated as follows:  
\[s=\int_{a}^{b}\sqrt{1+\left(\frac{dy}{dx}\right)^{2}}dx \tag{3}\]  
where a is the leftmost point and b is the rightmost point on the x-axis. Given a set of points \((X,Y)\) representing a curve and an integer \(n\) indicating the number of equal segments, the function aims to divide the arc length into \(n\) equal segments and return the corresponding \(x\)-coordinates. The mathematical formulation is as follows:  
* **Calculate the differences between consecutive points:** \[\Delta x_{i}=X_{i+1}-X_{i}\quad\text{for}\quad i=0,1,\dots,m-1\] (4) \[\Delta y_{i}=Y_{i+1}-Y_{i}\quad\text{for}\quad i=0,1,\dots,m-1\] (5)
* **Calculate the arc length increments:** \[\Delta s_{i}=\sqrt{(\Delta x_{i})^{2}+(\Delta y_{i})^{2}}\quad\text{for}\quad i =0,1,\dots,m-1\] (6)
* **Compute the cumulative arc length:** \[s_{i}=\sum_{j=0}^{i-1}\Delta s_{j}\quad\text{with}\quad s_{0}=0\quad\text{ for}\quad i=1,2,\dots,m\] (7)
* **Determine the total arc length \(L\):** \[L=s_{m}\]
* **Calculate the segment length \(\Delta L\):** \[\Delta L=\frac{L}{n}\] (8)  
A rational argument would suggest that the broader the arc, the greater the number of points required along it to accurately capture the image's content. Therefore, as a rule of thumb, the number of points should correspond to the distance between the leftmost and rightmost points on the x-axis. Naturally, if too many points are used, the final output may appear \"oversampled\", whereas using too few points may make it seem \"undersampled\". * **Find the \(x\)-coordinates that divide the arc into \(n\) equal segments:** 1. Initialize the list of \(x\)-coordinates with the first point: \[x_{\text{points}}\leftarrow\{X_{0}\}\]
2. For each segment \(i\) from \(1\) to \(n-1\): \[\sqrt{dx^{2}+dy^{2}}=\sqrt{1+\left(\frac{dy}{dx}\right)^{2}}dx \tag{2}\]0Use linear interpolation between \(s_{k-1}\) and \(s_{k}\) where \(s_{k-1}\leq i\cdot\Delta L<s_{k}\): \[\sqrt{dx^{2}+dy^{2}}=\sqrt{1+\left(\frac{dy}{dx}\right)^{2}}dx \tag{2}\]1 (9)
4. Append \(x_{i}\) to \(x_{\text{points}}\): \[\sqrt{dx^{2}+dy^{2}}=\sqrt{1+\left(\frac{dy}{dx}\right)^{2}}dx \tag{2}\]2
5. Finally, include the last \(x\)-coordinate: \[\sqrt{dx^{2}+dy^{2}}=\sqrt{1+\left(\frac{dy}{dx}\right)^{2}}dx \tag{2}\]3  
Having explored the mathematical framework, it is now necessary to define the height of the text in terms of pixels. This is essential for isolating the region of interest, a processing step similarly performed by [PERSON] et al. [17]. This can be performed by measuring the vertical extent of the black pixels relative to the estimated curve. With the sample points along the curve and the height of the text established, we proceed by calculating the tangent line that passes through each sample point along the curve.