Image processing method, device and electronic equipment
By improving the position update strategy and adaptive threshold mechanism of the Parrot optimization algorithm, the problem of insufficient local search ability of the Parrot optimization algorithm in multi-threshold segmentation is solved, and the segmentation accuracy and efficiency of remote sensing images are improved.
Patent Information
- Application Number
- CN202410875468.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-07-02
AI Technical Summary
The existing Parrot optimization algorithm has weak local search capabilities in multi-threshold segmentation and is difficult to quickly escape from the local optimal solution, resulting in poor segmentation accuracy and efficiency of remote sensing images, especially when processing large-scale images, the computational complexity increases.
The improved Parrot optimization algorithm is used to determine the position update mathematical model executed during the iteration through adaptive thresholds, combined with the position update strategy in the communication stage and escape stage, to improve the convergence speed and accuracy of the algorithm, and to achieve rapid processing of multiple threshold parameters. Search for excellence.
It effectively improves the segmentation accuracy and image segmentation efficiency of remote sensing images, reduces calculation time, and ensures efficient optimization performance under multi-threshold conditions.
Smart Images

Figure CN118411376B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image processing method, device and electronic equipment. Background Art
[0002] Remote sensing technology can monitor the image intensity changes of mountain slopes in real time and promptly detect possible cracks, deformations, soil erosion, etc. Image segmentation technology can divide remote sensing images of construction sites into multiple sub-regions with similar characteristics. In order to improve the accuracy of image segmentation, multi-threshold segmentation is usually used. However, as the number of thresholds increases, the process of calculating cross entropy may become more complicated, resulting in an increase in the execution time of the algorithm. Especially when processing large-scale images or data sets, inappropriate related parameter settings will lead to poor segmentation results or slow algorithm convergence. The Parrot Optimization Algorithm is a meta-heuristic optimization algorithm based on Parrot. Combining the meta-heuristic optimization algorithm with the cross-entropy multi-threshold segmentation method can solve the problem that the process of calculating cross entropy may become more complicated in multiple thresholds as the number of thresholds increases. However, the local search ability of the Parrot Optimization Algorithm is relatively weak, and it is difficult to quickly escape from the local optimal solution. At the same time, the convergence speed of the algorithm is unstable, making it difficult to achieve fast and accurate optimization of multiple thresholds, and thus it is difficult to ensure the segmentation accuracy and image segmentation efficiency of remote sensing images. Summary of the invention
[0003] The purpose of the present invention is to provide an image processing method, device and electronic equipment to achieve rapid and accurate optimization of multiple threshold parameters, thereby improving the segmentation accuracy and image segmentation efficiency of the original remote sensing image.
[0004] The present invention provides an image processing method, which includes: obtaining an original remote sensing image to be processed and multiple threshold parameters to be optimized; processing the original remote sensing image to obtain a first remote sensing grayscale image; using a preset improved parrot optimization algorithm to optimize multiple threshold parameters to obtain the best parameter solution for each threshold parameter; wherein, in the improved parrot optimization algorithm, based on the adaptive threshold of the current iteration, determining a position update mathematical model for the communication stage or a position update mathematical model for the escape stage to be executed in the current iteration; the position update mathematical model for the communication stage is determined based on the communication factor of the current iteration, and the communication factor of the current iteration is determined based on the average fitness value and the minimum fitness value of the parrot population of the current iteration; based on the best parameter solution of each threshold parameter, segmenting the first remote sensing grayscale image to obtain a segmented target image corresponding to the original remote sensing image.
[0005] Furthermore, the communication factor of the current iteration is determined by the following formula:
[0006] ;
[0007] in, is the number of current iterations; Indicates the current iteration The exchange factor at is the maximum number of iterations; It is the largest parrot population; For the current iteration The minimum fitness value when ; For the current iteration At that time, i The fitness value of the position of the parrot.
[0008] Furthermore, the mathematical model of the position update in the communication phase is determined by the following formula:
[0009] ;
[0010] in, For the current iteration Time i The location of the parrot; is the t+1th iteration i The location of the parrot, For the current iteration The average position of the parrot population at that time; is a random probability, and its value is a random number within (0,1); is a random number within the range (0,1).
[0011] Furthermore, the adaptive threshold of the current iteration is determined by the following formula:
[0012] ;
[0013] in, For the current iteration Adaptive threshold when is the farthest communication distance between the global parrot individual and the best parrot position; the best parrot position is the current iteration The parrot position corresponding to the minimum fitness value at ; For the current iteration Time i The communication distance between the position of the parrot and the optimal parrot position;
[0014] Determined by the following formula :
[0015] ;
[0016] in, From initialization to the current iteration The best position found at the time.
[0017] Furthermore, when the adaptive threshold of the current iteration is greater than the preset threshold, the location update mathematical model of the escape phase is determined to be executed in the current iteration; when the adaptive threshold of the current iteration is not greater than the preset threshold, the location update mathematical model of the communication phase is determined to be executed in the current iteration.
[0018] Furthermore, the position update mathematical model in the escape phase is determined by the following formula:
[0019] ;
[0020] in, .
[0021] Furthermore, a preset improved parrot optimization algorithm is used to optimize multiple threshold parameters, and the steps of obtaining the best parameter solution for each threshold parameter include: taking multiple threshold parameters as a space vector solution set; using the good point set to initialize the initial position of the parrot population, establishing a real number mapping between the initial position of the parrot population and the space vector solution set, and the position of each parrot corresponds to a space vector solution set; initializing the calculation parameters of the improved parrot optimization algorithm; taking the first iteration as the current iteration, and updating the position of each parrot based on the position update mathematical model of the foraging phase, the position update mathematical model of the stay phase, the position update mathematical model of the communication phase, and the position update mathematical model of the escape phase of the improved parrot optimization algorithm; using the preset fitness function to calculate the fitness value of the position of each parrot, and retaining the minimum fitness value of the current iteration. The parrot position corresponding to the fitness value is determined; the next iteration is taken as the new current iteration to determine whether the current iteration number is less than or equal to the maximum iteration number; if the current iteration number is less than or equal to the maximum iteration number, the step of updating the position of each parrot is repeated based on the improved parrot optimization algorithm, including the position update mathematical model of the foraging phase, the position update mathematical model of the stay phase, the position update mathematical model of the communication phase, and the position update mathematical model of the escape phase, so as to obtain the parrot position corresponding to the minimum fitness value of the current iteration; if the current iteration number is greater than the maximum iteration number, the global minimum fitness value is determined based on the minimum fitness value of each iteration, and the parrot position corresponding to the global minimum fitness value is resolved into the target vector solution set of the spatial vector solution set, and the optimal parameter solution of each threshold parameter is obtained based on the target vector solution set.
[0022] Furthermore, the first remote sensing grayscale image contains a target object; based on the optimal parameter solution of each threshold parameter, the first remote sensing grayscale image is segmented to obtain a segmented target image corresponding to the original remote sensing image, the steps include: extracting object features associated with the target object from the first remote sensing grayscale image; based on the optimal parameter solution of each threshold parameter, the first remote sensing grayscale image is segmented to obtain a first image area corresponding to the target object, and a second image area excluding the target object; according to the object features in the first image area and the object features in the second image area, the original remote sensing image is masked to obtain the masked original remote sensing image; calculating a first histogram corresponding to the first image area and a second histogram corresponding to the second image area; stretching the first histogram and the second histogram respectively to obtain a contrast-enhanced first image area and a contrast-enhanced second image area; merging the contrast-enhanced first image area and the contrast-enhanced second image area into the masked original remote sensing image to obtain a segmented target image corresponding to the original remote sensing image.
[0023] Furthermore, the steps of processing the original remote sensing image to obtain a first remote sensing grayscale image include: using a Gaussian filtering algorithm to smooth the original remote sensing image to obtain a smoothed remote sensing image; graying the smoothed remote sensing image to obtain a second remote sensing grayscale image; performing a chaos degree analysis on each pixel in the second remote sensing grayscale image according to a preset field size to obtain a grayscale chaos degree value corresponding to each pixel; and mapping based on the grayscale chaos degree value corresponding to each pixel to obtain the first remote sensing grayscale image.
[0024] The present invention provides an image processing device, which includes: an acquisition module, which is used to acquire an original remote sensing image to be processed and multiple threshold parameters to be optimized; a first processing module, which is used to process the original remote sensing image to obtain a first remote sensing grayscale image; an optimization module, which is used to optimize multiple threshold parameters using a preset improved parrot optimization algorithm to obtain the best parameter solution for each threshold parameter; wherein, in the improved parrot optimization algorithm, based on the adaptive threshold of the current iteration, a position update mathematical model for executing the communication stage or the position update mathematical model for the escape stage in the current iteration is determined; the position update mathematical model for the communication stage is determined based on the communication factor of the current iteration, and the communication factor of the current iteration is determined based on the average fitness value and the minimum fitness value of the parrot population of the current iteration; and a second processing module, which is used to segment the first remote sensing grayscale image based on the best parameter solution for each threshold parameter to obtain a segmented target image corresponding to the original remote sensing image.
[0025] The image processing method, device and electronic device provided by the present invention obtain the original remote sensing image to be processed and multiple threshold parameters to be optimized; process the original remote sensing image to obtain a first remote sensing grayscale image; use the preset improved parrot optimization algorithm to optimize multiple threshold parameters to obtain the best parameter solution for each threshold parameter; wherein, in the improved parrot optimization algorithm, based on the adaptive threshold of the current iteration, determine the position update mathematical model of the communication stage or the position update mathematical model of the escape stage to be executed in the current iteration; the position update mathematical model of the communication stage is determined based on the communication factor of the current iteration, and the communication factor of the current iteration is determined based on the average fitness value and the minimum fitness value of the parrot population of the current iteration; based on the best parameter solution of each threshold parameter, the first remote sensing grayscale image is segmented to obtain the segmented target image corresponding to the original remote sensing image. This method improves the execution strategy of the communication stage and the escape stage, as well as the position update mathematical model of the communication stage in the improved parrot optimization algorithm, can effectively improve the convergence speed of the parrot optimization algorithm, realize the rapid and accurate optimization of multiple threshold parameters, and thus improve the segmentation accuracy and image segmentation efficiency of the original remote sensing image. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] Figure 1 A flowchart of an image processing method provided by an embodiment of the present invention;
[0028] Figure 2 A schematic diagram of the relationship between a fitness value and the number of iterations provided in an embodiment of the present invention;
[0029] Figure 3 An effect diagram of optimizing the cross entropy multi-threshold segmentation of a construction site remote sensing image using the improved Parrot optimization algorithm provided by an embodiment of the present invention;
[0030] Figure 4 An effect diagram of optimizing cross entropy multi-threshold segmentation of construction site remote sensing images using an improved Parrot optimization algorithm provided by an embodiment of the present invention;
[0031] FIG5 (a) is a diagram showing the effect of enhancing a segmented construction site remote sensing image using a histogram equalization algorithm in the prior art;
[0032] FIG5( b ) is a diagram showing the effect of enhancing the segmented construction site remote sensing image using a histogram equalization algorithm provided by an embodiment of the present invention;
[0033] Figure 6 A schematic diagram of the structure of an image processing device provided by an embodiment of the present invention;
[0034] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0035] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0036] At present, remote sensing technology can monitor the image intensity changes of mountain slopes in real time, timely detect possible cracks, deformations, soil erosion, etc., and warn of possible landslide or collapse risks in advance, providing an important reference for construction safety. The image intensity data obtained through remote sensing monitoring can help engineers better understand the stability of mountain slopes, assist in decision-making and construction planning, and effectively reduce engineering construction risks. At the same time, remote sensing monitoring technology can achieve large-scale, all-round monitoring, with a wide coverage range and high monitoring efficiency. It can fully grasp the image intensity of mountain slopes and detect abnormal changes in a timely manner.
[0037] Among the existing image processing technologies, image segmentation technology has important application value in construction site remote sensing quality inspection. Image segmentation technology can divide the construction site remote sensing image into multiple sub-regions with similar characteristics. These sub-regions may correspond to different parts of the surface of the construction site remote sensing image. By setting appropriate segmentation algorithms and parameters, the defective areas can be accurately separated, which facilitates subsequent analysis and processing.
[0038] In order to improve the accuracy of image segmentation, multi-threshold segmentation is usually used in technology. In multi-threshold segmentation, as the number of thresholds increases, the process of calculating cross entropy may become more complicated, which may lead to an increase in the execution time of the algorithm. Especially when processing large-scale images or data sets, the performance of the cross-entropy multi-threshold segmentation method is often affected by the relevant parameter settings. These parameters include the number of thresholds, the selection of initial thresholds, etc. Inappropriate parameter settings will lead to poor segmentation results or slow algorithm convergence.
[0039] Parrot Optimizer (PO) is a meta-heuristic optimization algorithm based on parrots. It establishes an optimization mathematical model by simulating the foraging, staying, communicating and escaping behaviors of parrots. Combining the meta-heuristic optimization algorithm with the cross entropy multi-threshold segmentation method can well solve the problem that the process of calculating cross entropy may become more complicated in multiple thresholds as the number of thresholds increases. The idea of the parrot optimization algorithm is simple, easy to implement and debug, and suitable for solving problems in different fields. However, the local search ability of the parrot optimization algorithm is relatively weak, and it is difficult to quickly escape from the local optimal solution, especially when the search space of the problem has many local extreme points. At the same time, the convergence speed of the algorithm is unstable, and sometimes more iterations are required to achieve satisfactory results. Therefore, it is difficult for the relevant technology to achieve fast and accurate optimization of multiple thresholds, and it is difficult to ensure the segmentation accuracy and image segmentation efficiency of remote sensing images. Based on this, the embodiment of the present invention provides an image processing method, device and electronic device, which can be applied to applications that require accurate segmentation of images.
[0040] To facilitate understanding of this embodiment, an image processing method disclosed in an embodiment of the present invention is first introduced. Figure 1 As shown, the method comprises the following steps:
[0041] Step S102, obtaining an original remote sensing image to be processed and a plurality of threshold parameters to be optimized;
[0042] The above-mentioned original remote sensing image is an image obtained by remote sensing technology. It obtains the image of the earth's surface at a long distance through remote sensing platforms such as aircraft and satellites. The original remote sensing image can be a remote sensing image collected in real time or a pre-stored remote sensing image. The number of the above-mentioned threshold parameters can be set according to actual needs. Multiple threshold parameters to be optimized can be set, such as 3 threshold parameters, 4 threshold parameters, etc., to segment the original remote sensing image into multiple areas; in actual implementation, in order to perform image segmentation, it is necessary to first obtain the original remote sensing image to be processed and the multiple threshold parameters to be optimized. When collecting the original remote sensing image, it is usually necessary to use a high-speed customized LED parallel light source, which can make the collected original remote sensing image have the characteristics of high brightness.
[0043] Step S104, processing the original remote sensing image to obtain a first remote sensing grayscale image;
[0044] In actual implementation, the acquired original remote sensing image is usually processed first, such as smoothing, graying, and chaos analysis, to obtain a first remote sensing grayscale image corresponding to the original remote sensing image.
[0045] Step S106, using a preset improved parrot optimization algorithm to optimize multiple threshold parameters to obtain the best parameter solution for each threshold parameter; wherein, in the improved parrot optimization algorithm, based on the adaptive threshold of the current iteration, determine the position update mathematical model of the communication stage or the position update mathematical model of the escape stage to be executed in the current iteration; the position update mathematical model of the communication stage is determined based on the communication factor of the current iteration, and the communication factor of the current iteration is determined based on the average fitness value and the minimum fitness value of the parrot population of the current iteration;
[0046] In the improved parrot optimization algorithm of this embodiment, the execution strategies of the communication stage and the escape stage are improved. Not both the communication stage and the escape stage need to be executed. Specifically, the adaptive threshold of the current iteration can be calculated in advance. According to the adaptive threshold of the current iteration, it is determined how the improved parrot optimization algorithm selects a suitable position update mathematical model in the entire optimization process. For example, if the adaptive threshold of the current iteration is greater than the preset threshold, the improved parrot optimization algorithm executes the position update mathematical model of the escape stage, otherwise it executes the position update mathematical model of the communication stage.
[0047] This embodiment also improves the mathematical model of position update in the communication stage. Specifically, the fitness value of the position of each parrot in the current iteration can be calculated based on a preset fitness function. According to the fitness value of the position of each parrot, the average fitness value and the minimum fitness value of the parrot population in the current iteration are determined. The communication factor of the current iteration is designed according to the average fitness value and the minimum fitness value, and the communication factor of the current iteration is used to determine the improved mathematical model of position update in the communication stage. In actual implementation, the improved parrot optimization algorithm can be used to optimize multiple threshold parameters to obtain the best parameter solution for each threshold parameter.
[0048] Step S108 , based on the optimal parameter solution of each threshold parameter, segment the first remote sensing grayscale image to obtain a segmented target image corresponding to the original remote sensing image.
[0049] In actual implementation, the optimal parameter solution for each threshold parameter obtained by optimization can be used to segment the first remote sensing grayscale image, so as to segment the first remote sensing grayscale image into multiple regions. Based on the correspondence between the first remote sensing grayscale image and the original remote sensing image, the segmented target image corresponding to the original remote sensing image can be obtained.
[0050] The above-mentioned image processing method obtains the original remote sensing image to be processed and multiple threshold parameters to be optimized; processes the original remote sensing image to obtain a first remote sensing grayscale image; uses the preset improved parrot optimization algorithm to optimize multiple threshold parameters to obtain the best parameter solution for each threshold parameter; wherein, in the improved parrot optimization algorithm, based on the adaptive threshold of the current iteration, determines the position update mathematical model of the communication stage or the position update mathematical model of the escape stage to be executed in the current iteration; the position update mathematical model of the communication stage is determined based on the communication factor of the current iteration, and the communication factor of the current iteration is determined based on the average fitness value and the minimum fitness value of the parrot population of the current iteration; based on the best parameter solution of each threshold parameter, the first remote sensing grayscale image is segmented to obtain the segmented target image corresponding to the original remote sensing image. This method improves the execution strategy of the communication stage and the escape stage, as well as the position update mathematical model of the communication stage in the improved parrot optimization algorithm, which can effectively improve the convergence speed of the parrot optimization algorithm, realize the rapid and accurate optimization of multiple threshold parameters, and thus improve the segmentation accuracy and image segmentation efficiency of the original remote sensing image.
[0051] The embodiment of the present invention further provides another image processing method, which is implemented on the basis of the method of the above embodiment. In the method, the first remote sensing grayscale image contains a target object; the target object can be understood as an object to be monitored in the first remote sensing grayscale image, such as a mountain slope at a construction site, etc.; the method comprises the following steps:
[0052] Step 1, obtaining an original remote sensing image to be processed and a plurality of threshold parameters to be optimized;
[0053] Step 2: Use Gaussian filtering algorithm to smooth the original remote sensing image to obtain a smooth remote sensing image;
[0054] Smoothing is a technology used to reduce image noise and detail levels, which helps to improve the overall quality of the image. Commonly used smoothing methods include mean filtering algorithm, Gaussian filtering algorithm and median filtering algorithm. This embodiment mainly identifies the target object in the original remote sensing image. Therefore, it is preferred to use Gaussian filtering algorithm to smooth the original remote sensing image. The Gaussian filtering algorithm can effectively remove image noise while better retaining the details and edge information of the original remote sensing image to ensure the subsequent segmentation accuracy of the original remote sensing image.
[0055] Step 3, graying the smoothed remote sensing image to obtain a second remote sensing grayscale image;
[0056] In actual implementation, the original remote sensing image is usually an RGB (R: Red; G: Green; B: Blue) color image. Correspondingly, the smoothed remote sensing image obtained after smoothing is also an RGB color image. To facilitate subsequent image segmentation processing, the smoothed remote sensing image can be grayscaled to obtain its corresponding second remote sensing grayscale image, and the color value of the second remote sensing grayscale image is set to [0, 255].
[0057] Step 4: Performing a chaos degree analysis on each pixel in the second remote sensing grayscale image according to a preset field size to obtain a grayscale chaos degree value corresponding to each pixel;
[0058] Since the first remote sensing grayscale image contains the target object, the corresponding original remote sensing image and the second remote sensing grayscale image also contain the target object. The above-mentioned preset field size can be pre-set according to the outer dimensions, size, etc. of the target object in the second remote sensing grayscale image. For example, it can be a rectangle with a pixel size of 5×5. In actual implementation, the grayscale changes around each pixel in the second remote sensing grayscale image can be analyzed based on the above-mentioned preset field size. Specifically, for each pixel in the second remote sensing grayscale image, the grayscale values of all pixels within the preset field size of the current pixel can be extracted. Based on each extracted grayscale value, the grayscale chaos degree value within the preset field size of the current pixel can be calculated through a preset entropy function. The grayscale chaos degree value can reflect the drastic degree of grayscale value changes in the local area of the second remote sensing grayscale image, thereby achieving fine processing of the target object and improving the accuracy of identifying the target object.
[0059] Generally, the larger the grayscale chaos value, the greater the grayscale change within the preset range size of the current pixel; conversely, the smaller the grayscale chaos value, the smaller the grayscale change within the preset range size of the current pixel; among them, the entropy function can be used as a measure of the degree of chaos of the system; specifically, the grayscale chaos value corresponding to each pixel can be calculated by referring to the relevant technology, which will not be repeated here.
[0060] Step 5: Based on the grayscale confusion degree value corresponding to each pixel point, a first remote sensing grayscale image is mapped.
[0061] The grayscale confusion value corresponding to each pixel point obtained by the above calculation can be mapped to a new grayscale two-dimensional image. Specifically, the grayscale confusion value corresponding to each pixel point obtained by the above calculation can be stored in a grayscale image of the same size as the original remote sensing image, so as to obtain the above-mentioned first remote sensing grayscale image. In the first remote sensing grayscale image, the grayscale value of each pixel point is the grayscale confusion value corresponding to the pixel point at the corresponding position.
[0062] Step 6, treating multiple threshold parameters as a space vector solution set;
[0063] For the convenience of explanation, in this embodiment, the number of the multiple threshold parameters is three, and the three threshold parameters are respectively , , Take the following as an example to illustrate that these three threshold parameters , , as a space vector solution set.
[0064] Step 7, using the good point set to initialize the initial position of the parrot population, establishing a real number mapping between the initial position of the parrot population and the space vector solution set, and the position of each parrot corresponds to a space vector solution set;
[0065] The good point set is an effective method for evenly selecting points. Compared with random initialization, the good point set initialization is more evenly distributed in space. When generating the same number of points in two-dimensional space, the good point set initialization can make the points more evenly distributed, which helps the parrot optimization algorithm to better traverse the search space, thereby improving the effect of global optimization. In actual implementation, the good point set can be used to initialize the initial position of the parrot population, and a real number mapping can be established between the initialized initial position of the parrot population and the space vector solution set in the previous step. For details, please refer to the relevant technology, which will not be repeated here.
[0066] Step 8, initializing the calculation parameters of the improved Parrot optimization algorithm;
[0067] The above calculation parameters usually include the maximum size of the parrot population , the maximum number of iterations of the improved parrot feather optimization algorithm , Problem Dimension , and find the upper bound And the optimal lower bound , where the problem dimension The same as the number of multiple threshold parameters. For example, if the number of multiple threshold parameters is three, then the problem dimension =3; the above optimization upper bound The maximum value that can correspond to the position of the parrot; find the lower bound It can correspond to the minimum value of the parrot's position. In actual implementation, the calculation parameters of the improved parrot optimization algorithm can be initialized according to actual needs.
[0068] Step nine, taking the first iteration as the current iteration, updating the position of each parrot based on the position update mathematical model of the foraging phase, the position update mathematical model of the stay phase, the position update mathematical model of the communication phase, and the position update mathematical model of the escape phase of the improved parrot optimization algorithm;
[0069] Specifically, in the foraging behavior, the approximate location of the food is estimated by observing the location of the food, and then flying to the corresponding location. The position update mathematical model of the foraging stage can be established according to the following formula to update the position of each parrot;
[0070]
[0071] in, For the current iteration Time i The location of the parrot; is the t+1th iteration i The location of the parrot; From initialization to the current iteration The best position found at the time of search; is the Levy distribution, used to describe the flight of parrots; is a random number within (0,1); is the maximum number of iterations; For the current iteration The average position of the parrot population at that time.
[0072] In the stay behavior, the parrot suddenly flies to any part of the owner's body and remains stationary there for a period of time. The mathematical model of position update in the stay phase can be established according to the following formula to update the position of each parrot;
[0073] ;
[0074] in, For all elements to be 1, To show the flying process towards the master, Indicates a process that stops randomly on the master.
[0075] In the standard parrot optimization algorithm in the prior art, the position update strategy of the communication stage and the escape stage is executed sequentially, that is, the position update mathematical model of the communication stage is executed first, and then the position update mathematical model of the escape stage is executed; in this embodiment, when the improved parrot optimization algorithm optimizes the three threshold parameters of the cross entropy multi-threshold segmentation, the communication stage and the escape stage are not all required to be executed. Only by accurately executing the two stages of the communication stage and the escape stage can the performance of the parrot optimization algorithm be better performed. Specifically, the current iteration can be calculated first The communication distance between the position of the i-th parrot and the best parrot position ,according to Design current iteration Adaptive threshold at , in order to change the execution strategy of the communication stage and the escape stage in the parrot optimization algorithm, determine how the improved parrot optimization algorithm chooses the appropriate position to update the mathematical model in the entire optimization process, and through the improved execution strategy of the communication stage and the escape stage, the problem of slow convergence of the parrot optimization algorithm in the prior art can be solved.
[0076] Specifically, The mathematical model is as follows:
[0077] ;
[0078] in, From initialization to the current iteration The best position found at the time.
[0079] According to the Current iteration of the design Adaptive threshold at The mathematical model is as follows:
[0080] ;
[0081] in, For the current iteration Adaptive threshold when is the farthest communication distance between the global parrot individual and the best parrot position; the best parrot position is the current iteration The parrot position corresponding to the minimum fitness value at ; For the current iteration Time i The communication distance between the position of the parrot and the optimal parrot position;
[0082] Furthermore, when the adaptive threshold of the current iteration is greater than the preset threshold, it is determined that the location update mathematical model of the escape phase is executed in the current iteration; when the adaptive threshold of the current iteration is not greater than the preset threshold, it is determined that the location update mathematical model of the communication phase is executed in the current iteration.
[0083] The above preset threshold can be set according to actual needs, such as 0.5; specifically, combined with the above mathematical model, it can be seen that as the number of iterations increases, the current iteration Adaptive threshold at The introduced sinusoidal strategy is incremental, and as the iterations increase, the communication distance of the design is gradually decreasing, so is gradually increasing, the current iteration Adaptive threshold at The overall trend is nonlinear and decreasing, that is, in the early stage of the Parrot optimization algorithm, The value is large and close to , when it is greater than the preset threshold, the parrot optimization algorithm executes the position update mathematical model of the escape phase, which can search for good communication partners in a large range; in the middle and late stages of the parrot optimization algorithm, The value of gradually decreases and approaches 0. When it is less than or equal to the preset threshold, the Parrot optimization algorithm executes the position update mathematical model in the communication stage.
[0084] This embodiment improves the mathematical model of the position update in the communication phase. Specifically, the current iteration The average fitness value of the parrot population is and the minimum fitness value Design the AC factor of the current iteration. The AC factor of the current iteration is determined by the following formula:
[0085] ;
[0086] in, is the number of current iterations; Indicates the current iteration The exchange factor at is the maximum number of iterations; It is the largest parrot population; For the current iteration The minimum fitness value when ; For the current iteration At that time, i The fitness value of the position of the parrot.
[0087] The communication factor of the current iteration is used to improve the mathematical model of the position update in the communication phase. The mathematical model of the position update in the communication phase is determined by the following formula:
[0088] ;
[0089] in, For the current iteration Time i The location of the parrot; is the t+1th iteration i The location of the parrot, For the current iteration The average position of the parrot population at that time; is a random probability, and its value is a random number within (0,1); is a random number within the range (0,1).
[0090] This embodiment further improves the mathematical model for updating the position in the escape phase. Specifically, the mathematical model for updating the position in the escape phase is determined by the following formula:
[0091] ;
[0092] in, , indicating the process of escaping from strangers.
[0093] Step 10, using a preset fitness function to calculate the fitness value of each parrot's position, retaining the parrot position corresponding to the minimum fitness value of the current iteration;
[0094] When the metaheuristic algorithm optimizes practical problems, it needs a fitness function to assist. The fitness function mainly provides a standard for the metaheuristic algorithm to find the best solution. The standard is determined by calculating the value of the fitness function. In this embodiment, the original remote sensing image is segmented by optimizing the cross entropy multi-threshold through the improved Parrot Optimizer (IPO). The purpose is to minimize the difference between the segmented image and the original image, thereby segmenting the area corresponding to the target object from other areas except the target object. Therefore, the inverse of the criterion function is used as the fitness function. The larger the criterion function value, that is, the smaller the fitness value, the better the segmentation of the defective part and the intact part.
[0095] Assumptions is the set of pixels in the image that are divided into the construction site mountain slope area, and It is a set of pixels that are divided into non-construction site slope areas, and the criterion function can be defined as follows:
[0096] ;
[0097] in, It is the variance between the average grayscale values of the construction site mountain slope area and the non-construction site mountain slope area, which is used to measure the difference between the two areas; It is the variance of the pixel grayscale value inside the mountain slope area of the construction site, which is used to measure the consistency inside the slope area; It is the pixel gray value variance inside the non-construction site mountain slope area, which is used to measure the consistency inside the non-construction site mountain slope area; is a regularization parameter used to balance the weights of inter-regional differences and intra-regional differences.
[0098] Step 11, taking the next iteration as the new current iteration, and determining whether the current iteration number is less than or equal to the maximum iteration number;
[0099] Step 12, if the current number of iterations is less than or equal to the maximum number of iterations, repeatedly executing the position updating mathematical model of the foraging phase, the position updating mathematical model of the stay phase, the position updating mathematical model of the communication phase, and the position updating mathematical model of the escape phase based on the improved parrot optimization algorithm, and updating the position of each parrot to obtain the parrot position corresponding to the minimum fitness value of the current iteration;
[0100] Step 13. If the current number of iterations is greater than the maximum number of iterations, determine the global minimum fitness value based on the minimum fitness value of each iteration, resolve the parrot position corresponding to the global minimum fitness value into the target vector solution set of the spatial vector solution set, and obtain the optimal parameter solution for each threshold parameter based on the target vector solution set.
[0101] By iterating the above process, we can get the three threshold parameters of the optimal cross entropy multi-threshold segmentation remote sensing image: , , The corresponding optimal parameter solutions.
[0102] Step 14: extracting object features associated with the target object from the first remote sensing grayscale image;
[0103] The above-mentioned object features may include shape features, spectral reflectance chromaticity, etc. of the target object; for example, taking the target object as a construction site mountain slope as an example, object features related to the construction site mountain slope may be extracted from the first remote sensing grayscale image, including shape features, spectral reflectance chromaticity, etc. of the construction site mountain slope.
[0104] Step 15: based on the optimal parameter solution of each threshold parameter, segment the first remote sensing grayscale image to obtain a first image area corresponding to the target object and a second image area excluding the target object;
[0105] In the following example, the target object is the mountain slope of the construction site, and the three threshold parameters are , , As an example, the three threshold parameters can be used , , The optimal parameter solution is used to segment the first remote sensing grayscale image, and the area where the pixel value falls within a specific threshold range is divided into the construction site mountain slope area (corresponding to the first image area corresponding to the above target object), and the other areas are divided into non-construction site mountain slope areas (corresponding to the second image area outside the above target object), wherein the specific threshold range can be pre-set according to actual needs.
[0106] Step 16, performing mask processing on the original remote sensing image according to the object features in the first image area and the object features in the second image area to obtain the original remote sensing image after mask processing;
[0107] Continuing with the above example, based on the spectral reflectance chromaticity and shape characteristics of the segmented construction site mountain slope area, as well as the spectral reflectance chromaticity and shape characteristics of the non-construction site mountain slope area, a mask corresponding to the segmentation result can be applied to the original remote sensing image to perform mask processing on the original remote sensing image to obtain the original remote sensing image after mask processing.
[0108] Step 17, calculating a first histogram corresponding to the first image area and a second histogram corresponding to the second image area;
[0109] A histogram is a statistical table used to express the grayscale distribution of an image; the first histogram above counts the grayscale distribution corresponding to the first image area; the second histogram above counts the grayscale distribution corresponding to the second image area; continuing with the above example, the first histogram corresponding to the construction site mountain slope area and the second histogram corresponding to the non-construction site mountain slope area in the first remote sensing grayscale image can be calculated respectively.
[0110] Step eighteen, stretching the first histogram and the second histogram respectively to obtain a contrast-enhanced first image region and a contrast-enhanced second image region;
[0111] The histogram equalization algorithm can be used to perform contrast enhancement processing on the original remote sensing image in different regions. In actual implementation, the first histogram can be stretched so that the grayscale level of the first histogram is evenly distributed in the entire grayscale range, thereby improving the contrast of the construction site mountain slope area and obtaining the contrast-enhanced construction site mountain slope area; the second histogram can be stretched so that the grayscale level of the second histogram is evenly distributed in the entire grayscale range, thereby improving the contrast of the non-construction site mountain slope area and obtaining the contrast-enhanced non-construction site mountain slope area.
[0112] Step nineteen: merge the contrast-enhanced first image region and the contrast-enhanced second image region into the original remote sensing image after mask processing to obtain a segmented target image corresponding to the original remote sensing image.
[0113] The contrast-enhanced construction site mountain slope area and the contrast-enhanced non-construction site mountain slope area can be merged into the original remote sensing image after mask processing to obtain a segmented target image corresponding to the original remote sensing image, which is the final enhanced remote sensing image.
[0114] The following is a comparison between the parrot optimization algorithm PO before improvement (i.e., the standard parrot optimization algorithm in the prior art) and the parrot optimization algorithm IPO after improvement. The program design of the parrot optimization algorithm before and after improvement and the cross entropy multi-threshold segmentation algorithm are completed in Matlab, and the maximum size of the parrot population of the parrot optimization algorithm before and after improvement is set. =100, the maximum number of iterations of the improved parrot algorithm =100, Problem Dimension =3 and find the upper bound =[10, 10, 10] and find the lower bound =[0,0,0], run the program, such as Figure 2 A schematic diagram of the relationship between fitness value and iteration number is shown, wherein the dotted line is the relationship curve between the fitness value and the iteration number of the parrot optimization algorithm for optimizing cross entropy multi-threshold segmentation before improvement, and the solid line is the relationship curve between the fitness value and the iteration number of the parrot optimization algorithm for optimizing cross entropy multi-threshold segmentation after improvement. It can be seen that compared with the improved parrot optimization algorithm for optimizing cross entropy multi-threshold segmentation, the fitness value of the parrot optimization algorithm for optimizing cross entropy multi-threshold segmentation before improvement falls into the local optimum after 60 iterations, and the fitness value is stable at about 1450, and the fitness value decreases slowly during the entire iteration process, indicating that the optimization speed of the cross entropy multi-threshold is slow, resulting in limited improvement in segmentation accuracy; the fitness value of the improved parrot optimization algorithm for optimizing cross entropy multi-threshold segmentation decreases very quickly, reaches stability after about 30 iterations, and the stable value is about 700. According to the principle that the smaller the fitness value, the better the algorithm optimization performance of cross entropy multi-threshold segmentation, it is shown that the improved parrot optimization algorithm has better performance in optimizing cross entropy multi-threshold segmentation.
[0115] Furthermore, if Figure 3 The effect diagram of using the improved Parrot optimization algorithm to optimize the cross entropy multi-threshold segmentation of the construction site remote sensing image is shown in FIG. Figure 4 The effect diagram of using the improved Parrot optimization algorithm to optimize the cross entropy multi-threshold segmentation of the construction site remote sensing image is shown in Figure 3. By comparing Figure 3 and Figure 4, it can be clearly found that compared with Figure 3 , Figure 4 The segmentation accuracy of the construction site remote sensing image is more accurate, and many tiny details can be accurately marked, which shows that the method of this embodiment is more accurate and detailed in the segmentation of the construction site remote sensing image, and improves the segmentation accuracy of the construction site mountain slope and non-mountain slope parts in the construction site remote sensing image.
[0116] Furthermore, as shown in FIG5 (a), a prior art using a histogram equalization algorithm to enhance the segmented construction site remote sensing image, and FIG5 (b), a prior art using a histogram equalization algorithm to enhance the segmented construction site remote sensing image, wherein FIG5 (a) is a prior art enhancing construction site remote sensing image, and FIG5 (b) is an enhanced construction site remote sensing image using the method of the present application. Compared with FIG5 (a), the construction site remote sensing image of FIG5 (b) is clearer, and the contrast of the construction site mountain slope area is more obvious, which can better grasp the situation of the mountain slope and provide protection for construction safety. This embodiment improves the performance of the optimized cross entropy multi-threshold segmentation of the Parrot optimization algorithm by improving the Parrot optimization algorithm, and uses the improved image segmentation method to segment the construction site mountain slope area from the non-construction site mountain slope area, which can accurately extract the features of each area and perform contrast image enhancement by area.
[0117] The above-mentioned image processing method improves the performance of the Parrot optimization algorithm through the improved Parrot optimization algorithm, especially improves the performance of the optimized cross entropy multi-threshold of the Parrot optimization algorithm, and realizes fast and accurate optimization of multiple threshold parameters. By improving the standard Parrot optimization algorithm, including improving the position update mathematical model in the communication stage, and adjusting the execution strategies of the improved communication stage and the escape stage, it is possible to more effectively find the optimal parameter solution for each threshold parameter, and improve the segmentation accuracy of the area corresponding to the target object and other areas except the target object in the original remote sensing image. This method can accurately extract the features of each region, and use the histogram equalization algorithm to perform remote sensing contrast image enhancement in different regions, which can improve the recognition and visual accuracy of the area corresponding to the target object in the original remote sensing image.
[0118] The embodiment of the present invention provides an image processing device, such as Figure 6 As shown, the device includes: an acquisition module 60, which is used to acquire the original remote sensing image to be processed and multiple threshold parameters to be optimized; a first processing module 61, which is used to process the original remote sensing image to obtain a first remote sensing grayscale image; an optimization module 62, which is used to optimize multiple threshold parameters using a preset improved parrot optimization algorithm to obtain the best parameter solution for each threshold parameter; wherein, in the improved parrot optimization algorithm, based on the adaptive threshold of the current iteration, the position update mathematical model of the communication stage or the position update mathematical model of the escape stage is determined in the current iteration; the position update mathematical model of the communication stage is determined based on the communication factor of the current iteration, and the communication factor of the current iteration is determined based on the average fitness value and the minimum fitness value of the parrot population of the current iteration; the second processing module 63, which is used to segment the first remote sensing grayscale image based on the best parameter solution of each threshold parameter to obtain a segmented target image corresponding to the original remote sensing image.
[0119] The above-mentioned image processing device, in the improved Parrot optimization algorithm, improves the execution strategies of the communication stage and the escape stage, as well as the mathematical model of position update in the communication stage, which can effectively improve the convergence speed of the Parrot optimization algorithm, realize fast and accurate optimization of multiple threshold parameters, and thus improve the segmentation accuracy and image segmentation efficiency of the original remote sensing image.
[0120] Furthermore, the communication factor of the current iteration is determined by the following formula:
[0121] ;
[0122] in, is the number of current iterations; Indicates the current iteration The exchange factor at is the maximum number of iterations; It is the largest parrot population; For the current iteration The minimum fitness value when ; For the current iteration At that time, i The fitness value of the position of the parrot.
[0123] Furthermore, the mathematical model of the position update in the communication phase is determined by the following formula:
[0124] ;
[0125] in, For the current iteration Time i The location of the parrot; is the t+1th iteration i The location of the parrot, For the current iteration The average position of the parrot population at that time; is a random probability, and its value is a random number within (0,1); is a random number within the range (0,1).
[0126] Furthermore, the adaptive threshold of the current iteration is determined by the following formula:
[0127] ;
[0128] in, For the current iteration Adaptive threshold when is the farthest communication distance between the global parrot individual and the best parrot position; the best parrot position is the current iteration The parrot position corresponding to the minimum fitness value at ; For the current iteration Time i The communication distance between the position of the parrot and the optimal parrot position;
[0129] Determined by the following formula :
[0130] ;
[0131] in, From initialization to the current iteration The best position found at the time.
[0132] Further, when the adaptive threshold of the current iteration is greater than the preset threshold, it is determined to execute the position update mathematical model of the escape phase in the current iteration;
[0133] When the adaptive threshold of the current iteration is not greater than the preset threshold, it is determined to execute the position update mathematical model of the communication phase in the current iteration.
[0134] Furthermore, the position update mathematical model in the escape phase is determined by the following formula:
[0135] ;
[0136] in, .
[0137] Furthermore, the optimization module is also used to: use multiple threshold parameters as a space vector solution set; use the good point set to initialize the initial position of the parrot population, establish a real number mapping between the initial position of the parrot population and the space vector solution set, and the position of each parrot corresponds to a space vector solution set; initialize the calculation parameters of the improved parrot optimization algorithm; use the first iteration as the current iteration, and update the position of each parrot based on the position update mathematical model of the foraging phase, the position update mathematical model of the stay phase, the position update mathematical model of the communication phase, and the position update mathematical model of the escape phase of the improved parrot optimization algorithm; use the preset fitness function to calculate the fitness value of the position of each parrot, and retain the parrot position corresponding to the minimum fitness value of the current iteration; use the next iteration as A new current iteration is used to determine whether the current iteration number is less than or equal to the maximum iteration number; if the current iteration number is less than or equal to the maximum iteration number, the steps of updating the position of each parrot are repeated based on the improved parrot optimization algorithm, including the position update mathematical model of the foraging phase, the position update mathematical model of the stay phase, the position update mathematical model of the communication phase, and the position update mathematical model of the escape phase, to obtain the parrot position corresponding to the minimum fitness value of the current iteration; if the current iteration number is greater than the maximum iteration number, the global minimum fitness value is determined based on the minimum fitness value of each iteration, and the parrot position corresponding to the global minimum fitness value is resolved into a target vector solution set of the spatial vector solution set, and the optimal parameter solution for each threshold parameter is obtained based on the target vector solution set.
[0138] Furthermore, the first remote sensing grayscale image contains a target object; the second processing module is also used to: extract object features associated with the target object from the first remote sensing grayscale image; based on the optimal parameter solution of each threshold parameter, segment the first remote sensing grayscale image to obtain a first image area corresponding to the target object, and a second image area excluding the target object; mask the original remote sensing image according to the object features in the first image area and the object features in the second image area to obtain the masked original remote sensing image; calculate a first histogram corresponding to the first image area and a second histogram corresponding to the second image area; stretch the first histogram and the second histogram respectively to obtain a contrast-enhanced first image area and a contrast-enhanced second image area; merge the contrast-enhanced first image area and the contrast-enhanced second image area into the masked original remote sensing image to obtain a segmented target image corresponding to the original remote sensing image.
[0139] Furthermore, the first processing module is also used to: use a Gaussian filtering algorithm to smooth the original remote sensing image to obtain a smoothed remote sensing image; grayscale the smoothed remote sensing image to obtain a second remote sensing grayscale image; perform a chaos degree analysis on each pixel in the second remote sensing grayscale image according to a preset field size to obtain a grayscale chaos degree value corresponding to each pixel; based on the grayscale chaos degree value corresponding to each pixel, map to obtain the first remote sensing grayscale image.
[0140] The image processing device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned image processing method embodiment. For the sake of brief description, for matters not mentioned in the image processing device embodiment, reference may be made to the corresponding contents in the aforementioned image processing method embodiment.
[0141] The embodiment of the present invention further provides an electronic device, see Figure 7 As shown, the electronic device includes a processor 130 and a memory 131 , wherein the memory 131 stores machine executable instructions that can be executed by the processor 130 , and the processor 130 executes the machine executable instructions to implement the above-mentioned image processing method.
[0142] Further, Figure 7 The electronic device shown further includes a bus 132 and a communication interface 133 , and the processor 130 , the communication interface 133 and the memory 131 are connected via the bus 132 .
[0143] The memory 131 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 133 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 132 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0144] The processor 130 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 130. The above processor 130 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 131, and the processor 130 reads the information in the memory 131 and completes the steps of the method of the above embodiment in combination with its hardware.
[0145] An embodiment of the present invention also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned image processing method. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0146] The computer program product of the image processing method, device and electronic device provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments and will not be repeated here.
[0147] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0148] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An image processing method, characterized in that: The method comprises: Obtaining an original remote sensing image to be processed and a plurality of threshold parameters to be optimized; Processing the original remote sensing image to obtain a first remote sensing grayscale image; The preset improved parrot optimization algorithm is used to optimize the multiple threshold parameters to obtain the best parameter solution for each threshold parameter; wherein, in the improved parrot optimization algorithm, based on the adaptive threshold of the current iteration, the position update mathematical model of the communication phase or the position update mathematical model of the escape phase is determined in the current iteration; the position update mathematical model of the communication phase is determined based on the communication factor of the current iteration, and the communication factor of the current iteration is determined based on the average fitness value and the minimum fitness value of the parrot population of the current iteration; Based on the optimal parameter solution of each of the threshold parameters, segmenting the first remote sensing grayscale image to obtain a segmented target image corresponding to the original remote sensing image; The AC factor of the current iteration is determined by the following formula: ; in, is the number of current iterations; Indicates the current iteration The exchange factor at is the maximum number of iterations; It is the largest parrot population; For the current iteration The minimum fitness value when ; For the current iteration , the fitness value of the position of the i-th parrot; The mathematical model of the position update in the communication phase is determined by the following formula: ; in, Indicates the current iteration The exchange factor at For the current iteration The position of the i-th parrot at time; is the position of the i-th parrot at the t+1th iteration, For the current iteration The average position of the parrot population at that time; is a random probability, and its value is a random number within (0,1); is a random number with a value within (0,1); is the maximum number of iterations.
2. The method according to claim 1, characterized in that The adaptive threshold of the current iteration is determined by the following formula: ; in, For the current iteration Adaptive threshold when is the farthest communication distance between the global parrot individual and the best parrot position; the best parrot position is the current iteration The parrot position corresponding to the minimum fitness value at ; For the current iteration The communication distance between the position of the i-th parrot and the optimal parrot position; is the maximum number of iterations; Determined by the following formula : ; in, From initialization to the current iteration The best position found at the time; For the current iteration The position of the i-th parrot at time .
3. The method according to claim 1, characterized in that When the adaptive threshold of the current iteration is greater than a preset threshold, determining to execute the position update mathematical model of the escape phase in the current iteration; When the adaptive threshold of the current iteration is not greater than the preset threshold, it is determined to execute the position update mathematical model of the communication phase in the current iteration.
4. The method according to claim 1, characterized in that: The position update mathematical model of the escape phase is determined by the following formula: ; in, ; is the position of the i-th parrot at the t+1-th iteration; For the current iteration The position of the i-th parrot at time; is a random number with a value within (0,1); is the maximum number of iterations; From initialization to the current iteration The best position found at the time.
5. The method according to claim 1, characterized in that The step of optimizing the multiple threshold parameters using the preset improved Parrot optimization algorithm to obtain the optimal parameter solution for each threshold parameter includes: Taking the multiple threshold parameters as a space vector solution set; Initializing the initial position of the parrot population using the good point set, establishing a real number mapping between the initial position of the parrot population and the space vector solution set, and the position of each parrot corresponds to a space vector solution set; Initialize the calculation parameters of the improved Parrot optimization algorithm; Taking the first iteration as the current iteration, updating the position of each parrot based on the position update mathematical model of the foraging phase, the position update mathematical model of the stay phase, the position update mathematical model of the communication phase, and the position update mathematical model of the escape phase of the improved parrot optimization algorithm; The fitness value of each parrot's position is calculated using a preset fitness function, and the parrot position corresponding to the minimum fitness value of the current iteration is retained; The next iteration is used as the new current iteration, and whether the current iteration number is less than or equal to the maximum iteration number is determined; If the current number of iterations is less than or equal to the maximum number of iterations, repeatedly executing the step of updating the position of each parrot based on the improved parrot optimization algorithm, the position updating mathematical model of the foraging phase, the position updating mathematical model of the stay phase, the position updating mathematical model of the communication phase, and the position updating mathematical model of the escape phase, to obtain the parrot position corresponding to the minimum fitness value of the current iteration; If the current number of iterations is greater than the maximum number of iterations, the global minimum fitness value is determined based on the minimum fitness value of each iteration, the parrot position corresponding to the global minimum fitness value is resolved into the target vector solution set of the spatial vector solution set, and the optimal parameter solution for each threshold parameter is obtained based on the target vector solution set.
6. The method according to claim 1, characterized in that The first remote sensing grayscale image contains a target object; based on the optimal parameter solution of each threshold parameter, the first remote sensing grayscale image is segmented to obtain a segmented target image corresponding to the original remote sensing image, comprising: extracting object features associated with the target object from the first remote sensing grayscale image; Based on the optimal parameter solution of each of the threshold parameters, segmenting the first remote sensing grayscale image to obtain a first image area corresponding to the target object and a second image area excluding the target object; According to the object features in the first image area and the object features in the second image area, mask processing is performed on the original remote sensing image to obtain the masked original remote sensing image; Calculating a first histogram corresponding to the first image area and a second histogram corresponding to the second image area; Performing stretching processing on the first histogram and the second histogram respectively to obtain a first image region after contrast enhancement and a second image region after contrast enhancement; The contrast-enhanced first image region and the contrast-enhanced second image region are merged into the original remote sensing image after mask processing to obtain a segmented target image corresponding to the original remote sensing image.
7. The method according to claim 1, characterized in that The step of processing the original remote sensing image to obtain a first remote sensing grayscale image comprises: The original remote sensing image is smoothed by using a Gaussian filtering algorithm to obtain a smoothed remote sensing image; grayscale the smoothed remote sensing image to obtain a second remote sensing grayscale image; According to a preset area size, performing a chaos degree analysis process on each pixel point in the second remote sensing grayscale image to obtain a grayscale chaos degree value corresponding to each pixel point; Based on the grayscale disorder degree value corresponding to each pixel point, a first remote sensing grayscale image is mapped.
8. An image processing device, characterized in that: The device comprises: An acquisition module, used for acquiring an original remote sensing image to be processed and a plurality of threshold parameters to be optimized; A first processing module, used for processing the original remote sensing image to obtain a first remote sensing grayscale image; An optimization module, used for optimizing the multiple threshold parameters by using a preset improved parrot optimization algorithm to obtain the best parameter solution for each threshold parameter; wherein, in the improved parrot optimization algorithm, based on the adaptive threshold of the current iteration, the position update mathematical model of the communication phase or the position update mathematical model of the escape phase is determined in the current iteration; the position update mathematical model of the communication phase is determined based on the communication factor of the current iteration, and the communication factor of the current iteration is determined based on the average fitness value and the minimum fitness value of the parrot population of the current iteration; A second processing module is used to perform segmentation processing on the first remote sensing grayscale image based on the optimal parameter solution of each threshold parameter to obtain a segmented target image corresponding to the original remote sensing image; The AC factor of the current iteration is determined by the following formula: ; in, is the number of current iterations; Indicates the current iteration The exchange factor at is the maximum number of iterations; It is the largest parrot population; For the current iteration The minimum fitness value when ; For the current iteration , the fitness value of the position of the i-th parrot; The mathematical model of the position update in the communication phase is determined by the following formula: ; in, Indicates the current iteration The exchange factor at For the current iteration The position of the i-th parrot at time; is the position of the i-th parrot at the t+1th iteration, For the current iteration The average position of the parrot population at that time; is a random probability, and its value is a random number within (0,1); is a random number with a value within (0,1); is the maximum number of iterations.
