A method of image segmentation based on density clustering algorithm

Through the image segmentation method based on the density clustering algorithm, the human pixel likelihood and homogeneous recognition are used to screen and merge the block areas, combined with the distribution feature point analysis, to solve the problem of difficult portrait segmentation in dark environments and achieve more accurate portraits. Region segmentation.

CN118470335BActive Publication Date: 2024-10-11SHAANXI GUOBO ZHENGTONG INFORMATION TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410944455.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-10-11
Estimated Expiration
2044-07-15

AI Technical Summary

Technical Problem

In a dark environment, insufficient lighting causes the grayscale difference between the portrait and the background to be insignificant, making it difficult to accurately segment the overall portrait area.

Method used

The image segmentation method based on the density clustering algorithm is used to cluster the images through the preset cutoff distance, obtain the block areas, calculate the human pixel likelihood and identity recognition of the pixel points, screen out the suspected human portrait block areas and merge them. Combined with distribution feature point analysis, the real overall portrait area can be accurately segmented.

Benefits of technology

It significantly improves the segmentation accuracy of portrait areas in dark environments, can more effectively distinguish portraits from backgrounds, and enhances the reliability of face recognition technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118470335B_ABST
    Figure CN118470335B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image clustering technology, and in particular to an image segmentation method based on a density clustering algorithm. The method first selects suspected portrait block regions from the block regions according to the human pixel probability of all pixels in the block regions in the target segmented image; obtains the same-body recognition degree of each of the two suspected portrait block regions according to the difference between the human pixel probability of pixels in each of the two suspected portrait block regions and the spatial distribution proximity of each of the two suspected portrait block regions; selects the real overall portrait region from the suspected overall portrait region according to the spatial distribution characteristics of the distributed feature points in each suspected overall portrait region. In the present invention, the overall portrait region is segmented more accurately by deeply exploring the difference between the portrait region and the background region.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image clustering, and in particular to an image segmentation method based on a density clustering algorithm. Background Art

[0002] Face recognition technology is a biometric technology that identifies people based on their facial features. It provides an efficient and accurate identity verification method. Introducing face recognition in public places such as parking lots and garages can further enhance security capabilities. Face recognition technology relies on accurate recognition of the entire portrait and accurate extraction of the overall portrait area, which helps to extract and compare facial features.

[0003] In order to segment the portrait area from the captured image, the density clustering algorithm can use the grayscale difference between the background area and the portrait area to segment the entire portrait area from the captured image. However, in a dark environment, due to insufficient light, the grayscale difference between the portrait and the surrounding environment is not obvious, making it difficult to accurately segment the entire portrait area. Summary of the invention

[0004] In order to solve the problem that it is difficult to accurately segment the entire portrait area in the prior art, the purpose of the present invention is to provide an image segmentation method based on a density clustering algorithm. The technical solution adopted is as follows:

[0005] An image segmentation method based on a density clustering algorithm, the method comprising:

[0006] Clustering the images to be segmented using the preset cutoff distances respectively, and obtaining segmented images corresponding to the preset cutoff distances; the segmented images include the respective block regions;

[0007] According to the difference of the block areas to which the pixel points belong at different preset cutoff distances, the possibility of the pixel points being human pixels is obtained; a target segmented image is determined from all the segmented images; in the target segmented image, according to the possibility of the pixel points being human pixels in the segmented areas, a suspected human portrait segmented area is screened out from the segmented areas;

[0008] According to the difference between the possible degrees of the human pixels of the pixel points in each two of the suspected portrait block areas and the proximity of the spatial distribution of each two of the suspected portrait block areas, the same-body recognition degree of each two of the suspected portrait block areas is obtained; according to the same-body recognition degree of each two of the suspected portrait block areas in the target segmented image, the suspected portrait block areas are merged to obtain each suspected whole portrait area;

[0009] Obtaining distribution feature points of each suspected overall portrait region; and screening out a true overall portrait region from the suspected overall portrait region according to the spatial distribution characteristics of the distribution feature points in each of the suspected overall portrait regions.

[0010] Furthermore, the method for obtaining the possible degree of character pixels includes:

[0011] According to the area difference of the block area to which the pixel point belongs at different preset cutoff distances, an area difference factor is obtained;

[0012] Obtaining an edge distinguishing factor according to differences in edge smoothing features of the block area to which the pixel point belongs at different preset cutoff distances;

[0013] The character pixel likelihood of a pixel point is obtained according to the area distinction factor and the edge distinction factor; the area distinction factor and the edge distinction factor are both positively correlated with the character pixel likelihood.

[0014] Furthermore, the method for obtaining the area distinction factor includes:

[0015] According to the preset truncation distance from small to large, the areas of all the block regions to which the pixel points at the same position belong are sorted in turn, and the accumulated value of the absolute values ​​of the differential values ​​corresponding to all the areas is calculated to obtain the area distinction factor.

[0016] Furthermore, the method for obtaining the edge distinguishing factor includes:

[0017] Perform edge detection on the block area to obtain the edge of the block area; perform curve fitting on the edge of the block area to obtain the fitted edge of the block area; calculate the mean square error between the edge of the block area and the fitted edge, perform negative correlation mapping on the mean square error, and obtain the edge smoothing feature parameters of the block area;

[0018] According to the preset truncation distance, the edge smoothing feature parameters of all the block areas to which the pixel point at the same position belongs are sorted in sequence, and the accumulated value of the absolute values ​​of the differential values ​​corresponding to all the edge smoothing feature parameters is calculated to obtain the edge distinguishing factor.

[0019] Furthermore, the method for acquiring the target segmented image includes:

[0020] The segmented image corresponding to the minimum preset truncation distance is used as the target segmented image.

[0021] Furthermore, the method for obtaining the same-body recognition degree includes:

[0022] According to the area difference of the two suspected portrait block regions, an area difference factor is obtained;

[0023] According to the boundary connection condition of two suspected portrait block areas, a boundary connection factor is obtained;

[0024] According to the overall distribution characteristics of the human pixel possibility degree of all pixels in the suspected human portrait block area, the regional human degree of the suspected human portrait block area is obtained;

[0025] Obtaining a regional character difference factor according to a difference between the regional character degrees of two suspected human portrait block regions;

[0026] According to the area difference factor, the boundary connection factor and the regional character difference factor, the same-body recognition degree of two suspected portrait block areas is obtained; the boundary connection factor is positively correlated with the same-body recognition degree; the area difference factor and the regional character difference factor are both negatively correlated with the same-body recognition degree.

[0027] Furthermore, the method for obtaining the boundary contact factor includes:

[0028] In two suspected portrait block areas, the pixel points on the edge of the suspected portrait block area are used as the edge pixel points of the suspected portrait block area; any one of the suspected portrait block areas is used as the first area to be analyzed, and the other suspected portrait block area is used as the second area to be analyzed; the 8-neighborhood of all edge pixels in the first area to be analyzed is used as the connection range; each edge pixel point in the second area to be analyzed that is within the connection range is used as each connected pixel point; and the total number of all connected pixel points is used as the boundary connection factor.

[0029] Furthermore, the method for acquiring the distribution feature points includes:

[0030] The convex hull detection method is used to obtain the convex hull of the suspected overall portrait area; the inflection point detection method is used to detect the convex hull of the suspected overall portrait area to obtain the distribution feature points of the suspected overall portrait area.

[0031] Furthermore, the method for obtaining the real overall portrait area includes:

[0032] Obtaining the overall portrait region possibility of the suspected overall portrait region according to the irregular distribution characteristics of the feature points distributed on the convex hull of each of the suspected overall portrait regions;

[0033] The suspected whole portrait region whose whole portrait region possibility is greater than the preset whole portrait threshold is taken as the real whole portrait region.

[0034] Furthermore, the method for obtaining the possibility of the overall portrait region includes:

[0035] Taking any distribution feature point as the starting point, sort all distribution feature points along the derivative direction of the convex hull, and connect each distribution feature point with the next distribution feature point as the distribution feature line segment of each distribution feature point;

[0036] The line segment formed by the two distribution feature points with the largest interval distance is taken as the main line segment;

[0037] The Euclidean distance from each distribution feature point to the main line segment is used as the deviation distance of the distribution feature point;

[0038] The angle formed by each distribution characteristic line segment and the main line segment is used as the deviation angle of the distribution characteristic line segment;

[0039] According to the differences of all deviation distances, the length difference factor is obtained;

[0040] According to the differences of all deviation angles, the direction difference factor is obtained;

[0041] The overall portrait region possibility of the suspected overall portrait region is obtained according to the length difference factor and the direction difference factor; the length difference factor, the direction difference factor and the overall portrait region possibility are positively correlated.

[0042] The present invention has the following beneficial effects:

[0043] Considering that the background area contains fewer detail elements and the person area contains rich detail elements, as the preset truncation distance decreases, the block area corresponding to the portrait will become more and more fragmented, while the block area corresponding to the background will not change much, and the person possibility of the pixel point is obtained; the greater the person possibility, the more likely the pixel point is a person pixel point. Considering that in the segmented image with a small preset truncation distance, the block area is more refined and it is easier to distinguish between the person and the background, and the target segmented image is determined from all segmented images. Then, in the target segmented image, according to the person pixel possibility of all pixels in the block area, the suspected portrait block area is screened out from the block area. The suspected portrait block area can reflect the local area that may be a portrait.

[0044] In order to analyze the possibility that two suspected portrait block areas belong to the same portrait, it is considered that the similarity of the degree of fine-scale changes in the block areas corresponding to the pixel points of the same portrait is high; the closer the edges of the two suspected portrait block areas are and the closer the sizes are, the more likely the two suspected portrait block areas are to belong to the same portrait, and the same-body recognition of each two suspected portrait block areas is obtained. The greater the same-body recognition, the greater the possibility that the two suspected portrait block areas belong to the same portrait. Then the suspected portrait block areas are merged to obtain each suspected overall portrait area, and the suspected overall portrait area can preliminarily reflect the suspected overall portrait area. Considering that the portrait in the garage image has a torso and limbs, the outline of the portrait area is relatively irregular and not smooth, and the background area is mainly walls and cars, and the outline of the background area is relatively regular and smooth. In order to analyze the contour shape of the suspected overall portrait area, the distribution feature points with obvious characteristics are first analyzed; the more regular and smooth the outline formed by the distribution feature points, the more likely the suspected overall portrait area is to be a real portrait overall area; the present invention more accurately segments the real overall portrait area by deeply digging the difference between the portrait area and the background area. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are 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 work.

[0046] Figure 1 A flowchart of an image segmentation method based on a density clustering algorithm provided by an embodiment of the present invention;

[0047] Figure 2 A structural diagram of an image segmentation system based on a density clustering algorithm provided by an embodiment of the present invention;

[0048] Figure 3 A flow chart of a method for obtaining the possible degree of character pixels provided by one embodiment of the present invention;

[0049] Figure 4 A flow chart of a method for obtaining same-body recognition provided by an embodiment of the present invention;

[0050] Figure 5 A flow chart of a method for acquiring a real overall portrait area provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0051] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the image segmentation method based on the density clustering algorithm proposed by the present invention, its specific implementation, structure, features and effects, in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0052] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0053] The following is a detailed description of a specific scheme of an image segmentation method based on a density clustering algorithm provided by the present invention in conjunction with the accompanying drawings.

[0054] The present invention provides an image segmentation method based on a density clustering algorithm. Figure 1 , which shows a flow chart of an image segmentation method based on a density clustering algorithm provided by an embodiment of the present invention, the method comprising the following steps:

[0055] Step S1: clustering the images to be segmented using respective preset truncation distances to obtain segmented images corresponding to respective preset truncation distances; the segmented images include respective block regions.

[0056] Considering that the background area and the portrait area in the garage image have different effects in detail expression, the smaller the cutoff distance is set, the more detailed features can be reflected. By clustering the images to be segmented using each preset cutoff distance, the segmented images corresponding to each preset cutoff distance are obtained, providing data reference for subsequent analysis of the portrait area.

[0057] Specifically, in order to determine the portrait in the garage, it is first necessary to obtain an image in the garage. In an embodiment of the present invention, the camera arranged in the garage performs image acquisition when there is a portrait to obtain the original image. Since the original image acquired has noise, the noise will affect the subsequent analysis, so the image is subjected to noise reduction processing to obtain a noise-reduced image, eliminate the influence of noise and external interference, and enhance the accuracy of subsequent analysis. The noise-reduced image is grayed to obtain the image to be segmented of the garage. The embodiment of the present invention uses bilateral filtering to reduce the noise of the image, and the implementer can set it according to the actual situation.

[0058] The present invention is based on a density clustering algorithm, and utilizes various preset cutoff distances to cluster the images to be segmented, and obtains the segmented images corresponding to each preset cutoff distance. It should be noted that the density peak clustering algorithm is a prior art well known to those skilled in the art, and is only briefly described here. The density peak clustering algorithm is an unsupervised clustering algorithm, which can automatically discover the density peak points in the data and cluster the data according to these peak points. Among them, the cutoff distance is a key parameter, and the cutoff distance defines the neighborhood range of a point, that is, the set of all points whose distance from the point is less than or equal to the cutoff distance. The smaller the cutoff distance is set, the more detailed the clustering result is usually; the larger the cutoff distance is set, the rougher the clustering result is usually.

[0059] It is necessary to determine all preset cutoff distances used in the present invention, and the implementer can set them according to the implementation scenario. The present invention only provides an illustrative example of using all preset cutoff distances:

[0060] Based on the density clustering algorithm, the Euclidean distances between all the pixels in the image to be segmented are obtained, and these Euclidean distances are arranged in descending order. From the sorted Euclidean distances, the Euclidean distances at the positions corresponding to the preset proportions are selected as the preset cutoff distances. In one embodiment of the present invention, the preset proportions may be: 1%, 1.5%, 2%, 2.5%, ... 8.5%, 9%, 9.5%, 10%. For example, if the preset proportion is 1%, and the total number of all Euclidean distances is N, then the Euclidean distance at the N×1% position is selected from the sorted Euclidean distances as the preset cutoff distance corresponding to the 1% preset proportion. It should be noted that when N×1% is not an integer, it is rounded to the nearest integer.

[0061] Furthermore, the preset cutoff distance is used as the cutoff distance to cluster the image to be segmented. In one embodiment of the present invention, the method for obtaining the segmented image includes:

[0062] Based on the density clustering algorithm, the preset truncation distance is used as the truncation distance to cluster the image to be segmented, and each block area corresponding to the preset truncation distance is obtained, and all the block areas are used as the segmented image corresponding to the preset truncation distance. It should be noted that the density clustering algorithm is a prior art well known to those skilled in the art and will not be described in detail here.

[0063] Step S2: according to the differences in the block areas to which the pixel points belong at different preset cutoff distances, the possibility of the pixel points being a person is obtained; a target segmented image is determined from all the segmented images; in the target segmented image, according to the possibility of the pixel points being a person in the block areas, a suspected portrait block area is screened out from the block areas.

[0064] Considering that the background area contains fewer detail elements and the person area contains rich detail elements, as the preset truncation distance decreases, the block area corresponding to the portrait will become more and more fragmented, while the block area corresponding to the background will not change much, and the person possibility of the pixel point is obtained; the greater the person possibility, the more likely the pixel point is a person pixel point. Considering that in the segmented image with a small preset truncation distance, the block area is more refined and it is easier to distinguish between the person and the background, and the target segmented image is determined from all segmented images. Then, in the target segmented image, according to the person pixel possibility of all pixels in the block area, the suspected portrait block area is screened out from the block area. The suspected portrait block area can reflect the local area that may be a portrait.

[0065] To analyze the possibility that a pixel is a person's pixel, see Figure 3 , which shows a flow chart of a method for obtaining the likelihood of character pixels in one embodiment of the present invention. Preferably, in one embodiment of the present invention, the method for obtaining the likelihood of character pixels includes:

[0066] Step S201: obtaining an area difference factor according to the area difference of the block region to which the pixel point belongs at different preset cutoff distances.

[0067] Considering that portraits contain more detailed elements than backgrounds, as the preset cutoff distance decreases, the area of ​​the block region to which the portrait pixel belongs gradually decreases and the degree of decrease becomes more obvious, and the area distinction factor is obtained. The larger the area distinction factor, the more obvious the decrease in the block region to which the pixel belongs as the cutoff distance decreases, and the greater the possibility that the pixel is a portrait pixel.

[0068] In one embodiment of the present invention, the method for obtaining the area distinction factor includes: sorting the areas of all block regions to which the pixel points at the same position belong in order from small to large according to the preset cutoff distance, calculating the cumulative value of the absolute values ​​of the differential values ​​corresponding to all areas, and obtaining the area distinction factor. In other embodiments of the present invention, the method for obtaining the area distinction factor includes: calculating the variance of the areas of the block regions to which the pixel points belong at all preset cutoff distances, and obtaining the area distinction factor. It should be noted that the present invention adopts backward difference to calculate the differential value, that is, the latter data is subtracted from the current data.

[0069] Step S202: Obtain an edge distinguishing factor according to the difference in edge smoothing characteristics of the block area to which the pixel point belongs at different preset cutoff distances.

[0070] Considering that portraits contain more detailed elements than backgrounds, as the cutoff distance changes, the difference in edge smoothness of the block area to which the portrait pixel belongs becomes more obvious, and the edge distinction factor is obtained. The larger the value of the edge distinction factor, the more obvious the difference in edge smoothness of the block area to which the pixel belongs becomes as the cutoff distance changes, and the greater the possibility that the pixel is a portrait pixel.

[0071] In one embodiment of the present invention, the method for obtaining the area distinguishing factor includes: using the canny edge detection algorithm to perform edge detection on the block area to obtain the edge of the block area; using the least squares method to perform curve fitting on the edge of the block area to obtain the fitted edge of the block area; calculating the mean square error between the edge of the block area and the fitted edge, and performing negative correlation mapping on the mean square error to obtain the edge smoothing feature parameter of the block area; the larger the edge smoothing feature parameter, the smoother the edge of the block area. According to the preset cutoff distance, the edge smoothing feature parameters of all the block areas belonging to the pixel points at the same position are sorted in order from small to large, and the accumulated value of the absolute value of the corresponding differential value of all the edge smoothing feature parameters is calculated to obtain the edge distinguishing factor. It should be noted that the canny edge detection algorithm, the least squares method and the mean square error are prior arts well known to those skilled in the art, and will not be described in detail here. In one embodiment of the present invention, the method of using negative correlation mapping is: taking the opposite of the mean square error as the power of an exponential function with a natural constant as the base, and obtaining a negative correlation mapping result. It should be noted that in other embodiments of the present invention, other negative correlation mapping methods such as opposite numbers and inverse numbers may also be selected, which are all technical means well known to those skilled in the art and will not be described or limited herein. It should be noted that the image to be segmented includes all pixels at specific positions. After clustering the image to be segmented using each preset cutoff distance, the pixels at the same position correspond to all block areas of the preset cutoff distance. Since the smaller the preset cutoff distance is set, the more detailed the clustering is, each preset cutoff distance represents a specific degree of detail, and the pixels at the same position correspond to all block areas at the specific degree of detail. The total number of block areas corresponding to the pixels at the same position is the same as the total number of preset cutoff distances.

[0072] In other embodiments of the present invention, the method for obtaining the area distinction factor includes: using the Canny edge detection algorithm to perform edge detection on the block area to obtain the edge of the block area; using the least squares method to perform curve fitting on the edge of the block area to obtain the fitted edge of the block area; calculating the mean square error between the edge of the block area and the fitted edge, performing negative correlation mapping on the mean square error, and obtaining the edge smoothing feature parameters of the block area; calculating the variance of all edge smoothing feature parameters to obtain the edge distinction factor.

[0073] Step S203: obtaining the human pixel possibility of the pixel point according to the area distinction factor and the edge distinction factor; the area distinction factor and the edge distinction factor are both positively correlated with the human pixel possibility.

[0074] The fact that portraits contain more detailed elements than backgrounds and that portraits contain more complex detailed elements than backgrounds is taken into consideration to obtain the possibility of a pixel being a person. The greater the possibility of a person, the more likely the pixel is to be a person.

[0075] In one embodiment of the present invention, the product of the area distinction factor and the edge distinction factor is calculated, and the product is normalized to obtain the human pixel possibility of the pixel point. In other embodiments of the present invention, the sum of the area distinction factor and the edge distinction factor is calculated, and the sum is normalized to obtain the human pixel possibility of the pixel point. In one embodiment of the present invention, the normalization method is: normalization is performed using the norm normalization function to limit the value range to between 0 and 1.

[0076] Preferably, in order to facilitate subsequent analysis in the segmented image with good effect of distinguishing the person and the background, in one embodiment of the present invention, the method for obtaining the target segmented image includes:

[0077] Considering that in the segmented image with a small preset truncation distance, the block area is finer and it is easier to distinguish between the person and the background, the segmented image corresponding to the minimum preset truncation distance has a good degree of fineness, and the segmented image corresponding to the minimum preset truncation distance is used as the target segmented image.

[0078] Preferably, in one embodiment of the present invention, in order to screen out a local area that may be a portrait, a method for obtaining a suspected portrait block area includes:

[0079] In the target segmented image, the possible degree of human pixels of all pixels in the block area is integrated to obtain the regional portrait degree of the block area;

[0080] The block area whose regional portrait degree is greater than the preset regional portrait threshold is marked as a suspected portrait block area.

[0081] Considering that the greater the human possibility, the more likely the pixel is to be a human pixel, the human pixel possibility of all pixels in the block area is integrated to obtain the regional portrait degree of the block area. The greater the regional portrait degree, the more likely the block area is to be a local area of ​​a human portrait, and the suspected human portrait block area is screened out from the block area. The suspected human portrait block area can reflect the local area that may be a human portrait.

[0082] Specifically, for the above steps, the average of the possible degrees of the human pixels of all the pixels in the block area is calculated to obtain the regional portrait degree of the block area; the block area whose regional portrait degree is greater than the preset regional portrait threshold is marked as a suspected portrait block area. In one embodiment of the present invention, the preset regional portrait threshold is 0.55, which can be set by the implementer according to the implementation scenario.

[0083] Step S3: According to the difference between the possible degrees of the human pixels of the pixel points in each two suspected portrait block areas and the proximity of the spatial distribution of each two suspected portrait block areas, the same-body recognition degree of each two suspected portrait block areas is obtained; according to the same-body recognition degree of each two suspected portrait block areas in the target segmented image, the suspected portrait block areas are merged to obtain each suspected overall portrait area.

[0084] In order to analyze the possibility that two suspected portrait block areas belong to the same portrait, it is considered that the similarity of the degree of fine-scale changes in the block areas corresponding to the same portrait pixels is high; the closer the edges of the two suspected portrait block areas are and the closer the sizes are, the more likely the two suspected portrait block areas are to belong to the same portrait, and the same-body recognition of each two suspected portrait block areas is obtained. The greater the same-body recognition, the greater the possibility that the two suspected portrait block areas belong to the same portrait. Then, the suspected portrait block areas are merged to obtain each suspected overall portrait area, and the suspected overall portrait area can preliminarily reflect the suspected overall portrait area.

[0085] See also Figure 4 , which shows a flow chart of a method for obtaining same-body recognition in one embodiment of the present invention. Preferably, in one embodiment of the present invention, in order to analyze the possibility that two suspected portrait block areas belong to the same portrait, the method for obtaining same-body recognition includes:

[0086] Step S301: obtaining an area difference factor according to the area difference between two suspected portrait block regions.

[0087] Considering that the more similar the sizes of two suspected portrait blocks are, the more likely they are to belong to the same portrait. The area difference factor reflects the degree of area difference between the two suspected portrait blocks. The larger the value, the greater the degree of difference.

[0088] In one embodiment of the present invention, the absolute value of the difference between the total number of pixels of two suspected portrait block regions is calculated to obtain the area difference factor. In other embodiments of the present invention, the absolute value of the difference between the areas of two suspected portrait block regions is calculated to obtain the area difference factor.

[0089] Step S302: obtaining a boundary connection factor according to the boundary connection condition of two suspected portrait block regions.

[0090] Considering that the closer the edges of two suspected portrait blocks are, the more likely they are to belong to the same portrait; the boundary contact factor reflects the degree of contact between the edges of two suspected portrait blocks, and the larger the value, the closer they are.

[0091] In one embodiment of the present invention, in two suspected portrait block areas, the pixel points on the edge of the suspected portrait block area are used as the edge pixel points of the suspected portrait block area; any one of the suspected portrait block areas is used as the first area to be analyzed, and the other suspected portrait block area is used as the second area to be analyzed; the 8-neighborhood of all edge pixel points in the first area to be analyzed is used as the connection range; each edge pixel point in the second area to be analyzed that is in the connection range is used as each connected pixel point; and the total number of all connected pixel points is used as the boundary connection factor. In other embodiments of the present invention, one suspected portrait block area can also be used as the first area to be analyzed, and the other suspected portrait block area can be used as the second area to be analyzed, and the distance between each pixel point in the first area to be analyzed and each pixel point in the second area to be analyzed can be calculated; two pixel points whose distance is less than a preset distance threshold are marked as connected pixel points; and the total number of all connected pixel points is used as the boundary connection factor. In one embodiment of the present invention, the preset distance threshold is , implementers can set it according to the implementation scenario.

[0092] Step S303: obtaining the regional human degree of the suspected human portrait block area according to the overall distribution characteristics of the human pixel possibility degrees of all pixels in the suspected human portrait block area.

[0093] The regional character degree reflects the detailed elements contained in the suspected portrait block area by comprehensively considering the changes of all pixels in the suspected portrait block area as the preset cutoff distance changes and the degree of fine changes in the block area to which the pixels belong.

[0094] In one embodiment of the present invention, the average of the human pixel likelihood degrees of all pixels in the suspected human portrait block area is calculated to obtain the regional human degree of the suspected human portrait block area.

[0095] Step S304: obtaining a regional person difference factor according to the difference between the regional person degrees of the two suspected portrait block regions.

[0096] Taking into account that as the preset cutoff distance changes, the more similar the degree of detailed changes in the block areas to which the pixel points in the suspected portrait block areas belong, the more likely the two suspected portrait block areas are to belong to the same portrait; the smaller the regional character difference factor, the more similar the detail elements of the two suspected portrait block areas are, and the more likely the two suspected portrait block areas are to belong to the same portrait.

[0097] In one embodiment of the present invention, the absolute value of the difference between the regional character degrees of two suspected human portrait block regions is calculated to obtain the regional character difference factor.

[0098] Step S305: Obtain the same-body recognition degree of the two suspected portrait block areas according to the area difference factor, the boundary connection factor and the regional character difference factor; the boundary connection factor is positively correlated with the same-body recognition degree; the area difference factor and the regional character difference factor are both negatively correlated with the same-body recognition degree.

[0099] The greater the same-body recognition degree is, the more likely the two suspected portrait block areas are to belong to the same portrait.

[0100] In one embodiment of the present invention, the product of the area difference factor and the regional person difference factor is calculated, the ratio of the boundary connection factor and the product is calculated, and the comparison value is normalized to obtain the same-body recognition degree of the two suspected portrait block areas. In other embodiments of the present invention, the sum of the area difference factor and the regional person difference factor is calculated, the ratio of the boundary connection factor and the sum is calculated, and the comparison value is normalized to obtain the same-body recognition degree of the two suspected portrait block areas. In one embodiment of the present invention, the normalization method used is: normalization is performed using a linear normalization method, and the value range is limited to between 0 and 1.

[0101] Preferably, in one embodiment of the present invention, in order to merge the suspected portrait local regions to obtain the suspected whole portrait region, the method for obtaining the suspected whole portrait region includes:

[0102] Based on the region merging algorithm, in the target segmented image, the degree to which the two suspected portrait block regions can be merged into one overall region is reflected by the same-body recognition of the two suspected portrait block regions, and the same-body recognition of each two suspected portrait block regions is greater than the preset merging threshold, which is used as the merging condition of each two suspected portrait block regions; for all suspected portrait block regions that meet the merging conditions, a merging operation is performed to merge them into one overall region, and each overall region in the target segmented image is obtained, and each overall region is used as a suspected overall portrait region. It should be noted that the region merging algorithm is a prior art well known to those skilled in the art and will not be described in detail here.

[0103] Step S4: obtaining distribution feature points of each suspected overall portrait region; and screening out a true overall portrait region from the suspected overall portrait region according to the spatial distribution characteristics of the distribution feature points in each suspected overall portrait region.

[0104] Considering that the portrait in the garage image has a torso and limbs, the outline of the portrait area is relatively irregular and not smooth, while the background area is mainly composed of walls and cars, and the outline of the background area is relatively regular and smooth. In order to analyze the outline shape of the suspected overall portrait area, the distribution feature points with obvious characteristics are first analyzed; the more regular and smooth the outline formed by the distribution feature points, the more likely the suspected overall portrait area is to be the real overall portrait area, and then the real overall portrait area is screened out from the suspected overall portrait area.

[0105] In order to analyze the contour features of the suspected overall portrait area, it is necessary to analyze the points with obvious features in the suspected overall portrait area. The method for obtaining the distribution feature points includes:

[0106] The convex hull detection method is used to obtain the convex hull of the suspected overall portrait area; the convex hull of the suspected overall portrait area is detected using the inflection point detection method to obtain the distribution feature points of the suspected overall portrait area. The distribution feature points can reflect the points with higher features on the contour of the suspected overall portrait area, and the distribution feature points are the inflection points on the convex hull of the suspected overall portrait area. It should be noted that the convex hull detection method and the inflection point detection method are prior arts well known to those skilled in the art and will not be described in detail here.

[0107] To analyze whether the suspected whole-body portrait area is a real whole-body portrait, please refer to Figure 5 , which shows a flow chart of a method for obtaining a real overall portrait area in one embodiment of the present invention. Preferably, in one embodiment of the present invention, the method for obtaining a real overall portrait area includes:

[0108] Step S401: obtaining the overall portrait region possibility of each suspected overall portrait region according to the irregular distribution characteristics of the feature points distributed on the convex hull of each suspected overall portrait region.

[0109] Considering that the outline of the portrait area is more irregular and less smooth than that of the background area, the overall portrait area possibility of the suspected overall portrait area is obtained. The larger the value of the overall portrait area possibility is, the more irregular and less smooth the outline of the suspected overall portrait area is, and the more likely it is to be a real portrait.

[0110] In one embodiment of the present invention, a method for obtaining the likelihood of the entire portrait region includes:

[0111] Taking any distribution feature point as the starting point, sort all distribution feature points along the derivative direction of the convex hull, and connect each distribution feature point with the next distribution feature point as the distribution feature line segment of each distribution feature point;

[0112] The line segment formed by the two distribution feature points with the largest interval is taken as the main line segment; considering that the main body of a person is often long, the main line segment can reflect the main body of a person;

[0113] The Euclidean distance from each distribution feature point to the main line segment is used as the deviation distance of the distribution feature point; the deviation distance can reflect the degree to which the distribution feature point deviates from the main line;

[0114] The angle formed by each distribution feature line segment and the main line segment is used as the deviation angle of the distribution feature line segment; the deviation angle can reflect the deviation angle between the contour edge and the main edge;

[0115] According to the differences of all deviation distances, the length difference factor is obtained; the larger the length difference factor, the more different the degree of deviation of the contour from the main trunk, and the more irregular the contour;

[0116] According to the differences of all deviation angles, the directional difference factor is obtained; the larger the directional difference factor, the more different the angle of the contour deviates from the main trunk, and the less smooth the contour;

[0117] The overall portrait region possibility of the suspected overall portrait region is obtained based on the length difference factor and the direction difference factor; the length difference factor, the direction difference factor and the overall portrait region possibility are positively correlated. The larger the overall portrait region possibility value, the more irregular and less smooth the outline of the suspected overall portrait region is, and the more likely it is to be a real portrait.

[0118] Specifically for the above steps: take any distribution feature point as the starting point, sort all distribution feature points along the clockwise direction derived from the convex hull, connect each distribution feature point and the next distribution feature point as the distribution feature line segment of each distribution feature point; the line segment formed by the two distribution feature points with the largest interval distance is used as the main line segment; the Euclidean distance from each distribution feature point to the main line segment is used as the deviation distance of the distribution feature point; the angle formed by each distribution feature line segment and the main line segment is used as the deviation angle of the distribution feature line segment; calculate the cumulative sum of the absolute values ​​of all deviation distance difference values ​​to obtain the length difference factor; calculate the cumulative sum of the absolute values ​​of all deviation angle difference values ​​to obtain the direction difference factor; calculate the product of the length difference factor and the direction difference factor, normalize the product, and obtain the possibility of the overall portrait area of ​​the suspected overall portrait area. In other embodiments of the present invention, the method for obtaining the true overall portrait area includes: taking any distribution feature point as the starting point, sorting all distribution feature points in the clockwise direction derived from the convex hull, connecting each distribution feature point and the next distribution feature point as the distribution feature line segment of each distribution feature point; taking the line segment formed by the two distribution feature points with the largest interval distance as the main line segment; taking the distance from each distribution feature point to the main line segment as the deviation distance of the distribution feature point; taking the angle formed by each distribution feature line segment and the main line segment as the deviation angle of the distribution feature line segment; calculating the variance of all deviation distances to obtain the length difference factor; calculating the variance of all deviation angles to obtain the direction difference factor; calculating the sum of the length difference factor and the direction difference factor, normalizing the sum, and obtaining the overall portrait area possibility of the suspected overall portrait area. In one embodiment of the present invention, the normalization method is: using the norm normalization function for normalization, and limiting the value range to between 0 and 1.

[0119] Step S402: taking the suspected whole-portrait region whose whole-portrait region likelihood is greater than a preset whole-portrait threshold as a true whole-portrait region.

[0120] In one embodiment of the present invention, the preset overall portrait threshold is 0.45, and the implementer can set it according to the implementation scenario.

[0121] At this point, the real overall portrait area is obtained.

[0122] Specifically, in order to display the real overall portrait area on the visualization device, the final determined real overall portrait area is marked by masking operation, the portrait area is marked in red, and other areas are marked in black. For the determined real overall portrait area, its minimum circumscribed rectangle is drawn as the display bounding box of the current portrait area, the bounding box is assigned red, and all the real overall portrait areas are traversed to obtain the marked image. The marked image is displayed on the visualization device of the security personnel through a visualization display device, etc., to facilitate the security personnel to conduct security investigations.

[0123] In summary, the embodiment of the present invention provides an image segmentation method based on a density clustering algorithm. First, in the target segmented image, according to the human pixel probability of all pixels in the block area, the suspected portrait block area is screened out from the block area; according to the difference between the human pixel probability of pixels in each two suspected portrait block areas and the spatial distribution proximity of each two suspected portrait block areas, the same-body recognition of each two suspected portrait block areas is obtained; according to the spatial distribution characteristics of the distributed feature points in each suspected overall portrait area, the real overall portrait area is screened out from the suspected overall portrait area. In the embodiment of the present invention, the difference between the portrait area and the background area is deeply explored to more accurately segment the overall portrait area.

[0124] The present invention also proposes an image segmentation system based on density clustering algorithm, please refer to Figure 2 , which shows a structural diagram of an image segmentation system based on a density clustering algorithm provided by an embodiment of the present invention, the system includes: an image acquisition module 101, a suspected portrait block area screening module 102, a suspected overall portrait area acquisition module 103 and a real overall portrait area screening module 104.

[0125] The image acquisition module 101 is used to cluster the images to be segmented using each preset truncation distance, and acquire the segmented images corresponding to each preset truncation distance; the segmented images include each block area.

[0126] The suspected portrait block area screening module 102 is used to obtain the possibility of a pixel being a human pixel based on the differences in the block areas to which the pixel points belong at different preset cutoff distances; determine a target segmented image from all segmented images; and in the target segmented image, screen out the suspected portrait block areas from the block areas based on the possibility of the human pixels of all the pixels in the block areas.

[0127] The suspected whole portrait area acquisition module 103 is used to obtain the same-body recognition of each two suspected portrait block areas based on the difference between the human pixel probability degrees of the pixel points in each two suspected portrait block areas and the proximity of the spatial distribution of each two suspected portrait block areas; based on the same-body recognition of each two suspected portrait block areas in the target segmented image, the suspected portrait block areas are merged to obtain each suspected whole portrait area.

[0128] The real whole portrait region screening module 104 is used to obtain the distribution feature points of each suspected whole portrait region; and screen out the real whole portrait region from the suspected whole portrait region according to the spatial distribution characteristics of the distribution feature points in each suspected whole portrait region.

[0129] It should be noted that: the system provided in the above embodiment is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the image segmentation system based on the density clustering algorithm provided in the above embodiment and the image segmentation method embodiment based on the density clustering algorithm belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0130] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0131] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

Claims

1. An image segmentation method based on density clustering algorithm, characterized in that: The method comprises: Clustering the images to be segmented using the preset cutoff distances respectively, and obtaining segmented images corresponding to the preset cutoff distances; the segmented images include the respective block regions; According to the difference of the block areas to which the pixel points belong at different preset cutoff distances, the possibility of the pixel points being human pixels is obtained; a target segmented image is determined from all the segmented images; in the target segmented image, according to the possibility of the pixel points being human pixels in the segmented areas, a suspected human portrait segmented area is screened out from the segmented areas; According to the difference between the possible degrees of the human pixels of the pixel points in each two of the suspected portrait block areas and the proximity of the spatial distribution of each two of the suspected portrait block areas, the same-body recognition degree of each two of the suspected portrait block areas is obtained; according to the same-body recognition degree of each two of the suspected portrait block areas in the target segmented image, the suspected portrait block areas are merged to obtain each suspected whole portrait area; Obtaining distribution feature points of each suspected overall portrait region; and screening out a true overall portrait region from the suspected overall portrait region according to spatial distribution characteristics of the distribution feature points in each of the suspected overall portrait regions; The method for obtaining the character pixel probability comprises: According to the area difference of the block area to which the pixel point belongs at different preset cutoff distances, an area difference factor is obtained; Obtaining an edge distinguishing factor according to differences in edge smoothing features of the block area to which the pixel point belongs at different preset cutoff distances; According to the area distinction factor and the edge distinction factor, the character pixel possibility of the pixel point is obtained; the area distinction factor and the edge distinction factor are both positively correlated with the character pixel possibility; The method for obtaining the same-body recognition degree includes: According to the area difference of the two suspected portrait block regions, an area difference factor is obtained; According to the boundary connection condition of two suspected portrait block areas, a boundary connection factor is obtained; According to the overall distribution characteristics of the human pixel possibility degree of all pixels in the suspected human portrait block area, the regional human degree of the suspected human portrait block area is obtained; Obtaining a regional character difference factor according to a difference between the regional character degrees of two suspected human portrait block regions; According to the area difference factor, the boundary connection factor and the regional character difference factor, the same-body recognition degree of two suspected portrait block areas is obtained; the boundary connection factor is positively correlated with the same-body recognition degree; the area difference factor and the regional character difference factor are both negatively correlated with the same-body recognition degree.

2. The image segmentation method based on density clustering algorithm according to claim 1, characterized in that: The method for obtaining the area distinction factor includes: According to the preset truncation distance from small to large, the areas of all the block regions to which the pixel points at the same position belong are sorted in turn, and the accumulated value of the absolute values ​​of the differential values ​​corresponding to all the areas is calculated to obtain the area distinction factor.

3. The image segmentation method based on density clustering algorithm according to claim 1, characterized in that: The method for obtaining the edge distinguishing factor includes: Perform edge detection on the block area to obtain the edge of the block area; perform curve fitting on the edge of the block area to obtain the fitted edge of the block area; calculate the mean square error between the edge of the block area and the fitted edge, perform negative correlation mapping on the mean square error, and obtain the edge smoothing feature parameters of the block area; According to the preset truncation distance, the edge smoothing feature parameters of all the block areas to which the pixel point at the same position belongs are sorted in sequence, and the accumulated value of the absolute values ​​of the differential values ​​corresponding to all the edge smoothing feature parameters is calculated to obtain the edge distinguishing factor.

4. The image segmentation method based on density clustering algorithm according to claim 1, characterized in that: The method for acquiring the target segmented image comprises: The segmented image corresponding to the minimum preset truncation distance is used as the target segmented image.

5. The image segmentation method based on density clustering algorithm according to claim 1, characterized in that: The method for obtaining the boundary contact factor includes: In two suspected portrait block areas, the pixel points on the edge of the suspected portrait block area are used as the edge pixel points of the suspected portrait block area; any one of the suspected portrait block areas is used as the first area to be analyzed, and the other suspected portrait block area is used as the second area to be analyzed; the 8-neighborhood of all edge pixels in the first area to be analyzed is used as the connection range; each edge pixel point in the second area to be analyzed that is within the connection range is used as each connected pixel point; and the total number of all connected pixel points is used as the boundary connection factor.

6. The image segmentation method based on density clustering algorithm according to claim 1, characterized in that: The method for acquiring the distribution feature points comprises: The convex hull detection method is used to obtain the convex hull of the suspected overall portrait area; the inflection point detection method is used to detect the convex hull of the suspected overall portrait area to obtain the distribution feature points of the suspected overall portrait area.

7. The image segmentation method based on density clustering algorithm according to claim 6, characterized in that: The method for obtaining the real overall portrait area includes: Obtaining the overall portrait region possibility of the suspected overall portrait region according to the irregular distribution characteristics of the feature points distributed on the convex hull of each of the suspected overall portrait regions; The suspected whole portrait region whose whole portrait region possibility is greater than the preset whole portrait threshold is taken as the real whole portrait region.

8. The image segmentation method based on density clustering algorithm according to claim 7, characterized in that: The method for obtaining the possibility of the overall portrait area includes: Taking any distribution feature point as the starting point, sort all distribution feature points along the derivative direction of the convex hull, and connect each distribution feature point with the next distribution feature point as the distribution feature line segment of each distribution feature point; The line segment formed by the two distribution feature points with the largest interval distance is taken as the main line segment; The Euclidean distance from each distribution feature point to the main line segment is used as the deviation distance of the distribution feature point; The angle formed by each distribution characteristic line segment and the main line segment is used as the deviation angle of the distribution characteristic line segment; According to the differences of all deviation distances, the length difference factor is obtained; According to the differences of all deviation angles, the direction difference factor is obtained; The overall portrait region possibility of the suspected overall portrait region is obtained according to the length difference factor and the direction difference factor; the length difference factor, the direction difference factor and the overall portrait region possibility are positively correlated.

Citation Information

Patent Citations

  • Method and system based on portrait segmentation precision improvement, and storage medium

    CN113065534A

  • Automatic image segmentation method based on superpixels and improved fuzzy C-means clustering

    CN115131566A

  • Stem cell region rapid segmentation method based on artificial intelligence

    CN116645384A

  • PET high-temperature flame-retardant adhesive tape flaw extraction method and system based on image segmentation

    CN117237646A