3.1 Basic mathematical model of genetic algorithm
The reverse mutation in the GA algorithm has great randomness and is easy to form children with poor adaptability. The algorithm is seriously affected by modifying the specific genetic value of a species through a certain probability. Therefore, in order to further improve the effect of the algorithm, researchers specially designed a heuristic operator.
In each operation loop, the nearest adjacent target part can be selected as the next target position. The theorem proves that since GA adopts a selection strategy based on fitness ratio, it is easy to get the expectation that elements in H can be selected as follows:
$$\sum _{\text{x}\in (\text{H},\text{t})}\frac{\text{f}\left(\text{x}\right)}{\stackrel{-}{\text{f}}}=\text{N}(\text{H},\text{t})\frac{\text{f}(\text{H},\text{t})}{\stackrel{-}{\text{f}\left(\text{t}\right)}}$$
1
The expected value of the number of individuals in the population at the stage H with the shortest and lowest order in length and the fitness distribution value greater than the average fitness distribution value increases exponentially.
$$\text{J}=\text{C}\left[1-{\text{p}}_{\text{c}}\frac{{\delta }\left(\text{H}\right)}{1-\text{p}}\right]-{\text{p}}_{\text{m}}\text{O}\left(\text{H}\right)$$
2
Among them, the selection of variables and the selection of classification threshold are easy to cause some subjective problems, and the forms are as follows:
$$\text{l}\text{o}\text{g}\frac{\text{p}}{1-\text{p}}={\alpha }+\sum _{\text{i}=1}^{\text{N}}{{\beta }}_{\text{i}}{\text{X}}_{\text{i}}$$
3
Through the above changes, the improved GA can converge to the optimal solution stably and quickly. The gene fitness function:
$${\text{f}}_{\text{k}}=({{\mu }}_{0}+{{\mu }}_{1}\sum _{}^{\text{n}}{{\epsilon }}_{\text{i}})/{{\mu }}_{2}{\text{v}}_{\text{k}}$$
4
The weight coefficient plays an important role in balancing the effects of various restrictions on fitness. The adjusted weight coefficient has the following functions:
$${{\mu }}_{0}={\text{k}}_{0}$$
5
3.2 Research on machine vision
In the 1950s, the research of machine vision started from statistical pattern recognition, but most of the research at that time focused on the research and understanding of two-dimensional graphics. In the 1960s, Roberts analyzed digital images with computer programs and found that there were many reasons that affected the development of machine vision, but what really had a decisive impact was the market's need for machine vision. With the development of industry, the requirements for machine vision technology have been increased. At the same time, human demand for machine efficiency and quality has become greater and greater, which has also led to the development of machine vision. Mechanical vision needs to gradually develop towards a more open goal from the past single collection, analysis, transfer of data, identification and other behaviors.
In the case that the background color and the appearance of the object in the experiment are relatively monotonous, since the distribution of the pixel gray value of the image is close to the bimodal distribution, the histogram algorithm can quickly search the wave trough of the histogram and use it as the segmentation basis. Histogram means that the gray value of the image pixel is represented by the frequency histogram, which can express the average number of gray values in the image.
$$\text{f}\left(\text{k}\right)={\sum }_{\text{i}=0}^{\text{k}}{\text{n}}_{\text{i}}/\text{n}$$
6
For an image formed by cutting an original area, the nature of each area should be quite different or in sharp contrast. By comparing the contrast between these regions, we can determine the efficiency of the image segmentation algorithm, and thus determine the quality of the algorithm.
For two adjacent regions in the segmented image, suppose that their corresponding average gray values can be described by f1 and f2 respectively, then the gray contrast size between adjacent regions can be determined as:
$$\text{G}\text{C}=\frac{|{\text{f}}_{1}-{\text{f}}_{2}|}{{\text{f}}_{1}+{\text{f}}_{2}}$$
7
When an image is divided into many regions, it is usually possible to use a formula to count the contrast within two adjacent regions, and then sum up to obtain the overall contrast within each region.
After the original image has been segmented, because the subject and the background have not been completely separated, the image between the subject and the background also has some error segmentation more or less. The difference between these wrongly divided pixels and the original accurate positioning can reflect the level of segmentation efficiency in a certain sense. One parameter used in the description of pixel distance error is the quality factor:
$$\text{F}\text{O}\text{M}=\frac{1}{\text{S}}\sum _{\text{i}=1}^{\text{S}}\frac{1}{1+{\omega }\times {\text{D}}^{2}\left(\text{i}\right)}$$
8
Similar evaluations include the mean absolute value of deviation and normalized distance measurement, which are defined as follows:
$$\text{N}\text{D}\text{M}=\frac{\sqrt{\sum _{\text{i}=1}^{\text{S}}{\text{D}}^{2}\left(\text{i}\right)}}{\text{A}}\times 100\text{\%}$$
9
$$\text{M}\text{A}\text{V}\text{D}=\frac{1}{\text{S}}\sum _{\text{I}=1}^{\text{S}}\left|\text{D}\right(\text{i}\left)\right|$$
10
Incomplete image segmentation results will lead to a certain difference between the number of objects obtained after segmentation and the actual number in the image, and these differences can also reflect the effectiveness of the algorithm to a certain extent. The number of image blocks is used to evaluate the characteristics of the algorithm:
$$\text{f}=\frac{1}{1+\text{p}{|{\text{T}}_{\text{n}}-{\text{S}}_{\text{n}}|}^{\text{q}}}$$
11
The pixels of the whole image are classified according to the gray level, and the maximum variance between classes of each type is selected, which is set as the best threshold. Because variance is a measure of the balance degree of gray distribution, the larger the variance is, the greater the difference after the picture is correctly divided. In addition, in the special case where some scenes are wrongly divided into targets, or some targets are wrongly divided into scenes, the difference between the two parts can be reduced, so that the possibility of error division of variance between classes is minimized. After histogram enhancement, the gray distribution of the image is more balanced, and the pixel gray space occupied by the image is greatly increased, which improves the contrast of the overall picture and the visual effect of the overall image, so as to achieve the purpose of enhancing the effect.
$$\text{S}\left(\text{k}\right)=\text{l}\text{e}\text{v}\text{e}\text{l}\bullet \text{f}\left(\text{k}\right)$$
12
A large number of pixel coordinates on the contour curve are extracted by pixel gray step method, and the feature function is obtained by m-spline fitting:
$${\text{F}}_{\text{V}}\left(\text{x}\right)=\sum _{\text{t}=0}^{\text{m}}{\text{a}}_{\text{t}}{\text{x}}^{\text{t}}$$
13
A straight line can be obtained by connecting the first and last two points in the user coordinate system:
$${\text{F}}_{0-\text{n}}\left(\text{x}\right)={\text{P}}_{0,\text{y}}+\left[\right({\text{P}}_{\text{n},\text{y}}-{\text{P}}_{0,\text{y}})/({\text{P}}_{\text{n},\text{x}}-{\text{P}}_{0,\text{x}}\left)\right](\text{x}-{\text{P}}_{0,\text{x}})$$
14