Image segmentation method and device based on fuzzy clustering, and electronic equipment

Through the image segmentation method based on fuzzy clustering, and using multi-dimensional histogram and distance adjustment technology, the problem of difficult to take into account both the image segmentation speed and accuracy in the prior art is solved, and a more efficient and accurate image segmentation effect is achieved.

CN120125602AActive Publication Date: 2025-06-10XIAN JIAOTONG ENG COLLEGE +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510594311.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-06-10
Estimated Expiration
2045-05-09

AI Technical Summary

Technical Problem

The prior art is difficult to take into account both speed and accuracy in image segmentation, especially in complex image processing scenarios.

Method used

Using an image segmentation method based on fuzzy clustering, a multi-dimensional histogram is constructed by acquiring a sub-image of the target image, performing initial clustering processing, and adjusting the cluster clusters according to the difference or ratio of the first distance and the second distance to obtain the final segmentation result.

Benefits of technology

It improves the accuracy and robustness of image segmentation, enhances the processing ability of noise and field values, and achieves both segmentation speed and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120125602A_ABST
    Figure CN120125602A_ABST
Patent Text Reader

Abstract

The invention discloses an image segmentation method and device based on fuzzy clustering, and electronic equipment, and relates to the technical field of image processing, and the method comprises the steps: firstly obtaining a target image and a use scene, carrying out the attribute separation of the target image, and obtaining a plurality of sub-images; constructing a multivariate array according to the pixel information of each sub-image at the same pixel point, constructing a multi-dimensional histogram by taking each piece of pixel information in the multivariate array and the number of the multivariate arrays in the target image as dimensions, and performing initial clustering processing on the pixel points in the target image to obtain a plurality of clusters; determining a first distance between the pixel point in the same cluster and the cluster center and a second distance between the cluster centers of different clusters; determining an objective function according to a difference value and / or a ratio of the first distance and the second distance, and adjusting pixel points in the clustering cluster by minimizing the objective function to obtain a segmentation result; according to the method, the robustness of noise and outliers in the image segmentation process can be improved, and then the segmentation precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular, to an image segmentation method and apparatus based on fuzzy clustering, and an electronic device. Background Art

[0002] Image segmentation refers to the process of dividing an image into several homogeneous regions based on feature information such as brightness, color, and texture in the image, and the feature information within the homogeneous regions is consistent.

[0003] For example, Chinese Patent with application number 202311818218.3 discloses an image segmentation method based on adaptive feature perception, including: obtaining a feature vector and its initial weight corresponding to each pixel point in the image to be segmented, determining each initial clustering center, and obtaining an initial clustering cluster corresponding to each initial clustering center; according to the silhouette coefficient of each pixel point in the determined initial clustering cluster, determining whether to update the clustering center, and if it is necessary to update the clustering center, adaptively weighted-updating the initial weight of the feature vector to obtain a first weight, and determining each first clustering center; determining the clustering cluster for the next iteration based on the first weight and the first clustering center, and so on, iteratively executing the clustering cluster obtaining and evaluating process until the obtained clustering result meets the preset clustering requirements, and taking the clustering result at this time as the segmentation result of the image to be segmented; the invention improves the accuracy of image segmentation by adaptively optimizing the clustering process.

[0004] Although image segmentation technologies similar to the above technologies have improved the accuracy of image segmentation to a certain extent, due to the complex characteristics of image segmentation, it is still difficult to achieve both speed and accuracy. Therefore, how to effectively segment an image has become an urgent problem to be solved at present. Summary of the Invention

[0005] This specification proposes an image segmentation technical solution.

[0006] According to one aspect of this specification, there is provided an image segmentation method based on fuzzy clustering, including: Obtaining a target image and the usage scenario of the target image, and using a sub-image acquisition method matching the usage scenario to perform attribute separation processing on the target image to obtain a plurality of sub-images, where the sub-images have the same size as the target image; Constructing a multi-dimensional array according to the pixel information of each sub-image at the same pixel point, and constructing a multi-dimensional histogram with each pixel information in the multi-dimensional array and the number of multi-dimensional arrays in the target image as dimensions; Based on the multi-dimensional histogram, perform initial clustering processing on the pixel points in the target image to obtain multiple clustering clusters, and determine the first distance between the pixel points in the same clustering cluster and the clustering center and the second distance between the clustering centers of different clustering clusters; Determine an objective function based on the difference and / or ratio of the first distance and the second distance, and adjust the pixel points included in the clustering cluster by minimizing the objective function, so as to obtain a segmentation result of the target image according to the adjusted clustering cluster.

[0007] In a possible implementation manner, the constructing a multi-dimensional array according to the pixel information of each sub-image at the same pixel point includes: Select a target sub-image to be dilated from the sub-images, and construct a one-dimensional histogram with the pixel information of the pixels in the target sub-image as the abscissa and the number of pixels included in each pixel information as the ordinate; In the target sub-image, perform dilation processing on the target pixels corresponding to the valleys in the one-dimensional histogram to obtain a dilated sub-image, where the dilation processing is used to make the pixels adjacent to the target pixels have the same pixel information as the target pixels; Construct the multi-dimensional array according to the dilated sub-image and the pixel information of the sub-images at the same pixel point.

[0008] In a possible implementation manner, the performing dilation processing on the target pixels corresponding to the valleys in the one-dimensional histogram in the target sub-image to obtain a dilated sub-image includes: In the target sub-image, determine the dilated pixels corresponding to the target pixels with the target pixels as the center and a preset distance as the radius; Use the pixel information of the target pixels corresponding to the dilated pixels in the target sub-image as the pixel information of the dilated pixels to implement the dilation processing and obtain the dilated sub-image.

[0009] In a possible implementation manner, when the usage scenario is real-time tracking, the performing attribute separation processing on the target image by using a sub-image acquisition method matching the usage scenario to obtain multiple sub-images includes: Perform grayscale processing on the target image to obtain a grayscale image of the target image as the first sub-image; Use a preset smoothing filter to perform filtering processing on the target image to obtain a filtered image of the target image as the second sub-image.

[0010] In a possible implementation, when the usage scenario is multi-illumination, using the sub-image acquisition method matching the usage scenario to perform attribute separation processing on the target image to obtain multiple sub-images, including: Convert the target image from the RGB color space to the HSV color space to obtain an HSV image; Perform channel separation processing on the HSV image to obtain an H-channel image, an S-channel image, and a V-channel image, which are used as the first sub-image, the second sub-image, and the third sub-image respectively.

[0011] In a possible implementation, constructing a multi-dimensional array based on the pixel information of each sub-image at the same pixel point, and constructing a multi-dimensional histogram with the pixel information in the multi-dimensional array and the number of multi-dimensional arrays in the target image as dimensions, including: Construct a first multi-dimensional array based on the pixel information of the H-channel image and the S-channel image at the same pixel point, and construct a first multi-dimensional histogram with the pixel information in the first multi-dimensional array and the number of multi-dimensional arrays in the target image as dimensions; Construct a second multi-dimensional array based on the pixel information of the H-channel image and the V-channel image at the same pixel point, and construct a second multi-dimensional histogram with the pixel information in the second multi-dimensional array and the number of multi-dimensional arrays in the target image as dimensions; Performing initial clustering processing on the pixel points in the target image according to the multi-dimensional histogram to obtain multiple clustering clusters, including: Performing initial clustering processing on the pixel points in the target image according to the first multi-dimensional histogram to obtain multiple first clustering clusters; Performing initial clustering processing on the pixel points in the target image according to the second multi-dimensional histogram to obtain multiple second clustering clusters; Fusing the first clustering cluster with the second clustering cluster corresponding to the first clustering cluster to obtain the clustering cluster.

[0012] In a possible implementation, determining a first distance between a pixel point in the same clustering cluster and a clustering center and a second distance between clustering centers of different clustering clusters, including: Using a preset kernel function to perform feature transformation on the image information corresponding to the pixel points in the clustering cluster to obtain transformed information; Determining the first distance according to the transformed information corresponding to the pixel points and the clustering center in the same clustering cluster; Determining the second distance according to the transformed information corresponding to the clustering centers of different clustering clusters.

[0013] According to one aspect of the present specification, there is provided an image segmentation device based on fuzzy clustering, including: A sub-image module, configured to obtain a target image and the usage scenario of the target image, and perform attribute separation processing on the target image by using a sub-image acquisition method matching the usage scenario to obtain a plurality of sub-images, where the sub-images have the same size as the target image; A histogram module, configured to construct a multi-dimensional array according to the pixel information of each sub-image at the same pixel point, and construct a multi-dimensional histogram with each pixel information in the multi-dimensional array and the number of multi-dimensional arrays in the target image as dimensions; An initial clustering module, configured to perform initial clustering processing on the pixel points in the target image according to the multi-dimensional histogram to obtain a plurality of clustering clusters, and determine a first distance between the pixel points in the same clustering cluster and the clustering center and a second distance between the clustering centers of different clustering clusters; A segmentation module, configured to determine an objective function according to the difference and / or ratio of the first distance and the second distance, and adjust the pixel points included in the clustering cluster by minimizing the objective function to obtain a segmentation result of the target image according to the adjusted clustering cluster.

[0014] In a possible implementation manner, the histogram module includes: A one-dimensional histogram unit, configured to select a target sub-image to be subjected to dilation processing from the sub-images, and construct a one-dimensional histogram with the pixel information of the pixels in the target sub-image as the abscissa and the number of pixels included in each pixel information as the ordinate; A dilation processing unit, configured to perform dilation processing on the target pixels corresponding to the valleys in the one-dimensional histogram in the target sub-image to obtain a dilated sub-image, where the dilation processing is used to make the pixels adjacent to the target pixels have the same pixel information as the target pixels; A multi-dimensional array unit, configured to construct the multi-dimensional array according to the dilated sub-image and the pixel information of the sub-images at the same pixel point.

[0015] In a possible implementation manner, performing dilation processing on the target pixels corresponding to the valleys in the one-dimensional histogram in the target sub-image to obtain a dilated sub-image includes: In the target sub-image, taking the target pixel as the center and a preset distance as the radius, determining the dilated pixels corresponding to the target pixel; Taking the pixel information of the target pixels corresponding to the dilated pixels in the target sub-image as the pixel information of the dilated pixels to implement the dilation processing to obtain the dilated sub-image.

[0016] In a possible implementation, when the usage scenario is real-time tracking, the sub-image module includes: A first sub-image unit, configured to perform grayscale processing on the target image to obtain a grayscale image of the target image as the first sub-image; A second sub-image unit, configured to perform filtering processing on the target image using a preset smoothing filter to obtain a filtered image of the target image as the second sub-image.

[0017] In a possible implementation, when the usage scenario is multi-illumination, the sub-image module includes: An HSV image unit, configured to convert the target image from the RGB space to the HSV space to obtain an HSV image; An HSV channel separation unit, configured to perform channel separation processing on the HSV image to obtain an H-channel image, an S-channel image, and a V-channel image, which are used as the first sub-image, the second sub-image, and the third sub-image respectively.

[0018] In a possible implementation, the histogram module includes: A first histogram unit, configured to construct a first multi-dimensional array according to the pixel information of the H-channel image and the S-channel image at the same pixel point, and construct a first multi-dimensional histogram with the pixel information in the first multi-dimensional array and the number of multi-dimensional arrays in the target image as dimensions; A second histogram unit, configured to construct a second multi-dimensional array according to the pixel information of the H-channel image and the V-channel image at the same pixel point, and construct a second multi-dimensional histogram with the pixel information in the second multi-dimensional array and the number of multi-dimensional arrays in the target image as dimensions; The initial clustering module includes: A first clustering cluster unit, configured to perform initial clustering processing on the pixel points in the target image according to the first multi-dimensional histogram to obtain a plurality of first clustering clusters; A second clustering cluster unit, configured to perform initial clustering processing on the pixel points in the target image according to the second multi-dimensional histogram to obtain a plurality of second clustering clusters; A clustering cluster unit, configured to fuse the first clustering cluster with the second clustering cluster corresponding to the first clustering cluster to obtain the clustering cluster.

[0019] In a possible implementation, the initial clustering module includes: A sum function unit, configured to perform feature transformation on the image information corresponding to the pixel points in the clustering cluster using a preset kernel function to obtain transformation information; A first change unit, configured to determine the first distance according to the transformation information corresponding to the pixel points and the cluster center in the same cluster. A second change unit, configured to determine the second distance according to the transformation information corresponding to the cluster centers of different clusters.

[0020] According to one aspect of the present specification, there is provided an electronic device, including: A processor; a memory for storing instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory to execute the above image segmentation method.

[0021] According to one aspect of the present specification, there is also provided a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above image segmentation method is implemented.

[0022] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit this specification.

[0023] According to the following detailed description of exemplary embodiments with reference to the accompanying drawings, other features and aspects of this specification will become clear.

[0024] Beneficial effects: By introducing a kernel function that restricts operations to a smaller local area of the image during the clustering process, the present invention can achieve local operations on the target image, provide multi-level and multi-faceted information support, improve the robustness of the segmentation process to noise and outliers, and thus help accurately identify the boundary and texture information of the target image and improve the segmentation accuracy. Description of the Drawings

[0025] The accompanying drawings herein are incorporated into the specification and form a part of this specification. These drawings illustrate embodiments consistent with this specification and, together with the specification, are used to explain the technical solutions of this specification.

[0026] Figure 1 A flowchart showing an image segmentation method according to an embodiment of this specification.

[0027] Figure 2 A block diagram showing an image segmentation device according to an embodiment of this specification.

[0028] Figure 3 A block diagram showing an electronic device according to an embodiment of this specification.

[0029] Figure 4 A block diagram showing another electronic device according to an embodiment of this specification. Detailed Embodiments

[0030] Various exemplary embodiments, features, and aspects of the present specification will be described in detail below with reference to the accompanying drawings. The same reference numerals in the drawings denote elements having the same or similar functions. Although various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0031] As used herein, the term "exemplary" means "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as superior or better than other embodiments.

[0032] As used herein, the term "and / or" is merely a description of an association relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" as used herein means any one of a plurality or any combination of at least two of a plurality. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set composed of A, B, and C.

[0033] In addition, to better illustrate the present specification, numerous specific details are given in the following specific embodiments. Those skilled in the art should understand that the present specification can also be implemented without certain specific details. In some instances, methods, means, elements, and circuits well-known to those skilled in the art are not described in detail to highlight the gist of the present specification.

[0034] Figure 1 A flowchart showing an image segmentation method according to an embodiment of the present specification. The method can be applied to an image segmentation device, and the image segmentation device can be a terminal device, a server, or other processing devices, etc. Among them, the terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc.

[0035] In some possible implementation manners, the image segmentation method can be implemented by a processor calling computer-readable instructions stored in a memory.

[0036] As Figure 1 shown, the image segmentation method based on fuzzy clustering can include: Step S11, obtaining a target image and the usage scenario of the target image, and using a sub-image acquisition method matching the usage scenario to perform attribute separation processing on the target image to obtain a plurality of sub-images.

[0037] Among them, the target image is the image to be segmented. The target image can be the image collected by the image acquisition device of an autonomous vehicle, the image collected by a face recognition device, or the image collected by a medical device. In this specification, the source of the target image is not specifically limited and can be determined according to the actual situation.

[0038] For target images from different sources, their usage scenarios may also be different. For example, for a target image sourced from an autonomous vehicle's collection, its usage scenario can be real-time tracking; for a target image sourced from a face recognition device's collection, its usage scenario can be face recognition; for a target image sourced from a medical device's collection, its usage scenario can be organ or tissue recognition. Further, for target images from the same source, their usage scenarios can be further refined. For example, for a target image sourced from a medical device's collection, its usage scenario can be divided into a color-dominated scenario, a multi-light source scenario, etc. In this specification, the usage scenario of the target image is not specifically limited and can be determined according to the actual situation.

[0039] The sub-image is an image obtained by separating the attributes of the target image. Different usage scenarios correspond to different sub-image acquisition methods, and the resulting sub-images are also different. For example, for a color-dominated scenario, the target image can be subjected to the sub-image acquisition method of RGB channel attribute separation to obtain the R-channel image, G-channel image, and / or B-channel image as the sub-image; for a texture-dominated scenario, the target image can be subjected to the sub-image acquisition method of texture attribute separation to obtain the texture image as the sub-image. For the convenience of subsequent image segmentation, each sub-image can have the same size as the target image.

[0040] In one example, the usage scenario of the target image can be determined by combining the source of the target image and the content of the target image, etc. After determining the usage scenario, the sub-image acquisition method can be determined in combination with the usage scenario, and then the target image can be subjected to attribute separation processing using this sub-image acquisition method to obtain the sub-image.

[0041] Step S12: Construct a multi-dimensional array based on the pixel information of each sub-image at the same pixel point, and construct a multi-dimensional histogram with the pixel information in each multi-dimensional array and the number of multi-dimensional arrays in the target image as dimensions.

[0042] Among them, the multi-dimensional histogram is a histogram constructed based on the pixel information of each pixel point in the target image. The pixel information contained in each pixel point in the sub-image can be a grayscale value, a brightness value, etc.

[0043] A multi - element array is an array that integrates the pixel information corresponding to each sub - image separated from the target image. Specifically, one pixel point corresponds to one multi - element array. The number of elements in this multi - element array can be the same as the number of sub - images separated from the target image. The elements in the multi - element array are the pixel information of the same pixel point in each sub - image.

[0044] In one example, a multi - dimensional histogram can be constructed based on the multi - element array. In the curve corresponding to this multi - dimensional histogram, one of the coordinate axes can represent the number of the same multi - element arrays in the sub - images, and the remaining coordinate axes represent each element in the multi - element array. That is, the dimension N of the multi - dimensional histogram curve is the number of sub - images corresponding to the target image or the number of elements in the multi - element array, and N is greater than or equal to 2.

[0045] Since using the multi - dimensional histogram to count the number of occurrences of the multi - element array can avoid the defect of long time consumption when calculating the repeated values of the multi - element array, this enables the clustering algorithm based on the multi - dimensional histogram in the subsequent steps S13 - S14 to greatly improve the segmentation speed of the target image.

[0046] During the process of adding noise to the target image, it can be found that the one - dimensional histogram of the target image after adding noise has only one peak, that is, the object and the background are in a single - peak state. At this time, it may be impossible to extract the target from the target image using traditional image thresholding or clustering segmentation methods. However, the multi - dimensional histogram of the target image after adding noise significantly shows a multi - peak distribution. Therefore, using the multi - dimensional histogram algorithm in step S12 can effectively extract the image target and improve its anti - noise ability in segmentation.

[0047] Step S13: According to the multi - dimensional histogram, perform initial clustering processing on the pixel points in the target image to obtain multiple clustering clusters, and determine the first distance between the pixel points in the same clustering cluster and the clustering center and the second distance between the clustering centers of different clustering clusters.

[0048] Step S14: According to the difference and / or ratio of the first distance and the second distance, determine the objective function, and by minimizing the objective function, adjust the pixel points included in the clustering cluster to obtain the segmentation result of the target image based on the adjusted clustering cluster.

[0049] Among them, the first distance is the distance between the pixel points in the same clustering cluster and the clustering center, which reflects the within - class compactness. The second distance is the distance between the clustering centers of different clustering clusters, which reflects the between - class dispersion.

[0050] Specifically, after performing initial clustering processing on the pixel points in the target image based on the multi - dimensional histogram, an objective function can be constructed based on the first distance and the second distance, and then the objective function is used to adjust the pixel points in each clustering cluster to obtain the segmentation result.

[0051] Since the difference or ratio between the first distance and the second distance can combine the within-class compactness and the between-class scatter, in one example, an objective function can be constructed based on the difference or ratio between the first distance and the second distance, so as to adjust the tightness between the pixel points and the clustering centers and the scatter between different clustering clusters through the objective function. When both the tightness and the scatter are relatively good, the clustering cluster to which each pixel point in the target image finally belongs is determined.

[0052] In steps S13 - S14, by using the first distance and the second distance, both the tightness between the pixel points and the clustering centers and the scatter between different clustering clusters are considered, which can improve the accuracy of image segmentation.

[0053] In the embodiments of this specification, first, based on the sub-image acquisition method matching the usage scenario, multiple sub-images are acquired, and a multi-dimensional array corresponding to the sub-images is constructed. Then, based on the multi-dimensional array, initial clustering processing is performed on the pixel points in the target image to determine the first distance and the second distance. Finally, according to the objective function determined by the difference and / or ratio between the first distance and the second distance, the clustering clusters obtained by the initial clustering are adjusted to obtain the segmentation result. This process improves the segmentation speed of the target image through the multi-dimensional histogram, and improves the segmentation accuracy of the target image through the difference and / or ratio between the first distance and the second distance, thereby achieving both the segmentation speed and the accuracy, and improving the robustness of image segmentation.

[0054] In a possible implementation manner, constructing the multi-dimensional array according to the pixel information of each sub-image at the same pixel point includes: Select a target sub-image to be subjected to dilation processing from the sub-images, and construct a one-dimensional histogram with the pixel information of the pixels in the target sub-image as the abscissa and the number of pixels included in each piece of pixel information as the ordinate; In the target sub-image, perform dilation processing on the target pixels corresponding to the troughs in the one-dimensional histogram to obtain a dilated sub-image. The dilation processing is used to make the pixels adjacent to the target pixels have the same pixel information as the target pixels; Construct the multi-dimensional array according to the dilated sub-image and the pixel information of the sub-images at the same pixel point.

[0055] Among them, the target sub-image is the sub-image to be subjected to dilation processing, and the target pixel is the pixel to be subjected to dilation processing in the target sub-image. Generally, a sub-image containing more information can be selected as the target sub-image, and the number of target sub-images can be one or more.

[0056] The threshold method is an intuitive segmentation method based on the histogram. It selects the threshold according to the bottom position of the histogram, and the pixels corresponding to each peak represent a class of pixels in the image. The threshold method is simple and efficient, but it cannot guarantee the continuity of the segmented region.

[0057] Since the trough in the histogram corresponds to the threshold, in one example, dilation processing can be performed based on the pixel points corresponding to the trough in the histogram to improve the continuity of the segmented region. Specifically, the target sub-image to be dilated can be first selected from the target sub-image, a one-dimensional histogram corresponding to the target sub-image is constructed, and then the pixels corresponding to the trough in the one-dimensional histogram are determined as the target pixels, and then dilation processing is performed based on the target pixels.

[0058] In one possible implementation manner, performing dilation processing on the target pixels corresponding to the trough in the one-dimensional histogram in the target sub-image to obtain a dilated sub-image includes: In the target sub-image, with the target pixel as the center and a preset distance as the radius, determine the dilated pixels corresponding to the target pixel; Use the pixel information of the target pixel corresponding to the dilated pixel in the target sub-image as the pixel information of the dilated pixel to implement the dilation processing and obtain the dilated sub-image.

[0059] Among them, the dilated pixel is a pixel whose pixel information is changed based on the target pixel. Specifically, in the target sub-image, a circle can be drawn with the target pixel as the center, and the pixels in the circle except the target pixel are used as the dilated pixels. The radius of the circle can be n pixel sizes. In this specification, the value of n is not specifically limited and can be determined according to the actual situation. In one example, the value of n can be determined based on the resolution of the target image. For example, when the resolution is large, n can be larger, and when the resolution is small, n is smaller.

[0060] After determining the dilated pixels, the pixel information of the target pixel can be used as the pixel information of its corresponding dilated pixel to realize the dilation of the target pixel in the target sub-image and obtain the dilated sub-image.

[0061] Further, the dilated sub-image can be used as a supplement to the sub-image separated from the target image attributes. The dilated sub-image and each sub-image are used together to construct a multi-dimensional array and a multi-dimensional histogram at one time.

[0062] In the embodiments of this specification, first select the target sub-image from the sub-image, then perform dilation processing on the target sub-image to obtain the dilated sub-image, and combine the dilated sub-image and the sub-image to construct a multi-dimensional array. In this process, by constructing the dilated sub-image, the continuity of the segmented region can be improved, thereby making up for the shortcomings of image segmentation based on the histogram and improving the accuracy of image segmentation.

[0063] As described above, the sub-images corresponding to different usage scenarios may be different. In one possible implementation, when the usage scenario is real-time tracking, the target image is subjected to attribute separation processing by using a sub-image acquisition method matching the usage scenario, and a plurality of sub-images are obtained, including: Performing grayscale processing on the target image to obtain a grayscale image of the target image as the first sub-image; Using a preset smoothing filter to perform filtering processing on the target image to obtain a filtered image of the target image as the second sub-image.

[0064] Specifically, since usage scenarios such as autonomous driving for real-time tracking have relatively high requirements for segmentation speed, in one example, two relatively simple attribute separation processes, namely grayscale processing and filtering processing, can be selected to obtain sub-images, simplifying the process of obtaining sub-images and improving the segmentation speed.

[0065] Specifically, the target image can be subjected to grayscale processing, and the obtained grayscale image of the target image is used as the first sub-image. Further, a preset smoothing filter can be used to perform filtering processing on the target image, and the obtained filtered image of the target image is used as the second sub-image. Through the filtering operation, the pixel information of the pixel points in the second sub-image can include the pixel information of adjacent pixels. Among them, the smoothing filter can be a mean filter, a Gaussian filter, etc.

[0066] Considering that compared with the usage scenario of real-time tracking, the usage scenario of multi-lighting has higher requirements for segmentation accuracy. In one possible implementation, when the usage scenario is multi-lighting, the target image is subjected to attribute separation processing by using a sub-image acquisition method matching the usage scenario, and a plurality of sub-images are obtained, including: Converting the target image from the RGB space to the HSV space to obtain an HSV image; Performing channel separation processing on the HSV image to obtain an H-channel image, an S-channel image, and a V-channel image, which are used as the first sub-image, the second sub-image, and the third sub-image respectively.

[0067] Among them, the usage scenario of multi-lighting is a scenario using multiple lights with different intensities and brightness.

[0068] Since the target images corresponding to multi-lighting usage scenarios are prone to noises such as shadows, and the HSV color space is more suitable for image processing with varying lighting conditions compared to the RGB color space, in one example, the target image in the RGB color space can be converted to the HSV color space to obtain an HSV image. By performing channel separation processing on the HSV image, images of the H, S, and V channels can be obtained. Using these images as sub-images, a more reliable image segmentation result can be obtained compared to the RGB color space.

[0069] Among the H-channel image, S-channel image, and V-channel image, the H-channel image is basically not affected by lighting transformation. Therefore, image segmentation can mainly rely on this channel. In one possible implementation, constructing a multi-dimensional array based on the pixel information of each of the sub-images at the same pixel point, and constructing a multi-dimensional histogram with the pixel information in each multi-dimensional array and the number of multi-dimensional arrays in the target image as dimensions, includes: Constructing a first multi-dimensional array based on the pixel information of the H-channel image and the S-channel image at the same pixel point, and constructing a first multi-dimensional histogram with the pixel information in each first multi-dimensional array and the number of multi-dimensional arrays in the target image as dimensions; Constructing a second multi-dimensional array based on the pixel information of the H-channel image and the V-channel image at the same pixel point, and constructing a second multi-dimensional histogram with the pixel information in each second multi-dimensional array and the number of multi-dimensional arrays in the target image as dimensions; Performing initial clustering processing on the pixel points in the target image according to the multi-dimensional histogram to obtain multiple clustering clusters, includes: Performing initial clustering processing on the pixel points in the target image according to the first multi-dimensional histogram to obtain multiple first clustering clusters; Performing initial clustering processing on the pixel points in the target image according to the second multi-dimensional histogram to obtain multiple second clustering clusters; Fusing the first clustering clusters with the corresponding second clustering clusters of the first clustering clusters to obtain the clustering clusters.

[0070] Specifically, the H-channel image can be combined with the S-channel image and the V-channel image respectively to construct a multi-dimensional array, and then construct a multi-dimensional histogram. Among them, the multi-dimensional array constructed based on the H-channel image and the S-channel image is the first multi-dimensional array, and the multi-dimensional histogram constructed based on the H-channel image and the S-channel image is the first multi-dimensional histogram; the multi-dimensional array constructed based on the H-channel image and the V-channel image is the second multi-dimensional array, and the multi-dimensional histogram constructed based on the H-channel image and the V-channel image is the second multi-dimensional histogram. Among the first multi-dimensional array and the second multi-dimensional array, the pixel information corresponding to the dilated sub-image can be included.

[0071] After obtaining two multi-dimensional histograms (the first multi-dimensional histogram and the second multi-dimensional histogram), corresponding clustering results, i.e., multiple clustering clusters, can be obtained respectively based on these two multi-dimensional histograms. Among them, the clustering clusters corresponding to the first multi-dimensional histogram are the first clustering clusters, and the clustering clusters corresponding to the second multi-dimensional histogram are the second clustering clusters. Since the two multi-dimensional histograms use information from different target images, in one example, the corresponding clustering clusters of the two can be fused to obtain the clustering clusters corresponding to the target image. In addition to fusing the first clustering clusters and the second clustering clusters, the first clustering clusters or the second clustering clusters can also be used alone as clustering clusters.

[0072] In the embodiments of this specification, by mapping the target image located in the RGB space to the HSV space and performing the above processing process, the influence of noises such as shadows on the image segmentation result in the scenario of using multiple light sources can be reduced, and the reliability of the image segmentation result in the scenario of using multiple light sources can be improved.

[0073] In one possible implementation manner, the determining of the first distance between the pixel points in the same clustering cluster and the clustering center and the second distance between the clustering centers of different clustering clusters includes: Using a preset kernel function to perform feature transformation on the image information corresponding to the pixel points in the clustering cluster to obtain transformed information; Determining the first distance according to the transformed information corresponding to the pixel points and the clustering center in the same clustering cluster; Determining the second distance according to the transformed information corresponding to the clustering centers of different clustering clusters.

[0074] Among them, the kernel function is a function used for feature transformation. Specifically, the introduction of the kernel function can transform the non-linear problem in the original input space into a linear problem in a high-dimensional space. In this way, since the feature differences between its samples are enlarged, the clustering effect is improved. The definition of the kernel function can be as shown in Formula 1: K(x k ,v i ) = <Φ(x k ),Φ(v i )>; (Formula 1) Among them, <·> represents the inner product, Φ(·) represents the feature transformation corresponding to the kernel function, x k represents the pixel point, vi represents the clustering center, and K(x k ,v i ) represents the kernel function.

[0075] After obtaining the change information of the clustering clusters and the clustering centers based on the sum function, the first distance and the second distance can be determined based on the change information. In this specification, the type of the kernel function is not specifically limited and can be determined according to the actual situation. In one example, the kernel function can be expressed as a Gaussian kernel function.

[0076] In the above process, by introducing a kernel function that restricts the operation to a smaller local area of the image during the clustering process, the local operation of the target image can be realized, providing multi-level and multi-faceted information support, improving the robustness of the segmentation process to noise and outliers, and then helping to accurately identify the boundary and texture information of the target image and improving the segmentation accuracy.

[0077] It should be noted that the image segmentation method in the embodiments of this specification is not limited to being applied in the above two usage scenarios and can be applied to any usage scenario, and this specification does not make any limitations in this regard.

[0078] It can be understood that the above-mentioned method embodiments mentioned in this specification can be combined with each other to form combined embodiments without violating the principle logic. Due to space limitations, this specification will not elaborate further. Those skilled in the art can understand that in the above methods of the specific implementation manner, the specific execution order of each step should be determined according to its function and possible internal logic.

[0079] In addition, this specification also provides an image segmentation device, an electronic device, a computer-readable storage medium, and a program, all of which can be used to implement any one of the image segmentation methods provided in this specification. The corresponding technical solutions and descriptions are referred to the corresponding records in the method part and will not be elaborated further.

[0080] Figure 2 The block diagram of the image segmentation device according to the embodiments of this specification is shown. The image segmentation device can be a terminal device, a server, or other processing devices, etc. Among them, the terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc.

[0081] In some possible implementation manners, the image segmentation device can be implemented by the processor calling the computer-readable instructions stored in the memory.

[0082] As Figure 2 shown, the image segmentation device 20 may include: A sub-image module 21, configured to obtain a target image and the usage scenario of the target image, and perform attribute separation processing on the target image by using a sub-image acquisition method matching the usage scenario to obtain a plurality of sub-images, where the sub-images have the same size as the target image; A histogram module 22, configured to construct a multi-dimensional array according to the pixel information of each sub-image at the same pixel point, and construct a multi-dimensional histogram with the pixel information in each multi-dimensional array and the number of multi-dimensional arrays in the target image as dimensions; An initial clustering module 23, configured to perform initial clustering processing on the pixel points in the target image according to the multi-dimensional histogram to obtain a plurality of clustering clusters, and determine a first distance between the pixel points in the same clustering cluster and the clustering center and a second distance between the clustering centers of different clustering clusters; A segmentation module 24, configured to determine an objective function according to the difference and / or ratio between the first distance and the second distance, and adjust the pixel points included in the clustering cluster by minimizing the objective function, so as to obtain a segmentation result of the target image according to the adjusted clustering cluster.

[0083] In a possible implementation manner, the histogram module 22 includes: A one-dimensional histogram unit, configured to select a target sub-image to be subjected to dilation processing from the sub-images, and construct a one-dimensional histogram with the pixel information of the pixels in the target sub-image as the abscissa and the number of pixels included in each pixel information as the ordinate; A dilation processing unit, configured to perform dilation processing on the target pixels corresponding to the valleys in the one-dimensional histogram in the target sub-image to obtain a dilated sub-image, where the dilation processing is used to make the pixels adjacent to the target pixels have the same pixel information as the target pixels; A multi-dimensional array unit, configured to construct the multi-dimensional array according to the dilated sub-image and the pixel information of the sub-images at the same pixel point.

[0084] In a possible implementation manner, the step of performing dilation processing on the target pixels corresponding to the valleys in the one-dimensional histogram in the target sub-image to obtain a dilated sub-image includes: In the target sub-image, determine the dilated pixels corresponding to the target pixels with the target pixels as the center and a preset distance as the radius; Use the pixel information of the target pixels corresponding to the dilated pixels in the target sub-image as the pixel information of the dilated pixels to implement the dilation processing and obtain the dilated sub-image.

[0085] In a possible implementation manner, when the usage scenario is real-time tracking, the sub-image module 21 includes: The first sub-image unit is configured to grayscale the target image to obtain a grayscale image of the target image as the first sub-image. The second sub-image unit is configured to filter the target image using a preset smoothing filter to obtain a filtered image of the target image as the second sub-image.

[0086] In a possible implementation, when the usage scenario is multi-illumination, the sub-image module 21 includes: The HSV image unit is configured to convert the target image from the RGB space to the HSV space to obtain an HSV image. The HSV channel separation unit is configured to perform channel separation processing on the HSV image to obtain an H-channel image, an S-channel image, and a V-channel image, which are used as the first sub-image, the second sub-image, and the third sub-image respectively.

[0087] In a possible implementation, the histogram module 22 includes: The first histogram unit is configured to construct a first multi-dimensional array based on the pixel information of the H-channel image and the S-channel image at the same pixel point, and construct a first multi-dimensional histogram with each pixel information in the first multi-dimensional array and the number of multi-dimensional arrays in the target image as dimensions. The second histogram unit is configured to construct a second multi-dimensional array based on the pixel information of the H-channel image and the V-channel image at the same pixel point, and construct a second multi-dimensional histogram with each pixel information in the second multi-dimensional array and the number of multi-dimensional arrays in the target image as dimensions. The initial clustering module 23 includes: The first clustering cluster unit is configured to perform initial clustering processing on the pixel points in the target image according to the first multi-dimensional histogram to obtain a plurality of first clustering clusters. The second clustering cluster unit is configured to perform initial clustering processing on the pixel points in the target image according to the second multi-dimensional histogram to obtain a plurality of second clustering clusters. The clustering cluster unit is configured to fuse the first clustering cluster with the corresponding second clustering cluster of the first clustering cluster to obtain the clustering cluster.

[0088] In a possible implementation, the initial clustering module 23 includes: The sum function unit is configured to perform feature transformation on the image information corresponding to the pixel points in the clustering cluster using a preset kernel function to obtain transformation information. The first change unit is configured to determine the first distance according to the transformation information corresponding to the pixel points and the clustering center in the same clustering cluster. A second change unit, configured to determine the second distance according to transformation information corresponding to the cluster centers of different said clusters.

[0089] An embodiment of this specification also provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the above method is implemented. The computer-readable storage medium may be a non-volatile computer-readable storage medium.

[0090] An embodiment of this specification also provides an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory to execute the above method.

[0091] An embodiment of this specification also provides a computer program product, including computer-readable code. When the computer-readable code runs on a device, a processor in the device executes instructions for implementing the image segmentation method provided in any one of the above embodiments.

[0092] An embodiment of this specification also provides another computer program product, for storing computer-readable instructions. When the instructions are executed, a computer is caused to perform the operations of the image segmentation method provided in any one of the above embodiments.

[0093] The electronic device may be provided as a terminal, a server or other forms of devices.

[0094] Figure 3 A block diagram of an electronic device 800 according to an embodiment of this specification is shown. For example, the electronic device 800 may be a terminal such as a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0095] Refer to Figure 3 , the electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0096] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0097] The memory 804 is configured to store various types of data to support the operation of the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, and the like. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0098] The power supply component 806 provides power to various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.

[0099] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of the touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.

[0100] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 further includes a speaker for outputting audio signals.

[0101] The I / O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a power-on button, and a lock button.

[0102] The sensor assembly 814 includes one or more sensors for providing an assessment of the status of various aspects of the electronic device 800. For example, the sensor assembly 814 can detect the on / off state of the electronic device 800, the relative positioning of components, such as the display and keypad of the electronic device 800. The sensor assembly 814 can also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. The sensor assembly 814 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0103] The communication component 816 is configured to facilitate communication between the electronic device 800 and other devices in a wired or wireless manner. The electronic device 800 can access a wireless network based on communication standards, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0104] In an exemplary embodiment, the electronic device 800 can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described methods.

[0105] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 804 including computer program instructions, which can be executed by a processor 820 of the electronic device 800 to complete the above-described methods.

[0106] Figure 4 A block diagram of another electronic device 1900 according to an embodiment of the present specification is shown. For example, the electronic device 1900 can be provided as a server. Refer to Figure 4, the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by a memory 1932 for storing instructions executable by the processing component 1922, such as application programs. The application programs stored in the memory 1932 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0107] The electronic device 1900 may further include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server TM , Mac OS X TM , UnixTM, Linux TM , FreeBSD TM or the like.

[0108] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as the memory 1932 including computer program instructions, and the above computer program instructions can be executed by the processing component 1922 of the electronic device 1900 to complete the above method.

[0109] This specification may be a system, method, and / or computer program product. The computer program product may include a computer-readable storage medium having thereon computer-readable program instructions for causing a processor to implement various aspects of this specification.

[0110] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium may be, for example—but not limited to—an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanically encoded device such as a punched card or raised structures in grooves having instructions stored thereon, and any suitable combination of the foregoing. The computer-readable storage medium as used herein is not construed to be a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., an optical pulse through an optical fiber cable), or an electrical signal transmitted through a wire.

[0111] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to respective computing / processing devices, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network may include a copper transmission cable, an optical fiber transmission, a wireless transmission, a router, a firewall, a switch, a gateway computer, and / or an edge server. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing / processing device.

[0112] The computer program instructions for carrying out the operations of this specification may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state-setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it may be connected to an external computer (e.g., through the Internet using an Internet service provider). In some embodiments, by using the state information of the computer-readable program instructions to customize an electronic circuit, such as a programmable logic circuit, a field-programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer-readable program instructions to implement various aspects of this specification.

[0113] Aspects of this specification are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the specification. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0114] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, when executed by the processor of the computer or other programmable data processing apparatus, create a means for implementing the functions / acts specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, which instructions cause a computer, a programmable data processing apparatus, and / or other devices to operate in a particular manner, so that the computer-readable medium storing the instructions comprises a manufacture, which includes instructions for implementing various aspects of the functions / acts specified in one or more blocks of the flowchart and / or block diagram.

[0115] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices, causing a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other devices to generate a computer-implemented process, so that the instructions executed on the computer, other programmable data processing apparatus, or other devices implement the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0116] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present specification. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the figures. For example, two consecutive blocks may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or by a combination of dedicated hardware and computer instructions.

[0117] The computer program product may be implemented specifically in the form of hardware, software, or a combination thereof. In an alternative embodiment, the computer program product is embodied as a computer storage medium. In another alternative embodiment, the computer program product is embodied as a software product, such as a Software Development Kit (SDK), etc.

[0118] The embodiments of the present specification have been described above. The above description is exemplary and not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations are obvious to those of ordinary skill in the art in the technical field without departing from the scope and spirit of the described embodiments. The selection of the terms used herein is intended to best explain the principles of the embodiments, the practical application, or the improvement of the technology in the market, or to enable other ordinary skill in the art in the technical field to understand the embodiments disclosed herein.

Claims

1. A method for image segmentation based on fuzzy clustering, characterized in that: include: Acquire a target image and a usage scenario of the target image, and use a sub-image acquisition method that matches the usage scenario to perform attribute separation processing on the target image to obtain a plurality of sub-images, wherein the sub-images have the same size as the target image; Constructing a multi-element array according to the pixel information of each sub-image at the same pixel point, and constructing a multi-dimensional histogram with the pixel information of each sub-image in the multi-element array and the number of multi-element arrays in the target image as dimensions; Performing initial clustering processing on the pixels in the target image according to the multidimensional histogram to obtain a plurality of clusters, and determining a first distance between the pixels in the same cluster and the cluster center and a second distance between the cluster centers of different clusters; An objective function is determined according to a difference and / or ratio between the first distance and the second distance, and the pixel points included in the cluster are adjusted by minimizing the objective function to obtain a segmentation result of the target image according to the adjusted cluster.

2. The image segmentation method based on fuzzy clustering according to claim 1, characterized in that: The constructing of a multi-element array according to the pixel information of each sub-image at the same pixel point comprises: Selecting a target sub-image to be dilated from the sub-images, and constructing a one-dimensional histogram using pixel information of pixels in the target sub-image as a horizontal coordinate and the number of pixels contained in each pixel information as a vertical coordinate; In the target sub-image, a dilation process is performed on the target pixel corresponding to the trough in the one-dimensional histogram to obtain a dilated sub-image, wherein the dilation process is used to make the pixel information of the pixels adjacent to the target pixel the same as that of the target pixel; The multivariate array is constructed according to the pixel information of the expanded sub-image and the sub-image at the same pixel point.

3. The image segmentation method based on fuzzy clustering according to claim 2, characterized in that: In the target sub-image, the target pixels corresponding to the troughs in the one-dimensional histogram are expanded to obtain an expanded sub-image, including: In the target sub-image, taking the target pixel as the center and a preset distance as the radius, determining the dilated pixel corresponding to the target pixel; The pixel information of the target pixel corresponding to the dilated pixel in the target sub-image is used as the pixel information of the dilated pixel to implement the dilation process and obtain the dilated sub-image.

4. The image segmentation method based on fuzzy clustering according to claim 1, characterized in that: In the case where the usage scenario is real-time tracking, the sub-image acquisition method matching the usage scenario is used to perform attribute separation processing on the target image to obtain multiple sub-images, including: grayscale the target image to obtain a grayscale image of the target image as a first sub-image; The target image is filtered using a preset smoothing filter to obtain a filtered image of the target image as the second sub-image.

5. The image segmentation method based on fuzzy clustering according to claim 3, characterized in that: In the case where the usage scenario is multi-illumination, the sub-image acquisition method matching the usage scenario is used to perform attribute separation processing on the target image to obtain multiple sub-images, including: Convert the target image from the RGB space to the HSV space to obtain an HSV image; The HSV image is subjected to channel separation processing to obtain an H channel image, an S channel image and a V channel image, which are used as a first sub-image, a second sub-image and a third sub-image, respectively.

6. The image segmentation method based on fuzzy clustering according to claim 5, characterized in that: The method comprises: constructing a multi-element array according to the pixel information of each sub-image at the same pixel point, and constructing a multi-dimensional histogram with the pixel information of each sub-image in the multi-element array and the number of multi-element arrays in the target image as dimensions, including: Constructing a first multi-element array according to pixel information at the same pixel point of the H channel image and the S channel image, and constructing a first multi-dimensional histogram with the pixel information in the first multi-element array and the number of multi-element arrays in the target image as dimensions; Constructing a second multi-element array according to the pixel information of the H channel image and the V channel image at the same pixel point, and constructing a second multi-dimensional histogram with the pixel information of each pixel in the second multi-element array and the number of multi-element arrays in the target image as dimensions; The initial clustering process is performed on the pixels in the target image according to the multidimensional histogram to obtain a plurality of clusters, including: Performing initial clustering processing on the pixels in the target image according to the first multidimensional histogram to obtain a plurality of first clustering clusters; Performing initial clustering processing on the pixels in the target image according to the second multidimensional histogram to obtain a plurality of second clustering clusters; The first cluster is fused with a second cluster corresponding to the first cluster to obtain the cluster.

7. The image segmentation method based on fuzzy clustering according to claim 1, characterized in that: The determining of the first distance between the pixel point and the cluster center in the same cluster and the second distance between the cluster centers of different clusters includes: Using a preset kernel function, feature transformation is performed on the image information corresponding to the pixel points in the cluster to obtain transformation information; Determining the first distance according to transformation information corresponding to the pixel points and the cluster centers in the same cluster; The second distance is determined according to transformation information corresponding to cluster centers of different clusters.

8. An image segmentation device based on fuzzy clustering, characterized in that: include: A sub-image module is used to obtain a target image and a usage scenario of the target image, and use a sub-image acquisition method that matches the usage scenario to perform attribute separation processing on the target image to obtain a plurality of sub-images, wherein the sub-images have the same size as the target image; A histogram module, used to construct a multi-element array according to the pixel information of each sub-image at the same pixel point, and to construct a multi-dimensional histogram with the pixel information of each sub-image in the multi-element array and the number of multi-element arrays in the target image as dimensions; An initial clustering module, used to perform initial clustering processing on the pixels in the target image according to the multidimensional histogram to obtain a plurality of clusters, and determine a first distance between the pixels and the cluster center in the same cluster and a second distance between the cluster centers of different clusters; A segmentation module is used to determine an objective function according to a difference and / or ratio between the first distance and the second distance, and to adjust the pixel points included in the cluster by minimizing the objective function, so as to obtain a segmentation result of the target image according to the adjusted cluster.

9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image segmentation method based on adaptive feature perception

    CN117765008A

  • A full automatic soft segmentation method of characters in texture background

    CN109241973A

  • Otsu threshold segmentation method based on grey wolf and particle swarm collaborative optimization algorithm

    CN116433690A

  • Electronic device and method for segmenting image

    US20200151883A1