An image segmentation method, device, equipment and storage medium
By obtaining the cluster centers and membership matrices of the image, filtering and dynamic guidance parameter processing are performed to generate the target membership matrix for image segmentation. This solves the problem of misclassification of noise points in the FCM algorithm and improves the accuracy of image segmentation.
Patent Information
- Application Number
- CN202310601567.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-25
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-05-25
AI Technical Summary
Existing FCM algorithms are prone to misclassifying noise points during image segmentation, resulting in low accuracy of image segmentation results.
By obtaining the first cluster center and the first membership matrix of the image to be segmented, filtering is performed to determine the first and second dynamic guidance parameters. Based on these parameters, the target membership matrix is generated, and finally, image segmentation is performed based on the cluster center and the target membership matrix.
It improves the accuracy of image segmentation results, reduces misclassification of noise points, and enhances the precision of image segmentation.
Smart Images

Figure CN116596941B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of image processing, and particularly relate to an image segmentation method, device, equipment and storage medium. BACKGROUND
[0002] Image segmentation is a technology and process of dividing an image into several specific regions with unique properties and proposing a target of interest. It is a key step from image processing to image analysis. Existing image segmentation methods mainly include the following categories: threshold-based segmentation method, region-based segmentation method, edge-based segmentation method and segmentation method based on specific theory.
[0003] The FCM algorithm is a commonly used algorithm for image segmentation. The FCM algorithm only combines the distance information between elements and cluster centers in the clustering process. When the noise points are close to the cluster centers, the noise points are easily classified into clusters, resulting in misclassification of elements, and thus leading to low accuracy of image segmentation results. SUMMARY
[0004] Embodiments of the present application provide an image segmentation method, device, equipment and storage medium, which can improve the accuracy of image segmentation results.
[0005] According to an aspect of the present application, an image segmentation method is provided, comprising:
[0006] obtaining a first cluster center and a first membership matrix of an image to be segmented;
[0007] filtering the first membership matrix to obtain a target matrix;
[0008] determining a first dynamic guide parameter and a second dynamic guide parameter according to the first membership matrix and the target matrix;
[0009] determining a target membership matrix based on the first dynamic guide parameter, the second dynamic guide parameter and the target matrix;
[0010] segmenting the image to be segmented according to the first cluster center and the target membership matrix to obtain a segmentation result.
[0011] According to another aspect of the present application, an image segmentation device is provided, comprising:
[0012] an acquisition module configured to obtain a first cluster center and a first membership matrix of an image to be segmented;
[0013] a filtering module configured to filter the first membership matrix to obtain a target matrix;
[0014] determine a first dynamic guidance parameter and a second dynamic guidance parameter according to the first membership matrix and the target matrix;
[0015] determine a target membership matrix based on the first dynamic guidance parameter, the second dynamic guidance parameter and the target matrix;
[0016] segment the image to be segmented according to the first clustering center and the target membership matrix to obtain a segmentation result.
[0017] According to another aspect of the present application, an electronic device is provided, which comprises:
[0018] at least one processor; and
[0019] a memory in communication with the at least one processor; wherein
[0020] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the image segmentation method according to any one of the embodiments of the present application.
[0021] According to another aspect of the present application, a computer readable storage medium is provided, which stores computer instructions for enabling a processor to perform the image segmentation method according to any one of the embodiments of the present application when executed by the processor.
[0022] The embodiments of the present application can obtain a first clustering center and a first membership matrix of an image to be segmented, filter the first membership matrix to obtain a target matrix, determine a first dynamic guidance parameter and a second dynamic guidance parameter according to the first membership matrix and the target matrix, determine a target membership matrix based on the first dynamic guidance parameter, the second dynamic guidance parameter and the target matrix, and segment the image to be segmented according to the first clustering center and the target membership matrix to obtain a segmentation result, thereby improving the accuracy of the image segmentation result.
[0023] It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some of the embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0025] Figure 1 is a flow chart of an image segmentation method in an embodiment of the present application;
[0026] Figure 2 is a structural schematic diagram of an image segmentation device in an embodiment of the present application;
[0027] Figure 3 is a structural schematic diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the person skilled in the art better understand the present application, the following will combine the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of the present application.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0030] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the type, use range, use scenario, etc. of the personal information involved in the present disclosure should be informed to the user and the authorization of the user should be obtained through appropriate means according to relevant laws and regulations.
[0031] Embodiment one
[0032] Figure 1A flowchart of a reminding method provided by an embodiment of the present application, the embodiment can be applied to a reminding situation, and the method can be executed by a reminding device in the embodiment of the present application, which can be implemented in the form of software and / or hardware, as shown in the figure, and specifically includes the following steps: Figure 1
[0033] S110, a first clustering center and a first membership matrix of the image to be segmented are obtained.
[0034] Specifically, the first clustering center and the first membership matrix of the image to be segmented can be obtained in the following manner: an initial clustering center and an initial membership matrix corresponding to the image to be segmented are randomly generated; a distance similarity between the initial clustering center and other pixel points in the image to be segmented is obtained; and the initial clustering center and the initial membership matrix are updated according to the distance similarity between the initial clustering center and the other pixel points in the image to be segmented, to obtain the first clustering center and the first membership matrix. The first clustering center and the first membership matrix of the image to be segmented can also be obtained in the following manner: an initial clustering center and an initial membership matrix corresponding to the image to be segmented are randomly generated; a distance similarity between the initial clustering center and other pixel points in the image to be segmented is obtained; the initial clustering center and the initial membership matrix are updated according to the distance similarity between the initial clustering center and the other pixel points in the image to be segmented, to obtain an updated clustering center and an updated membership matrix; a distance similarity between the updated clustering center and other pixel points in the image to be segmented is obtained; and the updated clustering center and the updated membership matrix are updated according to the distance similarity between the updated clustering center and the other pixel points in the image to be segmented, to obtain the first clustering center and the first membership matrix.
[0035] S120, the first membership matrix is filtered to obtain a target matrix.
[0036] Specifically, the first membership matrix can be filtered to obtain the target matrix in the following manner: the first membership matrix is subjected to median filtering to obtain a first matrix; target features of the first matrix are extracted based on principal component analysis to obtain the target matrix.
[0037] S130, a first dynamic guiding parameter and a second dynamic guiding parameter are determined according to the first membership matrix and the target matrix.
[0038] Specifically, the manner of determining the first dynamic guidance parameter and the second dynamic guidance parameter according to the first membership matrix and the target matrix can be: obtaining a first window matrix and a second window matrix based on a preset window size, wherein the first window matrix is a window matrix in the first membership matrix with an Nth element as a center, and the second window matrix is a window matrix in the target matrix with the Nth element as a center, wherein N is a positive integer; determining a sum of products of elements in the first window matrix and elements at corresponding positions in the second window matrix as a first parameter; obtaining a mean value and a variance of elements in the second window matrix; determining a first dynamic guidance parameter corresponding to each element according to the first parameter, the mean value of the elements in the second window matrix, and the variance of the elements in the second window matrix; and determining a second dynamic guidance parameter corresponding to each element according to the first dynamic guidance parameter and the mean value of the elements in the second window matrix.
[0039] In S140, a target membership matrix is determined based on the first dynamic guidance parameter, the second dynamic guidance parameter, and the target matrix.
[0040] Specifically, the manner of determining the target membership matrix based on the first dynamic guidance parameter, the second dynamic guidance parameter, and the target matrix can be: determining a first dynamic mean value parameter corresponding to each window according to the first dynamic guidance parameter corresponding to each element; determining a second dynamic mean value parameter corresponding to each window according to the second dynamic guidance parameter corresponding to each element; and determining the target membership matrix according to the first dynamic mean value parameter corresponding to each window, the second dynamic mean value parameter corresponding to each window, and the target matrix.
[0041] In S150, the image to be segmented is segmented according to the first clustering center and the target membership matrix to obtain a segmentation result.
[0042] Specifically, the manner of segmenting the image to be segmented according to the first clustering center and the target membership matrix to obtain a segmentation result can be: if the first clustering center and the target membership matrix satisfy an iteration end condition, segmenting the image to be segmented according to the first clustering center and the target membership matrix to obtain a segmentation result. If the first clustering center and the target membership matrix do not satisfy the iteration end condition, obtaining a distance similarity between the first clustering center and other pixel points in the image to be segmented; updating the first clustering center and the target membership matrix according to the distance similarity between the first clustering center and the other pixel points in the image to be segmented to obtain an updated clustering center and an updated membership matrix; performing filtering processing on the updated membership matrix to obtain a filtered matrix; determining a first dynamic guide parameter corresponding to the updated membership matrix and a second dynamic guide parameter corresponding to the updated membership matrix according to the updated membership matrix and the filtered matrix; determining a second membership matrix based on the first dynamic guide parameter corresponding to the updated membership matrix, the second dynamic guide parameter corresponding to the updated membership matrix, and the filtered matrix; and if the updated clustering center and the second membership matrix satisfy the iteration end condition, segmenting the image to be segmented according to the updated clustering center and the second membership matrix to obtain a segmentation result.
[0043] Optionally, determining the first dynamic guide parameter and the second dynamic guide parameter according to the first membership matrix and the target matrix comprises:
[0044] obtaining a first window matrix and a second window matrix based on a preset window size, wherein the first window matrix is a window matrix with an Nth element as a center in the first membership matrix, and the second window matrix is a window matrix with the Nth element as a center in the target matrix, wherein N is a positive integer;
[0045] determining the first dynamic guide parameter and the second dynamic guide parameter according to the first window matrix and the second window matrix.
[0046] Specifically, the manner of obtaining the first window matrix and the second window matrix based on the preset window size can be: dividing the first membership matrix based on the preset window size to obtain the first window matrix, and dividing the target matrix based on the preset window size to obtain the second window matrix. For example, taking the first element in the first membership matrix as the center, a first window matrix centered on the first element in the first membership matrix is determined according to the preset window size, taking the second element in the first membership matrix as the center, a first window matrix centered on the second element in the first membership matrix is determined according to the preset window size, and so on, so as to obtain the first window matrix corresponding to each element in the first membership matrix. Taking the first element in the target matrix as the center, a second window matrix centered on the first element in the target matrix is determined according to the preset window size, taking the second element in the target matrix as the center, a second window matrix centered on the second element in the target matrix is determined according to the preset window size, and so on, so as to obtain the second window matrix corresponding to each element in the target matrix.
[0047] Specifically, the manner of determining the first dynamic guidance parameter and the second dynamic guidance parameter according to the first window matrix and the second window matrix can be: determining a first parameter, a mean and a variance of elements in the second window matrix according to the first window matrix and the second window matrix, determining a first dynamic guidance parameter corresponding to each element according to the first parameter, the mean of elements in the second window matrix and the variance of elements in the second window matrix; and determining a second dynamic guidance parameter corresponding to each element according to the first dynamic guidance parameter and the mean of elements in the second window matrix.
[0048] Optionally, determining the first dynamic guidance parameter and the second dynamic guidance parameter according to the first window matrix and the second window matrix comprises:
[0049] determining a sum of products of elements in the first window matrix and elements at corresponding positions in the second window matrix as a first parameter;
[0050] obtaining a mean and a variance of elements in the second window matrix;
[0051] determining a first dynamic guidance parameter corresponding to each element according to the first parameter, the mean of elements in the second window matrix and the variance of elements in the second window matrix;
[0052] determining a second dynamic guidance parameter corresponding to each element according to the first dynamic guidance parameter and the mean of elements in the second window matrix.
[0053] Specifically, a sum of products of elements in the first window matrix and elements at corresponding positions in the second window matrix is determined as the first parameter, which can be, for example, a first window matrix is A second matrix is Multiplying elements in the first window matrix and elements at corresponding positions in the second window matrix, a matrix is obtained Summing, a first parameter is obtained as follows:
[0054] A1B1+A2B2+A3B3+A4B4+A5B5+A6B6+A7B7+A8B8+A9B9.
[0055] Specifically, a manner of determining, according to the first parameter, a mean of elements in the second window matrix and a variance of elements in the second window matrix, a first dynamic guide parameter corresponding to each element can be that a smoothness control parameter is obtained, and the first dynamic guide parameter corresponding to each element is determined according to the smoothness control parameter, the first parameter, the mean of elements in the second window matrix and the variance of elements in the second window matrix. The manner of determining, according to the first parameter, the mean of elements in the second window matrix and the variance of elements in the second window matrix, the first dynamic guide parameter corresponding to each element can also be that a first value is determined according to the first parameter and the mean of elements in the second window matrix corresponding to each element, a second value is determined according to the variance of elements in the second window matrix corresponding to each element and the smoothness control parameter, and the first dynamic guide parameter corresponding to each element is determined as a ratio of the first value and the second value. For example, a difference between the first parameter and a square of the mean of elements in the second window matrix corresponding to each element can be determined as the first value, and a sum of a square of the variance of elements in the second window matrix corresponding to each element and the smoothness control parameter can be determined as the second value.
[0056] Optionally, determining a target membership matrix based on the first dynamic guide parameter, the second dynamic guide parameter and the target matrix comprises:
[0057] Determining, according to the first dynamic guide parameter corresponding to each element, a first dynamic mean parameter corresponding to each window;
[0058] Determining, according to the second dynamic guide parameter corresponding to each element, a second dynamic mean parameter corresponding to each window;
[0059] Determining a target membership matrix according to the first dynamic mean parameter corresponding to each window, the second dynamic mean parameter corresponding to each window and the target matrix.
[0060] Specifically, the manner of determining the first dynamic mean parameter corresponding to each window according to the first dynamic guide parameter corresponding to each element can be: obtaining the first dynamic guide parameter corresponding to each element, generating a first parameter set according to the first dynamic guide parameter corresponding to each element, performing window division on the first parameter set based on a preset window size, and the first dynamic mean parameter corresponding to each window being the average of the first dynamic guide parameters of the elements in each window.
[0061] Specifically, the manner of determining the second dynamic mean parameter corresponding to each window according to the second dynamic guide parameter corresponding to each element can be: obtaining the second dynamic guide parameter corresponding to each element, generating a second parameter set according to the second dynamic guide parameter corresponding to each element, performing window division on the second parameter set based on a preset window size, and the second dynamic mean parameter corresponding to each window being the average of the second dynamic guide parameters of the elements in each window. Specifically, the manner of determining the target membership matrix according to the first dynamic mean parameter corresponding to each window, the second dynamic mean parameter corresponding to each window, and the target matrix can be: performing window division on the target matrix based on a preset window size, obtaining an element matrix corresponding to each window, and determining the target membership matrix according to the element matrix corresponding to each window, the first dynamic mean parameter corresponding to each window, and the second dynamic mean parameter corresponding to each window. For example, the target membership matrix can be determined based on the following formula:
[0062]
[0063] wherein, U gN is the element matrix corresponding to the window centered on the Nth element in the target matrix, U q is the target membership matrix, is the first dynamic mean parameter corresponding to the window centered on the Nth element, is the second dynamic mean parameter corresponding to the window centered on the Nth element.
[0064] Optionally, the first clustering center and the first membership matrix of the image to be segmented are obtained, including:
[0065] randomly generating an initial clustering center and an initial membership matrix corresponding to the image to be segmented;
[0066] obtaining the distance similarity between the initial clustering center and other pixel points in the image to be segmented;
[0067] updating the initial clustering center and the initial membership matrix according to the distance similarity between the initial clustering center and other pixel points in the image to be segmented, to obtain the first clustering center and the first membership matrix.
[0068] Specifically, the manner of randomly generating the initial clustering center and the initial membership matrix corresponding to the image to be segmented can be that: selecting the initial clustering center and the initial membership matrix corresponding to the image to be segmented from a pre-stored database based on a preset rule.
[0069] Specifically, the manner of obtaining the distance similarity between the initial clustering center and other pixel points in the image to be segmented can be that: determining the distance similarity between the initial clustering center and other pixel points in the image to be segmented according to the distance between the initial clustering center and the other pixel points.
[0070] Specifically, the manner of updating the initial clustering center and the initial membership matrix according to the distance similarity between the initial clustering center and other pixel points in the image to be segmented to obtain the first clustering center and the first membership matrix can be that: determining a target function according to the distance similarity between the initial clustering center and other pixel points in the image to be segmented, updating the initial membership matrix based on the target function to obtain the first membership matrix, and updating the initial clustering center according to the first membership matrix to obtain the first clustering center.
[0071] Optionally, the image to be segmented is segmented according to the first clustering center and the target membership matrix to obtain a segmentation result, including:
[0072] If the first clustering center and the target membership matrix satisfy an iteration end condition, the image to be segmented is segmented according to the first clustering center and the target membership matrix to obtain a segmentation result.
[0073] Specifically, if the first clustering center and the target membership matrix satisfy the iteration end condition, the manner of segmenting the to-be-segmented image according to the first clustering center and the target membership matrix to obtain a segmentation result can be: determining a variation degree of the clustering center and a variation degree of the membership matrix according to the first clustering center, the target membership matrix, the initial clustering center and the initial membership matrix, if the variation degree of the clustering center is less than a first set threshold and the variation degree of the membership matrix is less than a second set threshold, it is determined that the first clustering center and the first membership matrix satisfy the iteration end condition, and then the to-be-segmented image is segmented according to the first clustering center and the target membership matrix to obtain a segmentation result. The first set threshold and the second set threshold can be the same or different. If the first clustering center and the target membership matrix satisfy the iteration end condition, the manner of segmenting the to-be-segmented image according to the first clustering center and the target membership matrix to obtain a segmentation result can also be: if the first clustering center and the target membership matrix do not satisfy the iteration end condition, obtaining a distance similarity between the first clustering center and other pixel points in the to-be-classified image, updating the first clustering center and the target membership matrix according to the distance similarity between the first clustering center and the other pixel points in the to-be-classified image to obtain an updated clustering center and an updated membership matrix; filtering the updated membership matrix to obtain a filtered matrix; determining a first dynamic guide parameter corresponding to the updated membership matrix and a second dynamic guide parameter corresponding to the updated membership matrix according to the updated membership matrix and the filtered matrix; determining a second membership matrix based on the first dynamic guide parameter corresponding to the updated membership matrix, the second dynamic guide parameter corresponding to the updated membership matrix and the filtered matrix; if the updated clustering center and the second membership matrix satisfy the iteration end condition, segmenting the to-be-segmented image according to the updated clustering center and the second membership matrix to obtain a segmentation result.
[0074] It should be noted that if the clustering center and the membership matrix do not satisfy the iteration end condition, the clustering center and the membership matrix need to be updated until the clustering center and the membership matrix satisfy the iteration end condition, and the to-be-classified image is classified according to the clustering center and the membership matrix to obtain a classification result.
[0075] In addition, before judging whether the iteration end condition is satisfied after each update, the membership matrix needs to be processed as follows: filtering the first membership matrix to obtain a target matrix; determining a first dynamic guide parameter and a second dynamic guide parameter according to the first membership matrix and the target matrix; determining a target membership matrix based on the first dynamic guide parameter, the second dynamic guide parameter and the target matrix.
[0076] Optionally, filtering the first membership matrix to obtain a target matrix includes:
[0077] Performing median filtering on the first membership matrix to obtain a first matrix;
[0078] The target features of the first matrix are extracted based on principal component analysis to obtain a target matrix.
[0079] The technical solution of this embodiment is to obtain the first cluster center and the first membership matrix of the image to be segmented; filter the first membership matrix to obtain a target matrix; determine the first dynamic guidance parameter and the second dynamic guidance parameter based on the first membership matrix and the target matrix; determine the target membership matrix based on the first dynamic guidance parameter, the second dynamic guidance parameter and the target matrix; segment the image to be segmented according to the first cluster center and the target membership matrix to obtain a segmentation result, which can improve the accuracy of the image segmentation result.
[0080] Example 2
[0081] Figure 2 This is a schematic diagram of the structure of an image segmentation device provided by an embodiment of the present invention. This embodiment is applicable to the case of image segmentation. The device can be implemented in software and / or hardware. The device can be integrated into any device that provides image segmentation function, such as Figure 2 As shown, the image segmentation device specifically includes: an acquisition module 210 , a filtering module 220 , a dynamic guidance parameter determination module 230 , a target membership matrix determination module 240 and an image segmentation module 250 .
[0082] The acquisition module is used to obtain the first cluster center and the first membership matrix of the image to be segmented;
[0083] A filtering module, configured to filter the first membership matrix to obtain a target matrix;
[0084] a dynamic guiding parameter determination module, configured to determine a first dynamic guiding parameter and a second dynamic guiding parameter according to the first membership matrix and the target matrix;
[0085] a target membership matrix determination module, configured to determine a target membership matrix based on the first dynamic guidance parameter, the second dynamic guidance parameter, and the target matrix;
[0086] The image segmentation module is used to segment the image to be segmented according to the first cluster center and the target membership matrix to obtain a segmentation result.
[0087] The above product can perform the method provided by any embodiment of the application, has the corresponding function module and beneficial effects of performing the method.
[0088] Embodiment three
[0089] Figure 3 A structural schematic diagram of an electronic device 10 that can be used to implement embodiments of the application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the applications described and / or claimed in this document.
[0090] As shown in Figure 3 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., connected in communication with the at least one processor 11, where the memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or loaded into the random access memory (RAM) 13 from the storage unit 18. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0091] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, a speaker, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunications networks.
[0092] The processor 11 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, and the like. The processor 11 performs various methods and processes described above, such as the image segmentation method.
[0093] In some embodiments, the image segmentation method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded onto the RAM 13 and executed by the processor 11, one or more steps of the image segmentation method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the image segmentation method by any other suitable means, such as by means of firmware.
[0094] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0095] Computer programs used to implement the methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed by the processor of the machine, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or server.
[0096] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0097] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0098] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0099] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
[0100] It should be understood that the various forms of flow shown above can be used to reorder, add or delete steps. For example, each step described in the present application can be executed in parallel, sequentially or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which is not limited herein.
[0101] The above detailed description does not constitute a limitation on the scope of protection of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. An image segmentation method characterized by, The method comprises the following steps: obtaining a first clustering center and a first membership matrix of an image to be segmented; filtering the first membership matrix to obtain a target matrix; determining a first dynamic guide parameter and a second dynamic guide parameter according to the first membership matrix and the target matrix; determining a target membership matrix based on the first dynamic guide parameter, the second dynamic guide parameter and the target matrix; segmenting the image to be segmented according to the first clustering center and the target membership matrix to obtain a segmentation result; determining a first dynamic guide parameter and a second dynamic guide parameter according to the first membership matrix and the target matrix, comprising: obtaining a first window matrix and a second window matrix based on a preset window size, wherein the first window matrix is a window matrix with the Nth element as the center in the first membership matrix, and the second window matrix is a window matrix with the Nth element as the center in the target matrix, wherein N is a positive integer; determining a first dynamic guide parameter and a second dynamic guide parameter according to the first window matrix and the second window matrix.
2. The method of claim 1, wherein, determining a first dynamic guide parameter and a second dynamic guide parameter according to the first window matrix and the second window matrix, comprising: determining the sum of the product of the elements in the first window matrix and the elements at the corresponding positions in the second window matrix as the first parameter; obtaining the mean and variance of the elements in the second window matrix; determining the first dynamic guide parameter corresponding to each element according to the first parameter, the mean of the elements in the second window matrix and the variance of the elements in the second window matrix; determining the second dynamic guide parameter corresponding to each element according to the first dynamic guide parameter and the mean of the elements in the second window matrix.
3. The method of claim 2, wherein, determining a target membership matrix based on the first dynamic guide parameter, the second dynamic guide parameter and the target matrix, comprising: determining the first dynamic mean parameter corresponding to each window according to the first dynamic guide parameter corresponding to each element; determining the second dynamic mean parameter corresponding to each window according to the second dynamic guide parameter corresponding to each element; determining the target membership matrix according to the first dynamic mean parameter corresponding to each window, the second dynamic mean parameter corresponding to each window and the target matrix.
4. The method of claim 1, wherein, obtaining a first clustering center and a first membership matrix of an image to be segmented, comprising: randomly generating an initial clustering center and an initial membership matrix corresponding to the image to be segmented; obtaining the distance similarity between the initial clustering center and other pixel points in the image to be segmented; updating the initial clustering center and the initial membership matrix according to the distance similarity between the initial clustering center and other pixel points in the image to be segmented to obtain the first clustering center and the first membership matrix.
5. The method of claim 1, wherein, segmenting the image to be segmented according to the first clustering center and the target membership matrix to obtain a segmentation result, comprising: if the first clustering center and the target membership matrix meet the iteration end condition, segmenting the image to be segmented according to the first clustering center and the target membership matrix to obtain a segmentation result.
6. The method of claim 1, wherein, The first membership matrix is filtered to obtain a target matrix, comprising: The first membership matrix is median filtered to obtain a first matrix; Target features of the first matrix are extracted based on principal component analysis to obtain a target matrix.
7. An image segmentation apparatus characterized by comprising: Comprise: An acquisition module is configured to acquire a first clustering center and a first membership matrix of an image to be segmented; A filtering module is configured to filter the first membership matrix to obtain a target matrix; A dynamic guidance parameter determination module is configured to determine a first dynamic guidance parameter and a second dynamic guidance parameter according to the first membership matrix and the target matrix; A target membership matrix determination module is configured to determine a target membership matrix based on the first dynamic guidance parameter, the second dynamic guidance parameter, and the target matrix; An image segmentation module is configured to segment the image to be segmented according to the first clustering center and the target membership matrix to obtain a segmentation result; The dynamic guidance parameter determination module is specifically configured to: Obtain a first window matrix and a second window matrix based on a preset window size, wherein the first window matrix is a window matrix centered on an Nth element in the first membership matrix, and the second window matrix is a window matrix centered on an Nth element in the target matrix, wherein N is a positive integer; Determine a first dynamic guidance parameter and a second dynamic guidance parameter according to the first window matrix and the second window matrix.
8. An electronic device, comprising: The electronic device comprises: At least one processor; and The memory is in communication connection with the at least one processor; wherein The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the image segmentation method of any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for enabling the processor to execute the image segmentation method of any one of claims 1-6 when executed.
Citation Information
Patent Citations
Fuzzy clustering image segmentation method based on morphological reconstruction and membership filtering
CN109285175A