Method and system for segmenting the perineal region of root-knot nematodes based on microscope images
Through edge detection and analysis and correction methods of pattern lines, the problem of inaccurate pattern segmentation in the perineal area in the microscope image is solved, and high-precision segmentation of perineal areas of root knot nematode is achieved, improving the accuracy and efficiency of species identification.
Patent Information
- Application Number
- CN202510080800.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2045-01-20
AI Technical Summary
After the microscopic image magnification, the pattern segmentation of the existing perineal patterns of root knot nematodes is caused by overlapping different layers of patterns, which affects the accuracy of the identification of root knot nematodes species.
The pattern lines in the microscope image were extracted through edge detection, the direction similarity relationship between pattern lines and its spatial distribution were analyzed, the two-sided lines of the pattern were constructed, and the internal distribution coefficient and outline reference were corrected, and the overlapping pattern lines were finally segmented.
The segmentation accuracy of the perineal area of root knot nematode is improved, the accuracy and efficiency of the identification of root knot nematode species is enhanced, and the impact of overlapping pattern lines on the identification of perineal patterns is reduced.
Smart Images

Figure CN119494848B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image processing, and in particular to a method and system for segmenting the perineum of a root-knot nematode based on microscope images. Background Art
[0002] Plant root-knot nematode diseases commonly occur in the agricultural and forestry fields. They parasitize a wide range and harm a variety of trees and plants in forests. Trees and plants are most seriously damaged during the seedling stage. The most seriously damaged tree species include paulownia, sycamore, olive, catalpa, catalpa, mulberry, and elephant ear bean. In the agricultural field, the roots of crops such as cucumbers and peanuts are also harmed by root-knot nematodes. The pattern of the perineum of the root-knot nematode is the main morphological feature for its species identification. The complex and fine structure of the perineum cuticle is usually used to classify root-knot nematodes.
[0003] The perineal area of the root-knot nematode is located around the body wall of the vulva and anus at the back of the adult body. The patterns are fine and dense and the body wall is transparent. The body is cut and stained to make sections, which are observed under a microscope. However, due to the fine and dense patterns, after magnification under a microscope, some different layers of patterns still overlap or overlap in the microscope image, resulting in inaccurate segmentation of the perineal pattern, which in turn affects the accuracy of the identification results of the root-knot nematode species based on the perineal pattern. Summary of the invention
[0004] The present invention provides a method and system for segmenting the perineum of a root-knot nematode based on a microscope image, so as to solve the problem that the existing perineum patterns of root-knot nematodes overlap at different layers under the microscope image magnification, resulting in inaccurate identification of the root-knot nematode species based on the perineum patterns. The technical solutions adopted are as follows:
[0005] The present invention proposes a method for segmenting the perineum of a root-knot nematode based on a microscope image, the method comprising the following steps:
[0006] Obtain microscopic images of the perineal region of root-knot nematodes;
[0007] Extract several pattern lines in the perineum area in the microscope image by edge detection; analyze the similarity relationship between the pattern lines and their spatial distribution, obtain overlapping and non-overlapping pattern lines and construct several groups of pattern double-sided lines; analyze the width change of a group of pattern double-sided lines and the difference in the direction between the pattern lines, and obtain the internal distribution coefficient of each group of pattern double-sided lines;
[0008] According to the overlapping relationship of the pattern lines in the double-sided lines of the pattern, the pattern distribution characteristics are constructed based on their internal distribution coefficients; for a group of overlapping pattern lines in the double-sided lines of the pattern and the non-overlapping pattern lines on both sides, the similarity of the orientation is quantified based on the spatial distribution, and the contour reference of the non-overlapping pattern lines to the overlapping pattern lines is obtained;
[0009] The overlapping pattern lines in the double-sided pattern lines are corrected according to the contour reference of each non-overlapping pattern line to the overlapping pattern line, and compared with the pattern distribution characteristics to achieve the segmentation of the overlapping pattern lines.
[0010] Optionally, the extracting of a plurality of pattern lines in the perineum region in the microscope image by edge detection includes the following specific methods:
[0011] Perform edge detection on the microscope image using the Canny algorithm to obtain several edge pixel points;
[0012] Several edges are obtained by connecting adjacent edge pixels, and all closed edges are used as pattern lines of the perineum area.
[0013] Optionally, the specific method of analyzing the direction similarity relationship and spatial distribution of pattern lines, obtaining overlapping and non-overlapping pattern lines and constructing several groups of double-sided pattern lines includes:
[0014] For any pattern line, obtain the tangent vector of each edge pixel point on the pattern line, wherein the tangent vectors are all clockwise, and obtain the angle of the tangent vector of each edge pixel point as the tangent angle of each edge pixel point;
[0015] Draw a straight line vertically upward from the center of the microscope image as the cutting line of each pattern line; starting from the right side of the cutting line, arrange the tangent angles of all edge pixel points of any pattern line in a clockwise manner to form the contour trend sequence of the pattern line;
[0016] The pattern lines without overlapping parts are recorded as non-overlapping pattern lines;
[0017] For pattern lines with overlapping parts, multiple layers of single pattern lines with overlapping parts constitute a group of pattern lines, and each closed edge in the group of pattern lines is regarded as an overlapping pattern line;
[0018] For any two non-overlapping pattern lines, DTW matching is performed on their contour trend sequences. During the matching process, the sine trigonometric function of the absolute value of the tangent angle difference between the elements of the two sequences is used as the distance between the elements to construct a matching distance matrix, and a number of matching element pairs and the DTW distance between the two contour trend sequences are obtained, which are used as the trend difference of the two non-overlapping pattern lines; according to the corresponding relationship between the tangent angle and the edge pixel points, a number of matching edge pixel point pairs are obtained; the Euclidean distance between any pair of matching edge pixel points is calculated, and the average of the Euclidean distances corresponding to all matching edge pixel point pairs is used as the spatial distance of the two non-overlapping pattern lines; the product of the trend difference and the spatial distance is used as the contour difference of the two non-overlapping pattern lines;
[0019] Calculate the contour difference of any two non-overlapping pattern lines, and match the non-overlapping pattern lines starting from the minimum value of all contour differences; form a group of double-side pattern lines with two non-overlapping pattern lines corresponding to the minimum value of all contour differences, and remove the two non-overlapping pattern lines from all non-overlapping pattern lines, and continue to match other non-overlapping pattern lines starting from the minimum value of the corresponding contour difference, and so on, divide all non-overlapping pattern lines into several groups of double-side pattern lines;
[0020] For the overlapping pattern lines in the same group of pattern lines, several groups of double-side pattern lines of each group of pattern lines are obtained according to their similarity in direction and spatial distribution.
[0021] Optionally, the specific method for obtaining the multiple groups of double-side pattern lines of each group of pattern lines is as follows:
[0022] Perform DTW matching on the contour trend sequence of any two overlapping pattern lines in any group of pattern lines, wherein if there are overlapping edge pixels between the two overlapping pattern lines, the overlapping edge pixels directly form a matching edge pixel pair with themselves; obtain the trend similarity of the two overlapping pattern lines and a number of matching edge pixel pairs; wherein the Euclidean distance between the matching edge pixel pairs formed by the overlapping edge pixels is 0, and the average Euclidean distance of the matching edge pixel pairs whose Euclidean distance is not 0 in all matching edge pixel pairs is calculated and used as the spatial distance of the two overlapping pattern lines;
[0023] For any overlapping pattern line in the group of pattern lines, the overlapping pattern line with the smallest spatial distance therefrom is obtained and constitutes a group of double-sided pattern lines in the group of pattern lines, and finally several groups of double-sided pattern lines in the group of pattern lines are obtained.
[0024] Optionally, the internal distribution coefficient of each group of double-sided lines of the pattern is obtained, including the specific method of:
[0025]
[0026] in, It represents the standard deviation of the Euclidean distances of all matching edge pixel pairs in any set of lines on both sides of the pattern. Indicates the number of matching edge pixel pairs in the double-sided lines of this group of patterns. Indicates the first The Euclidean distance between pairs of matching edge pixels, Indicates the maximum value of the Euclidean distance of all matching edge pixel pairs in the two-sided lines of the pattern. and Respectively represent the first The tangent angles of the two edge pixels in a matching edge pixel pair, represents the cosine trigonometric function, represents the weight normalization function, Represents an exponential function with a natural constant as its base.
[0027] Optionally, the constructing of the pattern distribution feature includes the following specific methods:
[0028] For all the double-sided lines of patterns constructed by non-overlapping pattern lines, they are recorded as non-overlapping double-sided lines. There is a contour difference degree corresponding to the non-overlapping pattern lines in any group of non-overlapping double-sided lines. The inverse proportional normalization result of the contour difference degree is taken as the contour similarity of the non-overlapping double-sided lines.
[0029] The contour similarities of all groups of non-overlapping bilateral lines are normalized, and the results are used as the distribution weights of each group of non-overlapping bilateral lines. The internal distribution coefficients of all groups of non-overlapping bilateral lines are weighted and averaged by the distribution weights, and the results are used as the pattern distribution features.
[0030] Optionally, the overlapping pattern lines in a group of pattern double-sided lines are quantified with the non-overlapping pattern lines on both sides based on the spatial distribution to obtain the contour reference of the non-overlapping pattern lines for the overlapping pattern lines, including the specific method of:
[0031] For any set of double-sided pattern lines consisting of overlapping pattern lines, one of the overlapping pattern lines is recorded as the target overlapping pattern line, and the other overlapping pattern line other than the target overlapping pattern line is recorded as the reference overlapping pattern line; all non-overlapping pattern lines on both sides of the target overlapping pattern line except one side of the reference overlapping pattern line are recorded as reference non-overlapping pattern lines of the target overlapping pattern line;
[0032] According to the contour trend sequence of the target overlapping pattern line and the reference non-overlapping pattern line, the contour reference of the reference non-overlapping pattern line to the target overlapping pattern line is obtained.
[0033] Optionally, the obtaining of the profile reference of the reference non-overlapping pattern lines to the target overlapping pattern lines comprises the following specific methods:
[0034] The target overlapping pattern line and any one of its reference non-overlapping pattern lines are matched by DTW based on their contour trend sequence to obtain a number of matching edge pixel pairs, and the contour difference between the target overlapping pattern line and the reference non-overlapping pattern line is obtained, and the contour similarity is obtained by inverse proportional normalization;
[0035] The contour similarity between the target overlapping pattern line and each of its reference non-overlapping pattern lines is obtained, all contour similarities are normalized, and the obtained result is used as the contour reference of each reference non-overlapping pattern line to the target overlapping pattern line.
[0036] Optionally, the overlapping pattern lines in the double-sided pattern lines are corrected according to the contour reference of each non-overlapping pattern line to the overlapping pattern line, and compared with the pattern distribution characteristics to achieve the segmentation of the overlapping pattern lines, including the specific method of:
[0037] Double-sided lines of a pattern formed by overlapping pattern lines are recorded as overlapping double-sided lines, and all overlapping double-sided lines are arranged in order from small to large according to the internal distribution coefficients corresponding to the overlapping double-sided lines;
[0038] Starting from the overlapping double-sided lines with the smallest internal distribution coefficient, the overlapping double-sided lines are corrected according to the contour reference of each non-overlapping pattern line corresponding to the overlapping pattern line and the contour trend sequence of the overlapping pattern line and each non-overlapping pattern line, and the corrected two overlapping pattern lines are recorded as corrected pattern lines;
[0039] The internal distribution coefficient of the overlapping double-sided lines including the corrected pattern lines is recalculated, and the internal distribution coefficients of other overlapping double-sided lines are sorted from small to large. The overlapping double-sided lines corresponding to the minimum value are corrected. If the corrected pattern lines are included, the corrected pattern lines will no longer be corrected. This process is repeated until all overlapping double-sided lines are corrected.
[0040] The present invention also proposes a root-knot nematode perineal region segmentation system based on microscope images, which includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps of the above method are implemented.
[0041] The beneficial effects of the present invention are as follows: the present invention extracts pattern lines by edge detection on microscope images, and if there are pattern lines of different layers in the pattern lines and they overlap, affecting the morphological display of the pattern in the perineum area, the overlapping pattern lines and the non-overlapping pattern lines are extracted respectively, and double-sided pattern lines are constructed for the overlapping pattern lines in pairs, and at the same time, based on the similarity relationship between the directions of the non-overlapping pattern lines and the distance in spatial distribution, the double-sided pattern lines are also constructed and the internal distribution coefficient is quantified to reflect the similarity relationship and distribution relationship of the overall contour, thereby providing a basis for correcting the overlapping pattern lines; based on the internal distribution coefficient of the double-sided pattern lines constructed by the non-overlapping pattern lines, and based on the contour difference between the non-overlapping pattern lines, weighted correction is performed to construct the pattern Distribution characteristics are used to reflect the distribution parameters between adjacent pattern lines; at the same time, the contour reference of overlapping pattern lines is quantified according to non-overlapping pattern lines, which is used for subsequent correction of overlapping pattern lines to ensure that the overlapping parts can be segmented and the contour shape will not change significantly; by comparing the contour reference of overlapping pattern lines with non-overlapping pattern lines, the overlapping pattern lines are iteratively corrected based on the tangential angles of non-overlapping pattern lines, and the pattern distribution characteristics are met, so that the pattern lines with overlapping parts can be segmented, thereby improving the recognition of each pattern line in the perineum area of root-knot nematodes, reducing the influence of overlapping pattern lines on the identification of perineum patterns, thereby improving the efficiency and accuracy of root-knot nematode species identification based on perineum patterns of root-knot nematodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0043] Figure 1 A schematic flow chart of a method for segmenting the perineal region of a root-knot nematode based on a microscope image provided by an embodiment of the present invention;
[0044] Figure 2 This is a schematic diagram of a 400x microscope image of the pattern in the perineal area of peanut root-knot nematodes. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] See also Figure 1 , which shows a flow chart of a method for segmenting the perineal region of a root-knot nematode based on a microscope image provided by an embodiment of the present invention, the method comprising the following steps:
[0047] Step S001, obtaining a microscope image of the perineum of a root-knot nematode.
[0048] The purpose of this embodiment is to segment the microscope image of the perineum of the root-knot nematode to better extract the pattern of the perineum of the root-knot nematode, thereby improving the accuracy of root-knot nematode species identification. First, it is necessary to obtain a microscope image of the perineum of the root-knot nematode.
[0049] Specifically, the female peanut root-knot nematode is cut into pieces, and the perineal region of the root-knot nematode is sliced after removing debris and staining, and a scanning electron microscope is used to obtain a microscope image of the slice, such as Figure 2 As shown, the microscope image obtained in this embodiment is a 400-fold magnification; the section making process is the existing technology for observing the perineal area of root-knot nematodes, and will not be repeated in this embodiment.
[0050] It should be noted that in the magnified microscope image of the perineum of the root-knot nematode, the pattern shows layers of concentric closed patterns similar to tree rings, which constitute the perineum pattern used to determine the species of the root-knot nematode. Usually, there are gaps between different layers of patterns. The pattern lines of different layers can be obtained through edge detection, and the gaps between the pattern lines are small. In the microscope image, due to the influence of the magnification, there will be obvious overlapping parts between different layers of patterns. The overlapping parts cause the perineum pattern of the root-knot nematode to fail to fully present the due pattern morphology, thereby affecting the species identification results of the root-knot nematode.
[0051] Step S002, extracting several pattern lines in the perineum area in the microscope image through edge detection; analyzing the similarity relationship between the pattern lines and their spatial distribution, obtaining overlapping and non-overlapping pattern lines and constructing several groups of pattern double-sided lines; analyzing the width change of a group of pattern double-sided lines and the difference in the direction between the pattern lines, and obtaining the internal distribution coefficient of each group of pattern double-sided lines.
[0052] It should be noted that after extracting several edges in the microscope image through edge detection, several closed edges constitute pattern lines. Since the pattern lines are concentric or nearly concentric, and due to the distribution of multiple layers of pattern lines, the closer the distance between the pattern lines is, the closer the overall contour trends are. As for the pattern lines with overlapping parts, since there is overlap with other pattern lines to form adjacent or identical edge parts, the overlapping pattern lines will show that multiple layers of pattern lines exist together on one (a group of) edges. This group of edges presents the shape of multiple layers of concentric contours, but since there is overlap between the multiple layers of contours, they cannot be regarded as multiple edges, but form a group of edges.
[0053] Preferably, in one embodiment of the present invention, a plurality of pattern lines in the perineum region in the microscope image are extracted by edge detection, and the specific method includes:
[0054] The microscope image is subjected to edge detection by using the Canny algorithm to obtain a number of edge pixel points; wherein the Canny edge detection algorithm is a prior art and will not be described in detail in this embodiment; adjacent edge pixel points are connected to obtain a number of edges, wherein adjacent is defined as eight-neighborhood adjacent between pixel points; all closed edges are regarded as pattern lines in the perineum area; it is particularly noted that for multi-layer overlapping patterns, the patterns on the same layer will still be closed, and the edge will appear as a group of edges formed by multi-layer overlapping, but it will not affect the extraction of closed edges and their determination as pattern lines.
[0055] It should be noted that there is no overlapping pattern lines because the closer the distance is, the more similar the overall contour direction is. Therefore, by analyzing the similarity in direction of pattern lines in different layers, the similarity in direction is used to reflect the similarity of the overall contour. Combined with the distance between the two layers of pattern lines, double-sided pattern lines are constructed for comparison with the overlapping pattern lines, where the overlapping pattern lines have two or more layers of pattern overlap.
[0056] Preferably, in one embodiment of the present invention, the similarity relationship between the pattern lines and their spatial distribution are analyzed, overlapping and non-overlapping pattern lines are obtained, and several groups of double-sided pattern lines are constructed, including the specific method of:
[0057] For any pattern line, for each edge pixel point on the pattern line, the tangent vector of each edge pixel point is obtained based on the gradient obtained during the edge detection process, wherein the tangent vectors all point clockwise, and the angle of the tangent vector of each edge pixel point is obtained as the tangent angle of each edge pixel point.
[0058] Furthermore, a straight line is drawn vertically upward with the center of the microscope image as the cutting line of each pattern line; starting from the right side of the cutting line, the tangent angles of all edge pixel points of any pattern line are arranged clockwise to form a contour trend sequence of the pattern line; it should be noted that for pattern lines with overlapping parts, the overlapping part accounts for a smaller proportion of the whole than the non-overlapping part, then the non-overlapping part directly arranges the tangent angles of the edge pixel points in a normal clockwise manner, while the overlapping part directly participates in the arrangement with the overlapping edge pixel points.
[0059] Furthermore, pattern lines without overlapping parts are recorded as non-overlapping pattern lines; for any two non-overlapping pattern lines, DTW matching is performed on their contour trend sequences, and in the matching process, the sine trigonometric function of the absolute value of the tangent angle difference between the elements of the two sequences is used as the distance between the elements to construct a matching distance matrix, and a number of matching element pairs and the DTW distance between the two contour trend sequences are obtained, which are used as the trend difference of the two non-overlapping pattern lines; based on the correspondence between the tangent angle and the edge pixel points, a number of matching edge pixel point pairs are obtained; the Euclidean distance between any pair of matching edge pixel points is calculated, and the average of the Euclidean distances corresponding to all matching edge pixel point pairs is used as the spatial distance of the two non-overlapping pattern lines; the product of the trend difference and the spatial distance is used as the contour difference of the two non-overlapping pattern lines.
[0060] Furthermore, the contour difference of any two non-overlapping pattern lines is calculated according to the above method, and the non-overlapping pattern lines are matched starting from the minimum value of all contour differences; the two non-overlapping pattern lines corresponding to the minimum value of all contour differences constitute a group of pattern double-side lines, and the two non-overlapping pattern lines are eliminated from all non-overlapping pattern lines, and the other non-overlapping pattern lines are matched starting from the minimum value of the corresponding contour difference, and so on, all non-overlapping pattern lines are divided into several groups of pattern double-side lines, and there are no common non-overlapping pattern lines between different groups of pattern double-side lines.
[0061] It should be noted that the edges of the overlapping parts should be segmented on the microscope image to present the complete morphology of the perineal pattern of the root-knot nematode, which is convenient for the identification of the species of the root-knot nematode; and the bilateral lines of the pattern composed of non-overlapping pattern lines are usually adjacent but non-overlapping pattern lines, and it is necessary to use them as the standard to segment the pattern lines with overlapping parts, so the adjacent but overlapping pattern lines need to be extracted first.
[0062] Specifically, for a group of pattern lines composed of edges, if the pattern lines include multiple layers of single pattern lines with overlapping parts, the pattern lines are recorded as a group of pattern lines; in the acquisition of the aforementioned contour trend sequence, the edge pixel points of the overlapping part of each pattern line in the group of pattern lines have been extracted, and each pattern line can be regarded as a closed edge separately; each closed edge in the group of pattern lines is regarded as an overlapping pattern line, and the contour trend sequence of any two overlapping pattern lines in the group of pattern lines is DTW matched according to the above method, wherein if there are overlapping edge pixel points between the two overlapping pattern lines, the overlapping The edge pixel points directly constitute matching edge pixel pairs with themselves; it should be noted that, in a group of pattern lines, there may be two overlapping pattern lines that do not overlap at all, that is, the two overlapping pattern lines overlap with other overlapping pattern lines in a certain part respectively, but the two overlapping pattern lines themselves do not overlap; then the direction similarity of the two overlapping pattern lines and a number of matching edge pixel pairs are obtained; the Euclidean distance between the matching edge pixel points constituted by the overlapping edge pixel points is 0, and the Euclidean distance of the matching edge pixel pairs whose Euclidean distance is not 0 in all matching edge pixel pairs is calculated as the average, and used as the spatial distance of the two overlapping pattern lines.
[0063] Furthermore, for any overlapping pattern line in the group of pattern lines, the overlapping pattern line with the smallest spatial distance therefrom is obtained and constitutes a group of double-sided pattern lines in the group of pattern lines, and finally several groups of double-sided pattern lines in the group of pattern lines are obtained; it should be noted that, since there is pairwise overlap between overlapping pattern lines in a group of pattern lines (a group of closed edges with overlapping parts), the double-sided pattern lines constructed with overlapping pattern lines do not need to consider the problem of shared overlapping pattern lines.
[0064] Furthermore, according to the above method, several groups of double-sided pattern lines are obtained for each group of pattern lines, and at the same time, non-overlapping pattern lines construct several groups of double-sided pattern lines.
[0065] Preferably, in one embodiment of the present invention, the width change of a group of double-sided lines of a pattern and the difference in the direction of the pattern lines are analyzed to obtain the internal distribution coefficient of each group of double-sided lines of the pattern, including the specific method of:
[0066] It should be noted that, for the bilateral lines of the pattern, the bilateral lines of the pattern constructed by overlapping pattern lines need to be adjusted so that the overlapping parts can be segmented, thereby clearly showing the pattern morphology of the perineum of the root-knot nematode; and the bilateral lines of the pattern composed of non-overlapping pattern lines are constructed based on contour differences, so they are usually two adjacent pattern lines with similar contours and similar lengths. In this way, the internal distribution coefficient of the bilateral lines of the pattern constructed by overlapping pattern lines is adjusted by quantifying the internal distribution coefficient that can reflect the contour similarity and spatial distribution relationship of the bilateral lines of the pattern composed of non-overlapping pattern lines, so as to realize the subsequent segmentation of the overlapping pattern lines.
[0067] Specifically, for any set of double-sided lines of a pattern, it contains Matching edge pixel pairs, then the internal distribution coefficient of the double-sided lines of the pattern is The calculation method is:
[0068]
[0069] in, It represents the standard deviation of the Euclidean distance of all matching edge pixel pairs in the two-sided lines of the pattern. Indicates the number of matching edge pixel pairs in the double-sided lines of this group of patterns. Indicates the first The Euclidean distance between pairs of matching edge pixels, Indicates the maximum value of the Euclidean distance of all matching edge pixel pairs in the two-sided lines of the pattern. and Respectively represent the first The tangent angles of the two edge pixels in a matching edge pixel pair, represents the cosine trigonometric function, Represents the weight normalization function, and the normalization object is all the matching edge pixel pairs in the two-side lines of the pattern. ; represents an exponential function with a natural constant as the base; the internal distribution coefficient of the lines on both sides of each group of patterns is obtained according to the above method.
[0070] It should be noted that the difference in tangent angles between matching edge pixel pairs is used to quantify the difference in direction. The greater the difference in tangent angles, the smaller the corresponding cosine trigonometric function, which will make the internal distribution coefficient smaller, reflecting the smaller the similarity in direction. At the same time, the Euclidean distance between matching edge similar point pairs is used to limit it. The larger the Euclidean distance, the less the Euclidean distance can intuitively correspond to the width between the pattern lines, and the smaller the reference value of the corresponding tangent angle will be. In particular, for the matching edge pixel pairs composed of overlapping parts, since they have no reference significance in the analysis of the internal distribution coefficient, that is, since they are matching edge pixel pairs composed of the same pixel points, their tangent angles are exactly the same and are not sufficient to analyze the difference in direction, they are not included in the calculation. The standard deviation of the Euclidean distance of the matching edge pixel pairs can reflect the width changes between the pattern lines. The larger the standard deviation, the larger the fluctuation range of the width, and the more dissimilar the distribution relationship between the pattern lines on both sides of the pattern.
[0071] At this point, the pattern lines are extracted by performing edge detection on the microscope image. Since the pattern lines of different layers overlap and affect the morphological display of the pattern in the perineum area, the overlapping pattern lines and non-overlapping pattern lines are extracted separately, and the double-sided pattern lines are constructed for the overlapping pattern lines. At the same time, based on the similarity of the directions of the non-overlapping pattern lines and the distance in spatial distribution, the double-sided pattern lines are also constructed and the internal distribution coefficient is quantified to reflect the similarity and distribution relationship of the overall contour, thereby providing a basis for the correction of the overlapping pattern lines.
[0072] Step S003, constructing pattern distribution features based on the internal distribution coefficient according to the overlapping relationship of pattern lines in the double-sided lines of the pattern; quantifying the trend similarity relationship between the overlapping pattern lines in a group of double-sided lines of the pattern and the non-overlapping pattern lines on both sides based on the spatial distribution, and obtaining the contour reference of the non-overlapping pattern lines for the overlapping pattern lines.
[0073] Preferably, in one embodiment of the present invention, according to the overlapping relationship of the pattern lines in the double-sided lines of the pattern, the pattern distribution feature is constructed based on its internal distribution coefficient, including the specific method of:
[0074] It should be noted that, since the double-sided lines of the pattern are constructed based on the contour difference between non-overlapping pattern lines, and there are no common non-overlapping pattern lines between the double-sided lines of the pattern, there may be special circumstances that cause the non-overlapping pattern lines in a group of double-sided lines of the pattern to be not adjacent and have a large contour difference. In this case, it is necessary to make adjustments to such special circumstances in the process of constructing the pattern distribution characteristics with the internal distribution coefficient.
[0075] Specifically, all double-sided pattern lines constructed by non-overlapping pattern lines are recorded as non-overlapping double-sided lines, and there is a corresponding contour difference between the non-overlapping pattern lines in any group of non-overlapping double-sided lines. The inverse proportional normalization result of the contour difference is used as the contour similarity of the non-overlapping double-sided lines; the internal distribution coefficient of each group of pattern double-sided lines is obtained according to the above method.
[0076] Furthermore, the contour similarities of all groups of non-overlapping bilateral lines are normalized by softmax, and the result is used as the distribution weight of each group of non-overlapping bilateral lines. The internal distribution coefficients of all groups of non-overlapping bilateral lines are weighted and averaged by the distribution weight, and the result is used as the pattern distribution feature.
[0077] It should be noted that the greater the contour difference between the non-overlapping bilateral lines, the smaller the contour similarity, the smaller the reference value of the internal distribution coefficient quantified by the contour similarity relationship and distribution relationship of the two non-overlapping pattern lines inside, and the smaller the weight allocated in the process of constructing the pattern distribution feature, and the pattern distribution feature is constructed in this way.
[0078] Preferably, in one embodiment of the present invention, for a group of double-sided pattern lines, overlapping pattern lines and non-overlapping pattern lines on both sides are respectively quantified in terms of direction similarity based on spatial distribution, and the profile reference of the non-overlapping pattern lines to the overlapping pattern lines is obtained, including the specific method of:
[0079] It should be noted that after obtaining the pattern distribution characteristics, it is necessary to segment the double-sided lines of the pattern constructed by overlapping pattern lines based on the pattern distribution characteristics. In the segmentation process, in addition to considering the close pattern distribution characteristics, it is also necessary to reconstruct and correct the overlapping parts of the overlapping pattern lines based on the non-overlapping pattern lines with similar distances. In the reconstruction and correction process, the overlapping pattern lines need to be adjusted according to the contour morphology of the non-overlapping pattern lines. The closer the distance between the contours in spatial distribution, the closer their pattern contour morphology is, and the greater the reference value. At the same time, to facilitate the segmentation of overlapping pattern lines, a group of double-sided lines of the pattern need to be segmented with reference to the contour morphology of the non-overlapping pattern lines on both sides.
[0080] Specifically, for any group of double-sided pattern lines composed of overlapping pattern lines, one of the overlapping pattern lines is recorded as the target overlapping pattern line, and the other overlapping pattern line other than the target overlapping pattern line is recorded as the reference overlapping pattern line; all non-overlapping pattern lines on both sides of the target overlapping pattern line except one side of the reference overlapping pattern line are used as reference non-overlapping pattern lines of the target overlapping pattern line.
[0081] Furthermore, DTW matching is performed on the target overlapping pattern line and any one of its reference non-overlapping pattern lines based on their contour trend sequences to obtain a number of matching edge pixel pairs, and the contour difference between the target overlapping pattern line and the reference non-overlapping pattern line is obtained according to the calculation method of the trend difference, spatial distance and contour difference between the non-overlapping pattern lines, and the contour similarity is obtained by inverse proportional normalization; the contour similarity between the target overlapping pattern line and each of its reference non-overlapping pattern lines is obtained according to the above method, and all contour similarities are softmax normalized, and the obtained result is used as the contour reference of each reference non-overlapping pattern line to the target overlapping pattern line; similarly, the contour reference of each non-overlapping pattern line to the overlapping pattern line is obtained, and the non-overlapping pattern lines are all non-overlapping pattern lines on the corresponding side of the overlapping pattern line.
[0082] It should be noted that, based on the judgment of the spatial distribution distance of overlapping and non-overlapping pattern lines, the overall similarity in their direction also needs to be used as a reference condition, that is, the overlap does not destroy the overall outline of the overlapping pattern lines. The purpose of correction is to improve its recognition, so non-overlapping pattern lines with more similar overall outlines are needed as a reference for correction. The smaller the difference in direction and the spatial distance, the closer the spatial distribution and the more similar the overall outline, the greater the referenceability and the greater the reference of the outline.
[0083] At this point, based on the internal distribution coefficient of the double-sided lines of the pattern constructed by non-overlapping pattern lines, and based on the weighted correction of the contour difference between the non-overlapping pattern lines, the pattern distribution characteristics are constructed to reflect the distribution parameters between adjacent pattern lines; at the same time, the contour reference of the overlapping pattern lines is quantified based on the non-overlapping pattern lines, which is used for the subsequent correction of the overlapping pattern lines to ensure that the overlapping parts can be segmented and the contour shape will not change significantly.
[0084] Step S004, correcting the overlapping pattern lines on both sides of the pattern based on the contour reference of each non-overlapping pattern line to the overlapping pattern lines, and comparing them with the pattern distribution characteristics to segment the overlapping pattern lines and complete the segmentation of the root-knot nematode perineal pattern.
[0085] It should be noted that, for the bilateral lines of the pattern composed of overlapping pattern lines, it is necessary to segment the overlapping pattern lines one by one according to the internal distribution coefficient. The smaller the internal distribution coefficient, the less the bilateral lines of the pattern conform to the pattern distribution characteristics, and the lower the recognition. In the segmentation process, the contour reference of the non-overlapping pattern lines to the overlapping pattern lines is used. The larger the contour reference, the higher the priority calculation, that is, the contours of the non-overlapping pattern lines are more similar to those of the overlapping pattern lines, and can be used as a reference for correction. After the correction, it is judged by the pattern distribution characteristics and iteratively corrected until all the overlapping pattern lines are segmented, and the segmentation of the pattern of the perineum of the root-knot nematode is completed.
[0086] Specifically, the double-sided lines of the pattern formed by the overlapping pattern lines are recorded as overlapping double-sided lines, and all the overlapping double-sided lines are arranged in ascending order according to the internal distribution coefficients corresponding to the overlapping double-sided lines; starting from the overlapping double-sided line with the smallest internal distribution coefficient, for two overlapping pattern lines therein, the maximum values of the contour references of each non-overlapping pattern line corresponding to each overlapping pattern line to it are respectively obtained, and the overlapping pattern line corresponding to the maximum value of the two maximum values is used as the first-corrected overlapping pattern line in the group of overlapping double-sided lines, and the overlapping pattern line corresponding to the minimum value of the two maximum values is used as the later-corrected overlapping pattern line; for the first-corrected overlapping pattern line, all the edge pixel points overlapping with the later-corrected overlapping pattern line and the adjacent previous edge pixel points when traversing clockwise are used as the edge pixel points to be corrected of the first-corrected overlapping pattern line, and according to a number of non-overlapping pattern lines corresponding to the first-corrected overlapping pattern line and the matching edge pixel point pairs between the two pattern lines, the matching edge pixel points of each edge pixel point to be corrected in each non-overlapping pattern line are obtained.
[0087] Furthermore, starting from the first edge pixel point on the right side of the cutting line of the first corrected overlapping pattern line, traverse clockwise to the first edge pixel point to be corrected, and taking the contour reference of each non-overlapping pattern line to the first corrected overlapping pattern line as the weight, the tangent angles of the edge pixel point to be corrected at the matching edge pixel points of each non-overlapping pattern line are weighted and averaged to obtain the weighted tangent angle of the edge pixel point to be corrected, and the average of the weighted tangent angle and the tangent angle of the edge pixel point to be corrected is used as the corrected tangent angle of the edge pixel point to be corrected; according to the corrected tangent angle, the corrected position of the next adjacent edge pixel point to be corrected during the clockwise traversal is obtained, and based on the corrected tangent angle, the corrected position of the next adjacent edge pixel point to be corrected during the clockwise traversal is obtained, and based on the corrected tangent angle, the corrected position of the edge pixel point to be corrected is obtained. The tangent correction angle is obtained according to the above method at the corresponding tangent angle, and so on, until the next edge pixel point is not the edge pixel point to be corrected when traversing clockwise, then the tangent angle correction is stopped, that is, the correction position is not obtained, and the original edge pixel point is directly connected until all the edge pixel points of the first corrected overlapping pattern lines are traversed clockwise, and the first correction of the first corrected overlapping pattern lines is completed; it is particularly noted that if the first edge pixel point on the right side of the cutting line is the edge pixel point to be corrected, then the edge pixel point that is not the edge pixel point to be corrected is traversed counterclockwise, and the tangent angle correction is started from the next edge pixel point clockwise (the edge pixel point to be corrected).
[0088] Furthermore, it is determined whether there is any overlapping part between the corrected first-corrected overlapping pattern lines and the later-corrected overlapping pattern lines. If there is no overlapping part, the internal distribution coefficient of the group of overlapping double-sided lines is recalculated (the corrected first-corrected overlapping pattern lines and the later-corrected overlapping pattern lines are calculated). If the internal distribution coefficient is greater than or equal to the pattern distribution characteristics, the group of overlapping double-sided lines is corrected; if there is still an overlapping part or there is no overlapping part but the internal distribution coefficient is still less than the pattern distribution characteristics, the later-corrected overlapping pattern lines are corrected according to the above method, and the first-corrected and the later-corrected overlapping pattern lines are corrected alternately, and so on, until the group of overlapping double-sided lines has no overlapping part after correction and the recalculated internal distribution coefficient is greater than or equal to the pattern distribution characteristics, the correction of the group of overlapping double-sided lines is completed, and the corrected two overlapping pattern lines are recorded as corrected pattern lines.
[0089] Furthermore, the internal distribution coefficients of the overlapping bilateral lines including the corrected pattern lines are recalculated according to the above method, and those two that are both corrected pattern lines are not calculated, and are sorted from small to large in combination with the internal distribution coefficients of other overlapping bilateral lines. The overlapping bilateral lines corresponding to the minimum value are corrected according to the above method, and if the corrected pattern lines are included, the corrected pattern lines are no longer corrected; and so on, all overlapping bilateral lines are finally corrected, thereby realizing the segmentation of the overlapping pattern lines and completing the segmentation of the pattern of the perineum of the root-knot nematode.
[0090] At this point, the overlapping pattern lines are iteratively corrected based on the tangential angle of the non-overlapping pattern lines by referring to their contours based on the non-overlapping pattern lines, and the pattern distribution characteristics are met, so that the pattern lines with overlapping parts can be segmented, thereby improving the recognition of each pattern line in the perineum area of the root-knot nematode, reducing the influence of overlapping pattern lines on the identification of perineum patterns, thereby improving the efficiency and accuracy of root-knot nematode species identification based on the perineum patterns of root-knot nematodes.
[0091] It should be noted that this embodiment adopts Model to present inverse proportional relationship and normalization, represents an exponential function with a natural constant as base, As the input of the model, the implementer can set the inverse proportional function and normalization function according to the actual situation.
[0092] Another embodiment of the present invention provides a root-knot nematode perineal region segmentation system based on microscope images, the system includes a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, the above-mentioned method steps S001 to S004 are implemented.
[0093] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for segmenting the perineum of root-knot nematodes based on microscope images, characterized in that: The method comprises the following steps: Obtain microscopic images of the perineal region of root-knot nematodes; Extract several pattern lines in the perineum area in the microscope image by edge detection; analyze the similarity relationship between the pattern lines and their spatial distribution, obtain overlapping and non-overlapping pattern lines and construct several groups of pattern double-sided lines; analyze the width change of a group of pattern double-sided lines and the difference in the direction between the pattern lines, and obtain the internal distribution coefficient of each group of pattern double-sided lines; According to the overlapping relationship of the pattern lines in the double-sided lines of the pattern, the pattern distribution characteristics are constructed based on their internal distribution coefficients; for a group of overlapping pattern lines in the double-sided lines of the pattern and the non-overlapping pattern lines on both sides, the similarity of the orientation is quantified based on the spatial distribution, and the contour reference of the non-overlapping pattern lines to the overlapping pattern lines is obtained; The overlapping pattern lines in the double-sided lines of the pattern are corrected according to the contour reference of each non-overlapping pattern line to the overlapping pattern line, and compared with the pattern distribution characteristics to achieve the segmentation of the overlapping pattern lines; The specific method of obtaining the internal distribution coefficient of each group of double-sided lines of the pattern includes: in, It represents the standard deviation of the Euclidean distances of all matching edge pixel pairs in any set of lines on both sides of the pattern. Indicates the number of matching edge pixel pairs in the double-sided lines of this group of patterns. Indicates the first The Euclidean distance between pairs of matching edge pixels, Indicates the maximum value of the Euclidean distance of all matching edge pixel pairs in the two-sided lines of the pattern. and Respectively represent the first The tangent angles of the two edge pixels in a matching edge pixel pair, represents the cosine trigonometric function, represents the weight normalization function, represents an exponential function with a natural constant as base; The specific method of constructing the pattern distribution feature includes: For all the double-sided lines of patterns constructed by non-overlapping pattern lines, they are recorded as non-overlapping double-sided lines. There is a contour difference degree corresponding to the non-overlapping pattern lines in any group of non-overlapping double-sided lines. The inverse proportional normalization result of the contour difference degree is taken as the contour similarity of the non-overlapping double-sided lines. The contour similarities of all groups of non-overlapping bilateral lines are normalized, and the results are used as the distribution weights of each group of non-overlapping bilateral lines. The internal distribution coefficients of all groups of non-overlapping bilateral lines are weighted and averaged by the distribution weights, and the results are used as the pattern distribution features.
2. The method for segmenting the perineum of root-knot nematodes based on microscope images according to claim 1, characterized in that: The method of extracting a plurality of pattern lines in the perineum region in the microscope image by edge detection includes: performing edge detection on the microscope image by using a Canny algorithm to obtain a plurality of edge pixel points; Several edges are obtained by connecting adjacent edge pixels, and all closed edges are used as pattern lines of the perineum area.
3. The method for segmenting the perineum of root-knot nematodes based on microscope images according to claim 2, characterized in that: The specific method of analyzing the similarity relationship between the pattern lines and their spatial distribution, obtaining overlapping and non-overlapping pattern lines and constructing several groups of double-sided pattern lines includes: For any pattern line, obtain the tangent vector of each edge pixel point on the pattern line, wherein the tangent vectors are all clockwise, and obtain the angle of the tangent vector of each edge pixel point as the tangent angle of each edge pixel point; Draw a straight line vertically upward from the center of the microscope image as the cutting line of each pattern line; starting from the right side of the cutting line, arrange the tangent angles of all edge pixel points of any pattern line in a clockwise manner to form the contour trend sequence of the pattern line; The pattern lines without overlapping parts are recorded as non-overlapping pattern lines; For pattern lines with overlapping parts, multiple layers of single pattern lines with overlapping parts constitute a group of pattern lines, and each closed edge in the group of pattern lines is regarded as an overlapping pattern line; For any two non-overlapping pattern lines, DTW matching is performed on their contour trend sequences. During the matching process, the sine trigonometric function of the absolute value of the tangent angle difference between the elements of the two sequences is used as the distance between the elements to construct a matching distance matrix, and a number of matching element pairs and the DTW distance between the two contour trend sequences are obtained, which are used as the trend difference of the two non-overlapping pattern lines; according to the corresponding relationship between the tangent angle and the edge pixel points, a number of matching edge pixel point pairs are obtained; the Euclidean distance between any pair of matching edge pixel points is calculated, and the average of the Euclidean distances corresponding to all matching edge pixel point pairs is used as the spatial distance of the two non-overlapping pattern lines; the product of the trend difference and the spatial distance is used as the contour difference of the two non-overlapping pattern lines; Calculate the contour difference of any two non-overlapping pattern lines, and match the non-overlapping pattern lines starting from the minimum value of all contour differences; form a group of double-side pattern lines with two non-overlapping pattern lines corresponding to the minimum value of all contour differences, and remove the two non-overlapping pattern lines from all non-overlapping pattern lines, and continue to match other non-overlapping pattern lines starting from the minimum value of the corresponding contour difference, and so on, divide all non-overlapping pattern lines into several groups of double-side pattern lines; For the overlapping pattern lines in the same group of pattern lines, several groups of double-side pattern lines of each group of pattern lines are obtained according to their similarity in direction and spatial distribution.
4. The method for segmenting the perineum of root-knot nematodes based on microscope images according to claim 3, characterized in that: The specific acquisition method of the plurality of groups of double-sided pattern lines of each group of pattern lines is as follows: DTW matching is performed on the contour trend sequence of any two overlapping pattern lines in any group of pattern lines, wherein if there are overlapping edge pixels between the two overlapping pattern lines, the overlapping edge pixels directly form a matching edge pixel pair with themselves; the trend similarity of the two overlapping pattern lines and a plurality of matching edge pixel pairs are obtained; wherein the Euclidean distance between the matching edge pixel pairs formed by the overlapping edge pixels is 0, and the Euclidean distance of the matching edge pixel pairs whose Euclidean distance is not 0 in all the matching edge pixel pairs is calculated as the average, and the average is used as the spatial distance of the two overlapping pattern lines; For any overlapping pattern line in the group of pattern lines, the overlapping pattern line with the smallest spatial distance therefrom is obtained and constitutes a group of double-sided pattern lines in the group of pattern lines, and finally several groups of double-sided pattern lines in the group of pattern lines are obtained.
5. The method for segmenting the perineum of root-knot nematodes based on microscope images according to claim 4, characterized in that: The method of quantifying the similarity of the orientation of the overlapping pattern lines in a group of pattern double-sided lines and the non-overlapping pattern lines on both sides based on the spatial distribution to obtain the contour reference of the non-overlapping pattern lines for the overlapping pattern lines includes the following specific methods: For any set of double-sided pattern lines consisting of overlapping pattern lines, one of the overlapping pattern lines is recorded as the target overlapping pattern line, and the other overlapping pattern line other than the target overlapping pattern line is recorded as the reference overlapping pattern line; all non-overlapping pattern lines on both sides of the target overlapping pattern line except one side of the reference overlapping pattern line are recorded as reference non-overlapping pattern lines of the target overlapping pattern line; According to the contour trend sequence of the target overlapping pattern line and the reference non-overlapping pattern line, the contour reference of the reference non-overlapping pattern line to the target overlapping pattern line is obtained.
6. The method for segmenting the perineum of root-knot nematodes based on microscope images according to claim 5, characterized in that: The specific method of obtaining the profile reference of the reference non-overlapping pattern lines to the target overlapping pattern lines is as follows: The target overlapping pattern line and any one of its reference non-overlapping pattern lines are matched by DTW based on their contour trend sequence to obtain a number of matching edge pixel pairs, and the contour difference between the target overlapping pattern line and the reference non-overlapping pattern line is obtained, and the contour similarity is obtained by inverse proportional normalization; The contour similarity between the target overlapping pattern line and each of its reference non-overlapping pattern lines is obtained, all contour similarities are normalized, and the obtained result is used as the contour reference of each reference non-overlapping pattern line to the target overlapping pattern line.
7. The method for segmenting the perineum of root-knot nematodes based on microscope images according to claim 3, characterized in that: The overlapping pattern lines in the double-sided pattern lines are corrected according to the contour reference of each non-overlapping pattern line to the overlapping pattern line, and compared with the pattern distribution characteristics to achieve the segmentation of the overlapping pattern lines, including the specific method of: Double-sided lines of a pattern formed by overlapping pattern lines are recorded as overlapping double-sided lines, and all overlapping double-sided lines are arranged in order from small to large according to the internal distribution coefficients corresponding to the overlapping double-sided lines; Starting from the overlapping double-sided lines with the smallest internal distribution coefficient, the overlapping double-sided lines are corrected according to the contour reference of each non-overlapping pattern line corresponding to the overlapping pattern line and the contour trend sequence of the overlapping pattern line and each non-overlapping pattern line, and the corrected two overlapping pattern lines are recorded as corrected pattern lines; Recalculate the internal distribution coefficients of the overlapping double-sided lines including the corrected pattern lines, sort them from small to large in combination with the internal distribution coefficients of other overlapping double-sided lines, correct the overlapping double-sided lines corresponding to the minimum value, and if the corrected pattern lines are included, the corrected pattern lines will not be corrected; And so on, finally all overlapping double-sided lines are corrected.
8. A root-knot nematode perineal region segmentation system based on microscope images, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method for segmenting the perineum of a root-knot nematode based on a microscope image as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Cutting piece pattern parameter measuring method based on Faster R-CNN
CN110274919A
Method for performing sperm morphology intelligent analysis based on cascaded SAM model
CN118506363A