Image processing method and device, electronic equipment and medium

By blocking, histogram matching and style transfer of satellite images, the problem of obvious stitching traces of satellite images is solved, efficient and automated color adjustment and accuracy of terrain information are achieved, and the needs of flight simulation training are met.

CN119477775AActive Publication Date: 2025-02-18BEIJING REALFLY AVIATION TECH CO LTD

Patent Information

Application Number
CN202411679725.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-02-18
Estimated Expiration
2044-11-22

AI Technical Summary

Technical Problem

The prior art has the problem of obvious splicing traces when processing satellite images, resulting in discontinuity of the terrain, affecting the pilot's judgment, and the existing methods are inefficient, costly, and may change the original terrain information.

Method used

By obtaining the image to be processed, determining the color offset after chunking, using histogram matching to adjust the color, and eliminating the stitching edges, finally input the image into the style transfer neural network for style transfer, and generating the target image.

Benefits of technology

It realizes efficient and automated color adjustment of satellite image, eliminates splicing traces, improves processing efficiency, maintains the accuracy of terrain information, and meets the needs of flight simulation training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119477775A_ABST
    Figure CN119477775A_ABST
Patent Text Reader

Abstract

The invention relates to an image processing method and device, electronic equipment and a medium, and relates to the technical fields of image processing, satellite image processing and the like. The method comprises the steps that a to-be-processed image is acquired, and the to-be-processed image is an image needing to be subjected to color adjustment; the to-be-processed image is partitioned according to N rows and M columns, each partitioned image is obtained, the color cast value of each partitioned image is determined, each color cast value is obtained, and N and M are positive integers; based on the color cast value corresponding to each block image, color adjustment is carried out on the to-be-processed image through a histogram matching mode, and elimination operation is carried out on the spliced edge of the image after color adjustment to obtain a gray level image; and carrying out size adjustment on the grayscale image, inputting the grayscale image after size adjustment into a style migration neural network, and carrying out style migration to obtain a target image. According to the invention, efficient and automatic image color adjustment is realized, and the efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to technical fields such as image processing and satellite image processing. Specifically, the present disclosure relates to an image processing method, device, electronic device and medium. Background Art

[0002] As a training system, flight simulators have extremely high requirements for the authenticity and continuity of terrain images. In the prior art, terrain image resources are generally provided for flight simulators through satellite images. However, the existing satellite image resources have obvious splicing marks. This is because satellites shoot the ground at different times and seasons. Due to lighting conditions and vegetation changes, the images have large differences in color tone and content. Simply splicing these images will result in discontinuity of the terrain, affecting the pilot's judgment.

[0003] In the prior art, in order to solve the problem of obvious satellite image splicing traces, the following technical solutions are generally used for processing: 1. Manual PS processing method: Engineers use image processing software (Photoshop, PS for short) and other software to adjust the overall color of satellite images, and use tools such as layer fusion and stamps to repair splicing edges and areas with large color differences, making the image more coordinated and unified.

[0004] 2. Image selection and synthesis method: By comparing multiple satellite image sources, images with better quality in the same area are selected for comprehensive processing.

[0005] 3. Histogram matching method: Using histogram matching technology, the image histogram characteristics of the area to be processed are adjusted to match the histogram characteristics of the target area. Figure 1 to achieve color correction and uniformity.

[0006] However, the above method of the prior art has the following problems: 1. Although the manual post-processing method can improve the image effect, it is labor-intensive and inefficient, and it may also change the original terrain information.

[0007] 2. The comprehensive image selection method requires a lot of manual comparison and analysis work, which is labor-intensive and inefficient. It also cannot completely eliminate the color difference and splicing marks between images. Different film sources need to be purchased separately, which increases costs.

[0008] 3. The histogram matching method has high requirements for region selection and target histogram determination, and the processing effect also has certain limitations.

[0009] Therefore, how to efficiently eliminate the splicing traces of satellite images and maintain the accuracy of terrain information has become an urgent problem to be solved. Summary of the invention

[0010] The embodiments of the present disclosure provide an image processing method, device, electronic device and medium, which realize efficient and automatic image color adjustment of satellite images, solve the problem of obvious splicing marks of satellite images, and improve processing efficiency.

[0011] In one aspect, an embodiment of the present disclosure provides an image processing method, the method comprising: Acquire an image to be processed, wherein the image to be processed is an image that needs to be color adjusted; Divide the image to be processed into blocks according to N rows and M columns to obtain each block image, determine the color deviation value of each block image to obtain each color deviation value, wherein N and M are positive integers; Based on the color deviation values ​​corresponding to the respective block images, the image to be processed is color adjusted by histogram matching, and the splicing edge of the image to be processed after the color adjustment is eliminated to obtain a grayscale image; The grayscale image is resized, and the resized grayscale image is input into a style transfer neural network to perform style transfer to obtain a target image.

[0012] In an optional embodiment, resizing the grayscale image, inputting the resized grayscale image into a style transfer neural network, performing style transfer, and obtaining a target image includes: Reducing the grayscale image according to a first size to obtain a grayscale image of the first size, wherein the image size of the grayscale image is an image size that is not supported by the image processing device, the first size is an image size supported by the image processing device, and the image processing device is a device used to process the image to be processed; Obtain a target style image, input the target style image and the grayscale image of the first size into a style transfer neural network, perform style transfer on the grayscale image of the first size based on the target style image, and obtain a first colored image, wherein the target style image and the grayscale image of the first size have the same image size; Repeat the following steps until the preset end condition is met: Divide the first colored graph into four parts according to the second size to obtain four second colored graphs, wherein the first size is twice the second size; For any second colored graph, the second colored graph is enlarged according to the first size to obtain a second colored graph of the first size, and the second colored graph of the first size is recorded as a third colored graph; intercepting an image area in the grayscale image corresponding to the position of the area where the second colored image is located as a target image area, determining whether the image size of the target image area is the first size, and if not, reducing the target image area to the first size, and if so, not performing a size reduction operation on the target image area; Using the third colored image as a target style image and the target image region of the first size as a content image, performing style migration on the target image region to obtain a fourth colored image; Until the fourth colored graphs corresponding to the second colored graphs are obtained, and the fourth colored graphs are used as new first colored graphs; Determine whether the preset end condition is met. If not, perform the above operation on each new first colored image. If met, splice the new first colored images to obtain the above target image, wherein the above preset end condition is not to perform the size reduction operation on the above target image area, and obtain new first colored images.

[0013] In an optional embodiment, the color adjustment of the image to be processed is performed based on the color deviation values ​​corresponding to each of the block images by histogram matching, including: Performing a clustering operation on the color deviation values ​​corresponding to each of the above-mentioned block images to obtain a maximum cluster set; Determine the mean of each color deviation value in the above largest cluster set to obtain an average color deviation value; Determine the color deviation value whose absolute value difference with the average color deviation value is the smallest among the color deviation values, and obtain the target color deviation value; Determine a target block image corresponding to the target color deviation value from each of the block images; Counting the histogram of the target block image, and based on the histogram of the target block image, performing histogram matching on the other block images among the block images except the target block image, to obtain the other block images after histogram matching; The target block image is spliced ​​with the other block images after histogram matching to obtain a fused image, wherein the fused image is an image obtained by color-adjusting the image to be processed.

[0014] In an optional embodiment, the step of performing an elimination operation on the spliced ​​edges of the color-adjusted image to obtain a grayscale image includes: Create a new transfer image with all pixels being 1, wherein the transfer image has the same image size as the fused image; For any two block images to be processed, determine the brightness ratio of the two block images to be processed, assign values ​​to the transfer image based on the brightness ratio, and obtain a weighted image; wherein the any two block images to be processed are any two images of the other block images after the target block image is matched with the histogram; Multiply the fused image and the weighted image to obtain a multiplied image; The above multiplied image is subjected to grayscale conversion to obtain the above grayscale image.

[0015] In an optional embodiment, the image to be processed is a satellite image to be processed, and the image size of the satellite image to be processed is an image size that is not supported by the image processing device, wherein the image processing device is a device for processing the satellite image to be processed.

[0016] In one aspect, an embodiment of the present disclosure provides an image processing device, the device comprising: An acquisition module, used for acquiring an image to be processed, wherein the image to be processed is an image that needs to be color adjusted; A determination module is used to divide the image to be processed into blocks according to N rows and M columns to obtain each block image, determine the color deviation value of each of the above block images, and obtain each color deviation value, wherein the above N and M are positive integers; A first processing module is used to perform color adjustment on the image to be processed by histogram matching based on the color deviation values ​​corresponding to each of the block images, and eliminate the splicing edge of the image to be processed after the color adjustment to obtain a grayscale image; The second processing module is used to resize the grayscale image, input the resized grayscale image into the style transfer neural network, perform style transfer, and obtain a target image.

[0017] In an optional embodiment, the second processing module is specifically used for: Reducing the grayscale image according to a first size to obtain a grayscale image of the first size, wherein the image size of the grayscale image is an image size that is not supported by the image processing device, the first size is an image size supported by the image processing device, and the image processing device is a device used to process the image to be processed; Obtain a target style image, input the target style image and the grayscale image of the first size into a style transfer neural network, perform style transfer on the grayscale image of the first size based on the target style image, and obtain a first colored image, wherein the target style image and the grayscale image of the first size have the same image size; Repeat the following steps until the preset end condition is met: Divide the first colored graph into four parts according to the second size to obtain four second colored graphs, wherein the first size is twice the second size; For any second colored graph, the second colored graph is enlarged according to the first size to obtain a second colored graph of the first size, and the second colored graph of the first size is recorded as a third colored graph; intercepting an image area in the grayscale image corresponding to the position of the area where the second colored image is located as a target image area, determining whether the image size of the target image area is the first size, and if not, reducing the target image area to the first size, and if so, not performing a size reduction operation on the target image area; Using the third colored image as a target style image and the target image region of the first size as a content image, performing style migration on the target image region to obtain a fourth colored image; Until the fourth colored graphs corresponding to the second colored graphs are obtained, and the fourth colored graphs are used as new first colored graphs; Determine whether the preset end condition is met. If not, perform the above operation on each new first colored image. If met, splice the new first colored images to obtain the above target image, wherein the above preset end condition is not to perform the size reduction operation on the above target image area, and obtain new first colored images.

[0018] In an optional embodiment, the first processing module is specifically used for: Performing a clustering operation on the color deviation values ​​corresponding to each of the above-mentioned block images to obtain a maximum cluster set; Determine the mean of each color deviation value in the above largest cluster set to obtain an average color deviation value; Determine the color deviation value whose absolute value difference with the average color deviation value is the smallest among the color deviation values, and obtain the target color deviation value; Determine a target block image corresponding to the target color deviation value from each of the block images; Counting the histogram of the target block image, and based on the histogram of the target block image, performing histogram matching on the other block images among the block images except the target block image, to obtain the other block images after histogram matching; The target block image is spliced ​​with the other block images after histogram matching to obtain a fused image, wherein the fused image is an image obtained by color-adjusting the image to be processed.

[0019] In an optional embodiment, the first processing module is specifically used for: Create a new transfer image with all pixels being 1, wherein the transfer image has the same image size as the fused image; For any two block images to be processed, determine the brightness ratio of the two block images to be processed, assign values ​​to the transfer image based on the brightness ratio, and obtain a weighted image; wherein the any two block images to be processed are any two images of the other block images after the target block image is matched with the histogram; Multiply the fused image and the weighted image to obtain a multiplied image; The above multiplied image is subjected to grayscale conversion to obtain the above grayscale image.

[0020] In an optional embodiment, the image to be processed is a satellite image to be processed, and the image size of the satellite image to be processed is an image size that is not supported by the image processing device, wherein the image processing device is a device for processing the satellite image to be processed.

[0021] On the one hand, an embodiment of the present disclosure provides an electronic device, which includes a processor and a memory, which are connected to each other; the memory is used to store computer programs; the processor is configured to execute a method provided by any possible implementation of the above-mentioned image processing method when calling the above-mentioned computer program.

[0022] On the one hand, an embodiment of the present disclosure provides a computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement a method provided by any possible implementation of the above-mentioned image processing method.

[0023] On the one hand, the embodiments of the present disclosure provide a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided by any possible implementation of the above-mentioned image processing method.

[0024] The technical solution provided by the present application has the following beneficial effects: obtaining an image to be processed, which is an image that needs to be color adjusted, dividing the image to be processed into blocks according to the specified N rows and M columns, and obtaining each block image after the block, and determining the color deviation value corresponding to each block image, and obtaining each color deviation value, wherein N and M are positive integers, based on each color deviation value obtained, the image to be processed is color adjusted by histogram matching, and the splicing edge of the image to be processed after the color adjustment is eliminated to obtain a grayscale image, and the grayscale image is resized, and the resized grayscale image is input into the style transfer neural network to perform style transfer to obtain a target image. In the prior art, although the method of using manual post-PS processing can improve the image effect, the workload is large, and the original terrain information may also be changed. In the embodiment of the present disclosure, the automated satellite image color adjustment method can eliminate the splicing traces and maintain the accuracy of the terrain information, meeting the needs of flight simulation training. The automated satellite image processing method can not only solve the existing image quality problem, but also greatly improve the processing efficiency, and provide a more realistic and reliable terrain environment for flight simulation training. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for describing the embodiments of the present disclosure are briefly introduced below.

[0026] Figure 1 A flowchart of an image processing method provided by an embodiment of the present disclosure; Figure 2 A schematic diagram of an image to be processed with different illumination in a regular area provided by an embodiment of the present disclosure; Figure 3 A schematic diagram of an image to be processed at different times in an irregular area provided by an embodiment of the present disclosure; Figure 4 A schematic diagram of an image to be processed in which the illumination of the entire image is inconsistent with that of other images provided by an embodiment of the present disclosure; Figure 5 A schematic diagram of an image to be processed of cloud shadows in an irregular area provided by an embodiment of the present disclosure; Figure 6 A schematic diagram of an image to be processed in which an original image of an irregular region has been fused according to an embodiment of the present disclosure; Figure 7 A schematic diagram of a grayscale image provided by an embodiment of the present disclosure; Figure 8 A schematic diagram of a target image provided by an embodiment of the present disclosure; Fig. 9 A schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure; Fig.10 A schematic diagram of the structure of an electronic device for an image processing method provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] The embodiments of the present disclosure are described below in conjunction with the drawings in the present disclosure. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present disclosure and do not constitute a limitation on the technical solutions of the embodiments of the present disclosure.

[0028] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "above", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present disclosure refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, the one element may be directly connected or coupled to the other element, or may refer to the one element and the other element establishing a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" or "A, B" indicates implementation as "A", or implementation as "B", or implementation as "A and B".

[0029] In order to make the objectives, technical solutions and advantages of the present disclosure more clear, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.

[0030] See also Figure 1 , Figure 1 is a flowchart of an image processing method provided by an embodiment of the present disclosure, such as Figure 1 As shown, the image processing method provided by the present disclosure includes the following steps: Step S101, obtaining an image to be processed, wherein the image to be processed is an image that needs to be color adjusted; Step S102, dividing the image to be processed into blocks according to N rows and M columns to obtain each block image, determining the color deviation value of each block image to obtain each color deviation value, wherein N and M are positive integers; Step S103, based on the color deviation values ​​corresponding to the respective block images, color adjustment is performed on the image to be processed by means of histogram matching, and a splicing edge of the image to be processed after color adjustment is eliminated to obtain a grayscale image; Step S104, resizing the grayscale image, inputting the resized grayscale image into a style transfer neural network, performing style transfer, and obtaining a target image.

[0031] Optionally, the image processing method in the embodiment of the present disclosure may be executed by an image processing device, wherein the image processing device may be a server, which may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server or server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The image processing device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a laptop computer, a digital broadcast receiver, a MID (Mobile Internet Devices), a PDA (Personal Digital Assistant), a desktop computer, a vehicle-mounted terminal (such as a vehicle-mounted navigation terminal), a smart speaker, a smart watch, etc.

[0032] The network used by the above-mentioned image processing method when performing image processing may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, Wi-Fi and other networks that realize wireless communication.

[0033] Optionally, in an embodiment of the present disclosure, the above-mentioned image processing method specifically includes the following steps: Acquire an image to be processed, wherein, in an optional embodiment, the image to be processed is a satellite image to be processed, and the image size of the satellite image to be processed is an image size that is not supported by an image processing device, wherein the image processing device is a device for processing the satellite image to be processed.

[0034] Specifically, the image to be processed is a large-scale image that needs color adjustment, and is a satellite image. Large-scale can be understood as a situation where the resolution of the satellite image to be processed is very large, such as an image with a size of 16384*16384. It can be understood that the embodiment of the present disclosure does not limit the size of the satellite image. The embodiment of the present disclosure is applicable to the situation where there is only one satellite image source in a geographical area and the satellite image needs to be color adjusted.

[0035] Optionally, the images to be processed in the embodiments of the present disclosure can be classified into the following categories: regular area with different illumination ( Figure 2 ), irregular areas at different times ( Figure 3), the lighting of the whole map is inconsistent with other maps ( Figure 4 )、Irregular area cloud shadows( Figure 5 )、The original image of the irregular area has been fused ( Figure 6 ).

[0036] in, Figure 2 A schematic diagram of an image to be processed with different illumination in a regular area provided by an embodiment of the present disclosure, such as Figure 2 As shown, Figure 2 There are two regular areas in the image. The two areas are taken by satellites in different lighting environments in a short period of time (such as a few days) and then stitched together. The content of this image is only different in the main color, and the content is not much different. Among them, the regular area refers to a simple concave and convex polygon formed by a small number of points.

[0037] Figure 3 A schematic diagram of an image to be processed at different times in an irregular area provided by an embodiment of the present disclosure, such as Figure 3 As shown, Figure 3 It is taken by satellite in similar lighting environment but at a long time (such as more than a few weeks), and the area after stitching is irregular. Regular area means that a small number of points can form a simple concave and convex polygon. Among them, irregular area means the area that cannot be selected by a simple polygon.

[0038] Figure 4 A schematic diagram of an image to be processed in which the illumination of the entire image is inconsistent with that of other images provided by an embodiment of the present disclosure, such as Figure 4 As shown, Figure 4 The entire image is taken by the satellite under non-ideal lighting conditions, seasons, time and other conditions. There is no obvious difference in color tone in the image, and the color tone of the entire image is unified, so the color of the entire image needs to be adjusted.

[0039] Figure 5 A schematic diagram of an image to be processed of cloud shadows in an irregular area provided by an embodiment of the present disclosure, such as Figure 5 As shown, Figure 5 There is a thin cloud below the satellite when taking the photo, which appears as shadowed or whitish irregular areas on the satellite image.

[0040] Figure 6 A schematic diagram of an image to be processed in which an original image of an irregular region has been fused is provided in an embodiment of the present disclosure, such as Figure 6 As shown, Figure 6 In the above cases, the images have been modified and adjusted by others when they were acquired.

[0041] Optionally, after the image to be processed is acquired in the above manner, the image to be processed may be processed in blocks, such as being divided into N rows and M columns to obtain each block image (if the image to be processed is a satellite image to be processed, the block image may also be referred to as a satellite block or satellite block), and then the color deviation value corresponding to each block image is calculated to obtain each color deviation value, wherein N and M are positive integers. It should be noted that the color deviation value ‌ refers to the difference between the formula calculated by the computer and the target standard. In image processing, color deviation refers to the difference between the color of the image and the original hue, which is usually caused by improper exposure time, film, flash, etc. The calculation of the color deviation value usually involves color comparison and difference calculation. In computer calculation, the color deviation value refers to the difference between the formula calculated by the computer under a certain light source and the target standard. The smaller the value, the higher the accuracy. Among them, the calculation of the color deviation value is a prior art, and the embodiments of the present disclosure will not be described in detail here.

[0042] Optionally, based on the color deviation values ​​corresponding to each block image, the image to be processed is color-adjusted by histogram matching. Optionally, the image to be processed can be color-adjusted in the following manner: based on the color deviation values ​​corresponding to each block image, a maximum color deviation value set corresponding to each color deviation value is determined by clustering (corresponding to the maximum cluster set in the text), and the mean of each color deviation value in the maximum color deviation value set is calculated, and a block image whose color deviation value is closest to the mean is selected and recorded as a target block image, and each block image other than the target block image is respectively histogram-matched with the target block image, and the above-mentioned image to be processed is color-adjusted by this histogram matching method to obtain a color-corrected image to be processed.

[0043] Optionally, the stitching edges of the color-adjusted image to be processed can be eliminated by an iterative color fusion method to obtain a grayscale image. This method can achieve a natural transition and eliminate obvious stitching marks by applying a gradient color weight to the stitching edges, thereby greatly improving the visual effect of the image. See the following description for details.

[0044] Optionally, the image size of the grayscale image obtained by the above method is adjusted to a certain extent to obtain a grayscale image after the resize that meets the requirements. If the image size of the grayscale image meets the requirements, there is no need to perform the resize operation. In practical applications, the grayscale image corresponding to the image to be processed is a large-scale image. Due to the limitations of the GPU video memory and computing power of the image processing device, the image processing device cannot support the processing of the large-scale grayscale image. Therefore, it is necessary to resize the grayscale image. Assuming that the image size of the grayscale image is 16384*16384, the image size of the grayscale image can be adjusted to 2048*2048. It can be understood that the image size of the resized grayscale image is not limited in the disclosed embodiments.

[0045] Then the resized grayscale image is input into the style transfer neural network, and the style transfer is performed on the resized grayscale image to obtain a target image that meets the target style. The detailed process is described below.

[0046] Through the disclosed embodiments, in the prior art, manual post-production PS is used to process the splicing traces. Although this method can improve the image effect, it is labor-intensive and may also change the original terrain information. Compared with the prior art, the disclosed embodiments make full use of the advantages of deep learning to achieve complete automation and intelligence of image processing, greatly improving the quality and efficiency of image processing. In addition, the disclosed embodiments can perform well in different processing tasks such as different lighting in regular areas, different times in irregular areas, inconsistent lighting in the whole image with other images, cloud shadows in irregular areas, and fusion of the original image in irregular areas. The processing results are unified in style and meet actual usage needs.

[0047] In order to more clearly illustrate the process of color adjustment of the image to be processed, in an optional embodiment, based on the color deviation values ​​corresponding to each of the above-mentioned block images, color adjustment is performed on the above-mentioned image to be processed by histogram matching, including: Performing a clustering operation on the color deviation values ​​corresponding to each of the above-mentioned block images to obtain a maximum cluster set; Determine the mean of each color deviation value in the above largest cluster set to obtain an average color deviation value; Determine the color deviation value whose absolute value difference with the average color deviation value is the smallest among the color deviation values, and obtain the target color deviation value; Determine a target block image corresponding to the target color deviation value from each of the block images; Counting the histogram of the target block image, and based on the histogram of the target block image, performing histogram matching on the other block images among the block images except the target block image, to obtain the other block images after histogram matching; The target block image is spliced ​​with the other block images after histogram matching to obtain a fused image, wherein the fused image is an image obtained by color-adjusting the image to be processed.

[0048] Optionally, the embodiment of the present disclosure describes in detail how to perform color adjustment on the image to be processed, that is, how to determine the fused image, in conjunction with an example. The specific process is as follows: Step 1: Divide the image to be processed (i.e., the original image) into blocks. The image to be processed is a satellite image to be processed. The resolution of the original image is 16384*16384 (including but not limited to this size). The original image is divided into N rows and M columns of block images (i.e., satellite image blocks), denoted as Pij (1<=i<=N, 1<=j<=M).

[0049] Step 2: Calculate the color deviation value of each block image, that is, calculate the color deviation value of image Pij respectively, and obtain each color deviation value, which is recorded as dij.

[0050] Step 3: cluster each color deviation value using a k-means clustering algorithm, and the number of clusters can be set to 3 to obtain a maximum cluster set. It can be understood that there is no limitation on the number of clusters in the embodiments of the present disclosure.

[0051] Among them, the k-means clustering algorithm is an iterative clustering analysis algorithm. Its steps are: pre-divide the data (i.e., each color deviation value) into K groups, then randomly select K objects (i.e., randomly select K color deviation values) as the initial cluster centers, and then calculate the distance between each object and each seed cluster center, and assign each object to the cluster center closest to it. The cluster centers and the objects assigned to them represent a cluster. Each time a sample is assigned, the cluster center of the cluster will be recalculated based on the existing objects in the cluster. This process will be repeated until a certain termination condition is met. The termination condition can be that no (or the minimum number) of objects are reassigned to different clusters, no (or the minimum number) of cluster centers change again, and the sum of squared errors is locally minimized.

[0052] It is understandable that the embodiments of the present disclosure do not limit the clustering method to be used. In practical applications, partitioning methods, hierarchical methods, density-based methods, grid-based methods, model-based methods, transitive closure method, Boolean matrix method, direct clustering method, correlation analysis clustering, statistical-based clustering methods, etc. can also be used.

[0053] Step 4: Calculate the mean of each color deviation value in the largest cluster set to obtain the average color deviation value da.

[0054] Step 5, compare the absolute value differences of all dij and da, and select the image Pij corresponding to dij with the smallest absolute value difference with the average color deviation value da, recorded as Pa (corresponding to the target block image); Step 6, count the histogram of Pa, perform histogram matching on other Pij (i.e., other block images except the target block image), obtain the matched image Qij (i.e., other block images after histogram matching), and splice Pa and the matched image Qij together in rows and columns to obtain image Q, which is the fused image.

[0055] Through the embodiments of the present disclosure, based on the color deviation value of each block image, a clustering method is adopted to count the color tone of the largest area, and then based on the color tone, a histogram matching method is used to perform color adjustment. This can make the overall color tone of the resulting fused image more unified and harmonious, achieve a unified color tone effect, eliminate obvious stitching traces, and greatly improve the visual effect of the image.

[0056] Optionally, after obtaining the fused image, in order to make the edge of the fused image more natural and smooth, the fused image may be subjected to iterative edge fusion. In an optional embodiment, the above-mentioned elimination operation of the spliced ​​edges of the above-mentioned color-adjusted image to obtain a grayscale image includes: Create a new transfer image with all pixels being 1, wherein the transfer image has the same image size as the fused image; For any two block images to be processed, determine the brightness ratio of the two block images to be processed, assign values ​​to the transfer image based on the brightness ratio, and obtain a weighted image; wherein the any two block images to be processed are any two images of the other block images after the target block image is matched with the histogram; Multiply the fused image and the weighted image to obtain a multiplied image; The above multiplied image is subjected to grayscale conversion to obtain the above grayscale image.

[0057] Optionally, in combination with the above method for determining a fused image, the present disclosure provides a method for determining a grayscale image, and the specific process is as follows: Step 1, create a new image D (i.e., the above-mentioned transfer image) with all pixel values ​​of 1 and a resolution of 16384*16384. The resolution of the image D is the same as that of the fused image Q. It can be understood that the resolution of the image D is not limited in the embodiment of the present disclosure. Calculate the brightness ratio of the image Qij and the corresponding adjacent image. The specific method is as follows: take any two adjacent images as an example, assume that the two adjacent images are Qa and Qb (corresponding to any two block images to be processed above), assume that the coordinates of a certain pixel on the boundary of the image Qa are (xe, ye), first calculate the average value of all pixels belonging to Qa within the center side length of 100 pixels of the pixel at the point, recorded as AverP, calculate the average value of all pixels belonging to the image Qb adjacent to Qa within the center side length of 100 pixels of the pixel at the point, recorded as AverN. The brightness ratio is R = AverP / AverN, then the point value of the image D with the coordinates of (xe, ye) is assigned to R, and when all the pixel points of the image D are assigned, the weighted image is obtained.

[0058] Step 3, traverse the weighted image D. If the calculated brightness ratio (non-1) exists in the 3*3 area near a certain pixel point of the weighted image D, the brightness ratio of the point is the average of the brightness ratios (non-1) in the nearby 3*3 area, otherwise it is 1. Repeat step 3 1000 times, and finally a grayscale brightness weight transition band with a width of 1000 can be obtained.

[0059] Step 4, multiply the image Q (i.e., the fused image) with the weighted image D to obtain the multiplied image E. Among them, after the weighted transition band corresponding to the weighted image D is multiplied with the image Q, the grayscale difference between the adjacent contact boundaries of the image Q (i.e., any image Qij and the corresponding adjacent image, that is, any two block images to be processed) can be eliminated to a large extent, so as to achieve smooth image transition. This step can be selected according to the situation. If the gap is too small, it can be omitted. If the gap is too large, this step is adopted. The size of the gap can be specified in advance according to the requirements.

[0060] Step 5: Convert the multiplied image E into a grayscale image to obtain image F (i.e., grayscale image), as shown in Figure 7 , which is a schematic diagram of a grayscale image obtained through an embodiment of the present disclosure.

[0061] Through the embodiments of the present disclosure, the iterative color fusion method is adopted, and by applying a gradient color weight on the stitching edge, the stitching edge of the fused image can achieve a smooth transition, effectively eliminating the grayscale difference of the stitching edge, thereby improving the accuracy of image processing and improving image quality.

[0062] In an optional embodiment, resizing the grayscale image, inputting the resized grayscale image into a style transfer neural network, performing style transfer, and obtaining a target image includes: Reducing the grayscale image according to a first size to obtain a grayscale image of the first size, wherein the image size of the grayscale image is an image size that is not supported by the image processing device, the first size is an image size supported by the image processing device, and the image processing device is a device used to process the image to be processed; Obtain a target style image, input the target style image and the grayscale image of the first size into a style transfer neural network, perform style transfer on the grayscale image of the first size based on the target style image, and obtain a first colored image, wherein the target style image and the grayscale image of the first size have the same image size; Repeat the following steps until the preset end condition is met: Divide the first colored graph into four parts according to the second size to obtain four second colored graphs, wherein the first size is twice the second size; For any second colored graph, the second colored graph is enlarged according to the first size to obtain a second colored graph of the first size, and the second colored graph of the first size is recorded as a third colored graph; intercepting an image area in the grayscale image corresponding to the position of the area where the second colored image is located as a target image area, determining whether the image size of the target image area is the first size, and if not, reducing the target image area to the first size, and if so, not performing a size reduction operation on the target image area; Using the third colored image as a target style image and the target image region of the first size as a content image, performing style migration on the target image region to obtain a fourth colored image; Until the fourth colored graphs corresponding to the second colored graphs are obtained, and the fourth colored graphs are used as new first colored graphs; Determine whether the preset end condition is met. If not, perform the above operation on each new first colored image. If met, splice the new first colored images to obtain the above target image, wherein the above preset end condition is not to perform the size reduction operation on the above target image area, and obtain new first colored images.

[0063] Optionally, in the embodiment of the present disclosure, style transfer is performed through a style transfer neural network. The main idea is to use an exponential hierarchy method, use a style transfer neural network, and perform style transfer from a low-resolution coloring image to a high-resolution grayscale image, thereby gradually improving the accuracy. In practical applications, the style transfer neural network can also be optimized through an optimization algorithm (Limited-memory BFGS, LBFGS for short), where LBFGS is an optimizer for the style transfer neural network. The specific steps are as follows: Step 1: Reduce the size of image F (i.e. the grayscale image mentioned above) from 16384*16384 to 2048*2048 (i.e. the first size mentioned above), and record the reduced size image F as F1 (i.e. the grayscale image of the first size mentioned above). The purpose of performing the reduction operation is as follows: first, due to the limitation of the style transfer algorithm, the graphics card cannot support images as large as 16384*16384, and the video memory can only support images of 2048*2048 at most for calculation; second, it is to meet the input requirements of the style transfer neural network.

[0064] Then, the image F1 is style-transferred with the target style image to obtain a coloring image G of size 2048*2048 (corresponding to the first coloring image mentioned above). The target style image has the same image size as the grayscale image. The selection criteria of the target style image can be determined according to actual needs, which is the ideal color style of the satellite image selected artificially. For example, the color style of the target style image can be mostly green forest, with some towns and some loess. This standard is related to the geographical location of the processing. For example, if the satellite image taken is a desert area, a yellow satellite image of a larger area can be selected as the target style image.

[0065] The following operations are performed until a preset end condition is met, wherein the preset end condition is that the target image area is not downsized and new first colored images are obtained: Step 2, divide the colored graph G (corresponding to the above-mentioned first colored graph) into four parts according to the size of 1024*1024 (that is, the above-mentioned second size), and record them as G1 (x: 0-1024, y: 0-1024), G2 (x: 1024-2048, y: 0-1024), G3 (x: 0-1024, y: 1024-2048), G4 (x: 1024-2048, y: 1024-2048), where G1, G2, G3 and G4 correspond to the above-mentioned four second colored graphs.

[0066] Take G1 among G1, G2, G3 and G4 as an example, enlarge G1 to 2048*2048, and obtain G1 of size 2048*2048 (corresponding to the second coloring map of the first size mentioned above, i.e., the third coloring map), and use G1 of size 2048*2048 (i.e., the third coloring map) as the target style image. Cut out the area (x:0-8192, y:0-8192) corresponding to the image content of image F and G1, and use the cutout area as the target image area, and determine whether the image size of the target image area is the first size. If not, reduce the target image area to the first size. If so, do not perform the size reduction operation on the target image area. It can be seen that the size of the target image area at this time does not meet the first size, that is, the image size does not meet 2048*2048, so the target image area is reduced to the first size of 2048*2048. The target image area of ​​the first size (i.e., 2048*2048) is used as the content image of the style transfer, and G1 (i.e., the third coloring image) of size 2048*2048 is used as the target style image to perform style transfer, and a coloring image H1 (i.e., the fourth coloring image) of size 2048*2048 is obtained. G2, G3, and G4 are processed in the same way to obtain corresponding coloring images H2, H3, and H4, which will not be described in detail in the embodiments of the present disclosure.

[0067] Finally, four fourth coloring graphs H1, H2, H3 and H4 corresponding to the first coloring graph G can be obtained, and the obtained fourth coloring graphs H1, H2, H3 and H4 are used as new first coloring graphs.

[0068] Determine whether the preset end condition is met. If not, continue to step 3.

[0069] Step 3, in the same manner as in step 2 above, the first colored graphs H1 ... H4 are processed to obtain the corresponding fourth colored graphs I1, I2 ... I16. The following is an example of the colored graph H1, and the specific process is as follows: The colored graph H1 (corresponding to the first colored graph mentioned above) is divided into four parts according to the size of 1024*1024 (i.e. the second size mentioned above), and they are respectively recorded as I1 (x: 0-1024, y: 0-1024), I2 (x: 1024-2048, y: 0-1024), I5 (x: 0-1024, y: 1024-2048), and I6 (x: 1024-2048, y: 1024-2048), among which I1, I2, I5 and I6 correspond to the four second colored graphs mentioned above.

[0070] Take I1 among I1, I2, I5 and I6 as an example, enlarge I1 to 2048*2048, obtain I1 of size 2048*2048 (corresponding to the second coloring map of the first size mentioned above, i.e., the third coloring map), and use I1 of size 2048*2048 (i.e., the third coloring map) as the target style image. Cut out the area (x:0-4096, y:0-4096) corresponding to the image content of image F and I1, and use the cutout area as the target image area, and determine whether the image size of the target image area is the first size. If not, reduce the target image area to the first size. If so, do not perform the reduction operation on the target image area. It can be seen that the size of the target image area at this time does not meet the first size, that is, the image size does not meet 2048*2048, so the target image area is reduced to the first size of 2048*2048. The target image area of ​​the first size (i.e., 2048*2048) is used as the content image of the style transfer, and I1 (i.e., the third coloring image) of size 2048*2048 is used as the target style image to perform style transfer, and a coloring image J1 (i.e., the fourth coloring image) of size 2048*2048 is obtained. I2, I5, and I6 are processed in the same manner to obtain corresponding coloring images J2, J5, and 16, which will not be described in detail in the embodiments of the present disclosure.

[0071] Finally, we can get four fourth colored graphs J1, J2, J5 and J6 corresponding to the first colored graph H1, four fourth colored graphs J3, J4, J7 and J8 corresponding to the second colored graph H2; four fourth colored graphs J9, J10, J13 and J14 corresponding to the second colored graph H3; four fourth colored graphs J11, J12, J15 and J16 corresponding to the second colored graph H4. The fourth colored graphs J1, J2, ... J16 are used as new first colored graphs.

[0072] Determine whether the preset end condition is met. If not, continue to step 4.

[0073] Step 4: Process each first colored graph J1, J2 ... J16 in the same manner as in Step 2 and Step 3 above to obtain each corresponding fourth colored graph L1, L2 ... L64. The following is an example of the colored graph J1, and the specific process is as follows: The colored graph J1 (corresponding to the first colored graph mentioned above) is divided into four parts according to the size of 1024*1024 (i.e. the second size mentioned above), and they are respectively recorded as K1 (x:0-1024, y:0-1024), K2 (x:1024-2048, y:0-1024), K9 (x:0-1024, y:1024-2048), and K10 (x:1024-2048, y:1024-2048), among which K1, K2, K9 and K10 correspond to the four second colored graphs mentioned above.

[0074] Take K1 among K1, K2, K9 and K10 as an example, enlarge K1 to 2048*2048, and obtain K1 of size 2048*2048 (corresponding to the second coloring map of the first size mentioned above, i.e., the third coloring map), and use K1 of size 2048*2048 (i.e., the third coloring map) as the target style image. Cut out the area (x:0-2048, y:0-2048) corresponding to the image content of image F and K1, and use the cutout area as the target image area, and determine whether the image size of the target image area is the first size. If not, reduce the target image area to the first size. If so, do not perform the size reduction operation on the target image area. It can be seen that at this time, if the size of the target image area meets the first size, there is no need to perform the size reduction operation on the target image area. The target image area of ​​the first size (i.e., 2048*2048) is used as the content image of the style transfer, and K1 (i.e., the third coloring image) of the size of 2048*2048 is used as the target style image to perform style transfer, and a coloring image L1 (i.e., the fourth coloring image) of the size of 2048*2048 is obtained. K2, K9, and K10 are processed in the same manner to obtain the corresponding coloring images L2, L9, and L10, which will not be described in detail in the embodiments of the present disclosure.

[0075] Finally, we can obtain four fourth colored graphs L1, L2, L9 and L10 corresponding to the first colored graph J1, four fourth colored graphs L3, L4, L11 and L12 corresponding to the second colored graph J2; ...; four fourth colored graphs L55, L56, L63 and L64 corresponding to the second colored graph J16. The fourth colored graphs L1, L2, ... L64 are used as new first colored graphs.

[0076] Determine whether the preset end condition is met, if yes, then continue to step 5.

[0077] Step 5, combine the new first colored images L1, L2...L64 together to generate a colored image L with a size of (16384*16384), which is the above-mentioned target image, where Figure 8 , which is a schematic diagram of a target image obtained through an embodiment of the present disclosure.

[0078] It should be noted that image G is a low-resolution coloring image, and image F is a high-resolution grayscale image. In step 2, firstly, a quarter of image G is enlarged to obtain a blurred 2048 coloring image, and then the corresponding area of ​​a quarter of image F is reduced in size to 2048, with a loss of 4 times the precision. The two have the same size and style transfer is performed. After completing this operation, a 4096*4096 coloring image H (H1, H1...H4) is obtained, which is a 2-fold increase in resolution of image G. Similarly, in step 3, the corresponding area of ​​one-eighth of image F is reduced in size to 2048, with a loss of 2 times the precision, and a 8192*8192 coloring image J (J1, J2...J16) is obtained. In step 4, the corresponding area of ​​one-sixteenth of image F is intercepted. At this time, the corresponding one-sixteenth of image F is the area where 2048*2048 is located, without losing precision. Style transfer is performed to obtain a 16384*16384 coloring image L (L1, L2...L64).

[0079] Through the embodiments of the present disclosure, the method of using a low-resolution colored image as a high-resolution grayscale image for style transfer can gradually improve the accuracy and improve the processing accuracy of style transfer.

[0080] The present disclosure provides an image processing device, such as Fig. 9 As shown, the image processing device 10 may include: an acquisition module 101, a determination module 102, a first processing module 103, and a second processing module 104, wherein: The acquisition module 101 is used to acquire an image to be processed, wherein the image to be processed is an image that needs to be color adjusted; The determination module 102 is used to divide the image to be processed into blocks according to N rows and M columns to obtain each block image, determine the color deviation value of each block image to obtain each color deviation value, wherein N and M are positive integers; The first processing module 103 is used to perform color adjustment on the image to be processed by histogram matching based on the color deviation values ​​corresponding to the respective block images, and eliminate the splicing edges of the image to be processed after the color adjustment to obtain a grayscale image; The second processing module 104 is used to resize the grayscale image, input the resized grayscale image into the style transfer neural network, perform style transfer, and obtain a target image.

[0081] In an optional embodiment, the second processing module 104 is specifically used for: Reducing the grayscale image according to a first size to obtain a grayscale image of the first size, wherein the image size of the grayscale image is an image size that is not supported by the image processing device, the first size is an image size supported by the image processing device, and the image processing device is a device used to process the image to be processed; Obtain a target style image, input the target style image and the grayscale image of the first size into a style transfer neural network, perform style transfer on the grayscale image of the first size based on the target style image, and obtain a first colored image, wherein the target style image and the grayscale image of the first size have the same image size; Repeat the following steps until the preset end condition is met: Divide the first colored graph into four parts according to the second size to obtain four second colored graphs, wherein the first size is twice the second size; For any second colored graph, the second colored graph is enlarged according to the first size to obtain a second colored graph of the first size, and the second colored graph of the first size is recorded as a third colored graph; intercepting an image area in the grayscale image corresponding to the position of the area where the second colored image is located as a target image area, determining whether the image size of the target image area is the first size, and if not, reducing the target image area to the first size, and if so, not performing a size reduction operation on the target image area; Using the third colored image as a target style image and the target image region of the first size as a content image, performing style migration on the target image region to obtain a fourth colored image; Until the fourth colored graphs corresponding to the second colored graphs are obtained, and the fourth colored graphs are used as new first colored graphs; Determine whether the preset end condition is met. If not, perform the above operation on each new first colored image. If met, splice the new first colored images to obtain the above target image, wherein the above preset end condition is not to perform the size reduction operation on the above target image area, and obtain new first colored images.

[0082] In an optional embodiment, the first processing module 103 is specifically used for: Performing a clustering operation on the color deviation values ​​corresponding to each of the above-mentioned block images to obtain a maximum cluster set; Determine the mean of each color deviation value in the above largest cluster set to obtain an average color deviation value; Determine the color deviation value whose absolute value difference with the average color deviation value is the smallest among the color deviation values, and obtain the target color deviation value; Determine a target block image corresponding to the target color deviation value from each of the block images; Counting the histogram of the target block image, and based on the histogram of the target block image, performing histogram matching on the other block images among the block images except the target block image, to obtain the other block images after histogram matching; The target block image is spliced ​​with the other block images after histogram matching to obtain a fused image, wherein the fused image is an image obtained by color-adjusting the image to be processed.

[0083] In an optional embodiment, the first processing module 103 is specifically used for: Create a new transfer image with all pixels being 1, wherein the transfer image has the same image size as the fused image; For any two block images to be processed, determine the brightness ratio of the two block images to be processed, assign values ​​to the transfer image based on the brightness ratio, and obtain a weighted image; wherein the any two block images to be processed are any two images of the other block images after the target block image is matched with the histogram; Multiply the fused image and the weighted image to obtain a multiplied image; The above multiplied image is subjected to grayscale conversion to obtain the above grayscale image.

[0084] In an optional embodiment, the image to be processed is a satellite image to be processed, and the image size of the satellite image to be processed is an image size that is not supported by the image processing device, wherein the image processing device is a device for processing the satellite image to be processed.

[0085] Through the disclosed embodiments, the automated satellite image color adjustment method can eliminate the splicing traces and maintain the accuracy of terrain information, meeting the needs of flight simulation training. The automated satellite image processing method can not only solve the existing image quality problems, but also greatly improve the processing efficiency, providing a more realistic and reliable terrain environment for flight simulation training.

[0086] The device of the embodiment of the present disclosure can execute the method provided by the embodiment of the present disclosure, and its implementation principle is similar and has corresponding technical effects. The actions performed by each module in the device of each embodiment of the present disclosure correspond to the steps in the method of each embodiment of the present disclosure. For the detailed functional description of each module of the device, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.

[0087] An embodiment of the present disclosure provides an electronic device (computer device / equipment / system), including a memory, a processor, and a computer program stored in the memory, and the processor executes the above computer program to implement the steps of the method provided in any optional embodiment of the present disclosure.

[0088] In an alternative embodiment, an electronic device is provided, such as Fig.10 As shown, Fig.10 The electronic device 1000 shown includes: a processor 1001 and a memory 1003. The processor 1001 and the memory 1003 are connected, such as through a bus 1002. Optionally, the electronic device 1000 may also include a transceiver 1004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 1004 is not limited to one, and the structure of the electronic device 1000 does not constitute a limitation on the embodiments of the present disclosure.

[0089] Processor 1001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. Processor 1001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0090] The bus 1002 may include a path to transmit information between the above components. The bus 1002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 1002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0091] The memory 1003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage medium, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.

[0092] The memory 1003 is used to store the computer program for executing the embodiment of the present disclosure, and the execution is controlled by the processor 1001. The processor 1001 is used to execute the computer program stored in the memory 1003 to implement the steps shown in the above method embodiment.

[0093] An embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.

[0094] The embodiments of the present disclosure also provide a computer program product, including a computer program, which can implement the steps and corresponding contents of the aforementioned method embodiments when executed by a processor.

[0095] It should be understood that, although the flowchart of the embodiment of the present disclosure indicates each operation step by arrows, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present disclosure, the implementation steps in each flowchart can be executed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on the actual implementation scenario. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage in these sub-steps or stages can also be executed at different times. In scenarios with different execution times, the execution order of these sub-steps or stages can be flexibly configured according to demand, and the embodiment of the present disclosure does not limit this.

[0096] The above are only optional implementation methods for some implementation scenarios of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the scheme of the present disclosure, other similar implementation methods based on the technical ideas of the present disclosure are also within the protection scope of the embodiments of the present disclosure.

Claims

1. An image processing method, characterized in that: The method comprises: Acquire an image to be processed, wherein the image to be processed is an image that needs to be color adjusted; Divide the image to be processed into blocks according to N rows and M columns to obtain each block image, determine the color deviation value of each block image to obtain each color deviation value, wherein N and M are positive integers; Based on the color deviation values ​​corresponding to the respective block images, the image to be processed is color adjusted by histogram matching, and the splicing edge of the image to be processed after the color adjustment is eliminated to obtain a grayscale image; The grayscale image is resized, and the resized grayscale image is input into a style transfer neural network to perform style transfer to obtain a target image.

2. The method according to claim 1, characterized in that The step of resizing the grayscale image and inputting the resized grayscale image into a style transfer neural network to perform style transfer to obtain a target image includes: Reducing the grayscale image according to a first size to obtain a grayscale image of the first size, wherein the image size of the grayscale image is an image size that is not supported by an image processing device, the first size is an image size supported by the image processing device, and the image processing device is a device used to process the image to be processed; Acquire a target style image, input the target style image and the grayscale image of the first size into a style transfer neural network, perform style transfer on the grayscale image of the first size based on the target style image, and obtain a first colored image, wherein the target style image and the grayscale image of the first size have the same image size; Repeat the following steps until the preset end condition is met: Divide the first colored graph into four parts according to a second size to obtain four second colored graphs, wherein the first size is twice the second size; For any second colored graph, the second colored graph is enlarged according to the first size to obtain a second colored graph of the first size, and the second colored graph of the first size is recorded as a third colored graph; intercepting an image area in the grayscale image corresponding to the position of the area where the second colored image is located as a target image area, determining whether an image size of the target image area is a first size, and if not, reducing the target image area to the first size, and if so, not performing a size reduction operation on the target image area; Using the third colored image as a target style image and the target image region of the first size as a content image, performing style migration on the target image region to obtain a fourth colored image; Until the fourth colored graphs corresponding to the second colored graphs are obtained, and the fourth colored graphs are used as new first colored graphs; Determine whether the preset end condition is met. If not, perform the above operation on each new first colored image. If met, splice the new first colored images to obtain the target image, wherein the preset end condition is not to perform a size reduction operation on the target image area, and obtain new first colored images.

3. The method according to claim 1, characterized in that The color adjustment of the image to be processed is performed based on the color deviation values ​​corresponding to each of the block images by means of histogram matching, including: Performing a clustering operation on the color deviation values ​​corresponding to each of the block images to obtain a maximum cluster set; Determine the mean of each color deviation value in the maximum cluster set to obtain an average color deviation value; Determine the color deviation value whose absolute value difference with the average color deviation value is the smallest among the color deviation values, and obtain a target color deviation value; Determine a target block image corresponding to the target color deviation value from each of the block images; Counting the histogram of the target block image, and based on the histogram of the target block image, performing histogram matching on other block images among the block images except the target block image to obtain other block images after histogram matching; The target block image is spliced ​​with the other block images after histogram matching to obtain a fused image, wherein the fused image is an image obtained by color-adjusting the image to be processed.

4. The method according to claim 3, characterized in that The step of performing an elimination operation on the spliced ​​edges of the color-adjusted image to obtain a grayscale image includes: Creating a new transfer image with all pixels being 1, wherein the transfer image has the same image size as the fused image; For any two block images to be processed, determine the brightness ratio of the two block images to be processed, assign values ​​to the transfer image based on the brightness ratio, and obtain a weighted image; wherein the any two block images to be processed are any two images of the other block images after the target block image is matched with the histogram; Multiplying the fused image and the weight image to obtain a multiplied image; The multiplied image is subjected to grayscale conversion to obtain the grayscale image.

5. The method according to claim 1, characterized in that The image to be processed is a satellite image to be processed, and the image size of the satellite image to be processed is an image size that cannot be processed by the image processing device, wherein the image processing device is a device used to process the satellite image to be processed.

6. An image processing device, characterized in that: The device comprises: An acquisition module, used for acquiring an image to be processed, wherein the image to be processed is an image that needs to be color adjusted; A determination module, configured to divide the image to be processed into blocks according to N rows and M columns to obtain each block image, determine the color deviation value of each block image, and obtain each color deviation value, wherein N and M are positive integers; A first processing module, configured to perform color adjustment on the image to be processed by histogram matching based on the color deviation values ​​corresponding to the respective block images, and to eliminate the splicing edges of the color-adjusted image to obtain a grayscale image; The second processing module is used to resize the grayscale image, input the resized grayscale image into the style transfer neural network, perform style transfer, and obtain a target image.

7. The device according to claim 6, characterized in that The second processing module is specifically used for: Reducing the grayscale image according to a first size to obtain a grayscale image of the first size, wherein the image size of the grayscale image is an image size that is not supported by an image processing device, the first size is an image size supported by the image processing device, and the image processing device is a device used to process the image to be processed; Acquire a target style image, input the target style image and the grayscale image of the first size into a style transfer neural network, perform style transfer on the grayscale image of the first size based on the target style image, and obtain a first colored image, wherein the target style image and the grayscale image of the first size have the same image size; Repeat the following steps until the preset end condition is met: Divide the first colored graph into four parts according to a second size to obtain four second colored graphs, wherein the first size is twice the second size; For any second colored graph, the second colored graph is enlarged according to the first size to obtain a second colored graph of the first size, and the second colored graph of the first size is recorded as a third colored graph; intercepting an image area in the grayscale image corresponding to the position of the area where the second colored image is located as a target image area, determining whether an image size of the target image area is a first size, and if not, reducing the target image area to the first size, and if so, not performing a size reduction operation on the target image area; Using the third colored image as a target style image and the target image region of the first size as a content image, performing style migration on the target image region to obtain a fourth colored image; Until the fourth colored graphs corresponding to the second colored graphs are obtained, and the fourth colored graphs are used as new first colored graphs; Determine whether the preset end condition is met. If not, perform the above operation on each new first colored image. If met, splice the new first colored images to obtain the target image, wherein the preset end condition is not to perform a size reduction operation on the target image area, and obtain new first colored images.

8. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Style migration method for target edge sharpening

    CN111986075A

  • Image processing method and device, electronic equipment and storage medium

    CN112102154A

  • Generative adversarial neural network based on color histogram and image re-coloring method

    CN117521739A

Cited By

  • High-resolution remote sensing image color correction method and system based on style migration

    CN120823116A