Detection and Selection of Compact Objects in Images Vladimir Yu. Volkov Dept. Radioengineering Saint-Petersburg State Electrotechnical University (LETI); Saint-Petersburg State University of Aerospace Instrumentation (SUAI) Saint-Petersburg, Russia vl_volk@mail.ru Abstract—The adaptive algorithm of detection and selection of isolated compact objects on monochrome images in remote sensing systems is investigated. To characterize compactness, the ratio of the object perimeter squared to its area is used. Selection of objects by area and shape is performed on binary slices in the process of multi-threshold processing, which allows you to set a detection threshold for each object, ensuring its best representation. The parameters of the algorithm, the properties of the decisive statistics are considered and detection characteristics for an object in the form of a disk under the action of Gaussian noise are obtained. The effectiveness of the algorithm is tested on a real image containing compact objects. The algorithm can also be used to isolate bacteria and spores on biological slices, to detect inhomogeneity in materials and tissues. Keywords- multi-threshold image segmentation; detection; selection and distinction; percolation I. object INTRODUCTION The problems of detection, extraction and localization of the objects of interest in noisy images are relevant in the analysis of images obtained by various remote sensing systems and thus are being intensively studied in the last decades [1–6]. The main differences between objects and noise structures are the connectivity of the object's points, the isolation of objects from each other, and the contrast of intensities. In fact, the segmentation problem is solved, i.e. the separation of the original image into regions. Threshold segmentation is most often used, and thresholds can be global or local. Theoretical threshold values for a given optimality criterion can only be used with known statistics of objects and background. In practical tasks, such information is not available, so the adaptation of threshold levels is used. The well-known Otsu algorithm uses an adaptive global threshold. Among the algorithms that form local thresholds, the BradleyRoth algorithm stands out. These algorithms use the original image to form thresholds, and do not take into account the properties of objects of interest and the results of segmentation in any way. Many objects of interest are characterized by compactness, which can be quantified and used to improve the quality of detection and selection. Also an important parameter is the area of objects. A range of values is usually set for this parameter. Various variants of multi-threshold processing are based on the properties of the histogram of the original image [7,8], and as a rule do not take into account the properties of objects of interest and the results of their selection. For heterogeneous objects, an approach is investigated in [6], which involves the construction of a three-dimensional hierarchical structure of objects based on multi-threshold processing using the percolation effect. This method allows you to link the properties of sections of an object in neighboring binary layers and build a hierarchical structure for subsequent segmentation. Considering the prospects of using the selection results to solve the problems of distinguishing and recognizing objects of interest by shape, an important task is to evaluate the effectiveness of the algorithm under the action of noise. This article investigates the problem of detecting a compact object in the form of a disk against a background of noise. The properties of the decisive statistics, the influence of the algorithm parameters is considered and the detection characteristics are calculated. Also, the effectiveness of the algorithm is tested on a real image containing compact objects of interest. II. MULTI-THRESHOLD OBJECT SELECTION ALGORITHM A. Multi-threshold Object Selection Approach and Parameters of the Algorithm The detection and selection of compact objects taking into account the restrictions on the area and the compactness coefficient are considered in [6]. The investigated multithreshold selection algorithm uses as a useful feature the 2 coefficient of perimeter elongation of the object PS = P /4πS, where P is the perimeter of the object, S is its area [9]. This characteristic is a geometric invariant and it has a minimum theoretical value equal to one for a disk-shaped object. However, measured on noisy images, this coefficient can significantly increase even for a compact object due to the appearance of fractal noise structures at its borders, which dramatically increase the perimeter of the object. This significantly affects the quality of selection, especially with small signal-to-noise ratios. Therefore, a detailed analysis of the characteristics of this method is necessary, which is given in this article. The multi-threshold algorithm proposed and investigated in [6] builds a three-dimensional hierarchical structure of objects based on a set of binary intensity slices obtained with increasing threshold values. In this structure, the object of interest can be located on several binary layers, depending on its intensity and texture. This state of the object is determined by the rate of decrease of its area KS = ST+∆T / ST with an increase in the threshold from value T to T+∆T. This coefficient depends on the threshold value T and reflects the properties of the object. If an object quickly loses its area or breaks into small fragments, then KS is small, and vice versa, values of KS close to unity indicate a large steepness of the boundaries and stability of the area. The limitation of this coefficient affects the number of new objects that appear in the place of the original one when its fragmentation increases with an increase in the threshold. An unambiguous determination of the successor of the original object on the next layer is possible if this coefficient is greater than 0.5. Thus, one of the parameters of the algorithm is the boundary coefficient of object area stability KP. If for a certain threshold value (percolation threshold) it turns out that KS < KP, then the original object is considered “dead”, and new objects are formed from its fragments. When KP is increased to one, this inequality is always satisfied, and new objects are created on each layer from fragments of the object on the previous layer. Thus, one of the parameters of the algorithm is the boundary stability coefficient of the area KP. Two more parameters of the algorithm are related to the selection of objects by the minimum area Smin and by the compactness coefficient PSmax, which limits the PS value of selected objects (see Table 1). B. Detection of Object with Disk Shape For certainty and clarification of the influence of the shape of the object on the detection characteristics, consider an object in the form of a disk that appears in Gaussian noise. In the pixels occupied by the object, there is a (positive) shift in the mathematical expectation of the distribution. The signal-tonoise ratio is defined as a shift related to the RMS value of the noise. Fig. 1 shows the input and output images for the optimal shift detection in every pixel according to the Neyman-Pearson criterion with a false alarm probability F = 0.01 and with a signal-to-noise ratio d = 2.326. There are two reasons why it is undesirable to use the accumulation of pixels within the object boundaries to increase the signal-to-noise ratio. Firstly, the size of the object is often unknown, and secondly, the accumulation destroys the boundaries of the object, which are quite informative. TABLE I. № 1 2 3 ALGORITHM PARAMETERS Name Boundary coefficient of object area stability Minimum area of selected objects Maximum value of perimeter elongation of the object Symbol Restrictions KP KS ≥ KP 0.5≤ KP ≤1 Smin S ≥ Smin PSmax PS ≤ PSmax PSmax ≥ 1 Figure 1. Input and output images with Neyman-Pearson threshold binarization If you remove small objects in the right image of Fig.1 and use a fill, then it is possible to restore the shape of the object quite accurately. However, with an unknown background level, there is a problem with setting the optimal threshold level. When the signal-to-noise ratio decreases, the ability to restore the shape of the object disappears due to fragmentation. When using detection algorithms with an adaptive threshold, you will have to face some problems and losses in the quality of detection. In the case of Otsu threshold, it is impossible to control the level of false alarms. With small signal-to-noise ratios, there are problems with highlighting the shape of the object. In the case of a local adaptive mean threshold (Bradley-Roth), the problem of suppressing the background and highlighting the shape of the object remains. This is illustrated in Fig. 2, which shows the result of segmentation with a signal-to-noise ratio of d = 2.326. Figure 2. Results of Otsu binarization (left) and Bradley-Roth thresholding (right) C. Object Selection by Area and Compactness Object selection is a powerful means of improving the efficiency of algorithms. Fig. 3 shows the dependences of the probability of a false alarm F on the threshold level T in the case of removing objects with an area smaller than Smin from the output binary image. In this case, it is possible to gain in the probability of correct detection of the object by reducing the threshold level. A similar effect of reducing the probability of a false alarm F is observed in the case of selection of objects by compactness. Fig. 4 shows the effect of joint selection of objects by area and compactness at PSmax = 10. Thus, the selection allows you to significantly clear the output image from the remnants of the background. contains output image for all selected objects (left) and extracted disk by the use of maximum threshold value (right). Figure 5. Distribution of the compactness coefficient PS over objects in pure noise (LN – lognormal approximation) Figure 3. Reducing the probability of a false alarm lgF with threshold T when removing small objects with S<Smin after selection by area Figure 6. Distributions of optimal threshold values Topt over objects Nobj in pure noise (left) and for disk in noise with d = 10 (right) Figure 4. Reducing the probability of a false alarm lgF with threshold T when removing objects with PS>PSmax after selection by compactness D. Crucial statistics and detection efficiency Multi-threshold algorithm determines the best binarization threshold for each object which corresponds to the minimum value of the compactness coefficient PS. In the case of pure noise, the selected objects have different compactness coefficients, the distribution of which over the objects is shown in Fig. 5 for KP = 0.5. For compact objects, the algorithm finds this minimum at high threshold values, and for background objects – at lower values. The calculated threshold values are used to detect and distinguish compact objects among the background ones. The algorithm generates a collection of objects that are indexed by their thresholds, as shown in Fig. 6 (left). The object of interest can be selected separately by selecting the maximum threshold value (in the right image of Fig. 6). Fig. 7 Figure 7. All extracted objects with d = 10 (left) and extracted disk by the use of maximum threshold value (right) Detection characteristics were obtained by modelling with number of iterations M = 50 and are presented in Fig.8. Selection parameters KP, Smin and PS were chosen so as to obtain false alarm probability less than F = 0.01 (see Fig. 4). Dashed line corresponds to Neyman-Pearson detector for the same false alarm probability which is calculated by the formulas DT = Φ(d − t NP ) , where tNP = 2.326 is the threshold for F = 0.01, using the probability integral Φ in the Laplace form. As follows from the analysis, the multi-threshold selection algorithm provides some gain in the quality of detection of compact objects in relation to known procedures. The algorithm has three parameters for controlling the process, which are easily understood physically. It is insensitive to changes in the image scale, if you do not take into account the selection by area. The shape of the object of interest is also preserved, which is important in the tasks of distinguishing compact objects by shape. The problem of detecting an object in the form of a disk against a background of noise is considered. 1 DT Ddisk 0.9 0.8 0.7 D 0.6 0.5 0.4 0.3 0.2 0.1 0 0 1 2 3 4 5 6 7 d Figure 8. Detection probability D depending on signal-to-noise ratio d for disk in noise with Smin = 50; PSmax = 10; and false alarm probability F < 0.01 III. MULTI-THRESHOLD PROCESSING FOE REAL IMAGES Two examples (Fig. 9 and Fig. 10) illustrate the effectiveness of using the compactness coefficient PS to distinguish objects by shape in remote sensing images. Each isolated object is selected separately, and can be localized and measured. Figure 10. Real image with objects (top) and result of object selection (bottom) It is established that higher detection thresholds are obtained for compact objects than for background objects, which makes it possible to use these statistics for detection. Comparative characteristics of detecting an object in the form of a disk against a background of noise are obtained. The effectiveness of the algorithm has been tested on real images containing compact objects of interest. REFERENCES [1] [2] [3] [4] [5] Figure 9. Real image with compact objects (top) and result of object selection (bottom) IV. CONCLUSIONS The problem of detection and selection of compact objects on monochrome images generated by remote surveillance systems is considered. An adaptive multi-threshold algorithm with selection of objects by area and by the coefficient of perimeter elongation was chosen for the study. The influence of the algorithm parameters on the properties of the decisive statistics and on the detection characteristics is investigated. [6] [7] [8] [9] G. Cheng, J Han, “A survey on object detection in optical remote sensing images,” ISPRS Journal of Photogrammetry and Remote Sensing, vol. 117, pp. 11–28, 2016 E. Arias-Castro, G. R. Grimmett, “Cluster detection in networks using percolation,” Bernoulli, vol. 19(2), pp. 676–719, 2013 G.P. Patil, C. Taillie, “Upper level set scan statistic for detecting arbitrarily shaped hotspots,” Environmental and Ecological Statistics, vol. 11, pp. 183–197, 2004 W. Zhou, A. Troy, “An Object-Oriented Approach for Analyzing and Characterizing Urban Landscape at the Parcel Level,” International Journal of Remote Sensing, vol. 29(11), pp. 3119–3135, 2008 H. Gu, Y. Han, Y. Yang, H. Li, Z. Liu, U. Soergel, T. Blaschke, S. Cui, “An efficient parallel multi-scale segmentation method for remote sensing imagery,” Remote Sensing, vol. 10(4), pp.590–608, 2018 V.Yu. Volkov, M.I. Bogachev, “Detection and extraction of objects in digital images,” 2020 9th Mediterranean Conference on Embedded Computing, MECO 2020, 9134228 B.D. Shivahare, S.K. Gupta, “Multilevel Thresholding based Image Segmentation using Whale Optimization Algorithm,” International Journal of Innovative Technology and Exploring Engineering (IJITEE), vol. 8, Issue-12, October 2019 E. Cuevas, A. González, F. Fausto, D. Zaldívar, M. Pérez-Cisneros, “Multithreshold Segmentation by Using an Algorithm Based on the Behavior of Locust Swarms,” Mathematical Problems in Engineering, Article ID 805357, 2015 R.C. Gonzales, R.E. Woods, Digital Image Processing, 4ed. Pearson, 2018.