# Sunspot Detection Using YOLOv5 in Spectroheliograph H-Alpha Images
## 3 Related Work
### Previous Work with OGAUC Images  
The images of the OGAUC observatory pose some difficulties when compared to modern images obtained from space, mostly due to atmosphere-related features and additional information directly engraved on the image itself. Figure 1 shows a good image, after removing the identification text. Figure 2 shows an example of a picture taken at the observatory, which is particularly challenging due to the bad weather that day.  
The picture clearly shows the slices due to the imaging process used, and it also contains its identification marking letters.  
A previous work with images from the OGAUC performed sunspot detection using an algorithm with mathematical morphology to detect sunspots and facular regions [9; 24]. The dataset consists of images taken from the spectroheliograph of OGAUC. In this work, the goal was to develop one method to apply to all the images captured at the OGAUC. Two methods to detect sunspots were considered:  
* Method based on mathematical morphology;
* Method based on the intensities of the pixels.  
Both methods were applied to a subset of images with features and other characteristics identified visually by an experienced solar observer. The work was based on an H\({}_{a}\) subset  
Figure 1: Example of a good image taken at OGAUC, showing just the solar disk. The identification marks were removed.  
Figure 2: Example of an image taken under adverse atmospheric conditions, in particular, clouds blocking the sunlight. This spectroheliogram was taken on \(11\) April 2011.  
of images, consisting of 144 spectroheliograms. Those were 8-bit images of the solar cycle 24, spread over several years and different seasons. Image dimensions are \(1200\times 1000\) pixels.  
As a first step, images were submitted to a pre-processing that consisted of a series of filters that, in addition to making the image easier to read by the algorithms, identified the solar disk [9]. The filters applied were the following:  
* Morphological operation _closing_ to make the image more homogeneous.
* Morphological operation _opening_ to remove letters from the image. Those letters are added to the original images to mark them, and contain information, such as date.
* Subtraction of the resulting image from the original image (as a mask).
* Morphological reconstruction of the image obtained as a mark.
* Application of an adaptive threshold filter with a lower cutting value of 30 and an upper cutting value of 124.
* Application of a morphological gradient called _thinning_, to obtain the contour of the sunspot.  
The mathematical morphology-based method takes the pre-processed images as input, and filters and processes the image in order to output the contour of the sunspots and its penumbra. The threshold is defined by the average value between the maximum and minimum gray levels inside the sunspot. If the pixel value is lower than the threshold value, then it will be considered the umbra (the central part of the sunspot); otherwise, it will be considered the penumbra (the grayish outer part).  
The second approach is based on the intensity of the digital level of the pixels, designated by PI. It consists of a two-stage process comprising (i) intensity normalization of the original image, and (ii) a sunspot detection stage, with the segmentation of umbra and penumbra. The goal is to create a synthetic image, in which the solar disk presents homogeneous digital levels and the background has a digital level of zero. This approach uses the same pre-processing as the first one presented. Using simple equations, the authors could also locate the center of the sunspots detected.  
The results reported from the approaches mentioned are 86.25% for the mathematical morphology approach, and 84.32% for the pixel intensity approach.