Image segmentation method, segmentation device and monitoring system for moving targets in mines
By introducing the Markov prior probability as a constraint term in the FCM algorithm, the improved FCM algorithm improves the accuracy of image segmentation in the recognition of moving targets in mines, solves the problem of poor noise resistance of the traditional FCM algorithm, and achieves more accurate image segmentation.
Patent Information
- Application Number
- CN202310502819.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-05
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2043-05-05
AI Technical Summary
In the existing technology, the traditional FCM algorithm lacks consideration of spatial information in the recognition of moving targets in mines, resulting in poor noise resistance and difficulty in achieving accurate image segmentation in complex underground environments.
By adding Markov's prior probability as a constraint term in the objective function of the standard FCM algorithm, an improved FCM algorithm is formed, which combines the distance from the pixel to the cluster center and the neighborhood information to improve the noise resistance performance.
It effectively suppresses noise points and interference points in downhole images, improves the accuracy and anti-noise performance of image segmentation, and ensures the accuracy of image segmentation results.
Smart Images

Figure CN116524406B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of mobile target recognition, and in particular to an image segmentation method, a segmentation device, a computer-readable storage medium and a monitoring system for a mobile target in a mine. Background Art
[0002] The present invention belongs to the field of mine mobile target identification, and video image processing and analysis technology is also constantly developing. Using image processing, computer vision and other technologies to analyze monitoring video images and apply them to coal mine intelligent safety systems has been a topic of focused research in the field of coal mine safety production in recent years. These include the identification of the coal-rock interface at the mining working face, the identification of natural fires underground in coal mines, the detection of coal levels in mine coal bunkers, and the detection and recognition of miners' faces. Therefore, combining modern technology with mine video image characteristics to study underground image processing methods suitable for coal mine environments will play a vital role in promoting the development and upgrading of the coal mining field and resolving mining safety hazards. It will also accelerate the process of intelligentization and automation in the coal mining industry.
[0003] Currently, the traditional FCM algorithm is used to recognize moving target images in mines. However, the traditional FCM algorithm lacks consideration of spatial information in its objective function and ignores the effective structural information contained in an image, resulting in poor noise immunity. Summary of the Invention
[0004] The main purpose of this application is to provide an image segmentation method, a segmentation device, a computer-readable storage medium and a monitoring system for a moving target in a mine, so as to at least solve the problem of poor noise resistance of the standard FCM algorithm in the prior art.
[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for image segmentation of a mobile target in a mine is provided, the method comprising: obtaining a video image of the mine, the video image being a video image of each construction site monitored by monitoring equipment during underground mining; performing image segmentation on the video image using an improved FCM algorithm to obtain multiple sub-images, the improved FCM algorithm being an improved algorithm that adds Markov's prior probability as a constraint term to the objective function of the standard FCM algorithm.
[0006] Optionally, an improved FCM algorithm is used to perform image segmentation on the video image to obtain multiple sub-images, including: an identification step of identifying the video image to obtain a sample set, where the samples in the sample set are pixels of the video image; an initialization step of initializing relevant parameters of the improved FCM algorithm to obtain a first membership matrix, where the relevant parameters include a first cluster center, the number of clusters, the number of iterations, the maximum number of iterations, a termination threshold, a sample set and a first membership matrix, where the first cluster center is the initial cluster center of the improved FCM algorithm, the first membership is the initial membership of the improved FCM algorithm, and the number of clusters is the number of clusters obtained when the improved FCM algorithm is finished running; the termination threshold is used At the end of the operation of the improved FCM algorithm, the membership degree is used to characterize the degree to which the pixel point belongs to the cluster center; in the first calculation step, the sample set is clustered to obtain multiple sample clusters, and the sample clusters correspond one-to-one to the second cluster centers, and the second cluster centers are cluster centers calculated during the iteration process; in the second calculation step, the objective function is determined according to the membership degree and the second cluster centers and the function value of the objective function is calculated, and the objective function is the loss function of the iterative process of the improved FCM algorithm; in the repetition step, the first calculation step and the second calculation step are repeated in sequence at least once until the number of iterations is equal to the maximum number of iterations, so that the multiple sample clusters form multiple sub-images in one-to-one correspondence.
[0007] Optionally, initializing the relevant parameters of the improved FCM algorithm includes: setting the number of clusters, and determining a random number of samples in the sample set as the first cluster centers, the random number being at least greater than the number of clusters; setting the termination threshold, the number of iterations and the maximum number of iterations; setting the membership corresponding to each of the samples to obtain multiple first memberships, and the first memberships correspond one-to-one to the samples.
[0008] Optionally, the sample set is clustered to obtain multiple sample clusters, and the sample clusters correspond one-to-one to the second cluster centers, including: calculating multiple distances based on the first cluster centers and the sample set, the distances being the Euclidean distances between each sample and each first cluster center in two-dimensional space; calculating the sample correspondence prior probability based on the sample set, and the prior probability is used to characterize the neighborhood relationship between each sample and each first cluster center; calculating the membership of each sample and each first cluster center based on the distances and the prior probabilities to obtain multiple second memberships; calculating multiple cluster centers based on the second memberships and each sample to obtain the second cluster center.
[0009] Optionally, based on the degree of membership and the second cluster center, an objective function is determined and a function value is calculated. The method further includes: determining the objective function based on the second cluster center, the distance and the prior probability; and calculating the function value based on the objective function.
[0010] Optionally, repeating the first calculation step and the second calculation step in sequence at least once until the number of iterations is equal to the maximum number of iterations includes: obtaining the function value when the number of iterations reaches the maximum number of iterations; comparing the function value with the termination threshold, stopping the iteration when the function value is not greater than the termination threshold, and continuing the iteration until the function value is no greater than the termination threshold when the function value is greater than the termination threshold.
[0011] Optionally, after repeating the first calculation step and the second calculation step at least once in sequence until the number of iterations is equal to the maximum number of iterations and the function value is less than the termination threshold, the method includes: determining a second membership matrix based on the second cluster center and the second membership, the second membership matrix being used to characterize the correspondence between the sample and the sub-image; and performing image segmentation on the video image based on the second membership matrix.
[0012] According to another aspect of the present application, an image segmentation device for a mobile target in a mine is provided, the device comprising: an acquisition unit for acquiring a video image of the mine, wherein the video image is a video image of each construction site monitored by monitoring equipment during underground mining; a segmentation unit for performing image segmentation on the video image using an improved FCM algorithm to obtain a plurality of sub-images, wherein the improved FCM algorithm is an improved algorithm that adds Markov's prior probability as a constraint term to the objective function of the standard FCM algorithm.
[0013] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described.
[0014] According to another aspect of the present application, a monitoring system is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of the methods described.
[0015] Applying the technical solution of the present application, in the above-mentioned method for image segmentation of mobile targets in a mine, first, a mine video image is acquired. The video image is a video image of each construction site monitored by monitoring equipment during underground mining. Then, an improved FCM algorithm is used to segment the video image to obtain multiple sub-images. The improved FCM algorithm is an improved algorithm that adds the Markov prior probability as a constraint term to the objective function of the standard FCM algorithm. By adding the Markov random process-based prior probability as a constraint term to the objective function of the FCM algorithm, the improved FCM algorithm incorporates both the distance from the pixel to the cluster center in the standard FCM algorithm and the pixel's neighborhood information, namely the Markov random process prior probability. Even if a noise point or interference point is encountered that is close to the i-th cluster center, the probability of it being classified into the i-th cluster is very low based on its neighborhood information. Therefore, this point will largely not be classified into the i-th cluster, effectively suppressing noise points and interference points in the image, thereby ensuring more accurate segmentation results. This method solves the problem of poor noise resistance of the standard FCM algorithm in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 The following is a hardware structure diagram of a mobile terminal for executing an image segmentation method for a mobile target in a mine provided in an embodiment of the present application;
[0017] Figure 2 A schematic flow chart of an image segmentation method for a moving target in a mine provided in accordance with an embodiment of the present application is shown;
[0018] Figure 3 A schematic flow chart of a method for image segmentation of a mobile target in a mine provided according to an embodiment of the present application is shown;
[0019] Figure 4 A graph showing the variation of under-segmentation rate with K value according to an embodiment of the present application is shown;
[0020] Figure 5 A graph showing segmentation accuracy versus K value according to an embodiment of the present application is shown;
[0021] Figure 6 A graph showing a change in recall rate versus K value according to an embodiment of the present application is shown;
[0022] Figure 7 The figure shows a structural block diagram of an image segmentation device for a moving target in a mine provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0024] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0025] 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 are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] For ease of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0027] A Markov random field (MRF) refers to a process in which the value at the next point in time is dependent only on the current value, not on previous values. This means that the future is determined by the present, not the past. A Markov random process is a type of random process. Its original model, the Markov chain, was proposed by Russian mathematician A.A. Markov in 1907. This process has the following properties: given a known current state (present), its future evolution (future) is independent of its past evolution (past).
[0028] As introduced in the background technology, the objective function of the traditional FCM algorithm in the prior art lacks consideration of spatial information, ignores the effective structural information contained in an image, and results in poor noise resistance of the algorithm. In order to solve the problem of poor noise resistance of the standard FCM algorithm in the prior art, the embodiments of the present application provide an image segmentation method, segmentation device, computer-readable storage medium and monitoring system for mobile targets in mines.
[0029] The technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present invention.
[0030] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for an image segmentation method of a mobile target in a mine according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0031] The memory 104 can be used to store computer programs, such as software programs and modules of application software, such as the computer program corresponding to the device information display method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned networks include but are not limited to the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0032] In this embodiment, a method for image segmentation of a mobile target in a mine running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0033] Figure 2 FIG. 1 is a flow chart of an image segmentation method for a mobile target in a mine according to an embodiment of the present application. Figure 2 As shown, the method includes the following steps:
[0034] Step S201: Acquire a mine video image, wherein the video image is a video image of each construction site monitored by monitoring equipment during the underground mining process;
[0035] Specifically, various emergencies may occur during underground coal mining. Collecting underground images and judging the mining situation are of great significance for resolving safety hazards and ensuring property and personal safety during the mining process.
[0036] Step S202 , segmenting the video image using an improved FCM algorithm to obtain a plurality of sub-images. The improved FCM algorithm is an improved algorithm that adds the Markov prior probability as a constraint term to the objective function of the standard FCM algorithm.
[0037] Specifically, when processing collected downhole images, the FCM algorithm is often used for image segmentation. However, the objective function of the FCM algorithm in the prior art lacks consideration of spatial information, resulting in poor noise resistance. Furthermore, the downhole environment is relatively complex, and the direct use of the standard FCM algorithm for image segmentation has poor accuracy and is difficult to meet usage requirements. Therefore, this application improves the existing FCM algorithm by adding a Markov prior probability as a constraint term in the objective function. This allows the objective function to include neighborhood information constraints when performing the constraints, thereby enhancing the FCM algorithm's noise resistance.
[0038] In this embodiment, a mine video image is first acquired. This video image is captured by monitoring equipment at various construction sites during underground mining. Then, an improved FCM algorithm is used to segment the video image to obtain multiple sub-images. This improved FCM algorithm incorporates Markov prior probabilities as constraints into the objective function of the standard FCM algorithm. By incorporating the Markov random process-based prior probabilities into the FCM algorithm's objective function, the improved FCM algorithm incorporates both the distance from the pixel to the cluster center, as used in the standard FCM algorithm, and the pixel's neighborhood information, namely the Markov random process prior probabilities. Even if a noise or interference point is encountered close to the i-th cluster center, its neighborhood information indicates that its probability of being classified into the i-th cluster is very low, and therefore, the point is largely excluded from classification into the i-th cluster. This effectively suppresses noise and interference points in the image, ensuring more accurate segmentation results. This method addresses the poor noise immunity of the standard FCM algorithm in the prior art.
[0039] In order to accurately segment the video image to obtain multiple sub-images, in an optional implementation manner, step S202 includes:
[0040] Step S2021, an identification step, identifying the video image to obtain a sample set, where the samples in the sample set are pixels of the video image;
[0041] Specifically, by scanning the collected video image, the video image is decomposed into pixel points that make up the image, and all the pixel points form a sample set. The sample set is the above-mentioned video image, and the pixel points are the samples in the sample set. The image segmentation problem is converted into a data calculation problem.
[0042] Step S2022, an initialization step, initializing relevant parameters of the improved FCM algorithm to obtain a first membership matrix, wherein the relevant parameters include a first cluster center, a number of clusters, a number of iterations, a maximum number of iterations, a termination threshold, a sample set, and a first membership. The first cluster center is the initial cluster center of the improved FCM algorithm, the first membership is the initial membership of the improved FCM algorithm, and the number of clusters is the number of clusters obtained at the end of the improved FCM algorithm. The termination threshold is used to terminate the operation of the improved FCM algorithm, and the membership is used to characterize the degree to which a pixel point belongs to a cluster center.
[0043] Specifically, this application sets a sample set and, based on the Markov characteristics of the image segmentation process, constructs a Markov random field on a two-dimensional plane for all pixel points. By setting relevant parameters, the image segmentation problem is converted into the calculation of a random probability model.
[0044] Step S2023, a first calculation step, clustering the sample set to obtain multiple sample clusters, wherein the sample clusters correspond one-to-one to the second cluster centers, and the second cluster centers are cluster centers calculated in the iterative process;
[0045] Specifically, a set of clusters can be obtained based on the initial cluster centers, that is, an image segmentation solution can be obtained. However, since the initial cluster centers are set randomly, the image segmentation solution obtained at this time is not accurate. It is necessary to recalculate the cluster centers based on the existing sample set, that is, the second cluster centers mentioned above, to obtain a more accurate image segmentation solution.
[0046] Step S2024, a second calculation step, determining an objective function based on the membership degree and the second cluster center and calculating a function value of the objective function, wherein the objective function is a loss function of the iterative process of the improved FCM algorithm;
[0047] Specifically, the above loss function is used to measure the accuracy of the image segmentation method corresponding to the current cluster.
[0048] Step S2025, repeating the first calculation step and the second calculation step at least once in sequence until the number of iterations is equal to the maximum number of iterations, so that the plurality of sample clusters form the plurality of sub-images in one-to-one correspondence.
[0049] In order to convert image segmentation into random probability model calculation, in an optional implementation manner, the above step S2022 includes:
[0050] Step S20221, setting the number of clusters, and determining a random number of the samples in the sample set as the first cluster centers, wherein the random number is at least greater than the number of clusters;
[0051] Specifically, the number of clusters in the improved FCM algorithm is set, that is, the number of clusters obtained by the final algorithm, that is, the number of sub-images into which the video image is ultimately segmented. The greater the number of sub-images, the better the final segmentation effect. However, as the number of segmented sub-images increases, the computational complexity increases dramatically, while the improvement in segmentation effect is minimal. Therefore, it is necessary to set an appropriate number of sub-images. At the same time, the initial cluster centers of the improved FCM algorithm are set. A certain number of pixels are randomly selected and used as cluster centers for fuzzy clustering. To obtain the final clusters, the number of cluster centers should be much larger than the number of clusters to facilitate screening.
[0052] Step S20222, setting the termination threshold, the number of iterations, and the maximum number of iterations;
[0053] Specifically, the termination threshold is used to evaluate the accuracy of the segmented sub-images. Only sub-images that meet the required accuracy can be used to predict underground mining conditions. Similarly, as the number of algorithm iterations increases, the accuracy of the sub-images increases, and the computational effort also increases. Therefore, it is necessary to set an appropriate maximum number of iterations to constrain the algorithm and conserve computing resources.
[0054] Step S20223: setting the membership degree corresponding to each of the above samples to obtain a plurality of the above first membership degrees, wherein the above first membership degrees correspond one-to-one to the above samples.
[0055] Specifically, after determining the initial cluster center, it is necessary to perform fuzzy clustering on the pixels in the sample set to determine to which cluster center the pixel belongs, that is, to which cluster center the pixel is segmented into the image corresponding to. Therefore, each pixel has a membership degree for each cluster center, which is used to determine to which cluster center the pixel belongs. To further explain, the above-mentioned pixel points belong to the corresponding cluster center with the largest membership degree.
[0056] In order to obtain a more accurate image segmentation method, in an optional implementation, the above step S2023 includes:
[0057] Step S20231, calculating a plurality of distances based on the first cluster center and the sample set, wherein the distances are Euclidean distances between each sample and each first cluster center in a two-dimensional space;
[0058] Specifically, the sample set corresponds to the video image, and a coordinate system can be established according to the image, that is, each pixel point is converted into a coordinate point, and the distance between the cluster center and the pixel point is calculated.
[0059] Step S20232: calculating the prior probability corresponding to the sample according to the sample set, wherein the prior probability is used to characterize the neighborhood relationship between each sample and each first cluster center;
[0060] Specifically, each pixel point is used as a variable in the image segmentation process, and the entire sample set constitutes a Markov random field. According to the Markov characteristic, the pixels in the image only depend on the pixels around it, and have nothing to do with other pixels farther away from it. Therefore, the prior probability is crucial information for accurate image segmentation, which is used to express the neighborhood relationship between the sample and the cluster center.
[0061] Step S20233, calculating the membership degree of each of the samples and each of the first cluster centers based on the distance and the prior probability, to obtain a plurality of second membership degrees;
[0062] Specifically, the degree of membership between each pixel and each cluster center, namely the second degree of membership, can be calculated according to the formula in the improved FCM algorithm. The formula is as follows:
[0063]
[0064] Among them, d ij is the above Euclidean distance, P is the prior probability, is the constraint coefficient, c is the number of clusters, X is the sample, u ij is the above membership degree.
[0065] Step S20234: Calculate multiple cluster centers based on the second membership degree and each of the samples to obtain the second cluster center.
[0066] Specifically, the new cluster center, namely the second cluster center, can be calculated according to the formula in the improved FCM algorithm. The above formula is as follows:
[0067]
[0068] Among them, V i is the above cluster center, and n is the number of the above selected cluster centers.
[0069] In order to determine the accuracy of the above image segmentation method, in an optional implementation, the above step S2024 includes:
[0070] Step S20241, determining the objective function based on the second cluster center, the distance, and the prior probability;
[0071] Specifically, the standard FCM algorithm only considers the Euclidean distance in the process of calculating accuracy, that is, only the distance between the pixel point and the cluster center is considered to determine the accuracy. Such classification may cause interference points or noise points in the pixel points to be misclassified. The present application adds a priori probability to the constraint term of the loss function, that is, in addition to considering the Euclidean distance, the neighborhood relationship between the pixel points is also considered. Even if a noise point or interference point close to the i-th cluster center is encountered, it can be obtained from its neighborhood information that the probability of it being classified into the i-th category is very small, so this point will not be classified into the i-th category to a large extent, thereby improving the noise resistance of the algorithm.
[0072] Step S20242, calculate the above function value according to the above objective function.
[0073] Specifically, the loss function value, that is, the above function value, can be calculated according to the formula in the improved FCM algorithm. The above formula is as follows:
[0074]
[0075] In order to determine whether to end the iteration, in an optional implementation, the above step S2025 includes:
[0076] Step S20251, when the number of iterations reaches the maximum number of iterations, obtaining the function value;
[0077] Specifically, when the number of iterations reaches a preset maximum number of iterations, the image segmentation method is close to the accuracy requirement, and the function value is obtained to determine the current accuracy requirement.
[0078] Step S20252, compare the above function value with the above termination threshold. If the above function value is not greater than the above termination threshold, stop the iteration. If the above function value is greater than the above termination threshold, continue the iteration until the above function value is no greater than the above termination threshold.
[0079] Specifically, when the above function value is not greater than the above termination threshold, it can be determined that the current image segmentation method has met the accuracy requirements and there is no need to continue iterating to improve the accuracy of the image segmentation method. When the above function value is greater than the above termination threshold, it can be determined that the current image segmentation method has not met the accuracy requirements and there is a need to continue iterating to improve the accuracy of the image segmentation method.
[0080] In order to obtain the above sub-image, in an optional implementation manner, after the above step S2024, the above method includes:
[0081] Step S301: determining a second membership matrix according to the second cluster centers and the second membership, where the second membership matrix is used to represent the correspondence between the samples and the sub-images;
[0082] Specifically, after determining that the image segmentation method has achieved accuracy, the output of the improved FCM algorithm is obtained, which is the second membership matrix. This includes the cluster centers calculated in this iteration and the subordinate relationship between each pixel and each cluster center. Each cluster center corresponds to a sub-image.
[0083] Step S302: performing image segmentation on the video image according to the second membership matrix.
[0084] Specifically, according to the second membership matrix, the required image segmentation method can be obtained, and image segmentation can be performed according to the method.
[0085] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the image segmentation method for mobile targets in mines of the present application will be described in detail below with reference to specific embodiments.
[0086] This embodiment relates to a specific method for image segmentation of a moving target in a mine. Figure 3 As shown, the following steps are included:
[0087] Step S1: First input the image to be segmented, the size is M×N, the number of pixels in the image is n=M*N, and initialize the cluster center V i , then initialize the number of clusters c, membership, initial iterations, maximum iterations, and termination threshold, and set the initial iterations t = 1;
[0088] Step S2: Calculate the new u ij and V i The value of
[0089] Step S3: Calculate the value of the objective function and determine whether it reaches the termination threshold or the pre-set number of iterations. If the termination threshold is reached, the iteration stops and the process goes to step S4. If neither of these two conditions is met, the value of t is incremented by 1 and the process goes to step S2.
[0090] Step S4: Divide each pixel point according to the obtained membership degree and cluster center, and segment the image.
[0091] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0092] In another embodiment of the present application, a superpixel number K value analysis is performed.
[0093] The value of K significantly affects the image segmentation results. When the value of m remains constant, increasing K results in more uniform superpixel sizes and finer segmentation. However, excessively high K values introduce redundant information, leading to unnecessary computational overhead and unnecessary computational effort for subsequent experiments. K should be kept as low as possible, while also ensuring high boundary segmentation accuracy. This reduces unnecessary computation while improving accuracy.
[0094] In order to more intuitively understand the impact of the number of superpixels K on image segmentation, the three indicators UE, ASA, and BR are used to qualitatively measure the image segmentation results on the MSRC dataset. Figure 4 The effect of the number of superpixels on the under-segmentation rate of image segmentation. The under-segmentation rate is the error rate between the segmentation result and the true value of the manually labeled boundary, such as Figure 4 As shown in Figure 3, within a certain range, as the number of superpixels increases, the value of UE gradually decreases and then enters a saturation state. In this state, even if the value of K continues to increase, the under-segmentation rate will not continue to decrease.
[0095] Figure 5 is the effect of the number of superpixels on segmentation accuracy. Segmentation accuracy is the upper limit indicator of the performance of segmenting images, such as Figure 5 As shown in Figure 1, within a certain range, as the number of superpixels increases, in the early stage, when the number of superpixels is small, the ASA grows very fast, and the segmentation accuracy improves rapidly. Afterwards, as the K value continues to increase, the ASA growth rate gradually slows down and finally reaches a saturation state.
[0096] Figure 6 is the effect of the number of superpixels on the edge recall rate of image segmentation. The edge recall rate is a measure of the ratio of the overlap between the target boundary of image segmentation and the true boundary. Figure 6 As shown in Figure 2, within a certain area, as the number of superpixels increases, BR increases steadily. When the K value increases to a certain number, the BR value tends to be stable.
[0097] The embodiment of the present application also provides an image segmentation device for a mobile target in a mine. It should be noted that the image segmentation device for a mobile target in a mine in the embodiment of the present application can be used to execute the image segmentation method for a mobile target in a mine provided in the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation methods, and the details that have been explained will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and conceivable.
[0098] The following introduces the image segmentation device for a moving target in a mine provided by an embodiment of the present application.
[0099] Figure 7 Schematic diagram of an image segmentation device for a mobile target in a mine according to an embodiment of the present application. Figure 7 As shown, the device includes:
[0100] An acquisition unit 10 is used to acquire mine video images, wherein the video images are video images of various construction sites monitored by monitoring equipment during underground mining;
[0101] Specifically, various emergencies may occur during underground coal mining. Collecting underground images and judging the mining situation are of great significance for resolving safety hazards and ensuring property and personal safety during the mining process.
[0102] The segmentation unit 20 is used to segment the video image using an improved FCM algorithm to obtain multiple sub-images. The improved FCM algorithm is an improved algorithm that adds Markov's prior probability as a constraint term to the objective function of the standard FCM algorithm.
[0103] Specifically, when processing collected downhole images, the FCM algorithm is often used for image segmentation. However, the objective function of the FCM algorithm in the prior art lacks consideration of spatial information, resulting in poor noise resistance. Furthermore, the downhole environment is relatively complex, and the direct use of the standard FCM algorithm for image segmentation has poor accuracy and is difficult to meet usage requirements. Therefore, this application improves the existing FCM algorithm by adding a Markov prior probability as a constraint term in the objective function. This allows the objective function to include neighborhood information constraints when performing the constraints, thereby enhancing the FCM algorithm's noise resistance.
[0104] In this embodiment, an acquisition unit acquires a mine video image, which is a video image of various construction sites monitored by monitoring equipment during underground mining. A segmentation unit segments the video image using an improved FCM algorithm to obtain multiple sub-images. The improved FCM algorithm incorporates a Markov prior probability as a constraint term into the objective function of the standard FCM algorithm. By incorporating a Markov random process-based prior probability as a constraint term into the FCM algorithm's objective function, the improved FCM algorithm incorporates both the distance from the pixel to the cluster center used in the standard FCM algorithm and the pixel's neighborhood information, namely, the Markov random process prior probability. Even if a noise point or interference point is close to the i-th cluster center, the probability of it being classified into the i-th cluster is very low based on its neighborhood information. Therefore, this point is largely excluded from classification into the i-th cluster. This effectively suppresses noise and interference points in the image, thereby ensuring more accurate segmentation results. This device addresses the poor noise immunity of the standard FCM algorithm in the prior art.
[0105] In order to accurately segment the video image to obtain multiple sub-images, in an optional implementation manner, the segmentation unit includes:
[0106] an identification module, configured to perform an identification step, identify the video image, and obtain a sample set, wherein the samples in the sample set are pixels of the video image;
[0107] Specifically, by scanning the collected video image, the video image is decomposed into pixel points that make up the image, and all the pixel points form a sample set. The sample set is the above-mentioned video image, and the pixel points are the samples in the sample set. The image segmentation problem is converted into a data calculation problem.
[0108] An initialization module is used to perform an initialization step to initialize relevant parameters of the improved FCM algorithm to obtain a first membership matrix, wherein the relevant parameters include a first cluster center, a number of clusters, a number of iterations, a maximum number of iterations, a termination threshold, a sample set, and a first membership. The first cluster center is the initial cluster center of the improved FCM algorithm, the first membership is the initial membership of the improved FCM algorithm, and the number of clusters is the number of clusters obtained at the end of the improved FCM algorithm. The termination threshold is used to terminate the operation of the improved FCM algorithm, and the membership is used to characterize the degree to which a pixel point belongs to the cluster center.
[0109] Specifically, this application sets a sample set and, based on the Markov characteristics of the image segmentation process, constructs a Markov random field on a two-dimensional plane for all pixel points. By setting relevant parameters, the image segmentation problem is converted into the calculation of a random probability model.
[0110] a first calculation module, configured to execute a first calculation step, clustering the sample set to obtain a plurality of sample clusters, wherein the sample clusters correspond one-to-one to second cluster centers, and the second cluster centers are cluster centers calculated in an iterative process;
[0111] Specifically, a set of clusters can be obtained based on the initial cluster centers, that is, an image segmentation solution can be obtained. However, since the initial cluster centers are set randomly, the image segmentation solution obtained at this time is not accurate. It is necessary to recalculate the cluster centers based on the existing sample set, that is, the second cluster centers mentioned above, to obtain a more accurate image segmentation solution.
[0112] a second calculation module, configured to perform a second calculation step, determine an objective function based on the membership degree and the second cluster center, and calculate a function value of the objective function, wherein the objective function is a loss function of the iterative process of the improved FCM algorithm;
[0113] Specifically, the above loss function is used to measure the accuracy of the image segmentation method corresponding to the current cluster.
[0114] The repetition module is used to execute the repetition step, repeating the first calculation step and the second calculation step at least once in sequence until the number of iterations is equal to the maximum number of iterations, so that the plurality of sample clusters form the plurality of sub-images in one-to-one correspondence.
[0115] In order to convert image segmentation into random probability model calculation, in an optional implementation, the initialization module includes:
[0116] A first setting submodule is configured to set the number of clusters and determine a random number of samples in the sample set as the first cluster centers, wherein the random number is at least greater than the number of clusters;
[0117] Specifically, the number of clusters in the improved FCM algorithm is set, that is, the number of clusters obtained by the final algorithm, that is, the number of sub-images into which the video image is ultimately segmented. The greater the number of sub-images, the better the final segmentation effect. However, as the number of segmented sub-images increases, the computational complexity increases dramatically, while the improvement in segmentation effect is minimal. Therefore, it is necessary to set an appropriate number of sub-images. At the same time, the initial cluster centers of the improved FCM algorithm are set. A certain number of pixels are randomly selected and used as cluster centers for fuzzy clustering. To obtain the final clusters, the number of cluster centers should be much larger than the number of clusters to facilitate screening.
[0118] A second setting submodule is used to set the termination threshold, the number of iterations and the maximum number of iterations;
[0119] Specifically, the termination threshold is used to evaluate the accuracy of the segmented sub-images. Only sub-images that meet the required accuracy can be used to predict underground mining conditions. Similarly, as the number of algorithm iterations increases, the accuracy of the sub-images increases, and the computational effort also increases. Therefore, it is necessary to set an appropriate maximum number of iterations to constrain the algorithm and conserve computing resources.
[0120] The third setting submodule is used to set the membership degree corresponding to each of the above samples to obtain a plurality of the above first membership degrees, and the above first membership degrees correspond to the above samples one by one.
[0121] Specifically, after determining the initial cluster center, it is necessary to perform fuzzy clustering on the pixels in the sample set to determine to which cluster center the pixel belongs, that is, to which cluster center the pixel is segmented into the image corresponding to. Therefore, each pixel has a membership degree for each cluster center, which is used to determine to which cluster center the pixel belongs. To further explain, the above-mentioned pixel points belong to the corresponding cluster center with the largest membership degree.
[0122] In order to obtain a more accurate image segmentation method, in an optional implementation, the first calculation module includes:
[0123] A first calculation submodule is configured to calculate a plurality of distances based on the first cluster center and the sample set, wherein the distances are Euclidean distances between each sample and each first cluster center in a two-dimensional space;
[0124] Specifically, the sample set corresponds to the video image, and a coordinate system can be established according to the image, that is, each pixel point is converted into a coordinate point, and the distance between the cluster center and the pixel point is calculated.
[0125] A second calculation submodule is used to calculate the prior probability corresponding to the above sample based on the above sample set, and the above prior probability is used to characterize the neighborhood relationship between each of the above samples and each of the above first cluster centers;
[0126] Specifically, each pixel point is used as a variable in the image segmentation process, and the entire sample set constitutes a Markov random field. According to the Markov characteristic, the pixels in the image only depend on the pixels around it, and have nothing to do with other pixels farther away from it. Therefore, the prior probability is crucial information for accurate image segmentation, which is used to express the neighborhood relationship between the sample and the cluster center.
[0127] A third calculation submodule is configured to calculate the degree of membership of each of the samples and each of the first cluster centers based on the distance and the prior probability to obtain a plurality of second degrees of membership;
[0128] Specifically, the degree of membership between each pixel and each cluster center, namely the second degree of membership, can be calculated according to the formula in the improved FCM algorithm. The formula is as follows:
[0129]
[0130] Among them, d ij is the above Euclidean distance, P is the prior probability, is the constraint coefficient, c is the number of clusters, X is the sample, u ij is the above membership degree.
[0131] The fourth calculation submodule is configured to calculate a plurality of cluster centers according to the second membership degree and each of the samples to obtain the second cluster center.
[0132] Specifically, the new cluster center, namely the second cluster center, can be calculated according to the formula in the improved FCM algorithm. The above formula is as follows:
[0133]
[0134] Among them, V i is the above cluster center, and n is the number of the above selected cluster centers.
[0135] In order to determine the accuracy of the above image segmentation method, in an optional embodiment, the above second calculation module includes:
[0136] A determination submodule, configured to determine the objective function based on the second cluster center, the distance, and the prior probability;
[0137] Specifically, the standard FCM algorithm only considers the Euclidean distance in the process of calculating accuracy, that is, only the distance between the pixel point and the cluster center is considered to determine the accuracy. Such classification may cause interference points or noise points in the pixel points to be misclassified. The present application adds a priori probability to the constraint term of the loss function, that is, in addition to considering the Euclidean distance, the neighborhood relationship between the pixel points is also considered. Even if a noise point or interference point close to the i-th cluster center is encountered, it can be obtained from its neighborhood information that the probability of it being classified into the i-th category is very small, so this point will not be classified into the i-th category to a large extent, thereby improving the noise resistance of the algorithm.
[0138] The fifth calculation submodule is used to calculate the above function value according to the above objective function.
[0139] Specifically, the loss function value, that is, the above function value, can be calculated according to the formula in the improved FCM algorithm. The above formula is as follows:
[0140]
[0141] In order to determine whether to end the iteration, in an optional embodiment, the repetition module includes:
[0142] An acquisition submodule, configured to obtain the function value when the number of iterations reaches the maximum number of iterations;
[0143] Specifically, when the number of iterations reaches a preset maximum number of iterations, the image segmentation method is close to the accuracy requirement, and the function value is obtained to determine the current accuracy requirement.
[0144] The control submodule is used to compare the above function value with the above termination threshold, stop iteration when the above function value is not greater than the above termination threshold, and continue iteration until the above function value is no greater than the above termination threshold when the above function value is greater than the above termination threshold.
[0145] Specifically, when the above function value is not greater than the above termination threshold, it can be determined that the current image segmentation method has met the accuracy requirements and there is no need to continue iterating to improve the accuracy of the image segmentation method. When the above function value is greater than the above termination threshold, it can be determined that the current image segmentation method has not met the accuracy requirements and there is a need to continue iterating to improve the accuracy of the image segmentation method.
[0146] In order to obtain the above sub-image, in an optional implementation manner, the above apparatus further includes:
[0147] a determining unit, configured to determine a second membership matrix according to the second cluster centers and the second membership, wherein the second membership matrix is used to represent a correspondence between the samples and the sub-images;
[0148] Specifically, after determining that the image segmentation method has achieved accuracy, the output of the improved FCM algorithm is obtained, which is the second membership matrix. This includes the cluster centers calculated in this iteration and the subordinate relationship between each pixel and each cluster center. Each cluster center corresponds to a sub-image.
[0149] A control unit is configured to perform image segmentation on the video image according to the second membership matrix.
[0150] Specifically, according to the second membership matrix, the required image segmentation method can be obtained, and image segmentation can be performed according to the method.
[0151] The above-mentioned image segmentation device for a mobile target in a mine includes a processor and a memory. The acquisition unit and the segmentation unit are stored as program units in the memory. The processor executes the program units stored in the memory to implement the corresponding functions. The above-mentioned modules are all located in the same processor; alternatively, the above-mentioned modules can be located in different processors in any combination.
[0152] The processor contains a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the noise resistance performance of the FCM algorithm can be improved by adjusting the kernel parameters.
[0153] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0154] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program. When the program is run, the device where the computer-readable storage medium is located is controlled to execute the image segmentation method for mobile targets in mines.
[0155] Specifically, the image segmentation method of a moving target in a mine includes:
[0156] Step S201: Acquire a mine video image, wherein the video image is a video image of each construction site monitored by monitoring equipment during the underground mining process;
[0157] Specifically, various emergencies may occur during underground coal mining. Collecting underground images and judging the mining situation are of great significance for resolving safety hazards and ensuring property and personal safety during the mining process.
[0158] Step S202 , segmenting the video image using an improved FCM algorithm to obtain a plurality of sub-images. The improved FCM algorithm is an improved algorithm that adds the Markov prior probability as a constraint term to the objective function of the standard FCM algorithm.
[0159] Specifically, when processing collected downhole images, the FCM algorithm is often used for image segmentation. However, the objective function of the FCM algorithm in the prior art lacks consideration of spatial information, resulting in poor noise resistance. Furthermore, the downhole environment is relatively complex, and the direct use of the standard FCM algorithm for image segmentation has poor accuracy and is difficult to meet usage requirements. Therefore, this application improves the existing FCM algorithm by adding a Markov prior probability as a constraint term in the objective function. This allows the objective function to include neighborhood information constraints when performing the constraints, thereby enhancing the FCM algorithm's noise resistance.
[0160] Optionally, step S2021 is an identification step, in which the video image is identified to obtain a sample set, where the samples in the sample set are the pixels of the video image; step S2022 is an initialization step, in which the relevant parameters of the improved FCM algorithm are initialized to obtain a first membership matrix, where the relevant parameters include a first cluster center, a number of clusters, an iteration number, a maximum iteration number, a termination threshold, a sample set and a first membership matrix, where the first cluster center is the initial cluster center of the improved FCM algorithm, the first membership matrix is the initial membership matrix of the improved FCM algorithm, and the number of clusters is the number of clusters obtained when the improved FCM algorithm ends running; the termination threshold is used to terminate the running of the improved FCM algorithm, and the membership matrix is used to terminate the running of the improved FCM algorithm. To characterize the degree to which the pixel point belongs to the cluster center; step S2023, the first calculation step, clustering the above sample set to obtain multiple sample clusters, the above sample clusters correspond one-to-one to the second cluster center, and the above second cluster center is the cluster center calculated in the iterative process; step S2024, the second calculation step, determining the objective function according to the above membership degree and the above second cluster center and calculating the function value of the above objective function, the above objective function is the loss function of the iterative process of the above improved FCM algorithm; step S2025, repeating step, repeating the above first calculation step and the above second calculation step in sequence at least once, until the above number of iterations is equal to the above maximum number of iterations, so that the above multiple sample clusters form the above multiple sub-images in one-to-one correspondence.
[0161] Optionally, in step S20221, the number of clusters is set, and a random number of samples in the sample set is determined as the first cluster centers, and the random number is at least greater than the number of clusters; in step S20222, the termination threshold, the number of iterations and the maximum number of iterations are set; in step S20223, the degree of membership corresponding to each of the samples is set to obtain a plurality of the first degrees of membership, and the first degrees of membership correspond one-to-one to the samples.
[0162] Optionally, in step S20231, multiple distances are calculated based on the above-mentioned first cluster center and the above-mentioned sample set, and the above-mentioned distances are the Euclidean distances between each of the above-mentioned samples and each of the above-mentioned first cluster centers in two-dimensional space; in step S20232, the corresponding prior probabilities of the above-mentioned samples are calculated based on the above-mentioned sample set, and the above-mentioned prior probabilities are used to characterize the neighborhood relationship between each of the above-mentioned samples and each of the above-mentioned first cluster centers; in step S20233, the above-mentioned membership degrees of each of the above-mentioned samples and each of the above-mentioned first cluster centers are calculated based on the above-mentioned distances and the above-mentioned prior probabilities, and multiple second membership degrees are obtained; in step S20234, multiple cluster centers are calculated based on the above-mentioned second membership degrees and each of the above-mentioned samples to obtain the above-mentioned second cluster centers.
[0163] Optionally, in step S20241, the objective function is determined based on the second cluster center, the distance and the prior probability; and in step S20242, the function value is calculated based on the objective function.
[0164] Optionally, in step S20251, when the above-mentioned number of iterations reaches the above-mentioned maximum number of iterations, the above-mentioned function value is obtained; in step S20252, the above-mentioned function value is compared with the above-mentioned termination threshold, and when the above-mentioned function value is not greater than the above-mentioned termination threshold, the iteration is stopped; when the above-mentioned function value is greater than the above-mentioned termination threshold, the iteration is continued until the above-mentioned function value is no greater than the above-mentioned termination threshold.
[0165] Optionally, in step S301, a second membership matrix is determined based on the second cluster center and the second membership, where the second membership matrix is used to characterize the correspondence between the sample and the sub-image; and in step S302, image segmentation is performed on the video image based on the second membership matrix.
[0166] An embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes the image segmentation method for a mobile target in a mine when running.
[0167] Specifically, the image segmentation method of a moving target in a mine includes:
[0168] Step S201: Acquire a mine video image, wherein the video image is a video image of each construction site monitored by monitoring equipment during the underground mining process;
[0169] Specifically, various emergencies may occur during underground coal mining. Collecting underground images and judging the mining situation are of great significance for resolving safety hazards and ensuring property and personal safety during the mining process.
[0170] Step S202 , segmenting the video image using an improved FCM algorithm to obtain a plurality of sub-images. The improved FCM algorithm is an improved algorithm that adds the Markov prior probability as a constraint term to the objective function of the standard FCM algorithm.
[0171] Specifically, when processing collected downhole images, the FCM algorithm is often used for image segmentation. However, the objective function of the FCM algorithm in the prior art lacks consideration of spatial information, resulting in poor noise resistance. Furthermore, the downhole environment is relatively complex, and the direct use of the standard FCM algorithm for image segmentation has poor accuracy and is difficult to meet usage requirements. Therefore, this application improves the existing FCM algorithm by adding a Markov prior probability as a constraint term in the objective function. This allows the objective function to include neighborhood information constraints when performing the constraints, thereby enhancing the FCM algorithm's noise resistance.
[0172] Optionally, step S2021 is an identification step, in which the video image is identified to obtain a sample set, where the samples in the sample set are the pixels of the video image; step S2022 is an initialization step, in which the relevant parameters of the improved FCM algorithm are initialized to obtain a first membership matrix, where the relevant parameters include a first cluster center, a number of clusters, an iteration number, a maximum iteration number, a termination threshold, a sample set and a first membership matrix, where the first cluster center is the initial cluster center of the improved FCM algorithm, the first membership matrix is the initial membership matrix of the improved FCM algorithm, and the number of clusters is the number of clusters obtained when the improved FCM algorithm ends running; the termination threshold is used to terminate the running of the improved FCM algorithm, and the membership matrix is used to terminate the running of the improved FCM algorithm. To characterize the degree to which the pixel point belongs to the cluster center; step S2023, the first calculation step, clustering the above sample set to obtain multiple sample clusters, the above sample clusters correspond one-to-one to the second cluster center, and the above second cluster center is the cluster center calculated in the iterative process; step S2024, the second calculation step, determining the objective function according to the above membership degree and the above second cluster center and calculating the function value of the above objective function, the above objective function is the loss function of the iterative process of the above improved FCM algorithm; step S2025, repeating step, repeating the above first calculation step and the above second calculation step in sequence at least once, until the above number of iterations is equal to the above maximum number of iterations, so that the above multiple sample clusters form the above multiple sub-images in one-to-one correspondence.
[0173] Optionally, in step S20221, the number of clusters is set, and a random number of samples in the sample set is determined as the first cluster centers, and the random number is at least greater than the number of clusters; in step S20222, the termination threshold, the number of iterations and the maximum number of iterations are set; in step S20223, the degree of membership corresponding to each of the samples is set to obtain a plurality of the first degrees of membership, and the first degrees of membership correspond one-to-one to the samples.
[0174] Optionally, in step S20231, multiple distances are calculated based on the above-mentioned first cluster center and the above-mentioned sample set, and the above-mentioned distances are the Euclidean distances between each of the above-mentioned samples and each of the above-mentioned first cluster centers in two-dimensional space; in step S20232, the corresponding prior probabilities of the above-mentioned samples are calculated based on the above-mentioned sample set, and the above-mentioned prior probabilities are used to characterize the neighborhood relationship between each of the above-mentioned samples and each of the above-mentioned first cluster centers; in step S20233, the above-mentioned membership degrees of each of the above-mentioned samples and each of the above-mentioned first cluster centers are calculated based on the above-mentioned distances and the above-mentioned prior probabilities, and multiple second membership degrees are obtained; in step S20234, multiple cluster centers are calculated based on the above-mentioned second membership degrees and each of the above-mentioned samples to obtain the above-mentioned second cluster centers.
[0175] Optionally, in step S20241, the objective function is determined based on the second cluster center, the distance and the prior probability; and in step S20242, the function value is calculated based on the objective function.
[0176] Optionally, in step S20251, when the above-mentioned number of iterations reaches the above-mentioned maximum number of iterations, the above-mentioned function value is obtained; in step S20252, the above-mentioned function value is compared with the above-mentioned termination threshold, and when the above-mentioned function value is not greater than the above-mentioned termination threshold, the iteration is stopped; when the above-mentioned function value is greater than the above-mentioned termination threshold, the iteration is continued until the above-mentioned function value is no greater than the above-mentioned termination threshold.
[0177] Optionally, in step S301, a second membership matrix is determined based on the second cluster center and the second membership, where the second membership matrix is used to characterize the correspondence between the sample and the sub-image; and in step S302, image segmentation is performed on the video image based on the second membership matrix.
[0178] An embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes the image segmentation method for a mobile target in a mine when running.
[0179] An embodiment of the present invention provides a monitoring system, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, at least the following steps are performed:
[0180] Step S201: Acquire a mine video image, wherein the video image is a video image of each construction site monitored by monitoring equipment during the underground mining process;
[0181] Step S202 , segmenting the video image using an improved FCM algorithm to obtain a plurality of sub-images. The improved FCM algorithm is an improved algorithm that adds the Markov prior probability as a constraint term to the objective function of the standard FCM algorithm.
[0182] Optionally, step S2021 is an identification step, in which the video image is identified to obtain a sample set, where the samples in the sample set are the pixels of the video image; step S2022 is an initialization step, in which the relevant parameters of the improved FCM algorithm are initialized to obtain a first membership matrix, where the relevant parameters include a first cluster center, a number of clusters, an iteration number, a maximum iteration number, a termination threshold, a sample set and a first membership matrix, where the first cluster center is the initial cluster center of the improved FCM algorithm, the first membership matrix is the initial membership matrix of the improved FCM algorithm, and the number of clusters is the number of clusters obtained when the improved FCM algorithm ends running; the termination threshold is used to terminate the running of the improved FCM algorithm, and the membership matrix is used to terminate the running of the improved FCM algorithm. To characterize the degree to which the pixel point belongs to the cluster center; step S2023, the first calculation step, clustering the above sample set to obtain multiple sample clusters, the above sample clusters correspond one-to-one to the second cluster center, and the above second cluster center is the cluster center calculated in the iterative process; step S2024, the second calculation step, determining the objective function according to the above membership degree and the above second cluster center and calculating the function value of the above objective function, the above objective function is the loss function of the iterative process of the above improved FCM algorithm; step S2025, repeating step, repeating the above first calculation step and the above second calculation step in sequence at least once, until the above number of iterations is equal to the above maximum number of iterations, so that the above multiple sample clusters form the above multiple sub-images in one-to-one correspondence.
[0183] Optionally, in step S20221, the number of clusters is set, and a random number of samples in the sample set is determined as the first cluster centers, and the random number is at least greater than the number of clusters; in step S20222, the termination threshold, the number of iterations and the maximum number of iterations are set; in step S20223, the degree of membership corresponding to each of the samples is set to obtain a plurality of the first degrees of membership, and the first degrees of membership correspond one-to-one to the samples.
[0184] Optionally, in step S20231, multiple distances are calculated based on the above-mentioned first cluster center and the above-mentioned sample set, and the above-mentioned distances are the Euclidean distances between each of the above-mentioned samples and each of the above-mentioned first cluster centers in two-dimensional space; in step S20232, the corresponding prior probabilities of the above-mentioned samples are calculated based on the above-mentioned sample set, and the above-mentioned prior probabilities are used to characterize the neighborhood relationship between each of the above-mentioned samples and each of the above-mentioned first cluster centers; in step S20233, the above-mentioned membership degrees of each of the above-mentioned samples and each of the above-mentioned first cluster centers are calculated based on the above-mentioned distances and the above-mentioned prior probabilities, and multiple second membership degrees are obtained; in step S20234, multiple cluster centers are calculated based on the above-mentioned second membership degrees and each of the above-mentioned samples to obtain the above-mentioned second cluster centers.
[0185] Optionally, in step S20241, the objective function is determined based on the second cluster center, the distance and the prior probability; and in step S20242, the function value is calculated based on the objective function.
[0186] Optionally, in step S20251, when the above-mentioned number of iterations reaches the above-mentioned maximum number of iterations, the above-mentioned function value is obtained; in step S20252, the above-mentioned function value is compared with the above-mentioned termination threshold, and when the above-mentioned function value is not greater than the above-mentioned termination threshold, the iteration is stopped; when the above-mentioned function value is greater than the above-mentioned termination threshold, the iteration is continued until the above-mentioned function value is no greater than the above-mentioned termination threshold.
[0187] Optionally, in step S301, a second membership matrix is determined based on the second cluster center and the second membership, where the second membership matrix is used to characterize the correspondence between the sample and the sub-image; and in step S302, image segmentation is performed on the video image based on the second membership matrix.
[0188] An embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes the image segmentation method for a mobile target in a mine when running.
[0189] The present application also provides a computer program product, which, when executed on a data processing device, is adapted to execute a program for initializing at least the following method steps:
[0190] Step S201: Acquire a mine video image, wherein the video image is a video image of each construction site monitored by monitoring equipment during the underground mining process;
[0191] Step S202 , segmenting the video image using an improved FCM algorithm to obtain a plurality of sub-images. The improved FCM algorithm is an improved algorithm that adds the Markov prior probability as a constraint term to the objective function of the standard FCM algorithm.
[0192] Optionally, step S2021 is an identification step, in which the video image is identified to obtain a sample set, where the samples in the sample set are the pixels of the video image; step S2022 is an initialization step, in which the relevant parameters of the improved FCM algorithm are initialized to obtain a first membership matrix, where the relevant parameters include a first cluster center, a number of clusters, an iteration number, a maximum iteration number, a termination threshold, a sample set and a first membership matrix, where the first cluster center is the initial cluster center of the improved FCM algorithm, the first membership matrix is the initial membership matrix of the improved FCM algorithm, and the number of clusters is the number of clusters obtained when the improved FCM algorithm ends running; the termination threshold is used to terminate the running of the improved FCM algorithm, and the membership matrix is used to terminate the running of the improved FCM algorithm. To characterize the degree to which the pixel point belongs to the cluster center; step S2023, the first calculation step, clustering the above sample set to obtain multiple sample clusters, the above sample clusters correspond one-to-one to the second cluster center, and the above second cluster center is the cluster center calculated in the iterative process; step S2024, the second calculation step, determining the objective function according to the above membership degree and the above second cluster center and calculating the function value of the above objective function, the above objective function is the loss function of the iterative process of the above improved FCM algorithm; step S2025, repeating step, repeating the above first calculation step and the above second calculation step in sequence at least once, until the above number of iterations is equal to the above maximum number of iterations, so that the above multiple sample clusters form the above multiple sub-images in one-to-one correspondence.
[0193] Optionally, in step S20221, the number of clusters is set, and a random number of samples in the sample set is determined as the first cluster centers, and the random number is at least greater than the number of clusters; in step S20222, the termination threshold, the number of iterations and the maximum number of iterations are set; in step S20223, the degree of membership corresponding to each of the samples is set to obtain a plurality of the first degrees of membership, and the first degrees of membership correspond one-to-one to the samples.
[0194] Optionally, in step S20231, multiple distances are calculated based on the above-mentioned first cluster center and the above-mentioned sample set, and the above-mentioned distances are the Euclidean distances between each of the above-mentioned samples and each of the above-mentioned first cluster centers in two-dimensional space; in step S20232, the corresponding prior probabilities of the above-mentioned samples are calculated based on the above-mentioned sample set, and the above-mentioned prior probabilities are used to characterize the neighborhood relationship between each of the above-mentioned samples and each of the above-mentioned first cluster centers; in step S20233, the above-mentioned membership degrees of each of the above-mentioned samples and each of the above-mentioned first cluster centers are calculated based on the above-mentioned distances and the above-mentioned prior probabilities, and multiple second membership degrees are obtained; in step S20234, multiple cluster centers are calculated based on the above-mentioned second membership degrees and each of the above-mentioned samples to obtain the above-mentioned second cluster centers.
[0195] Optionally, in step S20241, the objective function is determined based on the second cluster center, the distance and the prior probability; and in step S20242, the function value is calculated based on the objective function.
[0196] Optionally, in step S20251, when the above-mentioned number of iterations reaches the above-mentioned maximum number of iterations, the above-mentioned function value is obtained; in step S20252, the above-mentioned function value is compared with the above-mentioned termination threshold, and when the above-mentioned function value is not greater than the above-mentioned termination threshold, the iteration is stopped; when the above-mentioned function value is greater than the above-mentioned termination threshold, the iteration is continued until the above-mentioned function value is no greater than the above-mentioned termination threshold.
[0197] Optionally, in step S301, a second membership matrix is determined based on the second cluster center and the second membership, where the second membership matrix is used to characterize the correspondence between the sample and the sub-image; and in step S302, image segmentation is performed on the video image based on the second membership matrix.
[0198] Obviously, those skilled in the art will appreciate that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device, can be centralized on a single computing device, or can be distributed across a network of multiple computing devices. They can be implemented using program code executable by the computing device, and thus, can be stored in a storage device and executed by the computing device. In some cases, the steps shown or described herein can be performed in a different order than that shown, or can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0199] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0200] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0201] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0202] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.
[0203] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0204] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0205] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0206] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0207] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0208] 1) The present invention relates to an image segmentation method for mobile targets in a mine. First, a mine video image is acquired. The video image is obtained from various construction sites monitored by monitoring equipment during underground mining. Then, an improved FCM algorithm is used to segment the video image to obtain multiple sub-images. The improved FCM algorithm is an improved algorithm that adds a Markov prior probability as a constraint to the objective function of the standard FCM algorithm. By adding a Markov random process-based prior probability as a constraint to the FCM algorithm's objective function, the improved FCM algorithm incorporates both the distance from the pixel to the cluster center in the standard FCM algorithm and the pixel's neighborhood information, namely the Markov random process prior probability. Even if a noise point or interference point is close to the i-th cluster center, the probability of it being classified into the i-th cluster is very low based on its neighborhood information. Therefore, this point is largely excluded from classification into the i-th cluster. This effectively suppresses noise and interference points in the image, thereby ensuring more accurate segmentation results. This method addresses the poor noise immunity of the standard FCM algorithm in the prior art.
[0209] 2) The present invention relates to an image segmentation device for a mobile target in a mine. The acquisition unit acquires a video image of the mine, which is a video image of various construction sites monitored by monitoring equipment during underground mining. The segmentation unit segments the video image using an improved FCM algorithm to obtain multiple sub-images. The improved FCM algorithm incorporates a Markov prior probability as a constraint term into the objective function of the standard FCM algorithm. By incorporating a Markov random process-based prior probability as a constraint term into the FCM algorithm's objective function, the improved FCM algorithm incorporates both the distance from the pixel to the cluster center in the standard FCM algorithm and the pixel's neighborhood information, i.e., the Markov random process prior probability. Even if a noise point or interference point is close to the i-th cluster center, the probability of it being classified into the i-th cluster is very low based on its neighborhood information. Therefore, this point is largely excluded from classification into the i-th cluster. This effectively suppresses noise and interference points in the image, thereby ensuring more accurate segmentation results. This device addresses the poor noise immunity of the standard FCM algorithm in the prior art.
[0210] The above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
Claims
1. A method for image segmentation of a moving target in a mine, characterized in that: The method comprises: Acquire mine video images, wherein the video images are video images of various construction sites monitored by monitoring equipment during underground mining; An improved FCM algorithm is used to segment the video image to obtain a plurality of sub-images. The improved FCM algorithm is an improved algorithm that adds a Markov prior probability as a constraint term to the objective function of the standard FCM algorithm. The improved FCM algorithm is used to perform image segmentation on the video image to obtain multiple sub-images, including: an identification step, identifying the video image to obtain a sample set, where the samples in the sample set are pixel points of the video image; an initialization step, initializing relevant parameters of the improved FCM algorithm to obtain a first membership matrix, where the relevant parameters include a first cluster center, the number of clusters, the number of iterations, the maximum number of iterations, a termination threshold, a sample set and a first membership matrix, where the first cluster center is the initial cluster center of the improved FCM algorithm, the first membership is the initial membership of the improved FCM algorithm, and the number of clusters is the number of clusters obtained when the improved FCM algorithm is finished running; the termination threshold is used to terminate the segmentation. The improved FCM algorithm is run, and the membership degree is used to characterize the degree to which the pixel point belongs to the cluster center; in a first calculation step, the sample set is clustered to obtain multiple sample clusters, and the sample clusters correspond one-to-one to the second cluster centers, and the second cluster centers are cluster centers calculated in the iterative process; in a second calculation step, an objective function is determined according to the membership degree and the second cluster centers and a function value of the objective function is calculated, and the objective function is a loss function of the iterative process of the improved FCM algorithm; in a repeating step, the first calculation step and the second calculation step are repeated in sequence at least once until the number of iterations is equal to the maximum number of iterations, so that the multiple sample clusters form the multiple sub-images in one-to-one correspondence; Clustering the sample set to obtain a plurality of sample clusters, wherein the sample clusters correspond one-to-one to the second cluster centers, including: calculating a plurality of distances based on the first cluster centers and the sample set, wherein the distances are Euclidean distances between each sample and each first cluster center in a two-dimensional space; calculating a priori probability of the sample correspondence based on the sample set, wherein the priori probability is used to characterize the neighborhood relationship between each sample and each first cluster center; calculating the degree of membership between each sample and each first cluster center based on the distances and the priori probabilities to obtain a plurality of second degrees of membership; and calculating a plurality of cluster centers based on the second degrees of membership and each sample to obtain a second cluster center; According to the membership degree and the second cluster center, the objective function is determined and the function value is calculated. The method also includes: determining the objective function according to the second cluster center, the distance and the prior probability; and calculating the function value according to the objective function.
2. The method according to claim 1, characterized in that Initialize the relevant parameters of the improved FCM algorithm, including: Setting the number of clusters, and determining a random number of the samples in the sample set as the first cluster centers, wherein the random number is at least greater than the number of clusters; Setting the termination threshold, the number of iterations, and the maximum number of iterations; The membership degree corresponding to each of the samples is set to obtain a plurality of the first membership degrees, where the first membership degrees correspond to the samples one-to-one.
3. The method according to claim 1, characterized in that Repeating the first calculation step and the second calculation step in sequence at least once until the number of iterations is equal to the maximum number of iterations includes: When the number of iterations reaches the maximum number of iterations, obtaining the function value; The function value is compared with the termination threshold. If the function value is not greater than the termination threshold, the iteration is stopped. If the function value is greater than the termination threshold, the iteration is continued until the function value is no greater than the termination threshold.
4. The method according to claim 3, wherein after repeating the first calculation step and the second calculation step at least once in sequence until the number of iterations is equal to the maximum number of iterations and the function value is less than the termination threshold, the method comprises: determining a second membership matrix according to the second cluster centers and the second membership, wherein the second membership matrix is used to represent a correspondence between the samples and the sub-images; Perform image segmentation on the video image according to the second membership matrix.
5. An image segmentation device for a moving target in a mine, characterized in that: The device comprises: An acquisition unit, configured to acquire mine video images, wherein the video images are video images of various construction sites monitored by monitoring equipment during underground mining; a segmentation unit, configured to segment the video image using an improved FCM algorithm to obtain a plurality of sub-images, wherein the improved FCM algorithm is an improved algorithm that adds a Markov prior probability as a constraint term to the objective function of the standard FCM algorithm; The segmentation unit includes: an identification module for performing an identification step, identifying the above-mentioned video image, and obtaining a sample set, wherein the samples in the above-mentioned sample set are the pixel points of the above-mentioned video image; an initialization module for performing an initialization step, initializing the relevant parameters of the above-mentioned improved FCM algorithm, and obtaining a first membership matrix, wherein the above-mentioned relevant parameters include a first cluster center, the number of clusters, the number of iterations, the maximum number of iterations, a termination threshold, a sample set, and a first membership matrix, wherein the above-mentioned first cluster center is the initial cluster center of the above-mentioned improved FCM algorithm, the above-mentioned first membership matrix is the initial membership matrix of the above-mentioned improved FCM algorithm, and the above-mentioned number of clusters is the number of clusters obtained when the above-mentioned improved FCM algorithm ends running; the above-mentioned termination threshold is used to end the running of the above-mentioned improved FCM algorithm, and the above-mentioned membership matrix is the first cluster center of the above-mentioned improved FCM algorithm, and the above-mentioned first membership matrix is the first membership matrix of the above-mentioned improved FCM algorithm. used to characterize the degree to which a pixel point belongs to a cluster center; a first calculation module, used to perform a first calculation step, clustering the sample set to obtain a plurality of sample clusters, wherein the sample clusters correspond one-to-one to the second cluster centers, and the second cluster centers are cluster centers calculated during the iterative process; a second calculation module, used to perform a second calculation step, determining an objective function based on the membership degree and the second cluster centers and calculating the function value of the objective function, wherein the objective function is a loss function of the iterative process of the improved FCM algorithm; a repetition module, used to perform a repetition step, sequentially repeating the first calculation step and the second calculation step at least once, until the number of iterations is equal to the maximum number of iterations, so that the plurality of sample clusters form the plurality of sub-images in one-to-one correspondence; The first calculation module includes: a first calculation submodule, configured to calculate a plurality of distances based on the first cluster center and the sample set, wherein the distances are Euclidean distances between each sample and each first cluster center in a two-dimensional space; a second calculation submodule, configured to calculate a priori probabilities corresponding to the samples based on the sample set, wherein the priori probabilities are used to characterize neighborhood relationships between each sample and each first cluster center; a third calculation submodule, configured to calculate the membership degrees of each sample and each first cluster center based on the distances and the priori probabilities, to obtain a plurality of second membership degrees; and a fourth calculation submodule, configured to calculate a plurality of cluster centers based on the second membership degrees and each sample, to obtain a second cluster center. The second calculation module includes: a determination submodule, used to determine the objective function according to the second cluster center, the distance and the prior probability; and a fifth calculation submodule, used to calculate the function value according to the objective function.
6. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 4.
7. A monitoring system, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing the method of any one of claims 1 to 4.
Citation Information
Patent Citations
Image segmentation improved algorithm based on Markov random field and region merging
CN111951282A
Image segmentation method, device and equipment and computer readable storage medium
CN114782687A