Next Article in Journal
A Hybrid Optimization Algorithm with Multi-Strategy Integration and Multi-Subpopulation Cooperation for Engineering Problem Solving
Previous Article in Journal
A Two-Stage Feature Screening Framework for Ultrahigh-Dimensional Survival Data
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Dendro-AutoCount Enhanced Using Pith Localization and Peak Analysis Method for Anomalous Images

by
Sumitra Nuanmeesri
* and
Lap Poomhiran
Faculty of Science and Technology, Suan Sunandha Rajabhat University, Dusit, Bangkok 10300, Thailand
*
Author to whom correspondence should be addressed.
Mathematics 2026, 14(1), 94; https://doi.org/10.3390/math14010094 (registering DOI)
Submission received: 20 November 2025 / Revised: 22 December 2025 / Accepted: 23 December 2025 / Published: 26 December 2025

Abstract

Dendrochronology serves as a vital tool for analyzing the long-term interactions between commercial timber growth and environmental variables such as soil, water, and climate. This study presents Dendro-AutoCount, an innovative image processing framework designed for identifying obscured tree rings in cross-sectional images of Pinus taeda L. The methodology integrates Hessian-based ridge detection with a weighted radial voting gradient method to precisely locate the pith. Following pith detection, the system performs radial cropping to generate directional sub-images (north, east, south, west), where rings are identified via intensity profile analysis, signal smoothing, and peak detection. By filtering outliers and averaging directional counts, the system effectively mitigates common visual interference from black molds, fungus, structural cracks, buds, knots, and cracks. Experimental results confirm the high efficacy of Dendro-AutoCount in processing anomalous tree ring images.

1. Introduction

Ongoing climate change is severely impacting agriculture and ecosystems worldwide, as evidenced by rainfall variability, extreme temperatures, and prolonged droughts. Establishing climate-resilient frameworks requires profound insights into the long-term relationships among plants, soil, water, and climate. Given the temporal limitations of modern instrumental measurements, researchers increasingly rely on proxy-based natural records to obtain high-fidelity longitudinal data dating back centuries. One of the most accurate tools is the study of tree rings, which can be used to determine past climate conditions and to age natural events such as wildfires and floods [1]. Each annual tree ring consists of light, thin-walled earlywood for spring water transport and dark, thick-walled latewood for summer support. A tree’s age can be determined by counting these dark latewood bands from the center (pith) outward to the bark. While dendrochronology provides robust insights, the process of counting tree rings remains a key constraint due to the labor-intensive nature and subjectivity of manual methods. Despite modern technology’s aim to automate this process, processing accuracy is frequently hindered by poor image quality arising from reflections, low resolution, or biological degradation. A critical challenge lies in processing anomalous images. These anomalous images refer to disrupted tree ring patterns caused by environmental stress or injury, resulting in asymmetrical, distorted rings. Furthermore, these images frequently contain natural irregularities, including knots, buds, and cracks, as well as degradation caused by black mold and fungal growth. Together, these factors produce discontinuous tree rings and high-frequency noise, substantially hindering accurate automated counting.
To address these challenges, numerous automated methods have been proposed, which can be broadly classified into traditional image processing techniques and deep learning–based approaches. In the realm of image processing, many studies have applied filters such as the Sobel, Canny edge, bilateral, Gaussian, and Lorentz filters to enhance the boundaries of tree rings while reducing noise, making it easier to separate individual tree rings [2]. These filters help distinguish between earlywood and latewood and have become popular [3]. A method for determining the pith was presented in [4] using X-ray CT scan images and gradient-based Sobel filters, based on the average intensity. Following that, tree rings were detected using a Jacobi set to compare the areas under the curves of each tree ring. In parallel, approaches based on gradient peak detection and line-segment fitting have demonstrated high accuracy in tree ring identification for coniferous species and ring-porous angiosperm woods [5]. In addition, the ring radius was calculated by using the distance between tree rings at their intersection with radial lines, which provided the pixel distance to the pith. After error correction was applied to the radius, a high average accuracy was achieved [6]. Furthermore, semi-automated tools, such as MtreeRing [7], have been developed that integrate Canny edge detection and watershed algorithms to facilitate tree-ring analysis.
In recent years, deep learning has emerged as a dominant paradigm in dendrochronological image analysis. Models such as YOLOv3 and SSD MobileNet have been utilized for pith detection [8], while MLPNNs and conditional generative adversarial networks (cGANs) have been applied to ring segmentation tasks [9]. Furthermore, A Convolutional Neural Network (CNN) was used in DeepDenDro for detecting tree rings [10]. Additionally, the Mask R-CNN algorithm was used to train on tree ring images with annotated rings [11]. Similarly, another study applied Mask R-CNN and linear interpolation to detect tree rings, achieving high efficiency on high-resolution images [12]. Furthermore, the Feature Pyramid Network was employed in conjunction with a ResNet-18 to detect tree rings [13].
Automating pith detection is challenging in tree ring counting. It is imperative to find the position of the pith, which is the center of the tree rings. While many previous studies focused on edge detection, early computational methods, such as the Hough Transform, attempted to detect circular shapes [14,15]. This shape-based approach often fails because tree rings are rarely perfect circles. Rings are typically eccentric and distorted by natural features like knots and cracks. Conversely, alternative approaches determine ring radius by calculating it from the distance to the pith via ring intersections with radial lines [6]. A more robust solution, Hessian-based ridge detection, analyzes the underlying structural geometry and facilitates the identification of junction points. This technique is widely used for detection across many fields, for example, identifying myotendinous junctions [16], segmenting retinal vessels [17], and recognizing objects in autonomous vehicles [18]. Thus, it is assumed that Hessian-based ridge detection can treat tree rings as a series of concentric ridges, thereby avoiding the flawed assumption of a perfect circular shape.
Notwithstanding extensive research efforts, anomalous samples remain inadequately addressed, and a distinct gap persists in effectively addressing them. This limitation largely stems from the reliance of existing methods on idealized structural assumptions. First, geometric methods such as the Hough Transform are fundamentally limited by their assumption of circular or concentric rings. However, anomalous samples are intrinsically eccentric and distorted by factors such as knots and growth-slope stress. Second, commonly used standard edge filters, such as the Sobel filter, are overly sensitive to texture noise and fail to distinguish actual tree rings from noise, resulting in thicker, less sharp edges and frequent false positives. In contrast, the Scharr filter is more effective at detecting weak edges and details than the Sobel filter [19,20]. Gradient peak detection and line segment fitting were used to identify tree rings. Third, despite Deep Learning models’ strong performance on conventional datasets, they suffer from limited generalization and require massive, expert-annotated datasets [21]. Further, training the model takes considerable time [10]. Moreover, they struggle with unseen anomalies. Reliance on expert-annotated training datasets [21] limits their ability to handle anomalous samples not encountered during training. Models trained on well-defined conifer ring structures often perform poorly on samples affected by rot or erratic growth patterns, because these irregularities are absent from the training distribution. Finally, the absence of localized error-correction mechanisms in most pipelines means that disturbances caused by nodes in a particular region often lead to the failure of the overall counting algorithm for all samples. Although error corrections are performed to help improve accuracy, for example, corrections for the radius of the tree are calculated using the distance between the tree rings at the intersection with the radius [6]. However, that study’s reliance on manual tree ring identification is time-consuming and inappropriate for large-scale analysis [12].
To address the high resource requirements of deep learning models and the noise sensitivity of traditional filtering methods, this work proposes Dendro-AutoCount, an enhanced automated framework for pith localization and tree-ring counting, designed explicitly for anomalous images. Unlike deep learning approaches, this method proposes an image processing-based approach that eliminates the need for extensive training datasets, enabling greater robustness to unseen data and lower execution time than some deep learning models on the same dataset and in the same environment. The key contributions of this study are as follows:
  • Hessian-based pith localization: this work abandons the circularity assumption. It proposes a hybrid framework that adapts Hessian-based ridge detection. It combines gradient analysis (using the Scharr filter) with weighted radial voting. This treats tree rings as topographic ridges rather than circles, allowing for accurate pith detection even in highly distorted or asymmetric samples.
  • Peak analysis via ROI extraction: To handle localized defects (e.g., mold or knots), the image is segmented into four directional Regions of Interest (north, east, south, and west). For each ROI, intensity profiles are generated, smoothed with a Gaussian filter, and subjected to peak detection to identify tree rings as signal maxima. Subsequently, the tree ring detection is refined using constraints such as minimum distance and peak prominence.
  • Statistical tree ring consolidation: Finally, we implement an outlier removal mechanism using a 1.5 times the standard deviation threshold across the four ROI images. This ensures that if a specific sector is damaged or anomalous, it is excluded from the final calculation, and the result is averaged from the remaining valid directions to enhance accuracy.
The rest of the paper is organized as follows. The proposed method for counting tree rings is presented in Section 2. Section 3 outlines the results and discussions. A conclusion is given in Section 4.

2. Materials and Methods

This study presents a method for counting tree rings from cross-sectional images of stems comprising seven steps: data acquisition, image preprocessing, pith localization, region of interest extraction, ring detection, ring count consolidation, and evaluation, as shown in Figure 1. The proposed Dendro-AutoCount framework automates tree age estimation from anomalous cross-sectional images by following a pipeline of geometric localization, signal processing, and statistical verification. After initial preprocessing to reduce noise, it first locates the tree’s precise center (pith) using Hessian-based ridge detection and weighted radial voting to overcome irregular growth patterns. It then simulates physical core sampling by extracting four directional regions of interest (north, east, south, west) radiating from this detected pith. These visual strips are transformed into a 1-dimensional intensity profile graph where rings are detected as peaks using signal smoothing and prominence criteria. To ensure reliability against defects such as buds or cracks, the method concludes by statistically identifying and rejecting outlier counts in the four directions, then averaging the remaining consistent counts to determine the final tree ring count.

2.1. Data Acquisition

The tree ring images used in this work are cross-section images of Pinus taeda L. trees from three publicly available datasets: UruDendro [12], UruDendro2 [22], and UruDendro4 [23]. These datasets have a near-square aspect ratio, with the smallest image resolution of 913 by 900 pixels and the largest of 5712 by 4284 pixels. It also contains relevant details, including the coordinates of the pith position and the number of tree rings counted with ring annotations, ranging from 14 to 24 years. The UruDendro, UruDendro2, and UruDendro4 datasets contain 64, 53, and 102 cross-section images, respectively, totaling 219 images with 4302 tree rings. Additional information about these datasets is presented in Table 1. The tree ring image disc contains a variety of shapes and features that make it challenging to process, including black molds or fungus, cracks, knots, and discontinuities in the tree rings, as shown in Figure 2 and Figure 3.
In addition, other public datasets are available for evaluating the effectiveness of pith detection and tree ring counting methods. These include the Norell and Borgefors dataset [24] and the Kennel dataset [25]. The Norell and Borgefors dataset consists of fifty-three cross-sections of pine and spruce wood images, cut without surface smoothing, with image size 2046 × 1534 pixels. This dataset is taken under normal lighting conditions and without any surface adjustments. The Kennel dataset contains seven cross-sections of Abies alba wood-slice images, ranging in age from 10 to 50 years, and about 200 tree rings, with image size 1280 × 1280 pixels.

2.2. Image Preprocessing

Before tree ring counting can be performed, it is first necessary to separate the correct tree features from disturbances within anomalous tree ring images, such as fungi, saw marks, or camera sensors. This process involves two steps: noise reduction and background removal. First, the raw tree ring images were converted to grayscale. Then, a bilateral filter is applied to reduce noise. It is chosen because it blurs out noise (like wood grain fuzziness) while preserving the sharpness of the object’s edges [26] by combining neighboring pixel values in a non-linear manner [27]. It recalculates the pixel values by considering both spatial distance and intensity difference, as in (1) [28].
I f i l t e r e d ( p ) = 1 W p q ς G σ s ( p q ) · G σ r ( I p I ( q ) ) · I ( q )
where p is the target pixel being calculated, q is the neighboring pixel in the area around p , I f i l t e r e d ( p ) is the new pixel value at position p , σ is the pixel area around p , W p is a normalization factor, I ( p ) is the image value of pixel at position p , I ( q ) is the original brightness value of pixel at position q , G σ s is the Gaussian kernel for the space domain, and G σ r is the Gaussian kernel for luminance difference (range domain).
Therefore, the bilateral filter helps reduce noise caused by wood chips or pulps, as well as by the camera sensor, during the photography process during dataset collection. Next, background removal is applied to leave only the region of interest (ROI) in the images, thereby improving computational efficiency and accuracy in object recognition and detection [29]. The background information is removed, leaving only the circular wood discs, so the algorithm does not waste time analyzing empty or irrelevant areas of the image that are unrelated to tree rings. This step employs four techniques in combination: Canny edge detection, dilation, erosion, and edge contours, to separate the tree disc cross-sections from the background.

2.3. Pith Localization

Pith localization, or pith detection on tree ring images, is a method for finding the starting point for counting tree rings. A critical challenge in analyzing anomalous images is that tree rings may not be perfectly circular and may be distorted. Further, pith may not be located directly at the center of the tree ring, possibly due to irregular tree growth in constantly changing climate conditions. The key concept in locating pith on a wood disc image is to consider whether the wood’s tree rings exhibit tube-like structures, with curvature centered on a single point or at the pith. Then, vote to find the convergence point using the Hough transform. This pith localization process consists of three steps: Hessian-based ridge detection, gradient analysis, and weighted radial voting.

2.3.1. Hessian-Based Ridge Detection

To identify the specific geometric characteristics of an image I ( x , y ) , it is necessary to examine the changes in light intensity across the surface. Calculating the second partial derivatives helps measure local curvature in multiple directions, in particular, the rate of change in light intensity along the x -axis, y -axis, and diagonal. These derivatives are essential in distinguishing ridge-like structures from flat or edge regions. This process uses the Frangi filter, which analyzes a Hessian matrix to highlight or identify specific ridge- or tube-like circular structures in the tree rings, making them stand out against the rest of the wood. The Hessian matrix ( H ) is widely used, for example, in the Laplacian of Gaussian (LoG) algorithm for image processing [30]. For 2D image processing, the Hessian matrix can be formed as a 2 × 2 matrix for the image I ( x , y ) , as in (2).
H ( x , y ) = 2 I x 2 2 I x y 2 I y x 2 I y 2
where H ( x , y ) is the Hessian matrix result of a pixel coordinate x and y   on image I .
Then, the eigenvalues ( λ 1 and λ 2 ) of the Hessian matrix are calculated, given that λ 1 λ 2 . These values indicate the curvature characteristics of the structure. The filter calculates Vesselness from the Eigenvalues ( V σ ), as in (3) to (5).
R B = λ 1 λ 2
S = λ 1 2 + λ 2 2
V σ = 0 ,                                                                                                                               i f   λ 2 > 0 e x p R B 2 2 β 2 1 e x p S 2 2 c 2 ,             i f   λ 2 0
where R B is Blobness ratio, S is structureness, β and c are sensitivity parameters of the filter.
When this filter is applied to all pixels, the result is a new image that more clearly emphasizes the structure of the tree rings. The Frangi function computes this value at multiple scales ( σ ) to detect tree rings of varying thickness. It selects the optimal response value for each pixel. The result is a ridge map with high pixel values in the area of tree rings.

2.3.2. Gradient Analysis

Because tree rings are concentric curves rather than straight grid lines, the gradient direction must remain accurate as the ring traces distinct arcs and diagonals. To address this, the Scharr operator is selected because it minimizes angular error, which is critical for calculating. This step serves to find direction by calculating gradients (slopes) to determine the inward direction, which is perpendicular to the tree ring curve. The image gradients in this work are calculated using two Scharr 3 × 3 kernels, which are convolved to detect changes in pixel intensity and edges along the x -axis and y -axis. The Scharr kernels in horizontal ( K x ) and vertical ( K y ) directions are defined in (6) and (7) [17].
K x = 3 0 3 10 0 10 3 0 3
K y = 3 10 3 0 0 0 3 10 3
The specific kernel minimizes angular error, which is critical for calculating accurate normal vectors (the inward direction) perpendicular to the tree ring’s curve. Once the kernels are defined, the next step is to quantify the strength of the edges. By convolving the ridge map ( I ) with the kernels, it isolates the gradient magnitude of horizontal and vertical intensity changes ( G x and G y ). These gradient magnitudes are then geometrically combined to create the aggregate slope or gradient magnitude ( G ), which represents the overall intensity of the ridge structure at each pixel. Therefore, the gradient magnitude of the tree ring image can be calculated as in (8) to (10).
G x = I K x
G y = I K y
G = G x 2 + G y 2
where G is the gradient magnitude, G x is the horizontal gradient, G y is the vertical gradient, I is the ridge map, and is a convolution operator.
Finally, to determine the orientation of the rings, it must identify the direction in which brightness increases most rapidly. The angle ( θ ) indicates the normal vector perpendicular to the tree ring ridge. It is derived by converting the Cartesian gradient components into polar coordinates using the arctangent function as in (11).
θ = atan 2 ( G y , G x )

2.3.3. Weighted Radial Voting

In weighted radial voting, pixels along the tree ring vote to select the center point they consider to be the center. The point with the most convergences (votes) is identified as the pith. In this step, a two-dimensional accumulator is created the same size as the original image and filled with all zeros, acting as a voting board. Pixels along the edges are mapped to calculate intersection points and vote. Then, select voting points only for pixels from the ridge map with a high enough value (ridge map > 0.01), which means that points are confident that they are part of the tree ring. For each voter point ( x i ,   y i ), the gradient angle θ i and the weight, which corresponds to the brightness of the ridge map, are extracted. Then draw a straight line from the voter point ( x i ,   y i ) in the direction of the angle θ i . For each candidate point ( x p ,   y p ) on this line, add a weight to the accumulator at point ( x p ,   y p ). The parametric equations of the drawn lines x p t (for x -axis) and y p t (for y -axis) are shown in (12) and (13).
x p t = x i + t · cos ( θ i )
y p t = y i + t · sin ( θ i )
where i is an index denoting a voter point, x i and   y i are the voter point coordinates on the tree ring ridge, θ i is the gradient angle extracted at the voter point ( x i ,   y i ), t is the distance parameter (magnitude) between voter point ( x i ,   y i ) and candidate point ( x p ,   y p ).
This loop will then continue to evaluate the t value from zero, collecting scores along this line. Using the weights from the ridge map will result in clearer tree rings having a greater influence on voting than fainter ones. After voting is complete, the position in the accumulator with the highest value is the one where the most perpendicular lines converge, and is the most likely position of the pith. However, the accumulator obtained from voting may have multiple peaks close together. Therefore, applying a Gaussian blur at the end helps even out the votes and highlights a single actual peak, corresponding to the pith position in the tree ring image.
Therefore, the pith localization method provides a solid foundation for tree ring analysis, effectively addressing uneven growth and geometric distortions. By integrating Hessian matrix ridge detection to highlight tubular structures with gradient analysis for precise alignment, it extracts key features while minimizing angular errors. The process culminates in weighted radial voting, which synthesizes these geometric clues to identify the maximum convergence points, thereby allowing the pith to be accurately identified as a reliable starting point for tree ring counting.

2.4. Region of Interest Extraction

Instead of trying to count rings across the entire chaotic surface of the disc, the method simulates the use of an increment borer (a tool foresters use to bore a tree trunk to extract a core sample). In this step, the ROI image is defined as a sample of the tree rings, resembling a sample obtained with an increment borer. Therefore, the tree ring image is cropped vertically and horizontally into four narrow rectangular strips starting from the detected pith and extending to the bark in the north, east, south, and west directions to encompass the tree ring image. This work conducted a grid search over radial cropping in the 0.5–10.0% range across datasets, comparing results based on mean absolute error and processing time. The tests revealed an initial minimum radial cropping was 2.0% of the image width, which allows for tree ring counting while reducing processing time due to a smaller image size. Thus, the cropped ROI image height was set to 2.0% of the tree ring image width. However, if the output ROI image height is too small, the radial cropping value can be increased. After that, these strips are aligned horizontally, and they can be read like a timeline from left (pith) to right (bark), as shown in Figure 4. These four cropped ROI images will be used to count the number of tree rings, which will then be combined to determine the final count.
Therefore, this process simulates tree ring samples from an increment borer by extracting four ROI images as narrow rectangular strips extending from the pith to the bark in the principal directions (north, east, south, and west). An initial radial cropping of 2.0% is set to minimize errors while ensuring accurate detection. These ROI images are then horizontally aligned to create a linear timeline, enabling accurate tree ring counting and allowing the final results to be compiled from the combined samples.

2.5. Ring Detection

The visual strips (extracted ROI images) were converted into mathematical data waves to automate the tree-ring counting process. There are three steps: intensity profile generation, signal smoothing, and peak detection.

2.5.1. Intensity Profile Generation

Each image obtained from ROI extraction is two-dimensional data and is converted to one-dimensional data to form an intensity profile graph. To accurately capture signals from tree rings, it is necessary to minimize the impact of small cracks or vertical noise on the wood surface. By summing the pixel brightness values in each column, these vertical imperfections are averaged out, yielding a clearer signal that captures the tree ring structure spanning the entire height of the columns. Let I ( x , y ) be the pixel brightness at point ( x , y ) on the image, where H is the image height. The profile P ( x ) at column x is calculated in (14).
P x = y = 0 H 1 I ( x , y )

2.5.2. Signal Smoothing

This step smooths the profile graph to remove non-tree ring noise. Gaussian signal smoothing improves computational stability in peak detection by effectively reducing high-frequency noise in the raw intensity profile, which is typically caused by anatomical imperfections such as pores or wood surface textures. A Gaussian filter works similarly to a moving average. However, it weights pixels closer together more heavily than those farther apart. It uses a Gaussian kernel to convolve an intensity profile signal by performing a weighted average that emphasizes the central data point. This helps reduce unwanted oscillations while preserving the fundamental low-frequency structure of the tree rings. Reducing signal volatility significantly improves the signal-to-noise ratio, thereby decreasing the frequency of false detections and enabling better identification of individual peaks based on earlywood and latewood. An output value of the Gaussian function G ( x ) in one dimension can be calculated in (15) [31].
G x = 1 2 π σ e x 2 2 σ 2
where x is the distance from the center (origin) of the smoothing kernel, and σ is the standard deviation that controls the width of the bell curve in a graph (the higher the σ value, the more widespread the blur is and the smoother the graph becomes).
Selecting the σ value for Gaussian smoothing is challenging because the image size and the number of tree rings per image vary, leading to different pixel counts per tree-ring width. As a result, the σ value cannot be used as a single constant across datasets. Therefore, the median distance between tree rings, calculated from the peaks within the image, will be used as a multiplier to determine the σ value for Gaussian smoothing each image. The peak search process uses a simple condition to find as many peaks as possible, which is based on the intensity profile graph. Then it calculates the median distance between adjacent peaks. Next, the median distance value is multiplied by a small coefficient in the ranks 0.10 to 0.20 (default 0.15) to obtain the smoothing σ value. However, this coefficient should be experimentally searched to find the optimal value for each dataset.

2.5.3. Peak Detection

Each tree ring is composed of earlywood and latewood with different densities: earlywood is less dense, and latewood is denser, giving it a darker color and making the tree rings more visible. Thus, tree rings are generally the dark portions of the wood, corresponding to the lowest light values, or valleys, in the graph. Each tree ring has at least one relative maximum point, formed by latewood, which is used to indicate the tree ring count. In contrast, the relative minimum usually corresponds to earlywood, which will alternate with latewood the following year in a time series. Many applications use relative maximums as peaks and relative minimums as valleys to replace rising and falling rhythms, such as in lip reading [32]. Finding the valley directly is more complicated than finding the peak. Therefore, inverting the intensity profile in this work will immediately turn all valleys into peaks.
The maximum point in the inverted graph is identified using the relative maximum criteria. A data point x i is defined as a peak if it is strictly greater than its immediate neighbors on both the left ( x i 1 ) and right ( x i + 1 ) sides. This condition is formally expressed as in (16).
x i > x i 1   and   x i > x i + 1   for   1 i n 2
where x is the inverted intensity profile signal, i is the position index within the data sequence x 0 , x 1 , x 2 ,…, x n 1 , and n is the total number of columns in signal x .
However, this work enhances peak detection performance by specifying additional conditions, including height level, minimum distance, peak prominence, and width level. The correct peak will have x i height level. It is suitable for cutting out low-value noise that is near the x -axis or baseline of the signal. The minimum distance determines the minimum horizontal distance between adjacent peaks. If other peaks are found within a distance less than the minimum distance, only the highest peak is selected. In this case, consider the standard deviation value as a criterion for determining the minimum distance. This condition prevents double-counting of peaks from the same tree ring, even when it is slightly serrated. To avoid counting fake rings (noise), it checks for peak prominence rather than just absolute height. It is essential to measure how much the peak stands out from the background of the surrounding signal. Where peak prominence is the vertical height of a peak measured from the peak down to its lowest point (called base) before rising to a higher peak than the current peak. Peak prominence ( P r o ) can be calculated as in (17).
P r o = h P m a x h b a s e l e f t , h b a s e r i g h t
where h P is the height of the peak under consideration, h b a s e l e f t is the height of the left base, and h b a s e r i g h t is the height of the right base.
It is a suitable way to filter out unimportant peaks because it does not care about a peak’s absolute height (e.g., at a given height level) but rather its relative height to the surrounding area, allowing it to detect small but essential peaks that lie on top of larger ones. The width level measures the width of the horizontal peak. The width level is measured at a specific height, calculated as the peak height minus the peak prominence.
Therefore, the ring detection method efficiently automates tree ring counting by transforming noisy image data into a clear, analyzable signal. By converting the two-dimensional ROI image to a one-dimensional intensity profile and applying Gaussian smoothing, it significantly reduces high-frequency noise from anatomical imperfections. This improves the signal-to-noise ratio. Notably, applying peak dominance criteria in the final step enables the algorithm to distinguish true tree rings from insignificant surface fluctuations. This ensures detection accuracy based on relative structure differences rather than absolute signal height.

2.6. Ring Count Consolidation

After analyzing the four ROI images (north, east, south, and west), four values for the number of tree rings were obtained. These values may vary due to imperfections in the wood grain on each side. Because anomalous wood often has buds or cracks on some sides, a simple average would be inaccurate. Therefore, this step does not directly average four ROI images. If an image is severely misinterpreted (such as a large crack), the average can be easily distorted. This work compares the four ROI tree ring counts against each other. If an ROI tree ring count is statistically far from the others, it is flagged as an outlier and ignored. Because the sample size (cropped ROI images) is small ( N = 4 ), even a single outlier will inflate the variance and the standard deviation (SD). Using the standard statistical values of 2.0 (95% coverage) or 3.0 (99.7% coverage) for the coefficient and multiplying by the inflation of SD results in a threshold so broad that it encompasses all outliers, making it impossible to remove them for N = 4. This work set the coefficient to 1.5 to compensate for the higher SD and increase sensitivity to detecting outliers, making it suitable for a small dataset. According to Chauvenet’s criterion, for N = 4, the acceptable critical Z-score is approximately 1.53 [33], which is close to 1.5. Meanwhile, Tukey’s Fences (Boxplot rule) define an outlier as data more than 1.5 times the interquartile range from the group [34]. Although using SD is not a direct IQR, a coefficient of 1.5 is consistent with statistical convention. Thus, choosing 1.5 is a criterion consistent with probability theory for a small dataset. Therefore, the final tree ring count ( R f i n a l ) in the tree ring image is calculated by averaging only the ROI images that meet the condition, as in (18) and (19).
R f i n a l = 1 K i K x i + 0.5
K = i 1 , , N : x i x ~ < 1.5 S D
where x i is the number of tree rings counted from the cropped ROI image i , x ~ is the median value of x i to x N , N is the total number of ROI images (default N = 4), S D is the standard deviation of four ROI images, K is a set of indices of ROI images that meet the condition, and K is the number of members in set K (number of ROI images remaining after filtering).
Additionally, this work performs experiments by assuming the actual tree ring is 30 rings, and the calculated tree ring count from four ROI images ( x 1 , x 2 , x 3 , x 4 ), comparing it against coefficients within 1.5SD to 3.0SD. It can be seen that if the coefficient is higher, it becomes impossible to eliminate outliers. This results in significant error when calculating the final ring count, as shown in Table 2. This method ensures that the final result is highly reliable, even if the analysis of one of the images fails.
Therefore, the ring count consolidation process ensures the reliability of the final measurement by minimizing errors caused by wood abnormalities such as cracks or knots. Because simple averaging is prone to distortion in small datasets, this process employs a more sophisticated anomaly detection strategy based on a threshold of 1.5 times the SD, consistent with statistical principles such as Chauvenet’s criterion. This filtering process effectively eliminates statistical deviations, allowing the final number of tree rings to be calculated only from accurate ROI images. This maximizes accuracy even if an individual sample has imperfections.

2.7. Evaluation

In evaluating the efficiency of the proposed method, it is divided into two parts: pith position and number of tree rings. The tools used include mean distance error (MDE), SD, root mean square error (RMSE), mean error (ME), mean absolute error (MAE), mean absolute percentage error (MAPE), R-squared (R2), precision, recall, F1-score, and accuracy. The MDE, SD, RMSE, and recall are used to evaluate the accuracy of the detected pith position. The efficiency of tree ring counting can be evaluated using ME, MAE, RMSE, MAPE, R2, precision, recall, F1-score, and accuracy. Suppose N is the total number of tree ring images. The calculation of RMSE of pith position uses Euclidean distance to help in determining the pith position distance error ( d i ), as in (20) to (23).
d i = ( x ^ i x i ) 2 + ( y ^ i y i ) 2
M D E = 1 N i = 1 N d i
S D = 1 N i = 1 N ( d i M D E ) 2
R M S E p i t h = 1 N i = 1 N d i 2
where x i is the x -coordinate of the actual pith position on image i , y i is the y -coordinate of the actual pith position on image i , x ^ i is the x -coordinate of the detected pith position of image i , and y ^ i is the y -coordinate of the detected pith position of image i .
Additionally, the tree rings are counted by defining the pith as the center of the cropped ROI images in four directions. Therefore, before applying the detected pith to the tree ring image, it is necessary to measure its performance using the hit rate ( H r a t e ). First, set an acceptable distance threshold ( T ) related to the size of the tree ring image width ( w i ) or height ( h i ) for the cropped ROI of image I , with the desired crop width ( C w i d t h ) equal to 2.0% (or 0.02) of the maximum image width or height. However, the minimum width or height of the image is used to calculate the T value, ensuring that the actual pith position remains within the ROI image bounds, even if the computed pith is incorrect. The scaled factor ( α ) is defined as the scaling factor between 0 and 1, which represents the rigor of the evaluation. The α is closer to 0, which means that the detected pith position is closer to the actual pith position. Typically, the α is set to 0.5. Then count the number of images with the detected pith position that does not exceed the T value, as calculated in (24) to (26).
C w i d t h = 0.02 × min i = 1 N ( min w i , h i )
T = α × C w i d t h 1
H r a t e = 1 N i = 1 N I ( d i T ) × 100 %
where d i is the pith position distance error and I d i T = 1 ,   i f   d i T 0 ,   i f   d i > T .
Other efficiency values for tree ring counting are calculated from (27) to (36).
M E = 1 N i = 1 N ( y ^ i y i )
M A E = 1 N i = 1 N y ^ i y i
R M S E r i n g = 1 N i = 1 N ( y ^ i y i ) 2
M A P E = 1 N i = 1 N y ^ i y i y i × 100 %
R 2 = 1 i = 1 N ( y i y ^ i ) 2 i = 1 N ( y i y ¯ i ) 2
where y i is the actual number of tree rings, y ^ i is the calculated number of tree rings of image i , and y ¯ i is the average of the actual number of tree rings.
P r e c i s i o n = T P T P + F P
R e c a l l = T P T P + F N
F 1 s c o r e = 2 × P r e c i s i o n × R e c a l l P r e c i s i o n + R e c a l l
where T P is the number of actual tree rings correctly counted, F P is the number of fake or overcounted tree rings, and F N is the actual number of tree rings that are overlooked or not counted.
A c c u r a c y i m a g e = N u m b e r   o f   i m a g e   w i t h   r i n g s   c o r r e c t l y   c o u n t e d N u m b e r   o f   t o t a l   i m a g e s
A c c u r a c y r i n g = N u m b e r   o f   t r e e   r i n g s   c o r r e c t l y   c o u n t e d N u m b e r   o f   t o t a l   a c t u a l   t r e e   r i n g s
where A c c u r a c y i m a g e is the number of images that have correctly counted tree rings compared to the total sample image, and A c c u r a c y r i n g is the number of tree rings that have been correctly counted compared to the total tree rings in the dataset.

3. Results and Discussion

3.1. The Detected Pith Localization Efficiency

The results of pith position determination using Hessian-based ridge detection combined with gradient-based analysis and weighted radial voting are shown in Figure 5, Figure 6 and Figure 7 and Table 3. The results showed that the UruDendro dataset had the lowest error, with an MDE of 3.38 pixels, an SD of 2.42 pixels, and an RMSE of 3.94 pixels. Next in line is the UruDendro2 dataset, with an MDE of 9.59 pixels, an SD of 2.55 pixels, and an RMSE of 9.72 pixels. Lastly, UruDendro4 has the highest error, with an MDE of 10.34 pixels, an SD of 2.61 pixels, and an RMSE of 10.46 pixels.
Analysis of the results showed that the error values obtained from UruDendro4 were the highest, followed by those from UruDendro2 and UruDendro. This may be because the average image size of UruDendro4 is nearly twice that of UruDendro. Thus, when calculating gradient, weights, and voting, the calculated pith distance errors are higher than in datasets with smaller image sizes. However, given the distance errors between the actual pith and the image size, expressed as a ratio or percentage, there may be slight differences in these errors across the datasets used in this work. Additionally, given the minimum width of each dataset, UruDendro has the smallest width of 897 pixels, UruDendro2 has the smallest width of 2267 pixels, and UruDendro4 has the smallest width of 1317 pixels (see Table 1). According to (24) and (25), the minimum width ( C w i d t h ) of the ROI images (in the north- or south-direction) for the UruDendro, UruDendro2, and UruDendro4 datasets can be calculated as 17, 45, and 26 pixels, respectively. Resulting in the distance threshold or T values of each dataset being 7, 21, and 12 pixels, respectively. The experimental results showed that UruDendro’s hit rate was 92.19% at T = 7 pixels and gradually increased to 100.00% when T ≥ 11 pixels. For UruDendro2, the hit rate was 90.57% at T = 12 pixels and reached 100.00% when T ≥ 13 pixels. For UruDendro4, the hit rate was 90.20% at T = 12 pixels and reached 100.00% when T ≥ 15 pixels. Considering the UruDendro2 dataset, the calculated T value based on the minimum crop width was 21 pixels. The result shows that the hit rate reached 100.00% for T ≥ 13 pixels. It can be said that the cropped ROI images definitely cover the actual pith position for this dataset. The hit rate comparison results obtained when the distance threshold is increased to half the minimum cropped ROI width are illustrated in Figure 8.
Furthermore, this work tested pith localization in cases where the wood disc was not in the central zone of the image by enlarging the image to 20% of its original size using the canvas technique, which shifted the wood disc to each image corner, yielding four new tree ring images. The robustness of the proposed method was then tested to confirm whether the detected pith positions differed. The test results showed that the computed pith positions remained the same, as shown in Figure 9. Comparing the pith positions across canvased images, the testing results revealed that the detected pith positions were almost perfectly accurate (no difference). This may be because the size of the tree disc within the canvas image remains the same as in the original; the only differences are the image size and the tree disc’s position within the image.
In addition, to compare the performance of the proposed method with other deep learning techniques, namely YOLOv3 and SSD MobileNet, in the study by [8] using the Norell and Borgefors dataset, based on a confidence level of 0.4 (40%). The experimental result showed that the proposed method achieves the highest detection rate (or recall) of 91.06% with an MDE of 4.65 pixels. The following methods are SSD MobileNet and YOLOv3, with detection rates of 89.20% and 80.50%, respectively, and MDE of 5.12 and 6.42 pixels, respectively, as shown in Table 4.

3.2. The Tree Ring Counting Efficiency

The results of applying intensity profile, signal smoothing, and peak detection with minimum distance and peak prominence showed that each tree ring could be found. Four cropped images obtained by extracting ROIs (from the original image) in the north, east, south, and west directions of the detected pith position of each cross-section tree ring image, along with the results of the tree ring detection, are shown in Figure 10, Figure 11 and Figure 12.
Additionally, the overall experimental results revealed that nineteen tree ring images had miscounted rings. The UruDendro dataset contained four miscounted ring images (out of sixty-four): one was overcounted by two rings, two were undercounted by two rings, and one was undercounted by one ring. Five tree ring images (out of fifty-three) in the UruDendro2 dataset were miscounted, including four that overcounted one ring and one that undercounted two rings. For the UruDendro4, ten tree ring images (out of one hundred and two images) had miscounted rings, including four images that overcounted one ring, five images that undercounted one ring, and one image that undercounted two rings, as illustrated in Figure 13. Upon examining the results of the inaccurate tree ring counting images, it was discovered that the main reason for overcounting was that the tree ring image was wood-defective, with numerous knots and buds. These defects can confuse automated counting, leading to overcounting. In cases of undercounting, examination of sample images reveals that the distances between the tree rings are too close together, especially those on the outer edges or near the bark. Furthermore, if the sample image has a lower resolution, it may become more difficult to distinguish individual rings. Using peak detection, adjacent rings may be mistaken for a single ring.
Further, the efficiency values of the proposed method are presented in Table 5. The efficiency results of the tree ring counting showed that the mean errors were −0.031 and −0.029 for UruDendro and UruDendro4, respectively. This result indicates that both UruDendro and UruDendro4 were undercounted rings. In contrast, UruDendro2 had a mean error of 0.038, indicating an overcount ring. The main reason for inaccurate ring counts is the presence of large cracks or knots surrounding the pith or near it in more than two directions, between north, east, south, and west. These are naturally occurring factors that may contribute to undercounting or overcounting the tree rings. The number of miscounted rings in this work depends on the size of cracks or knots, which may cause image processing to misinterpret them as large or very large tree rings encompassing multiple tree rings. However, the impact of large black mold or fungi may also contribute to the miscounting of tree rings.
In addition, other ring counting efficiency values for each dataset are as follows: UruDendro achieved an MAE of 0.094 rings, an RMSE of 0.395 rings, an MAPE of 0.5320%, an R2 of 0.9936, a precision of 0.9985, a recall of 0.9962, and F1-score of 0.9972, an accuracy r i n g of 0.9951, and an accuracy i m a g e of 0.9375. The UruDendro2 has an MAE of 0.113 rings, an RMSE of 0.389 rings, an MAPE of 0.4960%, an R2 of 0.8924, precision of 0.9967, recall of 0.9984, F1-score of 0.9975, an accuracy r i n g of 0.9948, and an accuracy i m a g e of 0.9057. For the UruDendro4, the efficiency results showed an MAE of 0.108 rings, an RMSE of 0.357 rings, an MAPE of 0.5870%, an R2 of 0.9659, a precision of 0.9978, a recall of 0.9963, an F1-score of 0.9970, an accuracy r i n g of 0.9938, and an accuracy i m a g e of 0.9020. The efficiencies of the three datasets are not significantly different, with UruDendro having the highest accuracy, followed by UruDendro2 and UruDendro4, respectively. In contrast, UruDendro4 has the lowest RMSE, followed by UruDendro2 and UruDendro, respectively. Based on the R2 values, UruDendro4 had the highest, followed by UruDendro and UruDendro2. However, the recall values showed that UruDendro2 had the highest, followed by UruDendro4 and UruDendro, respectively.
Additionally, the results in Table 5 show that RMSE, MAE, and MAPE values vary minimally across datasets. However, the UruDendro4 dataset performs slightly worse despite its larger sample size. The experimental results in Table 5 show that RMSE, MAE, and MAPE values vary minimally across datasets. However, the UruDendro4 dataset performs slightly worse despite its larger sample size. Furthermore, when examining the sample images, it was found that bumps or eyes appeared on the tree disc in many of the sample tree ring images. In some samples, 3 to 5 buds or knots were found. In some cases, they were aligned with the north, south, east, and west directions and appeared on four of the ROI images. These can cause discrepancies in the counting of tree rings. Therefore, in this case, it is suggested to consider increasing the number of ROI images in different directions (e.g., eight directions) rather than the currently defined four directions.
Furthermore, some studies have used other deep learning methods for tree ring counting, including Cross Sections Tree Ring Detection (CS-TRD), using Canny edge detection-based [21,35] and Iterative Next Boundary Detection (INBD) [36] models, on the UruDendro and Kennel [25] datasets, which resized the images to 150 × 1500 pixels. This experiment was performed on the same hardware as in [35] using an Intel Core i5-10300H CPU @4.50 GHz on a workstation with 16GB of memory (without GPU benchmark). The comparative efficiency results and execution time for tree ring counting are shown in Table 6.
The results show that the proposed method demonstrates superior detection capabilities across both datasets. On the Kennel dataset, the proposed algorithm achieved a perfect precision score of 1.0000, a recall of 0.9730, and an F1-score of 0.9863, outperforming the CS-TRD method, which yielded a precision of 0.9700, a recall of 0.9700, and an F1-score of 0.9700. However, the RMSE values differed only slightly by 0.02. On the UruDendro dataset, the CS-TRD experienced a performance degradation, dropping to a recall of 0.8600 and an RMSE of 5.27. The proposed method achieved a recall of 0.9951 and a significantly reduced RMSE of 0.47. This contrast highlights the proposed method’s ability to maintain high fidelity in ring detection even in more challenging or variable data environments. Although the sample images in UruDendro were resized (some enlarged, some reduced) to 1500 × 1500 pixels, the results were not significantly different from the original image sizes. This is because the spacing between individual tree rings remains distinct, allowing them to be distinguished when cropping the ROI images into four images and then averaging the tree rings.
In addition to improved accuracy, the proposed method exhibits greater computational efficiency. Despite the enhanced detection performance, execution times were consistently lower than those of the CS-TRD method. For the Kennel dataset, the proposed method required 9.92 s compared to 11.10 s for CS-TRD. Similarly, on the UruDendro dataset, the proposed method reduced processing time to 16.21 s, down from 17.30 s for CS-TRD. While the neural network-based INBD baseline recorded the fastest execution time (7.50 s) on the UruDendro test set, its utility is limited by significantly lower precision (0.7500), recall (0.8400), and F1-scores (0.7900), rendering it less viable for high-precision applications. Although a direct comparison on the specific UruDendro test subset was not feasible due to the random sampling employed in prior studies, the proposed method was evaluated on the comprehensive UruDendro dataset. Given that CS-TRD significantly outperforms INBD on the test set, and the proposed method consistently surpasses CS-TRD on the full dataset, it can be reasonably inferred that the proposed framework offers superior overall performance compared to INBD.
Moreover, this work resized the images to smaller sizes to approximate the input shape for the deep learning model. These sizes were 512 × 512, 299 × 299, 256 × 256, 224 × 224, 128 × 128, and 96 × 96 pixels. An example of cropped ROI images at different image sizes is shown in Figure 14. The experimental results showed that the efficiency of tree ring counting decreased due to the merging of latewood and earlywood pixels during image resizing. The smaller the image size, the more difficult it is to distinguish between tree rings. However, when using an image size of 224 × 224 pixels, a popular choice for CNN models (e.g., VGGNet, ResNet, MobileNet, EfficientNet), the proposed method still achieved at least 96% recall, as shown in Table 7.
The resolution ablation study presented in Table 7 demonstrates the robustness of the Dendro-AutoCount technique at higher input dimensions, maintaining near-optimal recall rates across the UruDendro, UruDendro2, and UruDendro4 datasets at resolutions as low as 224 × 224. However, a non-linear performance degradation is observed at the 96 × 96 threshold, where recall declines sharply to approximately 90% (~9% drop). This precipitous drop is attributed to the loss of high-frequency spatial detail necessary to resolve narrow tree rings. As illustrated in Figure 14, downsampling to this extent causes the pixel grid to exceed the average width of latewood bands, leading to aliasing artifacts in which adjacent rings merge into indistinguishable pixel blocks. Thus, tree ring detection becomes more difficult as image resolution decreases. Consequently, while the model is resilient to moderate scaling, the 224 × 224 resolution represents the critical lower bound for preserving the feature fidelity essential for accurate automated counting. Therefore, analysis of each tree ring dataset revealed differences in image composition, particularly in image size. Higher image resolution can capture details or impurities of earlywood that may be misinterpreted as tree rings. Resizing images to a uniform size and optimizing blur and edge detection may help remove these impurities, thereby making latewood or tree ring regions more prominent.
Additionally, in this work, the cropped ROI width during radial cropping was set to 2.0% of the original image width. When the tree ring image is already large, setting radial cropping to 2.0% generally reduces image processing time by reducing the image size. During individual image analysis within the datasets, the 2.0% radial cropping rule proved ineffective for low-resolution images (e.g., 96 × 96 pixels). In case the tree ring image width is small, such as when the cropped ROI image’s height is less than 3 pixels (image width less than 128 pixels), the intensity profile may be statistically insignificant for averaging. To refine the strategy, the grid search might conclude that a minimum pixel height constraint is better than a fixed percentage. For example, set radial cropping to 2.0% of image width, but never less than 3 pixels. Thus, consider increasing the radial cropping percentage to improve peak detection efficiency and enhance tree ring counting.
In this work, the proposed framework is predicated on accurate pith localization to define the four cardinal ROI images. However, when pith features are indistinct or obscured by surface defects, precise localization becomes non-trivial, rendering the standard four-directional sampling scheme susceptible to missing off-axis structural information. This spatial misalignment propagates errors into the enumeration stage, significantly compromising accuracy. Consequently, expanding the sampling resolution to an eight-directional (or higher) configuration is critical to enhance spatial coverage and ensure robust ring enumeration despite uncertainties in pith localization.
Subsequently, the image size and the spacing between tree rings should also be considered. Furthermore, in the signal smoothing step using a Gaussian filter, if the σ value, or standard deviation, is set too large. It can lead to over-smoothing, where closely spaced rings may blur the distinct boundaries between adjacent rings, causing miscounted rings. Conversely, the σ value that is too small may result in under-smoothing. In this case, noise may persist in the intensity profile, leading to the detection of false rings or the failure to identify actual rings. Generally, the false ring is composed of earlywood that exhibits the characteristics of a latewood cell. It represents an anatomical response to biseasonal rainfall. These structures form when a severe early-season drought ends with the sudden arrival of monsoon rains during the peak growing season [37]. However, this σ value must be adjusted appropriately by considering the average distance between each tree ring and the distance between two adjacent tree rings.
Incidentally, to enhance the reliability of the proposed algorithm or method, it is crucial to select a dataset or collect tree ring images that include a greater diversity of tree species. This is because some tree species, particularly fast-growing plants such as Uruguayan pine, have significantly different tree ring spacing. In addition, trees with slow growth or unusual environmental conditions will have their tree rings closely spaced, making them difficult to detect each ring. Furthermore, trees growing on different continents and in entirely different climates will make counting tree rings even more challenging. Although deep learning models are highly efficient at detecting rings across multi-species, the performance degrades when the dataset contains previously unseen species. Because tree ring structure varies by species. This clearly demonstrates that the models require a larger, more diverse dataset to train effectively and accommodate previously unseen species [38].
Furthermore, preprocessing is a mathematically essential prerequisite for tree ring detection frameworks based on intensity summation, as nonuniform illumination acts as a low-frequency artifact that compromises signal fidelity. Because observed intensity integrates both wood reflectance and lighting conditions, raw summation can suffer from baseline drift, with shadowed latewood peaks exhibiting lower magnitudes than well-lit earlywood valleys. Although the datasets in this study were captured under optimal conditions, ensuring the algorithm’s generalizability to unseen datasets with variable lighting requires strict normalization. To ensure that intensity peaks correspond strictly to latewood density rather than shadowing or uneven lighting, normalization techniques such as morphological top-hat transformations or homomorphic filtering must be applied to decouple and remove the illumination component. This standardization generates a flat-field intensity profile, ensuring that the summation metric remains invariant to lighting conditions and robust across datasets.
Although averaging the tree rings after outlier rejection is reasonable, alternative robust estimators, such as the median or a trimmed mean, should also be compared. Consider the examples in Table 2. Find that the median ( x ~ ) is equal to 29.50 (except for the last example, which equals 30.0). If used to calculate the final tree ring count, the result will be an integer of 30 rings. Therefore, it is advisable to compare the original result with the median and trimmed mean to obtain a more efficient approach to counting tree rings.

4. Conclusions

Dendro-AutoCount introduces an automated, unsupervised image-processing framework that improves tree-ring counting accuracy despite morphological anomalies such as asymmetry, incomplete rings, and surface defects. Due to its robustness to surface defects, including black molds, fungus, buds, knots, and cracks, and to morphological variation, the proposed framework represents a meaningful advancement in automated tree ring analysis. The methodology removes reliance on training datasets by adopting a hybrid pith localization approach that combines Hessian-based ridge detection with gradient-weighted radial voting, implemented with a Scharr kernel. Ring counts are derived from cardinal regions of interest using intensity profiling, signal smoothing, and peak detection. At the same time, accuracy is maintained through statistical outlier rejection, which filters out inconsistent sectors. This approach supports the calculation of the final tree ring count from several strips (ROI images) cropped in more than four future directions. Additionally, ROI images using radial cropping can reduce image size and execution time compared to some deep learning models while maintaining high accuracy. By effectively recovering structural signals from compromised cross-sections that challenge traditional methods, this approach enables precise tree ring counting, a technique applicable to the agricultural and environmental sectors.
However, challenges persist if the marks are large enough to cover the tree rings, making them completely inseparable; counting becomes complicated. This may require future research into repair methods, such as exemplar-based inpainting (e.g., the Criminisi algorithm), to fully reconstruct the tree ring structure by copying patches from adjacent earlywood and latewood areas and pasting them into gaps, while preserving the continuity of the tree ring structure. Subsequently, the inpainted areas can be subjected to multi-scale directional analysis, specifically the Coherence-Enhancing Diffusion (CED) and Gabor filter methods, to smooth along the tree rings while stopping the flow perpendicular to the rings. Gabor provides the highest response only when encountering lines with the correct natural direction of the tree rings. These methods help to clarify broken tree rings without blurring the edges. Additionally, detecting false rings, which form when a tree is exposed to temporary stress (such as drought), remains a complex task that still requires human expertise, posing a significant challenge for future automated counting.

Author Contributions

Conceptualization, S.N.; methodology, S.N.; software, S.N. and L.P.; validation, S.N.; formal analysis, S.N. and L.P.; investigation, S.N.; resources, S.N.; data curation, S.N. and L.P.; writing—original draft, S.N. and L.P.; writing—review and editing, S.N.; visualization, S.N. and L.P.; supervision, S.N.; project administration, S.N. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The original data presented in the study are openly available in Zenodo at https://zenodo.org, reference numbers 15110647, 15652452, and 15653340.

Acknowledgments

The authors express their gratitude to the Institute for Research and Development, the Faculty of Science and Technology, and Suan Sunandha Rajabhat University for their support and the opportunity to conduct this research.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Divya, K.; Kaur, S. A study on tree rings: Dendrochronology using image processing. IOP Conf. Ser. Mater. Sci. Eng. 2021, 1022, 012115. [Google Scholar] [CrossRef]
  2. Decelle, R.; Ngo, P.; Debled-Rennesson, I.; Mothe, F.; Longuetaud, F. Directional filter for tree ring detection. In Proceedings of the 13th International Conference on Pattern Recognition Applications and Methods, Rome, Italy, 24–26 February 2024; pp. 852–859. [Google Scholar] [CrossRef]
  3. Latte, N.; Beeckman, H.; Bauwens, S.; Bonnet, S.; Lejeune, P. A novel procedure to measure shrinkage-free tree-rings from very large wood samples combining photogrammetry, high-resolution image processing, and GIS tools. Dendrochronologia 2015, 34, 24–28. [Google Scholar] [CrossRef]
  4. Makela, K.; Ophelders, T.; Quigley, M.; Munch, E.; Chitwood, D.; Dowtin, A. Automatic tree ring detection using Jacobi sets. arXiv 2020, arXiv:2010.08691. [Google Scholar] [CrossRef]
  5. Fabija’nska, A.; Danek, M.; Barniak, J.; Piórkowski, A. Towards automatic tree rings detection in images of scanned wood samples. Comput. Electron. Agric. 2017, 140, 279–289. [Google Scholar] [CrossRef]
  6. Zhang, W.; Zhao, T.; Su, X.; Wu, B.; Min, Z.; Tian, Y. A tree ring measurement method based on error correction in digital image of stem analysis disk. Forests 2021, 12, 464. [Google Scholar] [CrossRef]
  7. Jingning, S.; Wei, X.; Qijing, L.; Sher, S. MtreeRing: An R package with graphical user interface for automatic measurement of tree ring widths using image processing techniques. Dendrochronologia 2019, 58, 125644. [Google Scholar] [CrossRef]
  8. Kurdthongmee, W. A comparative study of the effectiveness of using popular DNN object detection algorithms for pith detection in cross-sectional images of parawood. Heliyon 2020, 6, e03480. [Google Scholar] [CrossRef]
  9. Habite, T.; Abdeljaber, O.; Olsson, A. Automatic detection of annual rings and pith location along Norway spruce timber boards using conditional adversarial networks. Wood Sci. Technol. 2021, 55, 461–488. [Google Scholar] [CrossRef]
  10. Fabija’nska, A.; Danek, M. DeepDendro- A tree rings detector based on a deep convolutional neural network. Comput. Electron. Agric. 2018, 150, 353–363. [Google Scholar] [CrossRef]
  11. Poláčcek, M.; Arizpe, A.; Hüther, P.; Weidlich, L.; Steindl, S.; Swarts, K. Automation of tree-ring detection and measurements using deep learning. Methods Ecol. Evol. 2023, 14, 2233–2242. [Google Scholar] [CrossRef]
  12. Kim, D.; Ko, C.; Kim, D. Method for detecting tree ring boundary in conifers and broadleaf trees using Mask R-CNN and linear interpolation. Dendrochronologia 2023, 79, 126088. [Google Scholar] [CrossRef]
  13. Wu, F.; Huang, Y.; Benes, B.; Warner, C.C.; Gazo, R. Automated tree ring detection of common Indiana hardwood species through deep learning: Introducing a new dataset of annotated images. Inf. Process. Agric. 2024, 11, 552–558. [Google Scholar] [CrossRef]
  14. Cerda, M.; Hitschfeld-Kahler, N.; Mery, D. Robust tree-ring detection. In Advances in Image and Video Technology (PSIVT 2007), Lecture Notes in Computer Science; Mery, D., Rueda, L., Eds.; Springer: Berlin/Heidelberg, Germany, 2007; pp. 575–585. [Google Scholar] [CrossRef]
  15. Du, W.; Xi, Y.; Harada, K.; Zhang, Y.; Nagashima, K.; Qiao, Z. Improved Hough transform and total variation algorithms for features extraction of wood. Forests 2021, 12, 466. [Google Scholar] [CrossRef]
  16. Zhou, G.-Q.; Hua, S.-H.; He, Y.; Wang, K.-N.; Zhou, D.; Wang, H. Automatic myotendinous junction identification in ultrasound images based on junction-based template measurements. IEEE Trans. Neural Syst. Rehabil. Eng. 2023, 31, 851–862. [Google Scholar] [CrossRef]
  17. Shabani, M.; Pourghassem, H. An active contour model using matched filter and Hessian matrix for retinalvessels segmentation. Turk. J. Electr. Eng. Comput. Sci. 2022, 30, 295–311. [Google Scholar] [CrossRef]
  18. Hien, N.L.H.; Kor, A.-L.; Ang, M.C.; Rondeau, E.; Georges, J.-P. Image filtering techniques for object recognition in autonomous vehicles. J. Univers. Comput. Sci. 2024, 30, 49–84. [Google Scholar] [CrossRef]
  19. Weng, B.; Gao, W.; Zheng, W.; Yang, G. Newly designed identifying method for ice thickness on high-voltage transmission lines via machine vision. High Volt. 2021, 6, 904–922. [Google Scholar] [CrossRef]
  20. Tang, Q.; Shi, X.; Zhang, Q.; Liu, Y. Focusing on the roots of range: Real-time 3D point cloud semantic segmentation with edge enhancement and heights delity. J. Frankl. Inst. 2025, 362, 107954. [Google Scholar] [CrossRef]
  21. Marichal, H.; Passarella, D.; Lucas, C.; Profumo, L.; Casaravilla, V.; Rocha Galli, M.N.; Ambite, S.; Randall, G. UruDendro, a public dataset of 64 cross-section images and manual annual ring delineations of Pinus taeda L. Ann. For. Sci. 2025, 82, 25. [Google Scholar] [CrossRef]
  22. Marichal, H.; Casaravilla, V.; Ludmila, P.; Christine, L.; Diego, P.; Gregory, R. UruDendro2, a Public Dataset of 53 Cross-Section Images and Manual Annual Ring Delineations of Pinus taeda L. Available online: https://zenodo.org/records/15652452 (accessed on 15 June 2025).
  23. Marichal, H.; Blanco, J.; Passarella, D.; Randall, G. UruDendro4: A Benchmark Dataset for Automatic Tree-Ring Detection in Cross-Section Images of Pinus taeda L. Available online: https://zenodo.org/records/15653340 (accessed on 15 June 2025).
  24. Norell, K.; Borgefors, G. Estimation of pith position in untreated log ends in sawmill environments. Comput. Electron. Agric. 2008, 63, 155–167. [Google Scholar] [CrossRef]
  25. Kennel, P.; Borianne, P.; Subsol, G. An automated method for tree-ring delineation based on active contours guided by DT-CWT complex coefficients in photographic images: Application to Abies alba wood slice images. Comput. Electron. Agric. 2015, 118, 204–214. [Google Scholar] [CrossRef]
  26. Hofheinz, F.; Langner, J.; Beuthien-Baumann, B.; Oehme, L.; Steinbach, J.; Kotzerke, J.; van den Ho, J. Suitability of bilateral ltering for edgepreserving noise reduction in PET. EJNMMI Res. 2011, 1, 23. [Google Scholar] [CrossRef] [PubMed]
  27. Kaur, B.; Dogra, A.; Goyal, B. Comparative analysis of bilateral filter and its variants for magnetic resonance imaging. Open Neuroimaging J. 2020, 13, 21–29. [Google Scholar] [CrossRef]
  28. Paris, S.; Kornprobst, P.; Tumblin, J.; Durand, F. Bilateral filtering: Theory and applications. Founda. Trends Comput. Graph. Vis. 2009, 4, 1–73. [Google Scholar] [CrossRef]
  29. Nuanmeesri, S. Utilization of multi-channel hybrid deep neural networks for avocado ripeness classification. Eng. Technol. Appl. Sci. Res. 2024, 14, 14862–14867. [Google Scholar] [CrossRef]
  30. Nuanmeesri, S.; Poomhiran, L.; Ploydanai, K. Improving the prediction of rotten fruit using convolutional neural network. Int. J. Eng. Trends Technol. 2021, 69, 51–55. [Google Scholar] [CrossRef]
  31. Oo, N.Z. The improvement of 1D Gaussian blur filter using AVX and OpenMP. In Proceedings of the 2022 22nd International Conference on Control, Automation and Systems (ICCAS), Jeju, Republic of Korea, 27 November–1 December 2022; pp. 1493–1496. [Google Scholar] [CrossRef]
  32. Poomhiran, L.; Meesad, P.; Nuanmeesri, S. Improving the recognition performance of lip reading using the concatenated three sequence keyframe image technique. Eng. Technol. Appl. Sci. Res. 2021, 11, 6986–6992. [Google Scholar] [CrossRef]
  33. Li, R.; Lv, S. Research on data cleaning method of metal material corrosion fatigue test data. IOP Conf. Ser. J. Phys. 2023, 2468, 012097. [Google Scholar] [CrossRef]
  34. Lin, H.; Zhang, R.; Tong, T. When Tukey meets Chauvenet: A new boxplot criterion for outlier detection. J. Comput. Graph. Stat. 2025, 1–14. [Google Scholar] [CrossRef]
  35. Marichal, H.; Passarella, D.; Randall, G. CS-TRD: A cross sections tree ring detection method. arXiv 2020, arXiv:2305.10809. [Google Scholar] [CrossRef]
  36. Gillert, A.; Resente, G.; Anadon-Rosell, A.; Wilmking, M.; von Lukas, U.F. Iterative next boundary detection for instance segmentation of tree rings in microscopy images of shrub cross sections. In Proceedings of the 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Vancouver, BC, Canada, 17–24 June 2023; pp. 14540–14548. [Google Scholar] [CrossRef]
  37. Morino, K.; Minor, R.L.; Barron-Gafford, G.A.; Brown, P.M.; Hughes, M.K. Bimodal cambial activity and false-ring formation in conifers under a monsoon climate. Tree Physiol. 2021, 41, 1893–1905. [Google Scholar] [CrossRef]
  38. Katzenmaier, M.; Garnot, V.S.F.; Wegner, J.D.; von Arx, G. Towards ROXAS AI: Automatic multi-species ring boundaries segmentation as regression in anatomical images. Front. Plant Sci. 2025, 16, 1516635. [Google Scholar] [CrossRef]
Figure 1. The proposed framework for Dendro-AutoCount.
Figure 1. The proposed framework for Dendro-AutoCount.
Mathematics 14 00094 g001
Figure 2. The sample of anomalous tree ring images in the UruDendro, UruDendro2, and UruDendro4 datasets.
Figure 2. The sample of anomalous tree ring images in the UruDendro, UruDendro2, and UruDendro4 datasets.
Mathematics 14 00094 g002
Figure 3. The sample of anomalous tree ring images with and without tree ring annotation in the UruDendro, UruDendro2, and UruDendro4 datasets.
Figure 3. The sample of anomalous tree ring images with and without tree ring annotation in the UruDendro, UruDendro2, and UruDendro4 datasets.
Mathematics 14 00094 g003
Figure 4. The four cropped images of ROI extraction.
Figure 4. The four cropped images of ROI extraction.
Mathematics 14 00094 g004
Figure 5. The example result of Hessian-based pith localization for the UruDendro dataset (the red cross in a yellow circle symbol represents the detected pith).
Figure 5. The example result of Hessian-based pith localization for the UruDendro dataset (the red cross in a yellow circle symbol represents the detected pith).
Mathematics 14 00094 g005
Figure 6. The example result of Hessian-based pith localization for the UruDendro2 dataset (the red cross in a yellow circle symbol represents the detected pith).
Figure 6. The example result of Hessian-based pith localization for the UruDendro2 dataset (the red cross in a yellow circle symbol represents the detected pith).
Mathematics 14 00094 g006
Figure 7. The example result of Hessian-based pith localization for the UruDendro4 dataset (the red cross in a yellow circle symbol represents the detected pith).
Figure 7. The example result of Hessian-based pith localization for the UruDendro4 dataset (the red cross in a yellow circle symbol represents the detected pith).
Mathematics 14 00094 g007
Figure 8. The comparison of the hit rate and the distance threshold on each dataset.
Figure 8. The comparison of the hit rate and the distance threshold on each dataset.
Mathematics 14 00094 g008
Figure 9. The testing results for pith localization on wood discs with different positions in the images (the red cross in a yellow circle symbol represents the detected pith).
Figure 9. The testing results for pith localization on wood discs with different positions in the images (the red cross in a yellow circle symbol represents the detected pith).
Mathematics 14 00094 g009
Figure 10. The peak detections on four ROI images from the UruDendro dataset.
Figure 10. The peak detections on four ROI images from the UruDendro dataset.
Mathematics 14 00094 g010
Figure 11. The peak detections on four ROI images from the UruDendro2 dataset.
Figure 11. The peak detections on four ROI images from the UruDendro2 dataset.
Mathematics 14 00094 g011
Figure 12. The peak detections on four ROI images from the UruDendro4 dataset.
Figure 12. The peak detections on four ROI images from the UruDendro4 dataset.
Mathematics 14 00094 g012
Figure 13. The number of miscounted rings of each dataset.
Figure 13. The number of miscounted rings of each dataset.
Mathematics 14 00094 g013
Figure 14. An example of cropped ROI images on different image sizes.
Figure 14. An example of cropped ROI images on different image sizes.
Mathematics 14 00094 g014
Table 1. The information on the public datasets used in this work.
Table 1. The information on the public datasets used in this work.
DatasetTotal ImagesTotal RingsTree Age (Years)Image Width (Pixels)Average Pixel per Ring Width
Max.Min.Max.Min.Mean
UruDendro [15]64122114 to 242877897174.8638.7393.75
UruDendro2 [22]53115119 to 2336722267142.5781.41110.16
UruDendro4 [23]102193016 to 2257121317282.1958.82173.47
Table 2. The comparison of final tree ring counts ( R f i n a l ) across coefficients at 1.5 to 3.0 times the SD.
Table 2. The comparison of final tree ring counts ( R f i n a l ) across coefficients at 1.5 to 3.0 times the SD.
Ring   Count   ( x 1 , x 2 , x 3 , x 4 )SD x ~ x 1 x ~ 1.5SD1.53SD1.6SD1.8SD2.0SD3.0SD
Th. R f i n a l Th. R f i n a l Th. R f i n a l Th. R f i n a l Th. R f i n a l Th. R f i n a l
21, 29, 30, 314.5729.508.506.86307.00307.32308.23309.152813.7228
22, 29, 30, 314.0829.507.506.12306.25306.53307.35308.162812.2528
23, 29, 30, 313.5929.506.505.39305.50305.75306.47307.192810.7828
24, 29, 30, 313.1129.505.504.66304.76304.97305.60296.22299.3329
25, 29, 30, 312.6329.504.503.94304.02304.21304.73295.26297.8929
26, 29, 30, 312.1629.503.503.24303.31303.46303.89294.32296.4829
27, 29, 30, 311.7129.502.502.56292.61292.73293.07293.42295.1229
28, 29, 30, 311.2929.501.501.94301.98302.07302.32302.58303.8730
29, 29, 30, 310.9629.500.501.44301.46301.53301.72301.91302.8730
30, 29, 30, 310.8230.000.001.22301.25301.31301.47301.63302.4530
Note: the Th. refers to the threshold value of the coefficient times the SD.
Table 3. The efficiency of the detected pith position across datasets.
Table 3. The efficiency of the detected pith position across datasets.
EfficiencyUruDendroUruDendro2UruDendro4
SD (pixels)2.422.552.61
MDE (pixels)3.389.5910.34
RMSE (pixels)3.949.7210.46
C w i d t h (pixels)174526
Calculated distance threshold (T)72112
Hit rate (%)92.19 (@T = 7),
100.00 (@T ≥ 11)
90.57 (@T = 12),
100.00 (@T ≥ 13)
90.20 (@T = 12),
100.00 (@T ≥ 15)
Table 4. The comparison of the efficiency of the detected pith positions with other methods on the Norell and Borgefors dataset (confidence level of 0.4).
Table 4. The comparison of the efficiency of the detected pith positions with other methods on the Norell and Borgefors dataset (confidence level of 0.4).
MethodDetection Rate (%)MDE (Pixels)SD (Pixels)
YOLOv3 [8]80.506.4210.68
SSD MobileNet [8]89.205.129.27
Proposed method91.064.657.02
Table 5. The efficiency of the Dendro-AutoCount for tree ring counting.
Table 5. The efficiency of the Dendro-AutoCount for tree ring counting.
EfficiencyUruDendroUruDendro2UruDendro4
ME (rings)−0.0310.038−0.029
MAE (rings)0.0940.1130.108
RMSE (rings)0.3950.3890.357
MAPE (%)0.53200.49600.5870
R20.99360.89240.9659
Precision0.99850.99670.9978
Recall0.99620.99840.9963
F1-score0.99720.99750.9970
Accuracy r i n g 0.99510.99480.9938
Accuracy i m a g e 0.93750.90570.9020
Table 6. The comparative efficiency results of Dendro-AutoCount (image size 1500 × 1500 pixels).
Table 6. The comparative efficiency results of Dendro-AutoCount (image size 1500 × 1500 pixels).
MethodDatasetPrecisionRecallF1-ScoreRMSEExecution Time (Seconds)
CS-TRD [35]Kennel0.97000.97000.97002.4011.10
Proposed methodKennel1.00000.97300.98632.429.92
CS-TRD [21,35]UruDendro0.95000.86000.89005.2717.30
Proposed methodUruDendro0.99850.99510.99640.4716.21
CS-TRD [35]UruDendro (test)0.94000.88000.91003.0018.00
INBD [35]UruDendro (test)0.75000.84000.79005.707.50
Table 7. The recall of the Dendro-AutoCount on different image sizes.
Table 7. The recall of the Dendro-AutoCount on different image sizes.
Image Size (Pixels)UruDendroUruDendro2UruDendro4
Original0.99620.99840.9963
1500 × 15000.99510.99650.9953
512 × 5120.98850.99040.9890
299 × 2990.97930.98250.9800
256 × 2560.97340.97540.9742
224 × 2240.96840.97090.9693
128 × 1280.94870.95030.9492
96 × 960.90030.90420.9018
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Nuanmeesri, S.; Poomhiran, L. Dendro-AutoCount Enhanced Using Pith Localization and Peak Analysis Method for Anomalous Images. Mathematics 2026, 14, 94. https://doi.org/10.3390/math14010094

AMA Style

Nuanmeesri S, Poomhiran L. Dendro-AutoCount Enhanced Using Pith Localization and Peak Analysis Method for Anomalous Images. Mathematics. 2026; 14(1):94. https://doi.org/10.3390/math14010094

Chicago/Turabian Style

Nuanmeesri, Sumitra, and Lap Poomhiran. 2026. "Dendro-AutoCount Enhanced Using Pith Localization and Peak Analysis Method for Anomalous Images" Mathematics 14, no. 1: 94. https://doi.org/10.3390/math14010094

APA Style

Nuanmeesri, S., & Poomhiran, L. (2026). Dendro-AutoCount Enhanced Using Pith Localization and Peak Analysis Method for Anomalous Images. Mathematics, 14(1), 94. https://doi.org/10.3390/math14010094

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop