Image processing method, computer terminal and storage medium
By generating target style templates in remote sensing scenes based on the color characteristics of the opposing color space, the problem of reduced classification accuracy caused by differences in satellite hardware, light brightness and geographical regions is solved, and the robustness and accuracy of the model are improved.
Patent Information
- Application Number
- CN202111166595.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2041-09-30
AI Technical Summary
In the segmentation, recognition and classification of ground objects in remote sensing scenes, the classification accuracy of the ground object classification model is reduced due to differences in satellite hardware, image post-processing, light brightness and geographical regions.
By generating a target style template, a target image is generated based on the color characteristics of each pixel in the preset image in the opposing color space, so as to reduce the difference between the image to be processed and the training data and improve the robustness and accuracy of the model.
By generating the target style template, the difference between the image to be processed and the training data is reduced, the robustness and accuracy of the model are improved, and the problem of reduced classification accuracy is solved.
Smart Images

Figure CN113962850B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to an image processing method, a computer terminal, and a storage medium. Background Art
[0002] At present, in the remote sensing scene ground object segmentation, recognition and classification scenario, the ground object category of each pixel in the satellite image can be manually labeled as training image data, and then the labeled training data can be passed to the deep model for learning to obtain the ground object classification model.
[0003] However, due to satellite hardware, image post-processing (such as Figure 1 As shown), light and dark (as shown Figure 2 shown), geographic areas (such as Figure 3 As shown in the figure, there are differences between the images to be processed and the training data, which leads to a decrease in the classification accuracy of the land feature classification model.
[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0005] The embodiments of the present application provide an image processing method, a computer terminal, and a storage medium to at least solve the technical problem in related technologies that there are differences between the image to be processed and the training data, resulting in reduced model accuracy.
[0006] According to one aspect of an embodiment of the present application, an image processing method is provided, including: obtaining an original image; determining a target style template corresponding to multiple first pixels in the original image, wherein the target style template is generated based on the color characteristics of each second pixel in a preset image in an opposing color space; and generating a target image based on the original image and the target style template corresponding to the multiple first pixels.
[0007] According to another aspect of an embodiment of the present application, an image processing method is provided, including: acquiring a ground object image; determining a target style template corresponding to multiple first pixels in the ground object image, wherein the target style template is generated based on the color characteristics of each second pixel in a preset image in an opposing color space; and generating a target image based on the ground object image and the target style template corresponding to the multiple first pixels.
[0008] According to another aspect of an embodiment of the present application, an image processing method is provided, including: a cloud server receiving an original image uploaded by a client; the cloud server determining a target style template corresponding to multiple first pixels in the original image, wherein the target style template is generated based on the color characteristics of each second pixel in a preset image in an opposing color space; the cloud server generates a target image based on the original image and the target style template corresponding to the multiple first pixels; and the cloud server outputs the target image to the client.
[0009] According to one aspect of an embodiment of the present application, an image processing device is provided, including: an acquisition module for acquiring an original image; a determination module for determining a target style template corresponding to multiple first pixels in the original image, wherein the target style template is generated based on the color characteristics of each second pixel in an opposing color space in a preset image; and a generation module for generating a target image based on the original image and the target style template corresponding to the multiple first pixels.
[0010] According to one aspect of an embodiment of the present application, an image processing device is provided, including: an acquisition module for acquiring a ground object image; a determination module for determining a target style template corresponding to multiple first pixels in the ground object image, wherein the target style template is generated based on the color characteristics of each second pixel in an opposing color space in a preset image; and a generation module for generating a target image based on the ground object image and the target style template corresponding to the multiple first pixels.
[0011] According to one aspect of an embodiment of the present application, an image processing device is provided, which is arranged on a cloud server and includes: a receiving module for receiving an original image uploaded by a client; a determining module for determining a target style template corresponding to multiple first pixels in the original image, wherein the target style template is generated based on the color characteristics of each second pixel in a preset image in an opposing color space; a generating module for generating a target image based on the original image and the target style template corresponding to the multiple first pixels; and an output module for outputting the target image to the client.
[0012] According to another aspect of an embodiment of the present application, a computer-readable storage medium is further provided. The computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the image processing method in the above embodiment.
[0013] According to another aspect of an embodiment of the present application, a computer terminal is further provided, including: a memory and a processor, wherein the processor is configured to run a program stored in the memory, wherein the image processing method in the above embodiment is executed when the program is run.
[0014] In an embodiment of the present application, after acquiring an original image, a target style template corresponding to a plurality of first pixels in the original image is determined, and a target image is generated based on the original image and the target style template corresponding to the plurality of first pixels, thereby achieving the purpose of image data enhancement. It is readily apparent that since the target style template is generated based on the color characteristics of each second pixel in the preset image in the opposing color space, the target image can be an image of a different style. Using the target image for model training can achieve the technical effect of reducing the difference between the image to be processed and the training data, thereby improving the robustness and accuracy of the model. This, in turn, solves the technical problem in related arts where the difference between the image to be processed and the training data leads to reduced model accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0016] Figure 1 It is a schematic diagram of an optional satellite hardware and image post-processing under different contrast scenarios according to the existing technology;
[0017] Figure 2 is a schematic diagram of an image in an optional light and dark scene according to the prior art;
[0018] Figure 3 is a schematic diagram of an image in an optional geographical area scenario according to the prior art;
[0019] Figure 4 This is a hardware structure block diagram of a computer terminal (or mobile device) for implementing an image processing method according to an embodiment of the present application;
[0020] Figure 5 is a flowchart of an image processing method according to Example 1 of the present application;
[0021] Figure 6a is a schematic diagram of an interactive interface according to an embodiment of the present application;
[0022] Figure 6b is a schematic diagram of an optional interactive interface according to an embodiment of the present application;
[0023] Figure 7 is a schematic diagram of an optional data enhancement method according to an embodiment of the present application;
[0024] Figure 8a is a schematic diagram of an optional satellite hardware and image post-processing generated images in different comparison scenarios according to an embodiment of the present application;
[0025] Figure 8b is a schematic diagram of an optional generated image in a light and dark scene according to an embodiment of the present application;
[0026] Figure 8c is a schematic diagram of a generated graph in an optional geographical area scenario according to an embodiment of the present application;
[0027] Figure 9 is a flowchart of an image processing method according to Example 2 of the present application;
[0028] Figure 10 is a flowchart of an image processing method according to Example 3 of the present application;
[0029] Figure 11 is a schematic diagram of an image processing device according to an embodiment of the present application;
[0030] Figure 12 is a schematic diagram of another image processing device according to an embodiment of the present application;
[0031] Figure 13 This is a structural block diagram of a computer terminal according to an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretations:
[0035] AI Earth: Uses AI technology to analyze the Earth and different landform types, with applications in natural resources, water conservancy, natural disasters, and other issues.
[0036] Data augmentation: This is mainly used to reduce overfitting of the network. By transforming the training images, a network with stronger generalization ability can be obtained, which can better adapt to the application scenario.
[0037] CIELAB color space: Also written as L*a*b*, it is a color space defined by the International Commission on Illumination (abbreviated as CIE) in 1976. It represents color as three values: "L*" represents perceived lightness, and "a*" and "b*" represent the four unique colors of human vision: red, green, blue, and yellow. CIELAB is intended to be a perceptually uniform space, where a given numerical change corresponds to a similar perceived color change; although it is not truly perceptually uniform, it is still used in industry to detect subtle differences in color.
[0038] RGB color space: defined by the chromaticity of the three primary colors red, green and blue, which can be used to define the corresponding color triangle to generate other colors.
[0039] To address these issues, related technologies offer the following solution: using a generative adversarial network (GAN) to learn the differences between images from different satellite hardware, image post-processing, lighting conditions, geographical regions, and seasons. This requires a large amount of image data from the same region under different conditions to learn a stable generative network. Furthermore, the resulting images generated by the network are uncontrollable, requiring human intervention for quality control.
[0040] Example 1
[0041] According to an embodiment of the present application, an image processing method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0042] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 4 FIG1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing an image processing method. Figure 4As shown, the computer terminal 10 (or mobile device) may include one or more (illustrated as 102a, 102b, ..., 102n) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 4 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 4 More or fewer components than shown, or with Figure 4 Different configurations shown.
[0043] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry." The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be fully or partially integrated into any of the other components of the computer terminal 10 (or mobile device). The data processing circuitry may function as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0044] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the image processing method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the above-mentioned image processing method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0045] The transmission device 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.
[0046] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0047] Figure 4 The hardware structure block diagram shown can serve not only as an exemplary block diagram of the computer terminal 10 (or mobile device), but also as an exemplary block diagram of the server. In an optional embodiment, the server can be a locally deployed server or a cloud server, connected to one or more clients via a data network connection or electronic connection. The data network connection can be a local area network connection, a wide area network connection, an Internet connection, or other types of data network connections.
[0048] Under the above operating environment, this application provides Figure 5 The image processing method shown. Figure 5 This is a flow chart of an image processing method according to Example 1 of the present application. Figure 5 As shown, the method may include the following steps:
[0049] Step S502: Acquire the original image.
[0050] The aforementioned original images can be, but are not limited to, remote sensing images, aerial images taken by drones, or radar images. In natural resource scenarios, original images can include images of farmland, greenhouses, road networks, buildings, and mountains. In water conservancy scenarios, original images can include images of dams, bridges, and rivers. In natural disaster scenarios, original images can include images of buildings, mountains, and rivers.
[0051] In an optional embodiment, the original image can be taken by a satellite or a drone and transmitted to a server via a network, processed by the server, and the original image can be displayed to the user at the same time, such as Figure 6a As shown, the original image can be displayed in the image acquisition area; in another optional embodiment, the original image can be taken by a satellite or a drone and uploaded to the server by the user, and processed by the server, such as Figure 6b As shown, users can upload their original images to the server by clicking the "Upload Image" button in the interactive interface or by dragging the original image directly into the dotted box. The uploaded image can then be displayed in the image collection area. The server here can be a local server or a cloud server.
[0052] Step S504 : determining a target style template corresponding to a plurality of first pixels in the original image, wherein the target style template is generated based on the color characteristics of each second pixel in the preset image in an opposing color space.
[0053] The aforementioned preset images can be a large number of images collected for different classification tasks. Objects of the same category may have different colors in different images. The category here refers not only to the category of the object itself but also to the category of the object's geographic location. For example, if the objects contained in the preset images are plots of land, the categories may be Northeast Farmland, Northwest Farmland, North China Farmland, etc., but are not limited to these. It should be noted that the preset images can be a collection of annotated images obtained from the internet or a collection of images obtained through manual annotation.
[0054] The above-mentioned color characteristics can be the mean and variance of color values. Different colors are represented differently in different color spaces. For example, in the opposing color space, i.e., the CIELAB color space, colors can be represented by three values: L*, a*, and b*; in the three primary color space, i.e., the RGB color space, colors can be represented by three values: R, G, and B.
[0055] Step S506 : generating a target image based on the original image and the target style template corresponding to the plurality of first pixels.
[0056] The target image can be an image generated by transferring the color features of the target style template to the original image. The target image contains the same objects as the original image, but has a different color style, realizing special color transformation for different categories of objects, such as different satellite image style transformations, light and dark transformations, red to yellow land transformations, yellow to green river water transformations, etc.
[0057] In an optional embodiment, the color values of each pixel in the preset image in the CIELAB color space can be statistically analyzed according to the different categories corresponding to each pixel in the preset image to obtain the average and standard deviation. Furthermore, the target image can be generated based on the color values of each pixel in the original image in the CIELAB color space and the color characteristics corresponding to each pixel. Finally, multiple original images and the corresponding target images can be mixed to train the image processing model.
[0058] In an optional embodiment, after the target style templates corresponding to the first pixels in the original image are determined in the server, they can be directly displayed to the user for viewing, such as Figure 6a As shown, the target style template can be displayed in the result feedback area; in another optional embodiment, after the target style template corresponding to the plurality of first pixels in the original image is determined in the server, the target style template can be fed back to the user's client through the network, and the client can display it to the user for viewing, such as Figure 6b As shown, the target style template can be displayed in the result feedback area. Further, after the target style template is displayed to the user, the color characteristics in the target style template can be modified according to user feedback, or the category corresponding to the target style template can be modified, such as Figure 6a and Figure 6b As shown, the user can modify the target style template in the result feedback area, generate feedback information, and upload it to the server, so that the server can migrate the color characteristics of the original image based on the user feedback.
[0059] For example, using land parcel classification in a natural resource scenario as an example, after acquiring a feature image via satellite, drone, or radar, the feature image can be sent directly to a server for data augmentation, or transmitted to a client, where the user can select and upload the feature image requiring data augmentation to the server. After acquiring the feature image, the server can determine the target style template corresponding to each pixel in the feature image and transfer the color characteristics of the CIELAB color space contained in the target style template to the feature image, generating a corresponding data augmented image. Furthermore, the feature image and data augmented image can be used to adjust the initial model to obtain an image processing model. This image processing model can then process images of different styles, making model training more robust and accurate. After determining the target style template corresponding to each pixel in the feature image, the server can directly display the target style template to the user for viewing, or the server can send the target style template to the client, which then displays it to the user. This allows the user to see whether the target style template matches the feature image and, based on user feedback, can generate the target image, improving server performance.
[0060] For example, taking the river classification process in a water conservancy scenario as an example, after a river image is captured by a satellite, drone, or radar, it can be sent directly to a server for data augmentation, or it can be transmitted to a client, where the user selects and uploads the river image to be augmented. After acquiring the river image, the server determines the target style template corresponding to each pixel in the river image and transfers the color characteristics of the CIELAB color space contained in the target style template to the river image, generating a corresponding data-augmented image. Furthermore, the river image and the data-augmented image can be used to adjust the initial model to obtain an image processing model. This image processing model can then process images of different styles, making model training more robust and accurate. After determining the target style template corresponding to each pixel in the river image, the server can directly display the target style template to the user for viewing, or it can send the target style template to the client, which then displays it to the user. The user can then see whether the target style template matches the river image and, based on user feedback, generate the target image, improving server performance.
[0061] For example, taking the building classification process in a natural disaster scenario as an example, after a building image is captured by a satellite, drone, or radar, it can be sent directly to a server for data augmentation, or it can be transmitted to a client, where the user selects and uploads the building image to be augmented. After acquiring the building image, the server can determine the target style template corresponding to each pixel in the building image and transfer the color characteristics of the CIELAB color space contained in the target style template to the building image, generating the corresponding data-augmented image. Furthermore, the building image and the data-augmented image can be used to adjust the initial model to obtain an image processing model. This image processing model can then process images of different styles, making model training more robust and more accurate. After determining the target style template corresponding to each pixel in the building image, the server can directly display the target style template to the user for viewing, or the server can send the target style template to the client, which then displays it to the user. This allows the user to see whether the target style template matches the building image and, based on user feedback, can generate the target image, improving server performance.
[0062] Through the solution provided by the above-mentioned embodiment of the present application, after acquiring the original image, the target style template corresponding to multiple first pixels in the original image is determined, and based on the original image and the target style template corresponding to the multiple first pixels, a target image is generated to achieve the purpose of image data enhancement. It is easy to note that because the target style template is generated based on the color characteristics of each second pixel in the preset image in the opposing color space, the target image can be an image of different styles. When using the target image for model training, the technical effect of reducing the difference between the image to be processed and the training data can be achieved, thereby improving the robustness and accuracy of the model, thereby solving the technical problem in the related art that the difference between the image to be processed and the training data leads to reduced model accuracy.
[0063] In the above embodiment of the present application, determining the target style template corresponding to multiple first pixels in the original image includes: determining the first category corresponding to each pixel, wherein the first category is used to characterize the category of the target object corresponding to the first pixel; comparing the first category with the second category corresponding to at least one preset style template; obtaining the preset style template corresponding to the second category that is the same as the first category, and obtaining the target style template corresponding to each pixel.
[0064] In an optional embodiment, to enable color migration for images of objects of different categories, a large number of images of different regions and categories of objects can be pre-acquired, and preset style templates corresponding to the different categories can be generated based on the acquired images. Furthermore, because different regions of the original image may contain objects of different categories, and objects of different categories often have different color characteristics, a preset style template can be generated based on the color of each pixel in the acquired image. Furthermore, a target style template can be determined for each pixel in the first category corresponding to the pixel to be used for color migration.
[0065] In the above embodiment of the present application, the method also includes: obtaining a preset image set, wherein the preset image set includes: multiple preset images, and a second category corresponding to each second pixel in each preset image, the second category being used to characterize the category of the preset object corresponding to the second pixel; determining the color characteristics corresponding to each category based on the first color values of all pixels in the multiple preset images in the opposing color space; and generating a preset style template corresponding to each category based on the color characteristics corresponding to each category.
[0066] The above categories can be obtained by manually labeling the objects contained in each area of the preset image, or they can be categories already included in the public dataset.
[0067] In an optional embodiment, because different categories of preset objects have different color transformation methods, in order to accurately generate a target image with a style similar to the preset image, the colors of all second pixels in all preset images of the same category can be statistically analyzed according to the second category corresponding to each second pixel. That is, the first color values of all second pixels of the same category in the preset image set in the CIELAB color space can be statistically analyzed to obtain the color characteristics corresponding to the corresponding category, that is, the average value and standard deviation of the first color values of all training samples after statistics. Finally, based on the color characteristics corresponding to each category, a corresponding preset style template can be generated.
[0068] In the above-described embodiment of the present application, determining the color characteristics corresponding to each category based on the first color values of all pixels in a plurality of preset images in an opposing color space includes: converting the plurality of preset images from a three-primary color space to an opposing color space to obtain a plurality of first converted images; and performing statistical processing on the first color value of each pixel based on the category corresponding to each pixel in each first converted image to obtain the color characteristics corresponding to each category.
[0069] In an optional embodiment, the following method can be used to convert from the RGB color space to the CIELAB color space: first, the RGB color space is converted to the XYZ space according to the following formula:
[0070]
[0071] RGB represents the R value, G value, and B value of each pixel in the preset image.
[0072] Then convert the XYZ space to CIELAB color space according to the following formula:
[0073]
[0074] Among them, Xn, Yn and Zn are preset constants, which can all be 1, or can be adjusted according to actual needs.
[0075] After the conversion is completed, the color values of all pixels of each category in each image can be counted according to the category label to obtain the mean in CIELAB space and standard deviation
[0076] In the above embodiment of the present application, generating a target image based on an original image and a target style template corresponding to a plurality of first pixels includes: converting the original image from a three-primary color space to an opposing color space to obtain a second converted image; generating a third converted image based on a second color value of each pixel in the second converted image and the target style template corresponding to each pixel; and converting the third converted image from the opposing color space to a three-primary color space to obtain the target image.
[0077] In an optional embodiment, the conversion process of the original image can employ the relevant technical solutions of the above-described embodiments, which will not be further described here. After determining the color characteristics corresponding to different categories, color characteristics of the same category can be selected based on the category corresponding to each pixel in the second converted image, and the second converted image can be generated based on the selected color characteristics. Specifically, the target color characteristics of each pixel can be first determined based on the color value of each pixel in the second converted image. The color value of each pixel in the third converted image can then be combined with the selected color characteristics to generate the color value of each pixel.
[0078] Finally, we can convert from CIELAB color space to RGB color space as follows: First, convert CIELAB color space to XYZ space according to the following formula:
[0079]
[0080] Then convert the XYZ space to RGB color space according to the following formula:
[0081]
[0082] In the above embodiment of the present application, the color characteristics include: a first average value and a first standard deviation. Based on the second color value of each pixel in the second conversion image and the target style template corresponding to each pixel, generating the third conversion image includes: obtaining the second average value and the second standard deviation of the second color value based on the second color value of the pixel corresponding to each category in the second conversion image; obtaining the ratio of the first standard deviation to the second standard deviation to obtain the target ratio; obtaining the difference between the original value and the second average value to obtain the target difference; obtaining the product of the difference and the first ratio to obtain the target product; obtaining the sum of the target product and the first average value to obtain the third color value of each pixel in the third conversion image.
[0083] In an optional embodiment, based on the category label corresponding to the second converted image, the color characteristics of the same category are selected, that is, the first average value is selected. and the first standard deviation After that, first the second color value of the pixel corresponding to each category in the second conversion image is Perform statistics and get the second average value and the second standard deviation Then, the third color value L′* of each pixel in the third conversion image is obtained using the following formula: * a′* * b′ * :
[0084]
[0085] In the above embodiment of the present application, after determining the target style template corresponding to multiple first pixels in the original image, the method also includes: outputting the target style template corresponding to the multiple first pixels; receiving feedback information corresponding to the multiple first pixels, wherein the feedback information is obtained by modifying the target style template or the category corresponding to the target style template; and generating a target image based on the original image and the feedback information corresponding to the multiple first pixels.
[0086] In order to ensure the diversity of the target image, in an optional embodiment, the server can directly display the target style templates corresponding to the multiple first pixels to the user for viewing, that is, display the target style templates corresponding to the multiple first pixels on the interactive interface. In another optional embodiment, the server can send the target style templates corresponding to the multiple first pixels to the client via the network, and the client can display them to the user for viewing, that is, display the target style templates corresponding to the multiple first pixels on the interactive interface. Furthermore, the target style template can be confirmed by the user. If the user confirms that no adjustment is required, the confirmation information can be fed back, and the server directly generates the target image based on the target style template; if the user confirms that adjustment is required, the user can adjust the target style template on the interactive interface, or adjust the category corresponding to the target template, obtain corresponding feedback information, and feed the feedback information back to the server. The server can then generate the target image based on the feedback information, thereby improving the diversity of the target image and enhancing the performance of the server.
[0087] In the above embodiment of the present application, determining the target style templates corresponding to multiple first pixels in the original image includes: displaying multiple preset style templates in the interactive interface; obtaining the preset style template selected in the interactive interface to obtain the target style templates corresponding to the multiple first pixels.
[0088] In an optional embodiment, to ensure that the target image better meets the user's needs, the server can directly display all preset style templates to the user for viewing, that is, display all preset style templates on the interactive interface, allow the user to select, and use the preset style template selected by the user as the final target style template. In another optional embodiment, the server can send all preset style templates to the client via the network, and the client displays them to the user for viewing, that is, display all preset style templates on the interactive interface, allow the user to select, and use the preset style template selected by the user as the final target style template.
[0089] In the above embodiment of the present application, after generating a target image based on the original image and a target style template corresponding to multiple first pixels, the method also includes: obtaining a target task selected in the interactive interface, wherein the target task includes at least one of the following: a target detection task, a target segmentation task, a target recognition task, and a target classification task; obtaining an initial model corresponding to the target task; training the initial model using the target image to generate a target processing model corresponding to the target task; and outputting the target processing model.
[0090] In an optional embodiment, the user can select the target task that needs to be executed in the current interface. After selecting the target task, an initial model can be constructed according to the selected target task, and the initial model can be trained using the target image to obtain the target processing model that is ultimately used to execute the target task. The target processing model can be deployed in the cloud or sent to the client, so that the target processing model can be used to process the image to be processed to obtain the corresponding processing result, which can be displayed in the interactive interface for the user to view. Furthermore, after the user selects the target task, a prompt box can pop up, prompting the user to select the initial model that needs to be trained, and provide the original image for data enhancement and initial model training. After the target processing model training is completed, the user can be reminded that the target processing model has been trained and the subsequent image processing process can be carried out.
[0091] The following combination Figure 7 A preferred embodiment of the present application is described in detail. Figure 7As shown, the entire processing flow can be divided into a template generation process and an image generation process. The template generation process is as follows: the input image is converted from RGB color space to CIELAB color space. Then, based on the manually labeled categories, the mean and standard deviation of all pixels in each category of each image in the CIELAB color space are calculated to generate a color style template. The image generation process is as follows: the input image is converted from RGB color space to CIELAB color space to obtain a CIELAB training image. Then, an image with the corresponding color style is generated using the template to obtain a CIELAB color style image generated according to the template. Finally, the generated new image is converted from CIELAB color space to RGB color space to obtain an RGB image with the color style generated according to the template. Finally, the RGB image with the color style generated according to the template can be used for model training.
[0092] For example, for Figure 1 The two images shown in the figure can be used to generate a template based on the image shown on the left, and the color characteristics can be transferred to the image shown on the right to generate an image with a similar style to the image shown on the left. Figure 8a As shown. Figure 2 The two images shown in the figure can be used to generate a template based on the image shown on the left, and the color characteristics can be transferred to the image shown on the right to generate an image with a similar style to the image shown on the left. Figure 8b As shown. Figure 3 The two images shown in the figure can be used to generate a template based on the image shown on the left, and the color characteristics can be transferred to the image shown on the right to generate an image with a similar style to the image shown on the left. Figure 8c shown.
[0093] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0094] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0095] Example 2
[0096] According to an embodiment of the present application, an image processing method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0097] Figure 9 This is a flow chart of an image processing method according to embodiment 2 of the present application. Figure 9 As shown, the method may include the following steps:
[0098] Step S902: Acquire a ground feature image.
[0099] Step S904 : determining a target style template corresponding to a plurality of first pixels in the ground object image, wherein the target style template is generated based on the color characteristics of each second pixel in the preset image in an opposing color space.
[0100] Step S906 : generating a target image based on the ground object image and the target style template corresponding to the plurality of first pixels.
[0101] In the above embodiment of the present application, after generating a target map based on a target style template corresponding to a ground object image and multiple first pixels, the method further includes: obtaining a target task selected in the interactive interface, wherein the target task includes at least one of the following: a ground object detection task, a ground object segmentation task, a ground object recognition task, and a ground object classification task; obtaining an initial model corresponding to the target task; training the initial model using the target image to generate a ground object processing model corresponding to the target task; and outputting the ground object processing model.
[0102] In the above embodiment of the present application, determining the target style template corresponding to multiple first pixels in the ground object image includes: determining the first category corresponding to each pixel, wherein the first category is used to characterize the category of the target object corresponding to the first pixel; comparing the first category with the second category corresponding to at least one preset style template; obtaining the preset style template corresponding to the second category that is the same as the first category, and obtaining the target style template corresponding to each pixel.
[0103] In the above embodiment of the present application, the method also includes: obtaining a preset image set, wherein the preset image set includes: multiple preset images, and a second category corresponding to each second pixel in each preset image, the second category being used to characterize the category of the preset object corresponding to the second pixel; determining the color characteristics corresponding to each category based on the first color values of all pixels in the multiple preset images in the opposing color space; and generating a preset style template corresponding to each category based on the color characteristics corresponding to each category.
[0104] In the above embodiment of the present application, the method also includes: obtaining a preset image set, wherein the preset image set includes: multiple preset images, and a second category corresponding to each second pixel in each preset image, the second category being used to characterize the category of the preset object corresponding to the second pixel; determining the color characteristics corresponding to each category based on the first color values of all pixels in the multiple preset images in the opposing color space; and generating a preset style template corresponding to each category based on the color characteristics corresponding to each category.
[0105] In the above-mentioned embodiment of the present application, generating a target image based on a ground object image and a target style template corresponding to a plurality of first pixels includes: converting the ground object image from a three-primary color space to an opposing color space to obtain a second converted image; generating a third converted image based on a second color value of each pixel in the second converted image and the target style template corresponding to each pixel; and converting the third converted image from the opposing color space to a three-primary color space to obtain a target image.
[0106] In the above embodiment of the present application, the color characteristics include: a first average value and a first standard deviation. Based on the second color value of each pixel in the second conversion image and the target style template corresponding to each pixel, generating the third conversion image includes: obtaining the second average value and the second standard deviation of the second color value based on the second color value of the pixel corresponding to each category in the second conversion image; obtaining the ratio of the first standard deviation to the second standard deviation to obtain the target ratio; obtaining the difference between the original value and the second average value to obtain the target difference; obtaining the product of the difference and the first ratio to obtain the target product; obtaining the sum of the target product and the first average value to obtain the third color value of each pixel in the third conversion image.
[0107] In the above embodiment of the present application, after determining the target style template corresponding to multiple first pixels in the ground object image, the method also includes: outputting the target style template corresponding to the multiple first pixels; receiving feedback information corresponding to the multiple first pixels, wherein the feedback information is obtained by modifying the target style template or the category corresponding to the target style template; and generating a target image based on the ground object image and the feedback information corresponding to the multiple first pixels.
[0108] In the above embodiment of the present application, determining the target style templates corresponding to multiple first pixels in the ground feature image includes: displaying multiple preset style templates in the interactive interface; obtaining the preset style template selected in the interactive interface to obtain the target style templates corresponding to the multiple first pixels.
[0109] It should be noted that the preferred implementation scheme involved in the above embodiments of this application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0110] Example 3
[0111] According to an embodiment of the present application, an image processing method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0112] Figure 10 This is a flow chart of an image processing method according to embodiment 3 of the present application. Figure 10 As shown, the method may include the following steps:
[0113] Step S1002: The cloud server receives the original image uploaded by the client.
[0114] In step S1004 , the cloud server determines a target style template corresponding to a plurality of first pixels in the original image, wherein the target style template is generated based on the color characteristics of each second pixel in the preset image in an opposing color space.
[0115] Step S1006: The cloud server generates a target image based on the original image and the target style template corresponding to the plurality of first pixels.
[0116] Step S1008: The cloud server outputs the target image to the client.
[0117] In the above embodiment of the present application, the cloud server determines the target style templates corresponding to multiple first pixels in the original image, including: determining the first category corresponding to each pixel, wherein the first category is used to characterize the category of the target object corresponding to the first pixel; comparing the first category with the second category corresponding to at least one preset style template; obtaining the preset style template corresponding to the second category that is the same as the first category, and obtaining the target style template corresponding to each pixel.
[0118] In the above embodiment of the present application, the method also includes: the cloud server obtains a preset image set, wherein the preset image set includes: multiple preset images, and a second category corresponding to each second pixel in each preset image, and the second category is used to characterize the category of the preset object corresponding to the second pixel; the cloud server determines the color characteristics corresponding to each category based on the first color values of all pixels in the multiple preset images in the opposing color space; the cloud server generates a preset style template corresponding to each category based on the color characteristics corresponding to each category.
[0119] In the above-described embodiment of the present application, determining the color characteristics corresponding to each category based on the first color values of all pixels in a plurality of preset images in an opposing color space includes: converting the plurality of preset images from a three-primary color space to an opposing color space to obtain a plurality of first converted images; and performing statistical processing on the first color value of each pixel based on the category corresponding to each pixel in each first converted image to obtain the color characteristics corresponding to each category.
[0120] In the above embodiment of the present application, the cloud server generates a target image based on the original image and the target style template corresponding to multiple first pixels, including: converting the original image from the three primary color space to the opposing color space to obtain a second converted image; generating a third converted image based on the second color value of each pixel in the second converted image and the target style template corresponding to each pixel; converting the third converted image from the opposing color space to the three primary color space to obtain the target image.
[0121] In the above embodiment of the present application, the color characteristics include: a first average value and a first standard deviation. Based on the second color value of each pixel in the second conversion image and the target style template corresponding to each pixel, generating the third conversion image includes: obtaining the second average value and the second standard deviation of the second color value based on the second color value of the pixel corresponding to each category in the second conversion image; obtaining the ratio of the first standard deviation to the second standard deviation to obtain the target ratio; obtaining the difference between the original value and the second average value to obtain the target difference; obtaining the product of the difference and the first ratio to obtain the target product; obtaining the sum of the target product and the first average value to obtain the third color value of each pixel in the third conversion image.
[0122] In the above embodiment of the present application, after the cloud server determines the target style template corresponding to multiple first pixels in the original image, the method also includes: the cloud server outputs the target style template corresponding to the multiple first pixels; the cloud server receives feedback information corresponding to the multiple first pixels, wherein the feedback information is obtained by modifying the target style template or the category corresponding to the target style template; the cloud server generates a target image based on the original image and the feedback information corresponding to the multiple first pixels.
[0123] In the above embodiment of the present application, the cloud server determines the target style templates corresponding to multiple first pixels in the original image, including: displaying multiple preset style templates in the interactive interface; obtaining the preset style template selected in the interactive interface to obtain the target style templates corresponding to the multiple first pixels.
[0124] In the above embodiment of the present application, after the cloud server generates a target image based on the original image and the target style template corresponding to multiple first pixels, the method also includes: the cloud server obtains the target task selected in the interactive interface, wherein the target task includes at least one of the following: target detection task, target segmentation task, target recognition task and target classification task; the cloud server obtains the initial model corresponding to the target task; the cloud server uses the target image to train the initial model to generate a target processing model corresponding to the target task; the cloud server outputs the target processing model.
[0125] It should be noted that the preferred implementation scheme involved in the above embodiments of this application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0126] Example 4
[0127] According to an embodiment of the present application, an image processing device for implementing the above image processing method is also provided. Figure 11 As shown, the device 1100 includes: an acquisition module 1102 , a determination module 1104 and a generation module 1106 .
[0128] Among them, the acquisition module 1102 is used to acquire the original image; the determination module 1104 is used to determine the target style template corresponding to multiple first pixels in the original image, wherein the target style template is generated based on the color characteristics of each second pixel in the preset image in the opposite color space; the generation module 1106 is used to generate the target image based on the original image and the target style template corresponding to the multiple first pixels.
[0129] It should be noted that the acquisition module 1102, determination module 1104, and generation module 1106 correspond to steps S502 to S506 in Example 1. The examples and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above modules, as part of the device, can be run in the computer terminal 10 provided in Example 1.
[0130] In the above embodiment of the present application, the determination module includes: a determination unit, a comparison unit and a first acquisition unit.
[0131] Among them, the determination unit is used to determine the first category corresponding to each pixel, wherein the first category is used to characterize the category of the target object corresponding to the first pixel; the comparison unit is used to compare the first category with the second category corresponding to at least one preset style template; the first acquisition unit is used to obtain the preset style template corresponding to the second category that is the same as the first category, and obtain the target style template corresponding to each pixel.
[0132] In the above embodiment of the present application, the acquisition module is also used to obtain a preset image set, wherein the preset image set includes: multiple preset images, and a second category corresponding to each second pixel in each preset image, and the second category is used to characterize the category of the preset object corresponding to the second pixel; the determination module is also used to determine the color characteristics corresponding to each category based on the first color values of all pixels in the multiple preset images in the opposite color space; the generation module is also used to generate a preset style template corresponding to each category based on the color characteristics corresponding to each category.
[0133] In the above embodiment of the present application, the determination module includes: a first conversion unit and a statistical unit.
[0134] Among them, the first conversion unit is used to determine the color characteristics corresponding to each category based on the first color values of all pixels in the multiple preset images in the opposite color space, including: converting the multiple preset images from the three primary color space to the opposite color space to obtain multiple first converted images; the statistical unit is used to perform statistical processing on the first color value of each pixel based on the category corresponding to each pixel in each first converted image to obtain the color characteristics corresponding to each category.
[0135] In the above embodiment of the present application, the generation module includes: a second conversion unit, a generation unit and a third conversion unit.
[0136] Among them, the second conversion unit is used to convert the original image from the three primary color space to the opposing color space to obtain a second converted image; the generation unit is used to generate a third converted image based on the second color value of each pixel in the second converted image and the target style template corresponding to each pixel; the third conversion unit is used to convert the third converted image from the opposing color space to the three primary color space to obtain the target image.
[0137] In the above embodiment of the present application, the color characteristics include: a first average value and a first standard deviation, and the generation unit is further used to: obtain a second average value and a second standard deviation of the second color value based on the second color value of the pixel corresponding to each category in the second conversion image; obtain the ratio of the first standard deviation to the second standard deviation to obtain a target ratio; obtain the difference between the original value and the second average value to obtain a target difference; obtain the product of the difference and the first ratio to obtain a target product; obtain the sum of the target product and the first average value to obtain a third color value of each pixel in the third conversion image.
[0138] In the above embodiments of the present application, the device further includes: an output module and a receiving module.
[0139] Among them, the output module is used to output the target style template corresponding to multiple first pixels; the receiving module is used to receive feedback information corresponding to multiple first pixels, wherein the feedback information is obtained by modifying the target style template or the category corresponding to the target style template; the generation module is also used to generate the target image based on the original image and the feedback information corresponding to multiple first pixels.
[0140] In the above embodiment of the present application, the determination module includes: a display unit and a second acquisition unit.
[0141] The display unit is used to display multiple preset style templates in the interactive interface; the second acquisition unit is used to acquire the preset style template selected in the interactive interface to obtain target style templates corresponding to multiple first pixels.
[0142] In the above embodiment of the present application, the device further includes: a training module.
[0143] Among them, the acquisition module is also used to obtain the target task selected in the interactive interface, wherein the target task includes at least one of the following: target detection task, target segmentation task, target recognition task and target classification task; the acquisition module is also used to obtain the initial model corresponding to the target task; the training module is used to train the initial model using the target image to generate a target processing model corresponding to the target task; the output module is used to output the target processing model.
[0144] It should be noted that the preferred implementation scheme involved in the above embodiments of this application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0145] Example 5
[0146] According to an embodiment of the present application, an image processing device for implementing the above image processing method is also provided. Figure 11 As shown, the device 1100 includes: an acquisition module 1102 , a determination module 1104 and a generation module 1106 .
[0147] Among them, the acquisition module 1102 is used to acquire the ground object image; the determination module 1104 is used to determine the target style template corresponding to multiple first pixels in the ground object image, wherein the target style template is generated based on the color characteristics of each second pixel in the preset image in the opposite color space; the generation module 1106 is used to generate the target image based on the ground object image and the target style template corresponding to the multiple first pixels.
[0148] It should be noted that the acquisition module 1102, determination module 1104, and generation module 1106 correspond to steps S902 to S906 in Example 2. The examples and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the contents disclosed in Example 2. It should be noted that the above modules, as part of the device, can be run in the computer terminal 10 provided in Example 1.
[0149] In the above embodiment of the present application, the determination module includes: a determination unit, a comparison unit and a first acquisition unit.
[0150] Among them, the determination unit is used to determine the first category corresponding to each pixel, wherein the first category is used to characterize the category of the target object corresponding to the first pixel; the comparison unit is used to compare the first category with the second category corresponding to at least one preset style template; the first acquisition unit is used to obtain the preset style template corresponding to the second category that is the same as the first category, and obtain the target style template corresponding to each pixel.
[0151] In the above embodiment of the present application, the acquisition module is also used to obtain a preset image set, wherein the preset image set includes: multiple preset images, and a second category corresponding to each second pixel in each preset image, and the second category is used to characterize the category of the preset object corresponding to the second pixel; the determination module is also used to determine the color characteristics corresponding to each category based on the first color values of all pixels in the multiple preset images in the opposite color space; the generation module is also used to generate a preset style template corresponding to each category based on the color characteristics corresponding to each category.
[0152] In the above embodiment of the present application, the determination module includes: a first conversion unit and a statistical unit.
[0153] Among them, the first conversion unit is used to determine the color characteristics corresponding to each category based on the first color values of all pixels in the multiple preset images in the opposite color space, including: converting the multiple preset images from the three primary color space to the opposite color space to obtain multiple first converted images; the statistical unit is used to perform statistical processing on the first color value of each pixel based on the category corresponding to each pixel in each first converted image to obtain the color characteristics corresponding to each category.
[0154] In the above embodiment of the present application, the generation module includes: a second conversion unit, a generation unit and a third conversion unit.
[0155] Among them, the second conversion unit is used to convert the ground feature image from the three primary color space to the opposing color space to obtain a second converted image; the generation unit is used to generate a third converted image based on the second color value of each pixel in the second converted image and the target style template corresponding to each pixel; the third conversion unit is used to convert the third converted image from the opposing color space to the three primary color space to obtain the target image.
[0156] In the above embodiment of the present application, the color characteristics include: a first average value and a first standard deviation, and the generation unit is further used to: obtain a second average value and a second standard deviation of the second color value based on the second color value of the pixel corresponding to each category in the second conversion image; obtain the ratio of the first standard deviation to the second standard deviation to obtain a target ratio; obtain the difference between the original value and the second average value to obtain a target difference; obtain the product of the difference and the first ratio to obtain a target product; obtain the sum of the target product and the first average value to obtain a third color value of each pixel in the third conversion image.
[0157] In the above embodiments of the present application, the device further includes: an output module and a receiving module.
[0158] Among them, the output module is used to output the target style template corresponding to multiple first pixels; the receiving module is used to receive feedback information corresponding to multiple first pixels, wherein the feedback information is obtained by modifying the target style template or the category corresponding to the target style template; the generation module is also used to generate the target image based on the ground object image and the feedback information corresponding to multiple first pixels.
[0159] In the above embodiment of the present application, the determination module includes: a display unit and a second acquisition unit.
[0160] The display unit is used to display multiple preset style templates in the interactive interface; the second acquisition unit is used to acquire the preset style template selected in the interactive interface to obtain target style templates corresponding to multiple first pixels.
[0161] In the above embodiment of the present application, the device further includes: a training module.
[0162] Among them, the acquisition module is also used to obtain the target task selected in the interactive interface, wherein the target task includes at least one of the following: object detection task, object segmentation task, object recognition task and object classification task; the acquisition module is also used to obtain the initial model corresponding to the target task; the training module is used to train the initial model using the target image to generate a object processing model corresponding to the target task; the output module is used to output the object processing model.
[0163] It should be noted that the preferred implementation scheme involved in the above embodiments of this application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0164] Example 6
[0165] According to an embodiment of the present application, an image processing device for implementing the above image processing method is also provided. The device deploys a cloud server, such as Figure 12 As shown, the apparatus 1200 includes: a receiving module 1202 , a determining module 1204 , a generating module 1206 and an output module 1208 .
[0166] Among them, the receiving module 1202 is used to receive the original image uploaded by the client; the determination module 1204 is used to determine the target style template corresponding to multiple first pixels in the original image, wherein the target style template is generated based on the color characteristics of each second pixel in the preset image in the opposite color space; the generation module 1206 is used to generate the target image based on the original image and the target style template corresponding to multiple first pixels; the output module 1208 is used to output the target image to the client.
[0167] It should be noted that the receiving module 1202, determining module 1204, generating module 1206, and outputting module 1208 correspond to steps S1002 to S1008 in Embodiment 3. The examples and application scenarios implemented by the four modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Embodiment 3. It should be noted that the above-mentioned modules, as part of the device, can be run in the computer terminal 10 provided in Embodiment 1.
[0168] In the above embodiment of the present application, the determination module includes: a determination unit, a comparison unit and a first acquisition unit.
[0169] Among them, the determination unit is used to determine the first category corresponding to each pixel, wherein the first category is used to characterize the category of the target object corresponding to the first pixel; the comparison unit is used to compare the first category with the second category corresponding to at least one preset style template; the first acquisition unit is used to obtain the preset style template corresponding to the second category that is the same as the first category, and obtain the target style template corresponding to each pixel.
[0170] In the above embodiment of the present application, the acquisition module is also used to obtain a preset image set, wherein the preset image set includes: multiple preset images, and a second category corresponding to each second pixel in each preset image, and the second category is used to characterize the category of the preset object corresponding to the second pixel; the determination module is also used to determine the color characteristics corresponding to each category based on the first color values of all pixels in the multiple preset images in the opposite color space; the generation module is also used to generate a preset style template corresponding to each category based on the color characteristics corresponding to each category.
[0171] In the above embodiment of the present application, the determination module includes: a first conversion unit and a statistical unit.
[0172] Among them, the first conversion unit is used to determine the color characteristics corresponding to each category based on the first color values of all pixels in the multiple preset images in the opposite color space, including: converting the multiple preset images from the three primary color space to the opposite color space to obtain multiple first converted images; the statistical unit is used to perform statistical processing on the first color value of each pixel based on the category corresponding to each pixel in each first converted image to obtain the color characteristics corresponding to each category.
[0173] In the above embodiment of the present application, the generation module includes: a second conversion unit, a generation unit and a third conversion unit.
[0174] Among them, the second conversion unit is used to convert the original image from the three primary color space to the opposing color space to obtain a second converted image; the generation unit is used to generate a third converted image based on the second color value of each pixel in the second converted image and the target style template corresponding to each pixel; the third conversion unit is used to convert the third converted image from the opposing color space to the three primary color space to obtain the target image.
[0175] In the above embodiment of the present application, the color characteristics include: a first average value and a first standard deviation, and the generation unit is further used to: obtain a second average value and a second standard deviation of the second color value based on the second color value of the pixel corresponding to each category in the second conversion image; obtain the ratio of the first standard deviation to the second standard deviation to obtain a target ratio; obtain the difference between the original value and the second average value to obtain a target difference; obtain the product of the difference and the first ratio to obtain a target product; obtain the sum of the target product and the first average value to obtain a third color value of each pixel in the third conversion image.
[0176] In the above embodiments of the present application, the device further includes: an output module and a receiving module.
[0177] Among them, the output module is used to output the target style template corresponding to multiple first pixels; the receiving module is used to receive feedback information corresponding to multiple first pixels, wherein the feedback information is obtained by modifying the target style template or the category corresponding to the target style template; the generation module is also used to generate the target image based on the original image and the feedback information corresponding to multiple first pixels.
[0178] In the above embodiment of the present application, the determination module includes: a display unit and a second acquisition unit.
[0179] The display unit is used to display multiple preset style templates in the interactive interface; the second acquisition unit is used to acquire the preset style template selected in the interactive interface to obtain target style templates corresponding to multiple first pixels.
[0180] In the above embodiment of the present application, the device further includes: a training module.
[0181] Among them, the acquisition module is also used to obtain the target task selected in the interactive interface, wherein the target task includes at least one of the following: target detection task, target segmentation task, target recognition task and target classification task; the acquisition module is also used to obtain the initial model corresponding to the target task; the training module is used to train the initial model using the target image to generate a target processing model corresponding to the target task; the output module is used to output the target processing model.
[0182] It should be noted that the preferred implementation scheme involved in the above embodiments of this application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0183] Example 7
[0184] The embodiment of the present application can provide a computer terminal, which can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal can also be replaced by a terminal device such as a mobile terminal.
[0185] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of a computer network.
[0186] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the image processing method: obtaining an original image; determining a target style template corresponding to multiple first pixels in the original image, wherein the target style template is generated based on the color characteristics of each second pixel in the preset image in the opposite color space; generating a target image based on the original image and the target style template corresponding to the multiple first pixels.
[0187] Optionally, Figure 13This is a structural block diagram of a computer terminal according to an embodiment of the present application. Figure 13 As shown, the computer terminal A may include: one or more (only one is shown in the figure) processors 1302 and a memory 1304.
[0188] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the image processing method and device in the embodiments of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned image processing method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely located relative to the processor, and these remote memories may be connected to terminal A via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0189] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain the original image; determine the target style template corresponding to multiple first pixels in the original image, wherein the target style template is generated based on the color characteristics of each second pixel in the preset image in the opposite color space; generate the target image based on the original image and the target style template corresponding to the multiple first pixels.
[0190] Optionally, the processor may also execute the program code of the following steps: determining a first category corresponding to each pixel, wherein the first category is used to characterize the category of the target object corresponding to the first pixel; comparing the first category with a second category corresponding to at least one preset style template; obtaining a preset style template corresponding to the second category that is the same as the first category, and obtaining a target style template corresponding to each pixel.
[0191] Optionally, the processor may also execute the program code of the following steps: obtaining a preset image set, wherein the preset image set includes: multiple preset images, and a second category corresponding to each second pixel in each preset image, the second category being used to characterize the category of the preset object corresponding to the second pixel; determining the color characteristics corresponding to each category based on the first color values of all pixels in the multiple preset images in the opposing color space; and generating a preset style template corresponding to each category based on the color characteristics corresponding to each category.
[0192] Optionally, the processor may also execute the program code of the following steps: converting multiple preset images from the three primary color space to the opposing color space to obtain multiple first converted images; and performing statistical processing on the first color value of each pixel based on the category corresponding to each pixel in each first converted image to obtain the color characteristics corresponding to each category.
[0193] Optionally, the processor may also execute program code for the following steps: converting the original image from the three primary color space to the opposing color space to obtain a second converted image; generating a third converted image based on the second color value of each pixel in the second converted image and the target style template corresponding to each pixel; and converting the third converted image from the opposing color space to the three primary color space to obtain a target image.
[0194] Optionally, the color characteristics include: a first mean value and a first standard deviation, and the above-mentioned processor can also execute the program code of the following steps: based on the second color value of the pixel corresponding to each category in the second converted image, obtain the second mean value and the second standard deviation of the second color value; obtain the ratio of the first standard deviation to the second standard deviation to obtain the target ratio; obtain the difference between the original value and the second mean value to obtain the target difference; obtain the product of the difference and the first ratio to obtain the target product; obtain the sum of the target product and the first mean value to obtain the third color value of each pixel in the third converted image.
[0195] Optionally, the processor may also execute the program code of the following steps: outputting a target style template corresponding to multiple first pixels; receiving feedback information corresponding to multiple first pixels, wherein the feedback information is obtained by modifying the target style template or the category corresponding to the target style template; and generating a target image based on the original image and the feedback information corresponding to multiple first pixels.
[0196] Optionally, the processor may further execute program code of the following steps: displaying a plurality of preset style templates in an interactive interface; acquiring a preset style template selected in the interactive interface, and obtaining target style templates corresponding to a plurality of first pixels.
[0197] Optionally, the above-mentioned processor can also execute the program code of the following steps: obtaining the target task selected in the interactive interface, wherein the target task includes at least one of the following: target detection task, target segmentation task, target recognition task and target classification task; obtaining the initial model corresponding to the target task; using the target image to train the initial model to generate a target processing model corresponding to the target task; and outputting the target processing model.
[0198] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain a ground object image; determine a target style template corresponding to multiple first pixels in the ground object image, wherein the target style template is generated based on the color characteristics of each second pixel in the preset image in the opposite color space; generate a target image based on the ground object image and the target style template corresponding to the multiple first pixels.
[0199] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: the cloud server receives the original image uploaded by the client; the cloud server determines the target style template corresponding to multiple first pixels in the original image, wherein the target style template is generated based on the color characteristics of each second pixel in the preset image in the opposite color space; the cloud server generates a target image based on the original image and the target style template corresponding to the multiple first pixels; the cloud server outputs the target image to the client.
[0200] The present invention provides an image classification solution. The target images can be images of different styles. Using the target images for model training can reduce the discrepancy between the processed images and the training data, improving the robustness and accuracy of the model. This solves the technical problem in related technologies where discrepancies between the processed images and the training data lead to reduced model accuracy.
[0201] It can be understood by those skilled in the art that Figure 13 The structure shown is for illustration only, and the computer terminal may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, or other terminal devices. Figure 13 It does not limit the structure of the above electronic device. For example, the computer terminal A may also include Figure 13 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 13 Different configurations shown.
[0202] A person skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0203] Example 8
[0204] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the image processing method provided in the above embodiment.
[0205] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0206] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: obtaining an original image; determining a target style template corresponding to multiple first pixels in the original image, wherein the target style template is generated based on the color characteristics of each second pixel in the preset image in the opposite color space; and generating a target image based on the original image and the target style template corresponding to the multiple first pixels.
[0207] Optionally, the storage medium is further configured to store program code for executing the following steps: determining a first category corresponding to each pixel, wherein the first category is used to characterize the category of the target object corresponding to the first pixel; comparing the first category with a second category corresponding to at least one preset style template; obtaining a preset style template corresponding to the second category that is the same as the first category, and obtaining a target style template corresponding to each pixel.
[0208] Optionally, the storage medium is further configured to store program code for executing the following steps: obtaining a preset image set, wherein the preset image set includes: multiple preset images, and a second category corresponding to each second pixel in each preset image, the second category being used to characterize the category of the preset object corresponding to the second pixel; determining the color characteristics corresponding to each category based on the first color values of all pixels in the multiple preset images in the opposing color space; and generating a preset style template corresponding to each category based on the color characteristics corresponding to each category.
[0209] Optionally, the storage medium is further configured to store program codes for executing the following steps: converting multiple preset images from the three primary color space to the opposing color space to obtain multiple first converted images; and performing statistical processing on the first color value of each pixel based on the category corresponding to each pixel in each first converted image to obtain color characteristics corresponding to each category.
[0210] Optionally, the above-mentioned storage medium is further configured to store program code for executing the following steps: converting the original image from the three primary color space to the opposing color space to obtain a second converted image; generating a third converted image based on the second color value of each pixel in the second converted image and the target style template corresponding to each pixel; converting the third converted image from the opposing color space to the three primary color space to obtain the target image.
[0211] Optionally, the color characteristics include: a first mean and a first standard deviation, and the above-mentioned storage medium is further configured to store program code for executing the following steps: based on the second color value of the pixel corresponding to each category in the second conversion image, obtaining the second mean and second standard deviation of the second color value; obtaining the ratio of the first standard deviation to the second standard deviation to obtain a target ratio; obtaining the difference between the original value and the second mean to obtain a target difference; obtaining the product of the difference and the first ratio to obtain a target product; obtaining the sum of the target product and the first mean to obtain a third color value of each pixel in the third conversion image.
[0212] Optionally, the above-mentioned storage medium is also configured to store program code for performing the following steps: outputting a target style template corresponding to multiple first pixels; receiving feedback information corresponding to multiple first pixels, wherein the feedback information is obtained by modifying the target style template or the category corresponding to the target style template; and generating a target image based on the original image and the feedback information corresponding to multiple first pixels.
[0213] Optionally, the storage medium is further configured to store program code for executing the following steps: displaying multiple preset style templates in the interactive interface; obtaining the preset style template selected in the interactive interface, and obtaining target style templates corresponding to multiple first pixels.
[0214] Optionally, the above-mentioned storage medium is also configured to store program code for executing the following steps: obtaining the target task selected in the interactive interface, wherein the target task includes at least one of the following: target detection task, target segmentation task, target recognition task and target classification task; obtaining the initial model corresponding to the target task; training the initial model using the target image to generate a target processing model corresponding to the target task; and outputting the target processing model.
[0215] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: obtaining a ground object image; determining a target style template corresponding to multiple first pixels in the ground object image, wherein the target style template is generated based on the color characteristics of each second pixel in the preset image in the opposite color space; and generating a target image based on the ground object image and the target style template corresponding to the multiple first pixels.
[0216] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: the cloud server receives the original image uploaded by the client; the cloud server determines a target style template corresponding to multiple first pixels in the original image, wherein the target style template is generated based on the color characteristics of each second pixel in the preset image in the opposite color space; the cloud server generates a target image based on the original image and the target style template corresponding to the multiple first pixels; the cloud server outputs the target image to the client.
[0217] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0218] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0219] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0220] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0221] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0222] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0223] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An image processing method, characterized in that: include: Get the original image; Determining a target style template corresponding to a plurality of first pixels in the original image, wherein the target style template is generated based on a color characteristic of each second pixel in a preset image in an opposing color space, the preset image being used to represent a plurality of images collected for different tasks, wherein objects of the same category in different images have different colors; generating a target image based on the original image and a target style template corresponding to the plurality of first pixels, wherein the target image is used to represent an image obtained by performing a color transformation on an object contained in the original image based on the preset image, and the original image and the target image are used to constitute training data for training an initial model; Obtain a target task selected in an interactive interface, wherein the target task includes at least one of the following: a target detection task, a target segmentation task, a target recognition task, and a target classification task; obtain the initial model corresponding to the target task; and train the initial model using the target image to generate a target processing model corresponding to the target task.
2. The method according to claim 1, characterized in that Determining the target style template corresponding to the plurality of first pixels in the original image includes: Determine a first category corresponding to each pixel, wherein the first category is used to represent a category of a target object corresponding to the first pixel; comparing the first category with a second category corresponding to at least one preset style template; A preset style template corresponding to a second category that is the same as the first category is obtained to obtain a target style template corresponding to each pixel.
3. The method according to claim 2, characterized in that The method further comprises: Acquire a preset image set, wherein the preset image set includes: a plurality of preset images, and a second category corresponding to each second pixel in each preset image, where the second category is used to represent a category of a preset object corresponding to the second pixel; Determining a color characteristic corresponding to each category based on first color values of all pixels in the plurality of preset images in the opposing color space; Based on the color features corresponding to each category, a preset style template corresponding to each category is generated.
4. The method according to claim 3, characterized in that Determining the color characteristics corresponding to each category based on the first color values of all pixels in the plurality of preset images in the opposing color space includes: Converting the plurality of preset images from the three primary color spaces into the opposing color space to obtain a plurality of first converted images; Based on the category corresponding to each pixel in each first conversion image, statistical processing is performed on the first color value of each pixel to obtain the color characteristics corresponding to each category.
5. The method according to claim 1, wherein Generating a target image based on the original image and a target style template corresponding to the plurality of first pixels includes: Converting the original image from the three-primary color space to the opposing color space to obtain a second converted image; generating a third converted image based on the second color value of each pixel in the second converted image and the target style template corresponding to each pixel; The third converted image is converted from the opponent color space to the three-primary color space to obtain the target image.
6. The method according to claim 1, characterized in that After determining the target style templates corresponding to the plurality of first pixels in the original image, the method further includes: Outputting a target style template corresponding to the plurality of first pixels; receiving feedback information corresponding to the plurality of first pixels, wherein the feedback information is obtained by modifying the target style template or a category corresponding to the target style template; The target image is generated based on the original image and feedback information corresponding to the plurality of first pixels.
7. The method according to claim 1, characterized in that Determining the target style template corresponding to the plurality of first pixels in the original image includes: Display multiple preset style templates in the interactive interface; A preset style template selected in the interactive interface is acquired to obtain a target style template corresponding to the plurality of first pixels.
8. An image processing method, characterized in that: include: Acquire ground feature images; Determining a target style template corresponding to a plurality of first pixels in the ground feature image, wherein the target style template is generated based on a color characteristic of each second pixel in a preset image in an opposing color space, the preset image being used to represent a plurality of images collected for different tasks, wherein objects of the same category in different images have different colors; generating a target image based on the ground object image and a target style template corresponding to the plurality of first pixels, wherein the target image is used to represent an image obtained by performing a color transformation on an object contained in the ground object image based on the preset image, and the ground object image and the target image are used to constitute training data for training an initial model; Obtain a target task selected in an interactive interface, wherein the target task includes at least one of the following: a ground object detection task, a ground object segmentation task, a ground object recognition task, and a ground object classification task; obtain the initial model corresponding to the target task; and train the initial model using the target image to generate a ground object processing model corresponding to the target task.
9. An image processing method, characterized in that: include: The cloud server receives the original image uploaded by the client; The cloud server determines a target style template corresponding to a plurality of first pixels in the original image, wherein the target style template is generated based on a color characteristic of each second pixel in a preset image in an opposing color space, the preset image being used to represent a plurality of images collected for different tasks, and having different colors of objects of the same category in different images; The cloud server generates a target image based on the original image and the target style template corresponding to the plurality of first pixels, wherein the target image is used to represent an image obtained by performing a color transformation on an object contained in the original image based on the preset image, and the original image and the target image are used to constitute training data for training an initial model; The cloud server outputs the target image to the client; The client obtains a target task selected in an interactive interface, wherein the target task includes at least one of the following: a target detection task, a target segmentation task, a target recognition task, and a target classification task; obtains the initial model corresponding to the target task; and trains the initial model using the target image to generate a target processing model corresponding to the target task.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the image processing method according to any one of claims 1 to 9.
11. A computer terminal, characterized in that: include: A memory and a processor, wherein the processor is configured to run a program stored in the memory, wherein the image processing method according to any one of claims 1 to 9 is executed when the program is run.
Citation Information
Patent Citations
Facial image style conversion method and device, storage medium and electronic equipment
CN112419477A