A Coronal Loop Automatic Detection Method

: Coronal loops are bright, filamentary structures formed by thermal plasmas constrained by the sun’s magnetic field. Studying coronal loops provides insights into magnetic fields and their role in coronal heating processes. We propose a new automatic coronal loop detection method to optimize the problem of existing algorithms in detecting low-intensity coronal loops. Our method employs a line-Gaussian filter to enhance the contrast between coronal loops and background pixels, facilitating the detection of low-intensity ones. Following the detection of coronal loops, each loop is extracted using a method based on approximate local direction. Compared with the classical automatic detection method, Oriented Coronal Curved Loop Tracing (OCCULT), and its improved version, OCCULT-2, the proposed method demonstrates superior accuracy and completeness in loop detection. Furthermore, testing with images from the Transition Region and Coronal Explorer (TRACE) at 173 Å, the Atmospheric Imaging Assembly (AIA) on the Solar Dynamics Observatory (SDO) at 193 Å, and the High-Resolution Coronal Imager (Hi-C) at 193 Å and 172 Å confirms the robust generalization capabilities of our method. Statistical analysis of the cross-section width of coronal loops shows that most of the loop widths are resolved in Hi-C images.


Introduction
Coronal loops are filamentary structures that serve as tracers for the solar coronal magnetic field.These loops are composed of thermal plasmas confined by magnetic fields in the outer atmosphere of the sun.Previous studies on coronal loops, such as those investigating loop width [1], have predominantly relied on manual visual detection of a limited number of coronal loops for statistical analysis.However, studying small samples does not yield generalizable results, and detection outcomes are influenced by researchers' subjective judgments.Therefore, manual detection of coronal loops no longer meets the needs of contemporary solar physics research.It is evident that the objective, generalizability, and efficiency of the automatic detection algorithm for the coronal loops are of great significance to related research.
Coronal loop detection algorithms are currently classified into two categories: those using frequency or wavelet domains to extract different frequency features for coronal loop feature detection, and those using intensity and gradient thresholds in the image spatial domain.In frequency domain methods, the Wavelet Transform Modulus Maxima (WTMM) method [2] employs the derivative of a 2D smoothing (Gaussian) filter to continuously scan all boundaries at all scales, corresponding to the largest gradients (modulus maxima).Detected ridges are then identified as individual coronal loops.Feng et al. [3] proposed a method for identifying oscillation in coronal loops using phase congruency and directional filtering.Zhao [4] applied this method for coronal loop detection, but the loops identified were discontinuous and contained many spurs.Zhang [5] proposed a method using guided filtering and wavelet transforms for coronal loop detection, but it could could not separate individual coronal loops.These algorithms, along with some earlier spatial domain methods [6][7][8][9][10][11], detect only a limited number of coronal loops.The Oriented Coronal Curved Loop Tracing (OCCULT) method [12] was the first automated detection algorithm to achieve standards comparable to manual detection.The subsequent OCCULT-2 algorithm, developed by Aschwanden et al. [13], extends OCCULT by improving the detection of long coronal loops.These two methods rely on local direction, curvature, and pixel intensity information to guide loop tracing and can detect the majority of coronal loops in solar images.Consequently, they are widely used in coronal loop-related scientific research [14][15][16].
However, both algorithms struggle to detect faint coronal loops.The detection results of OCCULT-2 on images observed with SDO/AIA [17] on 3 August 2011, at 01 UT, at a wavelength of 171 Å, are shown in Figure 1.Notably, the faint coronal loops in the yellowboxed area are not accurately detected by the OCCULT-2 method.This highlights a prevalent issue with current automatic coronal loop detection algorithms: their inability to effectively identify low-intensity coronal loops.Although it is possible to segment dimmer coronal loops by adjusting the threshold parameters of OCCULT-2, due to the application of a bipass-filtering method for image enhancement and the use of global thresholds in OCCULT-2, brighter coronal loops in the original image tend to adhere together, leading to excessive segmentation.Figure 1b represents the best overall segmentation result obtained by OCCULT-2 on Figure 1a.It is challenging for OCCULT-2 to balance various scenarios solely through threshold adjustments.Enhancement directly affects the results of coronal loop segmentation, and maximizing the use of the local distribution information of loop intensities is essential to enhancement.Additionally, the OCCULT-2 algorithm exhibits discontinuous detection of crossing coronal loops.For example, in Figure 1, the OCCULT-2 algorithm incorrectly identifies the long coronal loop within the whiteboxed area as two separate loops.Direction-guided detection algorithms often yield inaccurate directions near intersecting coronal loops, as the intersecting structures disrupt the calculation of local directions, thereby affecting the detection of intersecting loops.
Figure 1.The detection results of the OCCULT-2 on images observed with SDO/AIA on 3 August 2011, 01 UT, at a wavelength of 171 Å [13].The yellow boxed area shows faint coronal loops that are not recognized, and the white boxed area marks cross coronal loops that are not continuously To overcome the limitations of previous coronal loop detection methods, this study proposes an approach to optimize the detection of faint coronal loops.The contributions of this paper are as follows: 1.
Coronal Loop Detection: An approach is introduced to address the shortcomings of existing methods for detecting faint coronal loops.Firstly, the method employs a line-Gaussian filter to enhance the contrast between the coronal loop and background pixels by overlaying the intensities of coronal loop pixels along the loop direction.This approach improves the detection capability of faint coronal loops.Furthermore, the convolution coefficients of this method follow a Gaussian distribution, which efficiently suppresses noise interference and background interference.Subsequently, the method distinguishes individual coronal loops by assessing the similarity of local directions between adjacent pixels on the curve segments.The local direction of a single pixel is approximated using the median local direction of many pixels in its neighborhood, which increases the accuracy of intersecting loop extraction.The comparisons with OCCULT and OCCULT-2, as well as the test results on TRACE [18] images at a wavelength of 173 Å, SDO/AIA [17] images at 193 Å, and Hi-C [19][20][21] images at 193 Å and 172 Å, indicate that the proposed method detects coronal loops more accurately and comprehensively.

2.
Measurement Method for Coronal Loop Properties: This study introduces a method to measure the length and cross-sectional width of coronal loops, providing essential data for subsequent investigations into coronal heating and loop modeling.By applying this method, statistical analysis of the cross-sectional width distribution in Hi-C images is conducted, leading to the conclusion that the resolution of Hi-C is sufficient to discern the majority of coronal loops.
The first section of the paper outlines the importance of automatic coronal loop detection algorithms, reviews the current research landscape, and outlines the key features of the proposed method.The second part presents a comprehensive description of the proposed method.The third part demonstrates the detection results of the proposed method on solar images, compares them with previous methods, and presents a statistical analysis of the cross-sectional width distribution of coronal loops in Hi-C images.Finally, the fourth part summarizes and discusses the entire paper.

Methods
The method proposed in this paper comprises three primary components: (1) Coronal Loop Enhancement: This step aims to optimize the contrast to highlight the filamentary structure.
(2) Coronal Loop Segmentation: In this stage, local thresholds are employed to segment the coronal loop structures and refine the extraction of their medial axes.
(3) Single Loop Extraction and Attribute Measurement: Here, individual coronal loops are extracted based on the local direction of loop pixels.Furthermore, the length and width properties of each loop are measured.
The workflow is illustrated in Figure 2.Each of these three components is explained in detail below.

Coronal Loop Enhancement
Coronal loop enhancement consists of three parts: image preprocessing, line-Gaussian enhancement, and image post-processing.Each part serves distinct functions, as outlined below.

Image Preprocessing
Image preprocessing aims to improve the contrast of the original image, as the contrast between background areas and coronal loop regions is often low in solar image FITS files.Normalization is employed to adjust the image's contrast, thereby improving the visibility of coronal loops.In addition, the 3-sigma rule is used in normalization to reject transient loop brightening, such as that caused by flares or even microflares.The real potential range of pixel intensity values is defined by the 3-sigma rule as the range of values between (µ − 3σ) and (µ + 3σ), where µ and σ represent the image's mean and standard deviation, respectively.By normalizing pixel intensity values within this range to [0, 1], the contrast between bright coronal loop regions and dark background regions is effectively enhanced.
The Laplacian-of-Gaussian (LoG) approach, as illustrated in Equation (1), is used to further sharpen the contrast of coronal loop structures.
In Equation ( 1), the constant c determines the strength of sharpening, which is commonly set to 5. ⊗ is the convolution operation.  is a two-dimensional Gaussian filter with zero mean and standard deviation  .The Laplacian differential operator is

Coronal Loop Enhancement
Coronal loop enhancement consists of three parts: image preprocessing, line-Gaussian enhancement, and image post-processing.Each part serves distinct functions, as outlined below.

Image Preprocessing
Image preprocessing aims to improve the contrast of the original image, as the contrast between background areas and coronal loop regions is often low in solar image FITS files.Normalization is employed to adjust the image's contrast, thereby improving the visibility of coronal loops.In addition, the 3-sigma rule is used in normalization to reject transient loop brightening, such as that caused by flares or even microflares.The real potential range of pixel intensity values is defined by the 3-sigma rule as the range of values between (µ − 3σ) and (µ + 3σ), where µ and σ represent the image's mean and standard deviation, respectively.By normalizing pixel intensity values within this range to [0, 1], the contrast between bright coronal loop regions and dark background regions is effectively enhanced.
The Laplacian-of-Gaussian (LoG) approach, as illustrated in Equation (1), is used to further sharpen the contrast of coronal loop structures.
In Equation ( 1), the constant c determines the strength of sharpening, which is commonly set to 5. ⊗ is the convolution operation.G 2 σ g is a two-dimensional Gaussian filter with zero mean and standard deviation σ g .The Laplacian differential operator is used by the curly braces on the right side of Equation ( 1) to sharpen the image and highlight the parts of change in the image.However, due to its second-order differential nature, the Laplacian operator is susceptible to image noise.Thus, to reduce excessive noise sharpening, convolution with a two-dimensional Gaussian function is used after Laplacian sharpening.The preprocessing result is shown in Figure 3b, where coronal loops are notably more discernible compared to Figure 3a.used by the curly braces on the right side of Equation ( 1) to sharpen the image and highlight the parts of change in the image.However, due to its second-order differential nature, the Laplacian operator is susceptible to image noise.Thus, to reduce excessive noise sharpening, convolution with a two-dimensional Gaussian function is used after Laplacian sharpening.The preprocessing result is shown in Figure 3b, where coronal loops are notably more discernible compared to Figure 3a.

Line-Gaussian Enhancement
In order to improve the contrast and filamentous structure of coronal loops, the preprocessed output is convolved with a line-Gaussian filter.This filter revolves around each pixel and convolves with a rotational line filter, yielding the greatest response value as the enhanced pixel intensity.Figure 4 illustrates this convolution process.Specifically, a single-line sampler that is the same size as a line-Gaussian filter is generated during the filter's rotation.It samples the enhanced result of the coronal loop with the current pixel as the center.Then, it convolves this sample result with the corresponding direction of the line-Gaussian, yielding a response value.This convolution procedure is repeated for each rotational filter, with the maximum response value serving as the enhancement value for the current pixel.

Line-Gaussian Enhancement
In order to improve the contrast and filamentous structure of coronal loops, the preprocessed output is convolved with a line-Gaussian filter.This filter revolves around each pixel and convolves with a rotational line filter, yielding the greatest response value as the enhanced pixel intensity.Figure 4 illustrates this convolution process.Specifically, a single-line sampler that is the same size as a line-Gaussian filter is generated during the filter's rotation.It samples the enhanced result of the coronal loop with the current pixel as the center.Then, it convolves this sample result with the corresponding direction of the line-Gaussian, yielding a response value.This convolution procedure is repeated for each rotational filter, with the maximum response value serving as the enhancement value for the current pixel.used by the curly braces on the right side of Equation ( 1) to sharpen the image and highlight the parts of change in the image.However, due to its second-order differential nature, the Laplacian operator is susceptible to image noise.Thus, to reduce excessive noise sharpening, convolution with a two-dimensional Gaussian function is used after Laplacian sharpening.The preprocessing result is shown in Figure 3b, where coronal loops are notably more discernible compared to Figure 3a.

Line-Gaussian Enhancement
In order to improve the contrast and filamentous structure of coronal loops, the preprocessed output is convolved with a line-Gaussian filter.This filter revolves around each pixel and convolves with a rotational line filter, yielding the greatest response value as the enhanced pixel intensity.Figure 4 illustrates this convolution process.Specifically, a single-line sampler that is the same size as a line-Gaussian filter is generated during the filter's rotation.It samples the enhanced result of the coronal loop with the current pixel as the center.Then, it convolves this sample result with the corresponding direction of the line-Gaussian, yielding a response value.This convolution procedure is repeated for each rotational filter, with the maximum response value serving as the enhancement value for the current pixel.To better describe the principle of line-Gaussian convolution, this study uses the following equation: Symmetry 2024, 16, 704 6 of 20 where I l (x, y) is the image after line-Gaussian convolution.L(x, y, θ) is a line-shaped sampler with the center at (x, y), with a length equal to the line-Gaussian filter G l (σ l ), a width of one pixel, and an orientation of θ (the angle between it and the horizontal line).⊗ is the convolution operation.The line-Gaussian filter, or G l (σ l ), has a width of one pixel, a length of l = 2•⌊3σ l ⌋ + 1 according to the 3-sigma rule (⌊•⌋ denotes rounding down, and +1 ensures the filter is symmetric about the center), and a standard deviation of σ l .Each pixel in the preprocessed image I LoG is iterated over during the line-Gaussian convolution process.The sampling line L is rotated around the current pixel, the sampled result is convolved with the line-Gaussian filter after each rotation, and the maximum response value from the convolution results in each direction is chosen as the enhanced intensity value of the corresponding pixel.Figure 5a shows the convolution output using the line-Gaussian filter.Following line-Gaussian convolution, enhancement in coronal loop contrast is evident; in particular, the blurry coronal loops at the image's margins are now visible to the unaided eye.It is imperative to consider the parameter value ∆θ while applying line-Gaussian convolution.When ∆θ is smaller, meaning more sample lines are used, the local orientation of coronal loops is computed more accurately.However, this also increases the number of convolutions performed, leading to higher computational complexity.In implementation, the angle step size ∆θ for filter construction is set at 1 • , which corresponds to 180 sample lines.
To better describe the principle of line-Gaussian convolution, this study uses the following equation: where  (, ) is the image after line-Gaussian convolution.(, , ) is a line-shaped sampler with the center at (, ), with a length equal to the line-Gaussian filter  ( ), a width of one pixel, and an orientation of  (the angle between it and the horizontal line).⊗ is the convolution operation.The line-Gaussian filter, or  ( ), has a width of one pixel, a length of  = 2 • ⌊3 ⌋ + 1 according to the 3-sigma rule (⌊•⌋ denotes rounding down, and +1 ensures the filter is symmetric about the center), and a standard deviation of  .Each pixel in the preprocessed image  is iterated over during the line-Gaussian convolution process.The sampling line L is rotated around the current pixel, the sampled result is convolved with the line-Gaussian filter after each rotation, and the maximum response value from the convolution results in each direction is chosen as the enhanced intensity value of the corresponding pixel.Figure 5a shows the convolution output using the line-Gaussian filter.Following line-Gaussian convolution, enhancement in coronal loop contrast is evident; in particular, the blurry coronal loops at the image's margins are now visible to the unaided eye.It is imperative to consider the parameter value ∆ while applying line-Gaussian convolution.When ∆ is smaller, meaning more sample lines are used, the local orientation of coronal loops is computed more accurately.However, this also increases the number of convolutions performed, leading to higher computational complexity.In implementation, the angle step size ∆ for filter construction is set at 1°, which corresponds to 180 sample lines.Line-Gaussian convolution not only improves pixel intensity values but also gives each pixel its local orientation.Specifically, the maximum convolution value aligns with the direction of the coronal loop during line-Gaussian convolution.In other words, the direction of the coronal loop and the sample line segment L that corresponds to the maximum convolution value are consistent.Therefore, the local orientation value at the current pixel can be defined as the angle  (, ) that corresponds to the largest convolution value.The extracted local orientations are shown in Figure 5b, where the various filamentous structures of the coronal loops and their respective orientations can be clearly observed due to the image's pseudo-colors.This directional information can be crucial for separating individual coronal loops in subsequent steps.Line-Gaussian convolution not only improves pixel intensity values but also gives each pixel its local orientation.Specifically, the maximum convolution value aligns with the direction of the coronal loop during line-Gaussian convolution.In other words, the direction of the coronal loop and the sample line segment L that corresponds to the maximum convolution value are consistent.Therefore, the local orientation value at the current pixel can be defined as the angle θ max (x, y) that corresponds to the largest convolution value.The extracted local orientations are shown in Figure 5b, where the various filamentous structures of the coronal loops and their respective orientations can be clearly observed due to the image's pseudo-colors.This directional information can be crucial for separating individual coronal loops in subsequent steps.

Image Postprocessing
Image postprocessing enhances local contrast contrasts in line-Gaussian enhancement results, allowing for easier separation of finer coronal loop structures during subsequent segmentation.The postprocessing procedure employs the Contrast Limited Adaptive Histogram Equalization (CLAHE) method [22], a combination of high-pass and low-pass transformations, and the unsharp masking method [23].Unlike conventional histogram equalization enhancement, CLAHE computes the cumulative distribution function (CDF) of each pixel neighborhood, which improves the local contrast of different regions within the image.Additionally, CLAHE limits the amplification of noise in locally flat regions by constraining the height of the histogram.
High-hat and low-hat transformations from grayscale morphology are applied to the CLAHE results to enhance the clarity of coronal loop contours.The process is illustrated in Equation ( 3), where I tb is the results of the high-hat and low-hat transformations.I CLAHE is the image after CLAHE processing.T hat (I CLAHE ) and B hat (I CLAHE ) are the images after applying the top-hat and bottom-hat transformations, respectively.The image's brilliant details are emphasized with the top-hat transform, while its dark details are emphasized with the bottom-hat transform.The integration of top-hat and bottom-hat transforms in Equation ( 3) can notably increase the clarity of coronal loops by enhancing contrast and emphasizing the local features in the image.Long loops can be further refined by performing an additional round of linear-Gaussian convolution after the top-hat and bottom-hat transformations.
Figure 6a shows enhanced contrast in both long and faint coronal loops.

Coronal Loop Segmentation
In solar physics research, "region-based feature recognition methods" are commonly used to accurately identify the ragged contours of sunspots, active regions, and filament areas [24].Among these methods, threshold segmentation is one of the most widely used due to its intuitiveness and simplicity.This study uses a local threshold segmentation method to segment coronal loops.
Global thresholding employs a fixed threshold for segmentation, making it difficult to discern between noise and faint coronal loops.In contrast, the local thresholding method can use local information to adjust threshold values dynamically across different regions.Therefore, using the local thresholding method can produce better segmentation results when working with unequal-intensity images.The process of local thresholding can be represented by Equation ( 5): where ℎ is the obtained local threshold.ℎ is the global threshold computed from the image  (, ). is the standard deviation of the local window, which helps modify the threshold to handle changes in local contrast. is a constant used to adjust the influence of the standard deviation, with a value of 0.8 in implementation.And the window size is set to 15.The threshold segmentation result is shown in Figure 7a, where the coronal loops exhibit a reticular structure.Finally, unsharp mask filtering [18] is applied to further enhance the contrast of the image.The main concept behind unsharp mask filtering is to remove the image's smooth, low-frequency component while preserving the high-frequency details.The unsharp mask filter is defined as follows: where I F (x, y) is the enhanced result.I tb (x, y) represents the results of the top-hat and bottom-hat transformations.smooth[I tb (x, y), n sm ] is the operation of mean filtering, where the dimension of the mean filter is n sm with a value of 5 used during implementation.The result of the unsharp mask filtering is shown in Figure 6b, where certain bright areas are removed, making the coronal loop structures more discernible to the naked eye.In Figure 6b, there are highly warped structures, which are primarily attributed to the pixel intensity saturation at the base points of coronal loops in the image.During the subsequent process of extracting individual coronal loops, these structures will be segmented into segments smaller than 15 pixels due to their high curvature and ultimately filtered out.

Coronal Loop Segmentation
In solar physics research, "region-based feature recognition methods" are commonly used to accurately identify the ragged contours of sunspots, active regions, and filament areas [24].Among these methods, threshold segmentation is one of the most widely used due to its intuitiveness and simplicity.This study uses a local threshold segmentation method to segment coronal loops.
Global thresholding employs a fixed threshold for segmentation, making it difficult to discern between noise and faint coronal loops.In contrast, the local thresholding method can use local information to adjust threshold values dynamically across different regions.Therefore, using the local thresholding method can produce better segmentation results when working with unequal-intensity images.The process of local thresholding can be represented by Equation ( 5): where th is the obtained local threshold.th global is the global threshold computed from the image I F (x, y).σ n is the standard deviation of the local window, which helps modify the threshold to handle changes in local contrast.α is a constant used to adjust the influence of the standard deviation, with a value of 0.8 in implementation.And the window size is set to 15.The threshold segmentation result is shown in Figure 7a, where the coronal loops exhibit a reticular structure.Then, the medial axes of the coronal loops, with a width of one pixel, are obtained by morphological thinning of the binary image.This creates the necessary conditions for the subsequent acquisition of coronal loop location data.Figure 7b shows the extraction results of these medial axes.However, at this stage, the obtained medial axes still form entangled reticular structures.Some previous approaches [4,5] treated intersecting coronal loops as if they were one single coronal loop, leading to inaccurate measurements of individual coronal loop lengths and widths.To accurately acquire the property data of the coronal loops, it is necessary to extract independent, single coronal loops from this reticular structure.

Extraction and Property Measurement of Individual Coronal Loops
Identifying coronal loops primarily involves distinguishing them from the background.However, because the loops often appear reticular, accurately measuring their properties is difficult.Therefore, further extraction of individual loops is necessary, which involves breaking down the interconnected loop structure.Based on the principles of visual processing, continuous segments in a particular direction are regarded as connected wholes.Hence, researchers usually use directional information to identify individual loops [12,13].To effectively identify intersecting loops, this study uses the crossing points of thinned loops to divide the interconnected loop structure into independent segments.Subsequently, loop segments with similar directions are merged into individual loops.Then, the medial axes of the coronal loops, with a width of one pixel, are obtained by morphological thinning of the binary image.This creates the necessary conditions for the subsequent acquisition of coronal loop location data.Figure 7b shows the extraction results of these medial axes.However, at this stage, the obtained medial axes still form entangled reticular structures.Some previous approaches [4,5] treated intersecting coronal loops as if they were one single coronal loop, leading to inaccurate measurements of individual coronal loop lengths and widths.To accurately acquire the property data of the coronal loops, it is necessary to extract independent, single coronal loops from this reticular structure.

Extraction and Property Measurement of Individual Coronal Loops
Identifying coronal loops primarily involves distinguishing them from the background.However, because the loops often appear reticular, accurately measuring their properties is difficult.Therefore, further extraction of individual loops is necessary, which involves breaking down the interconnected loop structure.Based on the principles of visual pro-Symmetry 2024, 16, 704 9 of 20 cessing, continuous segments in a particular direction are regarded as connected wholes.Hence, researchers usually use directional information to identify individual loops [12,13].To effectively identify intersecting loops, this study uses the crossing points of thinned loops to divide the interconnected loop structure into independent segments.Subsequently, loop segments with similar directions are merged into individual loops.

Extraction of Coronal Loop Segments
As shown in Figure 8, there are four steps involved in separating the thinned reticular coronal loop into independent segments.Firstly, the crossing points of the coronal loop medial axes are extracted using morphological operations on the binary image.Then, the thinned reticular coronal loops are separated into a series of independent loop segments using these crossing points.Next, the connected component labeling method is used to identify these segments.This method detects the connectivity between adjacent pixels, assigning a distinct label to each loop segment.Finally, the pixels removed at the crossing points are restored, with adjacent labels applied to these pixels to maintain the integrity of the coronal loop medial axes.

Merging of Coronal Loop Segments
The obtained coronal loop segments with approximate orientations and distances merged into complete loops.Firstly, the local direction of each pixel on the loop segm is determined using the linear Gaussian convolution described in Section 2.1.2.The m ing process is illustrated in Figure 9, where A and B represent the two nearest endpo on loop segments L and L , respectively, with local directions θ and θ at poin and B. θ is the direction of the line connecting A and B. d is the distance between A B. Segments L and L are considered mergeable when the absolute difference betw θ and θ is less than th ., as shown in Figure 9a.Here, th is set to 10 degrees in implementation.

Merging of Coronal Loop Segments
The obtained coronal loop segments with approximate orientations and distances are merged into complete loops.Firstly, the local direction of each pixel on the loop segments is determined using the linear Gaussian convolution described in Section 2.1.2.The merging process is illustrated in Figure 9, where A and B represent the two nearest endpoints on loop segments L 1 and L 2 , respectively, with local directions θ 1 and θ 2 at points A and B. θ AB is the direction of the line connecting A and B. d is the distance between A and B. Segments L 1 and L 2 are considered mergeable when the absolute difference between θ 1 and θ 2 is less than th dir , as shown in Figure 9a.Here, th dir is set to 10 degrees in the implementation.
However, even when meeting the threshold criteria, segments L 1 and L 2 cannot be merged in the scenario depicted in Figure 9b.In this case, the two segments do not lie on the same line, and the direction of θ AB is dissimilar to θ 1 and θ 2 .Conversely, when segments L 1 and L 2 can be merged (Figure 9a), the direction of θ AB should be similar to θ 1 and θ 2 .Therefore, before merging, it is necessary to assess whether θ AB is similar to θ 1 and θ 2 .
ing process is illustrated in Figure where A and B represent the two nearest endpoints on loop segments L and L , respectively, with local directions θ and θ at points A and B. θ is the direction of the line connecting A and B. d is the distance between A and B. Segments L and L are considered mergeable when the absolute difference between θ and θ is less than th ., as shown in Figure 9a.Here, th is set to 10 degrees in the implementation.(3) errors in the local direction around loop intersection points.These factors indicate that using the local direction of individual pixels as a merging criterion is inaccurate.Therefore, this work proposes a retreat strategy for approximating the local direction of pixels by taking the median of the local directions of many pixels in their neighborhood.
Figure 9c,d illustrate the principle of the retreat strategy.An example without a retreat strategy is shown in Figure 9c.The local directions θ 1 and θ 2 are similar, and θ AB is also similar to θ 1 and θ 2 .In this case, loops L 1 and L 2 are incorrectly judged to be mergeable.However, after introducing the retreat strategy (Figure 9d), starting at point A and retreating m pixels leads to point A'.Next, a region of n pixels near A' is chosen.The local direction θ 3 for merging L 1 is calculated by taking the median of the local directions of n pixels in this neighborhood.Similarly, θ 4 is the local direction for merging L 2 .In Figure 9d, it can be observed that the directions indicated by the red arrows, θ 3 and θ 4 , are not similar; thus, L 1 and L 2 are not considered to fit the merger criterion.
After the merging process, the merged coronal loop segments are labeled with the same identifier, yet the gaps between segments remain unfilled.To address this, polynomial fitting is employed to bridge the gaps within the combined coronal loops.Some coronal loop medial axes are deformed during the thinning procedure, so the merging outcome of these segments is unsatisfactory.Therefore, an additional merging operation is performed to achieve better connectivity.The final merging results are shown in Figure 10, where individual coronal loops can be observed and successfully extracted.Various colors are used to identify distinct coronal loops, and intersecting coronal loops appear in different colors, demonstrating that this algorithm accurately separates intersecting coronal loops.come these segments is unsatisfactory.Therefore, an additional merging operation is performed to achieve better connectivity.The final merging results are shown in Figure 10, where individual coronal loops can be observed and successfully extracted.Various colors are used to identify distinct coronal loops, and intersecting coronal loops appear in different colors, demonstrating that this algorithm accurately separates intersecting coronal loops.

Property Measurement
This study proposes a method that uses coronal loop detection to successfully separate independent loops, facilitating more precise measurements of loop length, cross-section width, and other properties.The length of individual coronal loops is often used as a critical metric for evaluating automatic loop detection algorithms, serving as a measure of algorithm continuity [6].Simultaneously, loop length and cross-sectional width can both be used to collect information for later research on coronal loops, which can be used to deduce loop structures and heating mechanisms [1,14].The method employs a linear chordal approximation to compute the arc length.Specifically, the Euclidean distance formula determines the lengths of line segments connecting neighboring points using the given twodimensional coordinates of the coronal loop axes.These lengths are then added to obtain the length of each loop.This method offers the advantages of efficiency and simplicity.Due to the dense extraction of coronal loop coordinates by the proposed method, loop lengths can be estimated relatively accurately.Additionally, the cross-sectional width of each coronal loop is measured using its full width at half maximum (FWHM), which enables statistical examination of the distribution of loop cross-sectional widths in coronal loop images.Specifically, using the local direction extracted by the line-Gaussian convolution in Section 2.1.2,the perpendicular direction to the coronal loop axis at each pixel point on the loop axis is calculated.Subsequently, the outline of the cross-section perpendicular to the loop axis is determined.Then, the positions on either side of the loop axis where the intensity peaks are half the maximum intensity are identified, and the difference in width between these two positions represents the width of the cross-sectional outline.

Comparison Experiment
The comparison algorithms are the OCCULT algorithm [12] and its improved version, the OCCULT-2 algorithm [13].The OCCULT algorithm [12] was the first automatic detection method capable of achieving results comparable to manual detection, while the OCCULT-2 algorithm [13] optimized the extraction of long coronal loop segments.Widely acknowledged in the solar physics domain, these algorithms have been applied in various coronal loop-related studies [14][15][16].These algorithms effectively segment the majority of coronal loops while maintaining their continuity, performing significantly better than previous algorithms.Additionally, some prior algorithms [4,5] failed to detect individual coronal loops, resulting in the overestimation of length measures by grouping connected loops as one.The OCCULT algorithm [12] and OCCULT-2 algorithm [13] can separate each individual coronal loop, ensuring measurement accuracy.
The test image selected for the experiments this paper was observed with TRACE on 19 May 1998, at 22:21:43 UT, at a wavelength of 173 Å.The original image size is 1024 × 1024 pixels.Aschwanden et al. used the image to test existing automatic coronal loop detection algorithms and compared their performance with the OCCULT and OCCULT-2 algorithms [12,13].Thus, choosing the same image for testing allows for an intuitive comparison with the OCCULT and OCCULT-2 algorithms.The paper selects the same local image region as OCCULT [12], corresponding to the range of horizontal coordinates from 200 to 1000 pixels and vertical coordinates from 150 to 850 pixels, containing all the coronal loop parts.This ensures a more accurate comparison of the proposed algorithm and the comparison algorithms in terms of extracting faint coronal loops and maintaining loop continuity.Since the OCCULT-2 algorithm actually performs coronal loop detection on the entire image, our comparison process mainly focuses on the same region as the local image used by the OCCULT algorithm within the OCCULT-2 results (as shown by the yellow dashed box in Figure 11c).This research can then be directly compared with OCCULT-2 because it offers more continuous detection of long coronal loops and is more capable of recognizing low-intensity coronal loops than the OCCULT method.Figure 11b shows the single-coronal loop results of our algorithm, with different colored lines representing different coronal loops.Figure 11c displays the results of the OC-CULT-2 algorithm, with the red curves indicating the coronal loops detected by OCCULT-2, superimposed on the bipass-filtered result of the original image.A comparative analysis of Figure 11b,c reveals that our algorithm detects a greater number of coronal loops compared to the OCCULT-2 algorithm.Additionally, in Figure 11b, from the results of the individual coronal loops, it can be observed that our algorithm successfully separates independent coronal loops and accurately detects intersecting coronal loops.In terms of detecting weak coronal loops, our algorithm performs better in low-contrast regions of the Figure 11b shows the single-coronal loop results of our algorithm, with different colored lines representing different coronal loops.Figure 11c displays the results of the OCCULT-2 algorithm, with the red curves indicating the coronal loops detected by OCCULT-2, superimposed on the bipass-filtered result of the original image.A comparative analysis of Figure 11b,c reveals that our algorithm detects a greater number of coronal loops to the OCCULT-2 algorithm.Additionally, in Figure 11b, from the results of the individual coronal loops, it can be observed that our algorithm successfully separates independent coronal loops and accurately detects intersecting coronal loops.In terms of detecting weak coronal loops, our algorithm performs better in low-contrast regions of the image, successfully detecting weak coronal loops that OCCULT-2 fails to detect, such as the two coronal loops indicated by yellow arrows in Figure 11a,c.For a clearer observation, Figure 11e,f show the detection results of OCCULT-2 and our algorithm in this local area, respectively.It can be observed that our algorithm indeed detects these two weak coronal loops.Furthermore, to validate the authenticity of the coronal loops detected by our algorithm, the results of our algorithm are superimposed on the bipassfiltered result of the original image, as shown in Figure 11d.The results of the proposed algorithm are overlaid on the white ridge lines rather than the darker background pixels, indicating that our algorithm can identify coronal loops more accurately compared to the OCCULT-2 algorithm.
On the other hand, this study employs the quantitative evaluation method proposed by Aschwanden [12] to quantitatively compare with the OCCULT [12] and OCCULT-2 [13] methods, as well as the data manually detected [13] by Aschwanden et al.Three quantitative criteria are employed: (1) the number of detected coronal loops N L ; (2) the longest detected coronal loop length L max ; and (3) the number of coronal loops detected with lengths greater than 70 pixels N(L > 70).Criterion (1) initially assesses the algorithm's ability to detect coronal loops; Criterion (2) evaluates the algorithm's robustness in detecting long coronal loops; Criterion (3) assesses the completeness (i.e., continuity) of the algorithm in detecting coronal loops.
Figure 12 shows the cumulative distribution of loop lengths computed in this study.This cumulative distribution calculates the number of all coronal loops within a given length range.The maximum coronal loop length L max and the number of loops with a length greater than 70 pixels (70 × 0.5 × 725 km ≈ 25,375 km) N(L > 25, 375 km) are annotated in Figure 12.The method presented in this paper extracts the most N(L > 70) loops.Because the proposed method merges visually contiguous loops, there are fewer broken loops in the results compared to other methods, making the cumulative length histogram statistically more accurate.Table 1 presents the quantitative measurement results of the proposed method compared to the OCCULT [12] and OCCULT-2 [13] algorithms, as well as manual measurements [13].In terms of the number of traced coronal loops, OCCULT-2 detected coronal loops in the whole original image, identifying 437 loops.Despite detecting only localized regions of the image, the proposed algorithm traced 473 coronal loops, outperforming OCCULT-2.In contrast, due to the difficulty in identifying coronal loops with low contrast, the number of loops detected by manual detection is significantly lower.Therefore, OCCULT, OCCULT-2, and the proposed method all exceed manual detection in terms of the number of coronal loops.In terms of the detected length of the longest coronal loop, manual detection detected the longest length, which may be because visual perception interpolates patterns that are not detectable.In terms of loop continuity, manual tracing detected 154 loops with lengths greater than 70 pixels (N(L > 70)).For these relatively long coronal loops exceeding 70 pixels, humans are unlikely to make mistakes in recognition; thus, the result from manual detection should be relatively accurate.However, the N(L > 70) of the proposed algorithm is 149, which is the closest to the result of manual detection, demonstrating the excellent performance of the proposed algorithm in detecting the continuity of coronal loops.These results clearly demonstrate that, after optimizing the identification of individual loops, the proposed method indeed has an advantage in detecting loop integrity compared to the comparison algorithms.Based on the evaluation of the three quantitative standards mentioned above, the loop detection performance of our algorithm is relatively superior, especially in maintaining the continuity of coronal loops.
timizing the identification of individual loops, proposed method indeed has an vantage in detecting loop integrity compared to the comparison algorithms.Based on evaluation of the three quantitative standards mentioned above, the loop detection p formance of our algorithm is relatively superior, especially in maintaining the continu of coronal loops.

Adaptability Experiment
This paper uses images observed by TRACE, AIA/SDO, and Hi-C devices to verify the generalization of the proposed algorithm.
First, we tested the TRACE images.Figure 13a shows the original image of TRACE observed at 173 Å on 25 August 1998.Figure 13b,c show the coronal loop detection results of Figure 13a.Figure 13b uses different colors to mark individual coronal loops.The detection results in Figure 13b exhibit good integrity, with accurately merged intersecting coronal loops, suggesting that the proposed algorithm effectively optimizes the merging process.Figure 13c superimposes the coronal loop detection results on the bipass-filtered results, with the red curves representing the detected coronal loops.A bipass filter is commonly used to verify the accuracy of the coronal loop recognition, as it enhances the image features and makes the coronal loops in the processed original image more visible.The accuracy of coronal loop detection can be evaluated by comparing the position of the coronal loop in the original image with the detection result.By confirming the coincidence relationship between the long white ridge line in the background and the detection of the coronal loops, it is evident that the proposed algorithm can accurately detect most of them.Figure 13d shows a TRACE image observed at 173 Å on 6 November 1999.Figure 13e,f show the coronal loop detection results of Figure 13d.The detection results in Figure 13e, indicated by different colors for individual coronal loops, demonstrate good integrity.Observing Figure 13f, we can see that although the proposed algorithm detects most of the coronal loops, it also detects a few instrument artifacts (diagonal downward straight lines).Therefore, the proposed algorithm still requires improvements in noise suppression.
show coronal loop detection results of Figure 13d.The detection results in Figure 13e, indicated by different colors for individual coronal loops, demonstrate good integrity.Observing Figure 13f, we can see that although the proposed algorithm detects most of the coronal loops, it also detects a few instrument artifacts (diagonal downward straight lines).Therefore, the proposed algorithm still requires improvements in noise suppression.The SDO/AIA images were subsequently tested.Figure 14a shows the original image of the SDO/AIA observation at 00:00:00 UT on 14 February 2011, at 193 Å in NOAA 11158.The image exhibits uneven contrast, with very low intensity at the edges, making it difficult to observe coronal loops in these low-intensity regions with the naked eye.Different colors were used in Figure 14b to mark each distinct coronal loop, and Figure 14c superimposes the bipass-filtered image with the coronal loop detection results.Figure 14d highlights a region selected using the box in Figure 14a, where many low-intensity coronal loops can be faintly observed.Figure 14e,f show the local regions selected by the boxes in Figure 14b,c, respectively.The proposed algorithm extracted low-intensity coronal loops in the selected region.Additionally, other low-intensity coronal loops located in the marginal regions were also detected, maintaining good continuity and integrity.This test indicates that the proposed algorithm can detect low-intensity coronal loops in SDO/AIA images.
Finally, coronal loop detection was performed on the Hi-C [20] image.Figure 15a shows the original image of Hi-C observed at 18:54:16 UT on 11 July 2012 at 193 Å, with the active area being NOAA 11520.Due to the large image size, we zoomed in on a specific area marked by the red box in Figure 15a to observe and analyze the detection details more finely.The zoomed-in results are displayed in Figure 15b,c.In Figure 15b, single coronal loops are marked in different colors, demonstrating relatively good completeness.Furthermore, in Figure 15c, the coronal loop structure detected by the proposed algorithm aligns with the linear structure displayed in the bipass-filtered image, indicating good accuracy of the detection results.Figure 16a shows the original image of Hi-C 2.1 [21]    Finally, coronal loop detection was performed on the Hi-C [20] image.Figure 15a shows the original image of Hi-C observed at 18:54:16 UT on 11 July 2012 at 193 Å, with the active area being NOAA 11520.Due to the large image size, we zoomed in on a specific area marked by the red box in Figure 15a to observe and analyze the detection details more finely.The zoomed-in results are displayed in Figure 15b,c.In Figure 15b, single coronal loops are marked in different colors, demonstrating relatively good completeness.Furthermore, in Figure 15c, the coronal loop structure detected by the proposed algorithm aligns with the linear structure displayed in the bipass-filtered image, indicating good accuracy of the detection results.Figure 16a shows the original image of Hi-C 2.1 [21] at 18:56 UT on 29 May 2018 at 172 Å, in the active area NOAA 12712.The proposed method detected the low-intensity coronal loops in the darker region located in the upper right  Through the above analysis, we conclude that the detection of the proposed algorithm remains stable for TRACE, SDO/AIA, and Hi-C images observed by different resolutions at different wavelengths and achieves excellent detection for all the selected test images.The experimental results show that the proposed algorithm has good applicability and can be applied to automatically detect coronal loops.Through the above analysis, we conclude that the detection of the proposed algorithm remains stable for TRACE, SDO/AIA, and Hi-C images observed by different resolutions at different wavelengths and achieves excellent detection for all the selected test images.The experimental results show that the proposed algorithm has good applicability and can be applied to automatically detect coronal loops.
Through the above analysis, we conclude that the detection of the proposed algorithm remains stable for TRACE, SDO/AIA, and Hi-C images observed by different resolutions at different wavelengths and achieves excellent detection for all the selected test images.The experimental results show that the proposed algorithm has good applicability and can be applied to automatically detect coronal loops.

Distribution of Coronal Loop Cross-Sectional Widths
The first test image for width statistics is derived from Hi-C, observed on 11 July 2012, 18:54:16 UT, at a wavelength of 193 Å, in the active region NOAA 11520, as shown in Figure 15a.Aschwanden and Peter [15] performed a statistical analysis of the coronal loop width distribution in this image using the OCCULT-2 algorithm [13].We use the proposed algorithm in this paper to detect and extract coronal loops in the same image and perform width distribution statistics.To minimize measurement error, the most frequent coronal loop width is obtained from the peak value of the calculated fitted curve (shown by the

Distribution of Coronal Loop Cross-Sectional Widths
The first test image for width statistics is derived from Hi-C, observed on 11 July 2012, 18:54:16 UT, at a wavelength of 193 Å, in the active region NOAA 11520, as shown in Figure 15a.Aschwanden and Peter [15] performed a statistical analysis of the coronal loop width distribution in this image using the OCCULT-2 algorithm [13].We use the proposed algorithm in this paper to detect and extract coronal loops in the same image and perform width distribution statistics.To minimize measurement error, the most frequent coronal loop width is obtained from the peak value of the calculated fitted curve (shown by the red line in Figure 17).Our algorithm detects 440,370 coronal loop cross-section profiles, with the most frequently occurring loop width being 6.59 pixels, as depicted in the histogram in Figure 17a.In contrast, the OCCULT-2 algorithm detects 138,965 coronal loop cross-section profiles in the same test image, with the most frequently occurring loop width being 7.1 pixels.Compared to the OCCULT-2 algorithm, the proposed algorithm is able to detect more coronal loops, resulting in a larger statistical sample space.Specifically, it has detected more faint and small-scale coronal loops.This enhances the comprehensiveness of the proposed algorithm compared to OCCULT-2 in small-scale coronal loop statistics.Consequently, the statistical results obtained from this research are more statistically significant compared to those from the OCCULT-2 algorithm.red line in Figure 17).Our algorithm detects 440,370 coronal loop cross-section profiles, with the most frequently occurring loop width being 6.59 pixels, as depicted in the histogram in Figure 17a.In contrast, the OCCULT-2 algorithm detects 138,965 coronal loop cross-section profiles in the same test image, with the most frequently occurring loop width being 7.1 pixels.Compared to the OCCULT-2 algorithm, the proposed algorithm is able to detect more coronal loops, resulting in a larger statistical sample space.Specifically, it has detected more faint and small-scale coronal loops.This enhances the comprehensiveness of the proposed algorithm compared to OCCULT-2 in small-scale coronal loop statistics.Consequently, the statistical results obtained from this research are more statistically significant compared to those from the OCCULT-2 algorithm.The pixel resolution of Hi-C is 0.1 arc seconds, so the most frequent coronal loop width statistically obtained in this paper is approximately 6.59 × 72.5 km ≈ 477 km.According to [16], the point spread function of Hi-C is w = 2.5 pixels, meaning that width measurements greater than 2.5 pixels in this paper likely represent genuine coronal loop structures.As most of the measurement results in this paper exceed 2.5 pixels, Hi-C is The pixel resolution of Hi-C is 0.1 arc seconds, so the most frequent coronal loop width statistically obtained in this paper is approximately 6.59 × 72.5 km ≈ 477 km.According to [16], the point spread function of Hi-C is w psf = 2.5 pixels, meaning that width measurements greater than 2.5 pixels in this paper likely represent genuine coronal loop structures.As most of the measurement results in this paper exceed 2.5 pixels, Hi-C is capable of resolving the majority of coronal loop structures.
Additionally, we tested the image from Hi-C 2.1, as shown in Figure 16a, for width statistics.The coronal loop width distribution histogram of this image is shown in Figure 17b.Our algorithm detected 125,722 coronal loop cross-section profiles, with the most frequent loop width being 6 pixels (6 × 0.129 × 725 km ≈ 560 km).This result aligns with the conclusion drawn by the OCCULT-2 algorithm, which determined the most frequent coronal loop width to be 550 km based on width statistics [16], further validating the findings of Brooks et al.'s research [25].They came to the conclusion that the typical scale of solar coronal loops is hundreds of kilometers, far exceeding the spatial scales of many proposed physical mechanisms.Moreover, most of the widths measured in this study exceed the resolution of Hi-C, confirming that the second test image supports the same conclusion as the first test image: Hi-C can resolve the majority of coronal loop structures.This conclusion is consistent with the findings of references [19,25,26], further indicating that coronal heating units are not composed of microscopic, indistinguishable multi-band structures.

Conclusions
Existing algorithms for automatic detection of coronal loops face challenges in accurately detecting low-intensity coronal loops.In this paper, we propose an effective algorithm for automatic detection of coronal loops that aims to optimize their identification.By incorporating a rotating line-Gaussian filter and superimposing pixel intensity along the filamentous structure of the coronal loop, our method significantly enhances the contrast of these low-intensity structures, thereby improving their recognition capability.Notably, this method is not limited to the simple detection of coronal loops but is also capable of extracting individual coronal loops, which is conducive to accurately extracting subsequent properties of coronal loops.By comparing it with the OCCULT [12] and OCCULT-2 [13] methods, the proposed method demonstrates superior performance in extracting faint coronal loops and achieves more complete detection of coronal loops.Further generalization tests show that the proposed method achieves excellent detection results on EUV images, verifying its broad generalization in automatic coronal loop detection.Despite the fact that coronal loops are also observable in X-ray images (such as images from the Yohkoh and Hinode missions) and other EUV wavelengths with different temperature sensitivities (e.g., 335 Å and 94 Å), the focus of this study was on testing specific EUV wavelengths.Future work could explore the possibility of extending the proposed method to other wavelength images to further validate its generalizability and applicability.
Additionally, this paper provides a detailed statistical analysis of the static properties of coronal loops and analyzes the width distribution of coronal loops in Hi-C images.Compared to the OCCULT-2 algorithm, the proposed algorithm detects more accurate coronal loops, resulting in more comprehensive statistical results.Our statistical findings are more statistically significant and indicate that the resolution of Hi-C is sufficient to discern the majority of coronal loops.
However, the proposed method still needs to be improved.Firstly, since line-Gaussian convolution needs to traverse each pixel in the image several times, the real-time performance is low.In subsequent research, we will delve deeper into optimizing the algorithm's complexity to enhance its efficiency.
Secondly, the detection results still have a small amount of noise.We note that in terms of noise reduction and background removal, the method proposed by Tiwari et al. [27] offers a fresh perspective.The method can be used to quantify the steady background and remove it by creating minimum-brightness maps within different time windows.Furthermore, with

Figure 1 .
Figure 1.The detection results of the OCCULT-2 on images observed with SDO/AIA on 3 August 2011, 01 UT, at a wavelength of 171 Å [13].The yellow boxed area shows faint coronal loops that are not recognized, and the white boxed area marks cross coronal loops that are not continuously recognized.(a) Original image; (b) bipass-filtered image overlaid with the detection results of OCCULT-2.

Figure 2 .
Figure 2. Flowchart for the proposed automatic coronal loop detection method.

Figure 2 .
Figure 2. Flowchart for the proposed automatic coronal loop detection method.

Figure 5 .
Figure 5. Line-Gaussian convolution results and local orientation properties of Figure 3a.(a) Line-Gaussian convolution results; (b) local orientation in pseudo-colors.Different colors correspond to different degrees.

Figure 5 .
Figure 5. Line-Gaussian convolution results and local orientation properties of Figure 3a.(a) Line-Gaussian convolution results; (b) local orientation in pseudo-colors.Different colors correspond to different degrees.

Figure 6 .
Figure 6.The postprocessing results of Figure 3a.(a) Result of reapplying the line-Gaussian convolution; (b) result of the unsharp mask filtering.

Figure 6 .
Figure 6.The postprocessing results of Figure 3a.(a) Result of reapplying the line-Gaussian convolution; (b) result of the unsharp mask filtering.

Symmetry 2024 ,Figure 8 .
Figure 8. Process of extracting coronal loop segments.Pixels of the same color belong to the s connected component.

Figure 8 .
Figure 8. Process of extracting coronal loop segments.Pixels of the same color belong to the same connected component.

Figure 9 .
Figure 9. Backtracking mechanism of coronal loop merging.See text for details.Figure 9. Backtracking mechanism of coronal loop merging.See text for details.

Figure 9 .
Figure 9. Backtracking mechanism of coronal loop merging.See text for details.Figure 9. Backtracking mechanism of coronal loop merging.See text for details.Nevertheless, errors still occur during the merging process.Upon analysis, the following factors lead to incorrect loop merging: (1) deformation of the loop medial axe near crossing locations during thinning procedures; (2) potential errors in the local direction extracted by the line-Gaussian filter due to redundant distribution of medial axe pixels; and(3) errors in the local direction around loop intersection points.These factors indicate that using the local direction of individual pixels as a merging criterion is inaccurate.Therefore, this work proposes a retreat strategy for approximating the local direction of pixels by taking the median of the local directions of many pixels in their neighborhood.Figure9c,d illustrate the principle of the retreat strategy.An example without a retreat strategy is shown in Figure9c.The local directions θ 1 and θ 2 are similar, and θ AB is also similar to θ 1 and θ 2 .In this case, loops L 1 and L 2 are incorrectly judged to be mergeable.However, after introducing the retreat strategy (Figure9d), starting at point A and retreating m pixels leads to point A'.Next, a region of n pixels near A' is chosen.The local direction θ 3 for merging L 1 is calculated by taking the median of the local directions of n pixels in this neighborhood.Similarly, θ 4 is the local direction for merging L 2 .In Figure9d, it can be observed that the directions indicated by the red arrows, θ 3 and θ 4 , are not similar; thus, L 1 and L 2 are not considered to fit the merger criterion.After the merging process, the merged coronal loop segments are labeled with the same identifier, yet the gaps between segments remain unfilled.To address this, polynomial fitting is employed to bridge the gaps within the combined coronal loops.Some coronal loop medial axes are deformed during the thinning procedure, so the merging outcome of these segments is unsatisfactory.Therefore, an additional merging operation is performed to achieve better connectivity.The final merging results are shown in Figure10, where individual coronal loops can be observed and successfully extracted.Various colors are used to identify distinct coronal loops, and intersecting coronal loops appear in different colors, demonstrating that this algorithm accurately separates intersecting coronal loops.

Figure 10 .
Figure 10.Coronal loop merging results.Differentiating different coronal loops using various colors.Figure 10.Coronal loop merging results.Differentiating different coronal loops using various colors.

Figure 10 .
Figure 10.Coronal loop merging results.Differentiating different coronal loops using various colors.Figure 10.Coronal loop merging results.Differentiating different coronal loops using various colors.

Figure 11 .
Figure 11.Comparison between the proposed algorithm and OCCULT-2.(a) Original image observed with TRACE on 19 May 1998, 22:21:43 UT, at a wavelength of 173 Å; (b) single coronal loop results of the proposed algorithm; (c) results of the OCCULT-2 algorithm [13]; (d) results of this algorithm; (e) local detection results of the coronal loops labeled with yellow arrows by the OC-CULT-2 algorithm [13]; (f) local detection results of the coronal loops labeled with yellow arrows by this algorithm.

Figure 11 .
Figure 11.Comparison between the proposed algorithm and OCCULT-2.(a) Original image observed with TRACE on 19 May 1998, 22:21:43 UT, at a wavelength of 173 Å; (b) single coronal loop results of the proposed algorithm; (c) results of the OCCULT-2 algorithm [13]; (d) results of this algorithm; (e) local detection results of the coronal loops labeled with yellow arrows by the OCCULT-2 algorithm [13]; (f) local detection results of the coronal loops labeled with yellow arrows by this algorithm.

Figure 12 .
Figure 12.The cumulative distribution of loop lengths of the TRACE image observed on 19 Ma 1998, at 22:21:43 UT.See text for details.

Figure 12 .
Figure 12.The cumulative distribution of loop lengths of the TRACE image observed on 19 May 1998, at 22:21:43 UT.See text for details.

Figure 13 .
Figure 13.The coronal loop detection of the proposed algorithm in TRACE images.(a) The original image observed with TRACE on 25 August 1998, at a wavelength of 173 Å; (b) individual coronal loop detection result of (a); (c) detection result of (a) superimposed with a bipass-filtered image; (d) the original image observed with TRACE on 6 November 1999, at a wavelength of 173 Å; (e) individual coronal loop detection result of (d); (f) detection result of (d) superimposed with a bipass-filtered image.
at 18:56 UT on 29 May 2018 at 172 Å, in the active area NOAA 12712.The proposed method detected the low-intensity coronal loops in the darker region located in the upper right corner of the image.The linear structures in our detection results overlap with the bipass-filtered image in Figure 16c, indicating that the proposed algorithm has almost detected all the coronal loops, and the detected loops are relatively accurate.

Figure
Figure14b,c, respectively.The proposed algorithm extracted low-intensity coronal loops in the selected region.Additionally, other low-intensity coronal loops located in the marginal regions were also detected, maintaining good continuity and integrity.This test indicates that the proposed algorithm can detect low-intensity coronal loops in SDO/AIA images.

Figure 14 .
Figure 14.The coronal loop detection of the proposed algorithm in the SDO/AIA image.(a) The original image observed with SDO/AIA on 14 February 2011, 00:00:00 UT, at a wavelength of 193 Å in the active region of NOAA 11158; (b) individual coronal loop detection result; (c) detection result superimposed with a bipass-filtered image; (d) boxed local area in (a); (e) boxed local area in (b); (f) boxed local area in (c).

Figure 14 .
Figure 14.The coronal loop detection of the proposed algorithm in the SDO/AIA image.(a) The original image observed with SDO/AIA on 14 February 2011, 00:00:00 UT, at a wavelength of 193 Å in the active region of NOAA 11158; (b) individual coronal loop detection result; (c) detection result superimposed with a bipass-filtered image; (d) boxed local area in (a); (e) boxed local area in (b); (f) boxed local area in (c).Symmetry 2024, 16, x FOR PEER REVIEW 17 of 21

Figure 15 .
Figure 15.The coronal loop detection of the proposed algorithm in Hi-C image.(a) The original image observed with Hi-C on 11 July 2012, 18:54:16 UT, at a wavelength of 193 Å, in the active region of NOAA 11520; (b) detection result of individual coronal loops in the red boxed area of (a); (c) detection result in the red boxed area of (a) superimposed with a bipass-filtered image.

Figure 15 .
Figure 15.The coronal loop detection of the proposed algorithm in Hi-C image.(a) The original image observed with Hi-C on 11 July 2012, 18:54:16 UT, at a wavelength of 193 Å, in the active region of NOAA 11520; (b) detection result of individual coronal loops in the red boxed area of (a); (c) detection result in the red boxed area of (a) superimposed with a bipass-filtered image.

Figure 16 .
Figure 16.The coronal loop detection of the proposed algorithm in Hi-C 2.1 image.(a) The original image observed with Hi-C 2.1 on 29 May 2018, 18:56 UT, at a wavelength of 172 Å, in the active region of NOAA 12712; (b) detection result of individual coronal loops; (c) detection result superimposed with a bipass-filtered image.

Figure 16 .
Figure 16.The coronal loop detection of the proposed algorithm in Hi-C 2.1 image.(a) The original image observed with Hi-C 2.1 on 29 May 2018, 18:56 UT, at a wavelength of 172 Å, in the active region of NOAA 12712; (b) detection result of individual coronal loops; (c) detection result superimposed with a bipass-filtered image.

Figure 17 .
Figure 17.Histogram of coronal loop widths for the proposed algorithm.(a) Histogram of coronal loop width distribution for the image observed with Hi-C on 11 July 2012, 18:54:16 UT, at a wavelength of 193 Å, in the active region NOAA 11520; (b) histogram of coronal loop width distribution for the image observed with Hi-C 2.1 on 29 May 2018, 18:56 UT, at a wavelength of 172 Å, in the active region NOAA 12712.

Figure 17 .
Figure 17.Histogram of coronal loop widths for the proposed algorithm.(a) Histogram of coronal loop width distribution for the image observed with Hi-C on 11 July 2012, 18:54:16 UT, at a wavelength of 193 Å, in the active region NOAA 11520; (b) histogram of coronal loop width distribution for the image observed with Hi-C 2.1 on 29 May 2018, 18:56 UT, at a wavelength of 172 Å, in the active region NOAA 12712.

Table 1 .
Quantitative measurement results of the proposed method and the comparison methods.