Научная статья на тему 'FEATURES OF APPLICATION OF THRESHOLD METHODS AT A STAGE OF PRELIMINARY PROCESSING OF GRAPHIC DATA'

FEATURES OF APPLICATION OF THRESHOLD METHODS AT A STAGE OF PRELIMINARY PROCESSING OF GRAPHIC DATA Текст научной статьи по специальности «Компьютерные и информационные науки»

CC BY
40
9
i Надоели баннеры? Вы всегда можете отключить рекламу.
Ключевые слова
threshold method / processing / segmentation / pixel / graphic data / image / algorithm / automation.

Аннотация научной статьи по компьютерным и информационным наукам, автор научной работы — Nedashkivskyi S.

The article considers the peculiarities of the application of threshold methods at the stage of preliminary data processing. The concept of "computer vision" is defined and the directions of application of the latter are formed. It is noted that the constraint methods are divided into six groups based on the information controlled by the algorithm, in this work the main attention is paid to the threshold methods at the stage of pre-processing of graphic data as the main stage in the processing. It is emphasized that the threshold constraint is the simplest method of image segmentation. The stages of graphic data processing are shown and each of them is described. It is noted that a threshold constraint is the process of creating a black-and-white image from a grayscale image by setting those pixels to white that exceed the specified threshold, other pixels to black, and grayscale images with a threshold value can be used to create binaries. images. A number of threshold methods used at the stage of pre-processing of graphic data are determined: the method of global threshold processing, the method of local threshold processing and the adaptive method of threshold processing. Each of the methods is described in detail and illustrated. The method of global threshold processing is based on the analysis of the image histogram. It is emphasized that the essence of global threshold processing is to divide the histogram of the image into two parts using a single global threshold. The method of local threshold processing is a logical continuation of the global threshold processing and is used mainly when the histogram is not amenable to separation within the application of the method of global threshold processing. It is emphasized that the adaptive algorithm of threshold processing is based on the idea of comparing the brightness levels of a pixel with the values of local averages calculated directly in its environment, ie in neighbors. The mathematical aspect of the methods implementation is given, their strengths and weaknesses are separated.

i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «FEATURES OF APPLICATION OF THRESHOLD METHODS AT A STAGE OF PRELIMINARY PROCESSING OF GRAPHIC DATA»

TECHNICAL SCIENCES

FEATURES OF APPLICATION OF THRESHOLD METHODS AT A STAGE OF PRELIMINARY

PROCESSING OF GRAPHIC DATA

Nedashkivskyi S.

Lecture The Open International University of Human Development 'Ukraine'

https://orcid.org/0000-0002-8222-6905

Abstract

The article considers the peculiarities of the application of threshold methods at the stage of preliminary data processing. The concept of "computer vision" is defined and the directions of application of the latter are formed. It is noted that the constraint methods are divided into six groups based on the information controlled by the algorithm, in this work the main attention is paid to the threshold methods at the stage of pre-processing of graphic data as the main stage in the processing. It is emphasized that the threshold constraint is the simplest method of image segmentation. The stages of graphic data processing are shown and each of them is described. It is noted that a threshold constraint is the process of creating a black-and-white image from a grayscale image by setting those pixels to white that exceed the specified threshold, other pixels to black, and grayscale images with a threshold value can be used to create binaries. images. A number of threshold methods used at the stage of pre-processing of graphic data are determined: the method of global threshold processing, the method of local threshold processing and the adaptive method of threshold processing. Each of the methods is described in detail and illustrated. The method of global threshold processing is based on the analysis of the image histogram. It is emphasized that the essence of global threshold processing is to divide the histogram of the image into two parts using a single global threshold. The method of local threshold processing is a logical continuation of the global threshold processing and is used mainly when the histogram is not amenable to separation within the application of the method of global threshold processing. It is emphasized that the adaptive algorithm of threshold processing is based on the idea of comparing the brightness levels of a pixel with the values of local averages calculated directly in its environment, ie in neighbors. The mathematical aspect of the methods implementation is given, their strengths and weaknesses are separated.

Keywords: threshold method, processing, segmentation, pixel, graphic data, image, algorithm, automation.

Problem statement. In today's world, humans have to rely more and more on machines, so that they are unable to cope with most of their current tasks. Because of this, various devices are being created that enhance or completely replace, in their focus, the human perceptual organs. Because of this, man, with the help of machines, is able to perceive not capable under normal conditions and to work under different conditions.

One such device is computer vision. Computer vision is a field which includes methods of obtaining, processing, analyzing and understanding images.

The relevance of the development of computer vision is that it opens up enormous opportunities in various areas from automation of measurements and technical control to video surveillance and robot vision.

In addition, it can be noted that computer vision is a branch of computer graphics and its development in applications in various areas of image processing and analysis.

There are three classical problems as applied to graphics. The image synthesis problem involves obtaining an image from its description. The task of analysis consists in obtaining a description of a given image. Finally, image processing tasks consist in obtaining a new image based on the original image using the desired algorithm. Computer vision typically involves image processing and analysis. Image processing is based on segmentation, which is a preliminary step.

Thresholding is the simplest method of image segmentation. On a grayscale image, thresholding can be used to create binary images. Constraint methods are

divided into six groups based on the information the algorithm is guided by, this paper focuses on thresholding methods in the preprocessing phase of the image data, as the main step in the processing.

Analysis of recent research and publications. In recent years, a fairly large number of methods and algorithms used in the preprocessing phase of graphical data has been created.

O. A. Kobylin and I. S. Tworoshenko [1] disclosed the basic methods of digital image processing and provided examples of their practical application. The authors described the basic concepts of digital image processing, characteristics of the technical means of digital image processing, parametric and nonparametric methods of digital image classification, methods of filtering and restoration of images, methods of linear spatial invariant filtering and filtering in the spatial domain.

The combined method for the solution of the image processing problem was proposed by M.V. Vo-loshin [2]. The scientist has analyzed the developed methods in terms of computational complexity when solving the practical problem of image processing and justified the necessity and advantages of using the new combined method of image processing developed by the author.

Yu. A. Oleynik and D. A. Katyushchenko [3] devoted their work to the study of the development of methods for determining the weights of document attributes when solving the problem of automatic classi-

fication of textual information. Authors analyze influence of reduction of dimensionality of attributes of the document on work of the vector classifier.

A. V. Mazurets, T. K. Skripnik and A. V. Izotov [4] proposed the facet method of image transformation using neural network recognition. The method of facet transformation of images consists in a programmatic change of the dimensionality of the input image and is intended for use in the process of pre-recognition processing of images.

D. V. Storozhik, A.V. Muravyov, A.G. Protasov, V.G. Bazhenov and G.A. Bogdan [5] investigated the possibilities of applying methods of complexing multi-spectral images to improve the information content and quality of data processing results based on binary segmentation.

Among the foreign authors it is worth noting such works as: Guruprasad, Prathima, Kushal S Mahal-ingpur, Manjesh.T.N [6], Bader, B. and Yan, J. [7], Caeiro, F. and Gomes, M. I. [8], Northrop, P. J. and Coleman, C. L. [9], Scarrott, C. and MacDonald, A. [10], Southworth, H. and Heffernan, J. E. [11], Thompson, P.; Cai, Y.; Reeve, D. & Stander, J. [12] and others.

However, given the described scientific achievements on the topic, the issues of revealing the specifics

of threshold methods application at the stage of preliminary processing of graphic data remain open and require detailed elaboration.

Task definition. To reveal the peculiarities of threshold methods application at the stage of graphic data preprocessing.

Presentation of the basic material of the study. Computer vision involves various steps, as shown in the flowchart.

Image acquisition: Image acquisition is the creation of digital images of, for example, a physical scene or the internal structure of an object.

Image preprocessing: The technique of enhancing data images, including removing low-frequency background noise, normalizing the image intensity of individual particles, removing reflections, and masking parts of images.

Image segmentation: The process of dividing a digital image into multiple segments (sets of pixels, also known as superpixels). The purpose of segmentation is to simplify and/or change the representation of an image to one that is more meaningful and easier to analyze.

Object recognition: The task of searching for and identifying objects in a sequence of images or videos.

Image acquisition

Image preprocessing

Image segmentation

Presentation and description

Object recognition

Figure 1. The main stages of image processing

Thres holding is the process of creating a black and white image from a grayscale image by setting exactly those pixels in white whose value exceeds the specified threshold, other pixels in black. A grayscale image using thresholding can be used to create binary images.

The task of image segmentation is usually applied at some stage of image processing in order to obtain more accurate and more convenient representations of this image for further work with it.

There are many segmentation methods, and different methods focus on different image partitioning properties.

Threshold processing is one of the main methods

of image segmentation, threshold processing is aimed at splitting the graphical data (image) into separate areas, each of which has its own level of brightness.

In this case the image is processed pixel by pixel and the conversion of each pixel of the input image into the input image is determined from the ratio:

f(x ^ = fZo.HKmo AUy)<T

where T - processing parameter, is called threshold, Zq i Z^ - the levels of initial brightness. Processing by pixels, the position of which in the image does not matter, is called dot processing [2]. Levels, Z0

and play the role of labels. They are used to deter-

mine whether the point in question is: before

H

or

H

H

after ^ ^1 type. Or they say , that ^ ^0 consisting of h

background points and 1 of points of interest. As a rule, Z0 and Zy correspond to the levels of white and black. For simplicity, further on, where it will occur, we

H H

will call classes 1 the object class, and the class 0 the background class.

Naturally, segmentation can be not only binary, in which case there are more than two classes. In the latter case, the notion of "multilevel segmentation" arises. Formally this operation can be written as follows: ', HKipo f0 (x, y) E D1

2,nY,mp fG{x,y) G

,(2)

n,siKU^0 f0(x,y) e Dn 0pB IHIIIHX BHnazjKax

where 71 - number of levels, and ' -

image classes.

Multilevel segmentation has prerequisites, the main of which is the need to have a brightness threshold for each individual class. This threshold is needed to

separate classes from each other.

Threshold T is often written as a function, has the

form:

T = T ( x, y, I ( x, y), f )

(3)

where ^ - image, a I (l, y) - some feature of

the point (-£, y) of image, e.g., the average brightness

in the neighborhood centered at this point.

If the value of the threshold T depends only on f

, i.e., is the same for all points of the image, then such threshold is called a global threshold. If the threshold

T depends on the spatial coordinates (.X", y). then such threshold is called local. If T depends on a characteristic I ( t , y). then such threshold is called adaptive. Thus, processing is considered global if it applies to the whole image, and local if it applies to some selected area [2].

In addition to the above distinctions of algorithms, there are many more methods.

For today the most actual and such which constantly develops are three basic threshold methods applied at a stage of preliminary processing of graphic data:

1) Global threshold processing method;

2) Local threshold processing method;

3) Adaptive method of threshold processing.

The method of global threshold processing is

based on image histogram analysis. The essence of the global threshold processing is to divide the image histogram into two parts using a single global threshold T

The algorithm of the global thres holding method is shown in Fig. 2.

The disadvantage of this algorithm is that the histogram rarely lends itself to simple division, and in most real-world images this approach does not give good results. A disadvantage of the histogram method in general is that there is no guarantee that pixels belonging to the same mode of brightness distribution lie side by side in the picture and form connected regions. Histogram by its structure does not contain characteristics on the spatial arrangement of pixels.

One of the varieties of methods based on histogram analysis is the local threshold processing, but it differs significantly from the global algorithm, is more complex and gives better results. This method is a logical continuation of global threshold processing and is used mainly when the histogram cannot be separated within the application of global threshold processing method. The main influence factors should be considered: illumination, noise, brightness in the picture.

Figure 2. Algorithm of Global Threshold Graphics Processing Method Implementation

To solve this problem, the image is divided into setting of the threshold value, there is an additional

some sub-sections, in each of which the corresponding problem, the problem of splitting the image into seg-

threshold value is set, which is unique throughout the ments. So, the original image is divided into areas, as

graphical data. Based on this, in addition to the correct in figure 3.

Figure 3. Partitioning the image into areas with the definition of the threshold value of each individual area

The principles for analyzing each area are as follows:

- if there is no boundary between classes, the total area of separation necessarily has its own dispersion (i.e., brightness);

- all areas through which the boundary of class H1 passes (and all pixels that contain class H1) are given their own variance;

- in all areas from the previous paragraph the segmentation is performed with the threshold calculated according to the algorithm of implementation of the global threshold method of graphic data processing.

Thus, the decision in choosing whether a pixel belongs to one of the classes depends on the spatial location of this pixel.

The disadvantage of this approach is a longer runtime compared to global thresholding and the inability to automatically select the exact parameters.

However, with a reasonable choice of parameters, good results can be obtained.

The advantage of the local threshold processing is that it is well suited for noisy images, for low brightness graphic data, as well as images that have a complicated structure, i.e., overlapping background and different color levels.

The adaptive thresholding algorithm is based on the idea of comparing pixel brightness levels with values of local averages calculated directly in its environment, i.e., in its neighbors. Pixels are processed one by one. The intensity of each pixel is compared to the average brightness values in the dimension windows

(2D + 1) ■ (2D + 1) centered on the point K.

The scheme is shown in more detail in Figure 4.

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

Figure 4. Direction of bypass of neighboring pixels

Let a pixel K centered in this area have coordi-natesK(ifj). Then K is considered a pixel of the class Hq. if it has a mark 0, and a pixel H-^. if it has a mark 1. That is K becomes a pixel Hj when for T — 0, S, where

s = (2D + 1) ■ (2D + 1) - 1 condition i

the formula:

=

I

/ (ir + m,jr + n)

—Dsm.nsD

is

fulfilled:

where T and plays just the role of the threshold value, and the average local brightness, determined by

(2D + 1) - (2D + 1)

where f (lr, _/r) - brightness at the point Kr

with coordinates (£r, jr).

In order to eliminate the errors of the usual threshold transformation, it is obviously not possible to apply a global algorithm. Therefore, the following automatic

and adaptive parameter determination is applied T : 1) let f (i, j) - is a pixel of the image with co-

ordinates

In

the

window

(2D + 1) ■ (2D + 1) with the center in f', ! j .' the maximum and minimum brightness values are calculated:

fmax = m3* f(i + a,J + b)

- D<a,b<D

fmn = min f(i + ^ J + b)

- D<abb<D

(5)

(6)

2) the maximum and minimum brightness increments relative to the central pixel are calculated:

Af = f

^ max J n

z

A^min fmm ^

Afm

(7)

(8)

3) the values of ^max and

Afmax > Afmi

Af

min are com-

pared. If max > 111111, then the window (2D + 1) ■ (2D + 1) contains more local low

brightness's. According to this i is chosen by the formula:

t = a

V

1

- f + -Z

^ J min ^

ae (0;1]

(9)

where " v "' ~J - some constant. 4) if A/inax < A/inin tllen tlle window (2D + 1) ■ (2D + 1) contains more local high

brightness's. And according to this the threshold T can be found by the formula:

. 2

t = a

\

ß ./min ß ^

J

(10)

The parameter a G (0; 1] is a regularization parameter. As a rule, for most images this parameter is chosen to be equal . But if the image lias very high

noise and low contrast, then

« - V,

In most cases, the parameters are usually set as fol-

lows: D = l,a =

This algorithm makes it possible to perform segmentation for images containing noise, images with a complex background structure or low contrast, and with virtually no loss of useful information.

Conclusions and prospects for further research. The paper reveals the peculiarities of application of thresholding methods at the stage of graphic data preprocessing. In the aforementioned graphical data preprocessing study, it was found that the global thresholding method eliminates unnecessary and redundant image data, preserving only useful information, while

the local thresholding method selects the optimal threshold value. The adaptive algorithm is not fully automatic, and hence makes it difficult for the user to operate it at least if the user wants better results. The algorithm is impractical to apply to relatively simple graphical data, with which the global algorithm will show maximum values. Thus, the adaptive thresholding algorithm is one of the robust methods used in the preprocessing phase of graphical data of high complexity and pinch.

References

1. Kobylin A. A. A. Methods of digital image processing: textbook / A. A. Kobylin, I. S. Tvoro-shenko; Ministry of Education and Science of Ukraine, Kharkov National University of Radio Electronics. -Kharkiv: Kharkiv National University of Radio Electronics, 2021. - 124 p.

2. Voloshin M.V. Combined model of recognition of graphic images // Information modeling technologies, systems and complexes (current state and ways of development of information technologies, modeling technologies of information and intelligent systems and complexes in society) / Materials of I International Scientific and Practical Conference IMTSK2019 Cherkassy: 2019. - P. 13-16.

3. Oleinik Yu.A., Katiuschenko D.A. Analysis of methods for determining the weight of features of text documents / NTUU "KPI named after Igor Sikorsky", Ukraine, Kiev.

4. Mazurets A. A. Facet method of image transformation using neural network recognition / V. Mazurets, T. K. Skrypnyk, A. V. Izotov // Vestnik of KNU. Technical Sciences. - 2020. - № 1. - P. 147-153.

5. Storozhik D.V., Muravyov A.V., Protasov A.G., Bazhenov V.G., Bogdan G.A. Complexing of multispectral images as a method of increasing their information content during binary segmentation / D.V. Storozhik, Muravyov A.V., Protasov A.G., Bazhenov V.G., Bogdan G.A. // Scientific news of KPI. - 2020. -№ 2. - P. 82-87.

6. Guruprasad, Prathima, Kushal S Mahalingpur, Manjesh. T.N. (2020). Overview of different thresholding methods in image processing / TEQIP Sponsored 3rd National Conference on ETACC

7. Bader, B. and Yan, J. (2015). Extreme Value Analysis with Goodness-of-Fit Testing, R package version 0.1.2.

8. Caeiro, F. and Gomes, M. I. (2016), Threshold Selection in Extreme Value Analysis, Extreme Value Modeling and Risk Analysis: Methods and Applications, 69-82.

9. Northrop, P. J. and Coleman, C. L. (2014), Improved threshold diagnostic plots for extreme value analyses, Extremes, 17, 289- 303.

10. Scarrott, C. and MacDonald, A. (2012), A Review of Extreme Value Threshold Estimation and Uncertainty Quantification, REVSTAT-Statistical Journal, 10, 33-60.

11. Southworth, H. and Heffernan, J. E. (2013), texmex: Statistical Modelling of Extreme Values, R package version 2.1.

12. Thompson, P.; Cai, Y.; Reeve, D. & Stander, J. (2009). Automated threshold selection methods for extreme wave analysis, Coastal Engineering, 56, 10131021.

i Надоели баннеры? Вы всегда можете отключить рекламу.