Image processing method, image reconstruction model generation method and device, computer equipment, readable storage medium and program product
By extracting edge features and scene information of image data, using image reconstruction model to perform image reconstruction, and judging scene transformation based on similarity rate, selecting appropriate rendering methods, the problem of poor image reconstruction efficiency and quality in the prior art is solved, and the problem of poor image reconstruction efficiency and quality is realized Real-time high-resolution 3D rendering requirements.
Patent Information
- Application Number
- CN202410904673.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-11-01
AI Technical Summary
When existing image reconstruction technologies achieve real-time high-resolution 3D rendering, the calculation volume is large and cannot meet the game's running quality requirements. The neural network methods rely too much on training networks to meet the real-time rendering requirements.
By extracting edge features and scene information of the image data to be processed in the current frame, using the image reconstruction model for image reconstruction, combining the similarity rate to determine whether scene transformation occurs, and selecting a suitable rendering method to improve rendering speed and quality.
It improves the efficiency and effect of image reconstruction, enhances the accuracy of the target image, meets the needs of real-time high-resolution 3D rendering, and reduces the requirements for hardware storage.
Smart Images

Figure CN118887328A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, an image reconstruction model generation method, an apparatus, a computer device, a computer-readable storage medium, and a computer program product. Background Art
[0002] Real-time, high-resolution 3D game rendering can effectively improve the gaming experience. However, real-time, high-resolution 3D game rendering has high requirements for hardware and storage speed. The existing hardware and storage speed limitations cannot perfectly achieve real-time, high-resolution 3D game rendering. Therefore, low-resolution image reconstruction of high-resolution images (Super-Resolution, SR) technology can be used to solve the high-resolution rendering delay problem of large-scale scenes.
[0003] Existing image reconstruction technologies generally include interpolation algorithms, super sampling anti-aliasing (SSAA) and multiple sampling anti-aliasing (MSAA), as well as deep learning methods based on neural networks.
[0004] However, the interpolation algorithm has a small amount of calculation and is easy to implement in hardware. However, the interpolation algorithm causes the color and edge of the output image to be distorted, which is prone to aliasing. The low-quality image rendered cannot meet the quality requirements of the game. The super sampling anti-aliasing method and the multi-sampling anti-aliasing method have high hardware storage requirements in the rendering process. The deep learning method using neural networks is too dependent on the trained network and cannot meet the requirements of real-time rendering. Summary of the invention
[0005] Based on this, it is necessary to provide an image processing method, an image reconstruction model generation method, an apparatus, a computer device, a computer-readable storage medium and a computer program product that can improve rendering speed and quality in response to the above technical problems.
[0006] In a first aspect, the present application provides an image processing method, comprising:
[0007] Acquire the current frame of image data to be processed, and determine the first scene information of the current frame of image data to be processed;
[0008] Perform edge extraction on the image data to be processed in the current frame to obtain a first edge feature;
[0009] Determine first processed image data corresponding to the image data to be processed in the current frame according to the first scene information;
[0010] Performing edge extraction on the first processed image data to obtain a second edge feature;
[0011] The current frame image data to be processed, the first edge feature, the first processed image data and the second edge feature are input into the image reconstruction model, and the first target image output by the image reconstruction model is obtained.
[0012] In one embodiment, before inputting the current frame of image data to be processed, the first edge feature, the first processed image data and the second edge feature into the image generation model, the method also includes: obtaining the similarity rate corresponding to the previous frame of image data of the current frame of image data to be processed, the similarity rate is used to characterize the similarity between the second target image and the second processed image data, the second processed image data is the image data corresponding to the second scene information of the previous frame of image data, and the second target image is the result data generated by the image reconstruction model according to the previous frame of image data, the edge feature of the previous frame of image data, the second processed image data and the edge feature corresponding to the second processed image data; when the similarity rate is less than a preset threshold, obtaining a preset rendering method, and using the preset rendering method to render the current frame of image data to be processed.
[0013] In one of the embodiments, after obtaining the similarity rate corresponding to the previous frame image data of the current frame image data to be processed, the method further includes: when the similarity rate is greater than or equal to a preset threshold, judging whether the scene change has occurred in the current frame image data to be processed based on the first scene information and the second scene information; in the case that the scene change has occurred in the current frame image data to be processed, executing the step of obtaining the preset rendering method and rendering the current frame image data to be processed using the preset rendering method.
[0014] In one embodiment, after determining whether a scene change has occurred in the current frame image data to be processed based on the first scene information and the second scene information, the method further includes: when the current frame image data to be processed has not undergone a scene change, executing the step of inputting the current frame image data to be processed, the first edge feature, the first processed image data, and the second edge feature into the image generation model.
[0015] In one embodiment, judging whether a scene change has occurred in the current frame of image data to be processed based on the first scene information and the second scene information includes: judging whether the first graphic color texture information included in the first scene information and the second graphic color texture information included in the second scene information match; when the first graphic color texture information does not match the second graphic color texture information, then a scene change has occurred in the current frame of image data to be processed.
[0016] In one of the embodiments, before inputting the current frame image data to be processed, the first edge feature, the first processed image data and the second edge feature into the image reconstruction model, the method also includes: acquiring sample data, the sample data including low-resolution sample image data, high-resolution sample image data corresponding to the low-resolution sample image data, third edge information included in the low-resolution sample image data and fourth edge information included in the high-resolution sample image data; training a neural network model based on the low-resolution sample image data, the high-resolution sample image data corresponding to the low-resolution sample image data, the third edge information included in the low-resolution sample image data and the fourth edge information included in the high-resolution sample image data to generate an image reconstruction module model.
[0017] In a second aspect, the present application also provides a method for generating an image reconstruction model, comprising:
[0018] Acquire sample data, where the sample data includes low-resolution sample image data, high-resolution sample image data corresponding to the low-resolution sample image data, third edge information included in the low-resolution sample image data, and fourth edge information included in the high-resolution sample image data;
[0019] A neural network model is trained based on the low-resolution sample image data, the high-resolution sample image data corresponding to the low-resolution sample image data, the third edge information included in the low-resolution sample image data, and the fourth edge information included in the high-resolution sample image data to generate an image reconstruction model.
[0020] In a third aspect, the present application further provides an image processing device, comprising:
[0021] A first data acquisition module, used to acquire the image data to be processed in the current frame, and determine the first scene information of the image data to be processed in the current frame;
[0022] A first edge feature extraction module is used to extract the edge of the image data to be processed in the current frame to obtain a first edge feature;
[0023] A second data acquisition module, used to determine processed image data corresponding to the image data to be processed in the current frame according to the first scene information;
[0024] A second edge feature extraction module, used for performing edge extraction on the processed image data to obtain a second edge feature;
[0025] The receiving module is used to input the current frame image data to be processed, the first edge feature, the first processed image data and the second edge feature into the image reconstruction model, and obtain the first target image output by the image reconstruction model.
[0026] In a fourth aspect, the present application also provides an image reconstruction model generation device, comprising:
[0027] A sample data acquisition module, used to acquire sample data, the sample data including low-resolution sample image data, high-resolution sample image data corresponding to the low-resolution sample image data, third edge information included in the low-resolution sample image data, and fourth edge information included in the high-resolution sample image data;
[0028] The model training module is used to train a neural network model to generate an image reconstruction model based on low-resolution sample image data, high-resolution sample image data corresponding to the low-resolution sample image data, third edge information included in the low-resolution sample image data, and fourth edge information included in the high-resolution sample image data.
[0029] In a fifth aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in each method embodiment when executing the computer program.
[0030] In a sixth aspect, the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps in each method embodiment are implemented.
[0031] In a seventh aspect, the present application also provides a computer program product, including a computer program, which implements the steps in each method embodiment when executed by a processor.
[0032] The above-mentioned image processing, image reconstruction model generation method, device, computer equipment, computer-readable storage medium and computer program product, in the process of implementing image processing, extract the first edge feature of the image data to be processed in the current frame, obtain the first processed image data with the same scene as the image data to be processed in the current frame, and obtain the second edge feature of the first processed image data, and use the image data to be processed in the current frame, the first edge feature, the first processed image data and the second edge feature to realize the reconstruction of the current image to be processed to obtain the first target image. The acquisition of the target image using the image reconstruction model can improve the efficiency and effect of image reconstruction, and the use of the second edge feature and the first processed image data to realize the increase of details of the generated target image, thereby improving the accuracy of the generated target image and improving the effect of image processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 A schematic diagram of a flow chart of an image processing method provided in an embodiment of the present application;
[0035] Figure 2 A schematic diagram of edge feature extraction provided in an embodiment of the present application;
[0036] Figure 3 A schematic diagram of a process of edge feature extraction provided in an embodiment of the present application;
[0037] Figure 4 A schematic diagram of image reconstruction in an embodiment of the present application;
[0038] Figure 5 A schematic diagram of an image reconstruction model provided in an embodiment of the present application;
[0039] Figure 6 A schematic diagram of a flow chart of another image processing method provided in an embodiment of the present application;
[0040] Figure 7 A schematic diagram of a process for generating an image reconstruction model provided in an embodiment of the present application
[0041] Figure 8 A structural block diagram of an image processing device provided in an embodiment of the present application;
[0042] Fig. 9 A structural block diagram of an image reconstruction model generation device provided in an embodiment of the present application;
[0043] Fig.10 This is a diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] In an exemplary embodiment, Figure 1As shown, an image processing method is provided. This embodiment takes the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0046] Step 102: Acquire the current frame of image data to be processed, and determine the first scene information of the current frame of image data to be processed.
[0047] The scene information is used to represent the semantic information of the image scene. Optionally, the scene information includes objects, people, environment, etc.
[0048] In one embodiment, a graphics processing unit (GPU) is provided on the terminal, and the graphics processing unit processes the image, for example, renders the image.
[0049] In one embodiment, the terminal is provided with application software, such as game software, video playback software, image software, etc. When the application software is used, data is exchanged between the application software and the GPU so that the GPU can process the image transmitted by the application software.
[0050] Optionally, a switch control may be provided to switch the image processing mode. For example, when the switch is turned off, the image processing is performed using the image processing mode of the GPU itself, and when the switch is turned on, the GPU is controlled to perform image processing using the image reconstruction model. The image reconstruction model is used to reconstruct and generate high-resolution image data corresponding to the low-resolution image data based on the low-resolution image data.
[0051] In an optional embodiment, when an image needs to be processed, the terminal obtains the image to be processed, forms the current frame of image data to be processed, and determines whether the current frame of image data to be processed needs to be processed based on the image reconstruction model or directly processed using the GPU. Optionally, the determination of whether the current frame of image data to be processed is based on the image reconstruction model or directly processed using the GPU can also be determined whether the current frame of image data to be processed has undergone a scene change.
[0052] Step 104: extract edges of the image data to be processed in the current frame to obtain a first edge feature.
[0053] Among them, edge features are used to characterize those features in the image data that have step changes or roof-like changes.
[0054] Optionally, an edge algorithm may be used to extract edge features of an image. Optionally, the edge algorithm may be a differential method, a differential edge detection method, a Roberts edge detection operator, a Sobel edge detection operator, or the like.
[0055] In one embodiment, an edge extraction IP core is formed, and when edge extraction is required, the edge extraction IP core is called, and the edge extraction IP core is used to implement edge extraction of an image.
[0056] Optionally, after acquiring the current frame image data to be processed, the current frame image data to be processed is input into an edge extraction IP core, so as to use the edge extraction IP core to implement edge extraction on the current frame image data to be processed to obtain a first edge feature.
[0057] Exemplarily, the edge extraction IP core may be formed by a Sobel edge detection operator.
[0058] The Sobel edge detection operator includes a 3×3 matrix, one for horizontal and one for vertical. By performing a plane convolution with the image, we can obtain the approximate horizontal and vertical brightness difference values. If A represents the original image, the formula is as follows:
[0059]
[0060] The approximate horizontal and vertical gradients of each pixel in the image can be combined with the following formula to calculate the magnitude of the gradient:
[0061]
[0062] Among them, G x and G y is the convolution of the Sobel operator and the image, represents the horizontal component of the first-order gradient operator in the x and y directions respectively, G is the value calculated by the operator, and the two convolution filters composed of the Sobel operator are applied to each 3×3 image block in the image, and the edge feature value of the pixel at the center of the image can be obtained, such as Figure 2 shown.
[0063] In one embodiment, Figure 3 As shown, the step of early image edge features may include: obtaining the first row of image data of the current frame to be processed, the first row of image data including a plurality of image blocks to be processed; inputting the plurality of image blocks to be processed into the edge extraction IP core one by one from left to right, detecting whether the storage space of the edge extraction IP core is full, and if so, performing a comparison between the pixels of the image block to be processed and a preset pixel threshold, and when the pixels of the image block to be processed match the preset pixel threshold, the matched image block is considered to be the target image block; and looping through the above steps until the entire current frame to be processed image recognition is completed.
[0064] Step 106 determines first processed image data corresponding to the current frame of image data to be processed according to the first scene information.
[0065] Step 108: extract edges from the first processed image data to obtain second edge features.
[0066] It is understandable that most of the content presented by 3D rendering is similar and moves continuously. The content rendered continuously in the same scene is highly repetitive. Therefore, sampling can be performed based on the processed image that has been rendered for reconstruction of the image to be processed, which can greatly reduce the loss of details in low-resolution reconstruction and effectively reduce the huge consumption of pixel sampling in the original method, so that the processed image that is the same or similar to the image to be processed can be obtained through scene data for image reconstruction.
[0067] In one embodiment, after processing a frame of image data, the terminal obtains scene information corresponding to the frame of image data, and sets the frame of image information corresponding to the scene information.
[0068] Optionally, after the first scene information is acquired, the first scene information is used to acquire first processed image data corresponding to the image data to be processed in the current frame and having the same or similar scene information as the first scene information from the stored correspondence relationship. For example, the scene information of the image data to be processed in the current frame is the first scene information, and the processed image data is acquired using the first scene information and the correspondence relationship, which is recorded as the first processed image data. It can be understood that the first processed image data is high-resolution image data.
[0069] In one embodiment, after the first processed image data is acquired, edge features may be extracted from the first processed image data to obtain second edge feature information. Optionally, the step of edge extraction is referred to step 104 and will not be described in detail here.
[0070] Step 110: input the current frame image data to be processed, the first edge feature, the first processed image data and the second edge feature into the image reconstruction model, and obtain the first target image output by the image reconstruction model.
[0071] The image reconstruction model is used to reconstruct the image based on the input low-resolution image data to obtain a high-resolution target image.
[0072] Optionally, the current frame image data to be processed is low-resolution image data, and the current frame image data to be processed is used as input to the image reconstruction model to obtain a first target image of a high-resolution image output by the image reconstruction model.
[0073] It can be understood that, assuming that the high-resolution image HR is X, the LR image corresponding to the high-resolution image is obtained through HR, and the LR image is set to Y. Therefore, after downsampling and processing, the degradation model from X to Y is:
[0074] Y=SPX (1)
[0075] Where: S is downsampling; P is the image processing operator.
[0076] The process of solving the super-resolution reconstruction of HR images through LR images is an inverse problem that is created out of nothing. For a given low-resolution image Y, an infinite number of high-resolution images X can be obtained that satisfy the above degradation model.
[0077] If we take any sub-image block x∈X of the high-resolution image X, and the high-resolution image X' is the translation and rotation of the high-resolution image X, then x can be approximated by a linear combination in X' using the following formula:
[0078] x=F(x′,y,y sobel ; α,ε,D) (2)
[0079] Where F(.) is the reconstruction function, α is the transformation matrix from image x' to x, x' is the image block corresponding to x in image X, y is the low-resolution image block corresponding to x, y∈Y, ε is the transformation matrix, y sobel is the edge processing result corresponding to y, and D is the edge processing function.
[0080] The solution of the transformation matrix α, ε, and edge processing operator D can also be approximately written as follows:
[0081] α, ε, D = arg min α,ε,D |xF(x′,y,y sobel ;α,ε,D)| (3)
[0082] Thus, the prior knowledge of the existing sample data is used to form a reconstructed image model, so that after obtaining the current frame image data to be processed, the first edge feature, the first processed image data and the second edge feature, the reconstructed image model is used to achieve image reconstruction and obtain the first target image. Figure 4 As shown, Figure 4 Schematic diagram of image reconstruction. The left side is the input part of the image reconstruction model, which is used to input the current frame to be processed image data, the first edge feature, the first processed image data and the second edge feature; the middle part is the inference network part of the image reconstruction model, which is used to implement inference according to the data input by the input part to obtain the target image. Optionally, Figure 5The inference network part receives the low-resolution image, the first edge feature of the low-resolution image, the second edge feature of the high-resolution image, and the high-resolution image, and effectively extracts features and calculates corresponding pixels through operations such as convolution and pooling, thereby generating a target image; the right part is the output part, which is used to output the target image.
[0083] In one embodiment, a method for training an image reconstruction model may include: acquiring sample data, the sample data including low-resolution sample image data, high-resolution sample image data corresponding to the low-resolution image sample data, third edge information included in the low-resolution sample image data, and fourth edge information included in the high-resolution sample image data; training a neural network model based on the low-resolution sample image data, the high-resolution sample image data corresponding to the low-resolution sample image data, the third edge information included in the low-resolution sample image data, and the fourth edge information included in the high-resolution sample image data to generate an image reconstruction model.
[0084] In one embodiment, the sample data can be generated using an image data set directly rendered by a GPU. HR and Y LR They are high-resolution image and low-resolution image datasets directly rendered by GPU, respectively. HR and Y LR Corresponding to establish samples, for example, determine X HR and Y LR Is it the same 3D rendering task? If so, set X HR and Y LR Correspondingly, after all images in the high-resolution image and low-resolution image data sets are set, sample data is formed.
[0085] Optionally, the continuously rendered HR image and LR image datasets are uniformly reconstructed and learned and feedback results are output. The rendered training sample pairs are defined as Data = {X HR , Y LR}, where x i (1≤i≤n)∈X HR represents the HR image block, y i (1≤i≤n)∈Y LR is the corresponding LR image, where n is the number of samples. In order to use the reconstruction of the historical frame image, the x neighbor in the same scene can be used i-c Image and y i Image Reconstructionx i , where c is the time interval between the current frame and the processed historical frame. The transformation matrix α, ε, and edge processing operator D are solved by the following formula:
[0086]
[0087] L b =x i -x i ′ (5)
[0088] Where: L b is the similarity rate, which is used to feedback the similarity between the reconstructed image and the original high-resolution image. is the time domain sampling edge information. i With x i ′ respectively correspond to the original high-resolution image and the reconstructed image. In order to learn the accuracy, the above equations (4) and (5) are performed for asynchronous training and can be expressed as:
[0089]
[0090] Where: L′ b is the learned similarity, P(.) is the similarity calculation matrix, and the above will be further simplified as follows:
[0091]
[0092] Among them, Q is the image reconstruction model.
[0093] Thus, an image reconstruction model can be pre-generated based on sample data, so that after obtaining the current frame image data to be processed, the first edge feature, the first processed image data, and the second edge feature, the current frame image data to be processed, the first edge feature, the first processed image data, and the second edge feature can be input into the image reconstruction model to obtain the first target image output by the image reconstruction model. Optionally, the similarity between the first target image data output when reconstructing the current frame image data to be processed and the first processed image data can also be obtained.
[0094] In one embodiment, a sample generation script can be pre-established, and the sample generation script can be used to obtain a high-resolution image and a low-resolution image data set directly rendered by the GPU, and determine whether the high-resolution image in the high-resolution image set and the low-resolution image in the low-resolution image set are the same 3D rendering task. If so, the high-resolution image and the low-resolution image are set correspondingly to generate sample data. Optionally, reference image data with the same scene information as the low-resolution image is obtained from the high-resolution image set, and the reference image data is set correspondingly to the low-resolution image to update the sample data. Optionally, the third edge feature of the low-resolution image data and the fourth edge feature of the reference image data can also be obtained, and the sample data can be updated using the obtained third edge feature and fourth edge feature. Optionally, a pre-generated neural network model is obtained, and the sample data is input into the neural network model to generate an image reconstruction model.
[0095] In one embodiment, the image reconstruction model may be an image reconstruction IP core. Optionally, the edge extraction IP core and the image reconstruction IP core are two independent IP cores.
[0096] In an optional embodiment, before inputting the current frame image data to be processed, the first edge feature, the first processed image data and the second edge feature into the image reconstruction model, the image processing method also includes: obtaining the similarity corresponding to the previous frame image data of the current frame image data to be processed; when the similarity is less than a preset threshold, obtaining a preset rendering method, and using the preset rendering method to render the current frame image data to be processed.
[0097] Among them, the similarity is used to characterize the similarity between the second target image and the second processed image data, the second processed image data is the image data corresponding to the second scene information of the previous frame image data, and the second target image is the result data generated by the image reconstruction model based on the previous frame image data, the edge features of the previous frame image data, the second processed image data and the edge features corresponding to the second processed image data.
[0098] It can be understood that when the image reconstruction model reconstructs the second target image corresponding to the previous frame image data, the image reconstruction model can output the similarity of the second target image corresponding to the previous frame image while outputting the second target image corresponding to the previous frame image. This similarity is used to determine the similarity between the second target image and the second processed image data. If the similarity is not high, it can be considered that the scene change may have occurred in the previous frame image data, and it can be directly rendered by the GPU to improve the accuracy of image processing. If the similarity is high, the image processing can continue to be performed using the rendering method of the current image reconstruction model to ensure the efficiency of image processing while ensuring the accuracy of image processing.
[0099] In one embodiment, a preset threshold is set in advance, and the preset threshold is used to compare with the similarity to determine whether the similarity between the target image output by the image reconstruction model and the number of processed images input meets the requirements. Optionally, the preset threshold can be a numerical value, and the specific numerical value is not limited here and can be set as needed, and the corresponding similarity can also be a numerical value.
[0100] In an optional embodiment, when the similarity is less than a preset threshold, a preset rendering method is obtained, and the preset rendering method is used to render the image data to be processed in the current frame, thereby improving the accuracy of the target image and thus improving the effect of image processing. Optionally, the preset rendering method is a GPU built-in rendering method, and when the similarity is less than a preset threshold, the GPU is used for direct rendering.
[0101] In an optional embodiment, when the similarity is greater than or equal to a preset threshold, it can be determined whether a scene change has occurred in the current frame of image data to be processed based on the first scene information and the second scene information; if a scene change has occurred in the current frame of image data to be processed, the step of obtaining a preset rendering method and rendering the current frame of image data to be processed using the preset rendering method is executed.
[0102] It can be understood that in the process of 3D continuous rendering, the image changes in the same scene are small. Therefore, when the similarity is greater than or equal to the preset threshold, it indicates that the image similarity obtained when reconstructing the processed image in the same scene is high and the efficiency is also high. Then, it can be determined whether to continue to use the image reconstruction model to realize image processing based on whether the scene information has changed.
[0103] Optionally, when the scene information changes, the GPU can be used to directly render the image; when the scene information does not change significantly, the image reconstruction model can continue to be used to process the image.
[0104] In one embodiment, whether the scene information has changed can be determined based on whether the first scene information and the second scene information match. If the first scene information and the second scene information do not match, it indicates that a scene change has occurred between the current frame image to be processed and the previous frame image. If continuing to use the image reconstruction model to implement image processing is likely to cause inaccurate image rendering, then the steps of obtaining a preset rendering method and using the preset rendering method to render the current frame image to be processed can be performed, so as to use the preset rendering method that comes with the GPU to implement processing of the current frame image to be processed.
[0105] Optionally, if the first scene information and the second scene information match, it can be considered that the scene information has not undergone any transformation, and the image reconstruction model can be used to process the image to be processed in the current frame, so as to improve the image processing efficiency while ensuring the accuracy of image processing.
[0106] In an exemplary embodiment, based on the first scene information and the second scene information, determining whether a scene change has occurred in the current frame of image data to be processed includes: determining whether the first graphic color texture information included in the first scene information matches the second graphic color texture information included in the second scene information; when the first graphic color texture information does not match the second graphic color texture information, then a scene change has occurred in the current frame of image data to be processed.
[0107] Among them, graphic color texture information is used to characterize the arrangement and frequency of color and tone changes of the image.
[0108] Optionally, the match may be completely identical, or the difference may be within a preset range.
[0109] It is understandable that different scene information corresponds to different material information in the image, so whether the scene information has changed can be determined by identifying the material information in the image data. When the scene information has not been changed, the image color and texture information has also changed, so whether the image data has undergone a scene change can be determined based on the graphic color and texture information in the image.
[0110] In one embodiment, first graphic color texture information of the first processed image data can be obtained as the first scene information, and second graphic color texture information of the previous frame image can be obtained as the second scene information, and the first graphic color texture information and the second graphic color texture information can be compared, and it is determined whether the image data has undergone a scene change based on the comparison result between the first graphic color texture information and the second graphic color texture information.
[0111] It can be understood that when a 3D image is rendered, it is rendered based on the input resource, shader and state (a one-time setting of a certain characteristic or parameter of a fixed rendering pipeline). Therefore, the image scene information can be determined based on the resource, shader and state settings, and the relevant data of the resource, shader and state settings can be used as graphic color texture information to determine whether the scene information has changed based on the graphic color texture information.
[0112] Optionally, you can get shader (shader is a computer program used to control the graphics rendering process in computer graphics, which defines the surface properties, lighting effects, material texture, etc. of graphics objects), state, VBIB (VB vertex buffer, IB is vertex index buffer), CB (constant buffer, used for constant data used by programmable shaders).
[0113] In one embodiment, the detection order can be set, and the detection can be performed according to the set detection order to determine whether the scene has changed. Optionally, it can be detected whether the shader has changed first, and if it is determined that the shader has not changed, then detect whether the state has changed. If the state has not changed, then further detect whether VBIB has changed. If VBIB has not changed, then further detect whether CB has changed. If CB has not changed, it indicates that the scene data has not changed.
[0114] Optionally, if the shader is changed, it indicates that the scene information is changed.
[0115] Optionally, if the shader has not changed, further check whether the state has changed. If so, it indicates that the scene information has changed.
[0116] Optionally, if the shader has not changed, further check whether the state has changed. If the state has not changed, further check whether VBIB has changed, which indicates that the scene information has changed.
[0117] Optionally, if the shader has not changed, the state has not changed, and the VBIB has not changed, then it is detected whether the CB has changed. If so, it indicates that the scene information has changed.
[0118] In the above-mentioned image processing method, in the process of realizing image processing, the first edge feature of the image data to be processed of the current frame is extracted, the processed image data with the same scene as the image data to be processed of the current frame is obtained, and the second edge feature of the processed image data is obtained, and the first edge feature, the second edge feature, and the processed image data with the same scene are used to realize the reconstruction of the current image to be processed to obtain the target image. The acquisition of the target image by using the image reconstruction model can improve the efficiency and accuracy of image reconstruction, and the second edge feature of the processed image data is used to increase the details of the generated target image, thereby improving the accuracy of the generated target image and improving the effect of image processing. In addition, the above-mentioned image processing method also involves detecting whether the scene information between the current frame to be processed image and the previous frame image has changed. If it has changed, the preset rendering method of the GPU itself is used to perform image processing. If the scene information has not changed significantly, the image reconstruction model is used to realize image processing, thereby improving the speed of image processing on the basis of ensuring the accuracy of image processing.
[0119] In an exemplary embodiment, Figure 6 As shown, an image processing method is provided. This embodiment takes the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0120] Step 202: Acquire the image data to be processed of the current frame, and determine the first scene information of the image data to be processed.
[0121] Step 204: extract edges of the image data to be processed in the current frame to obtain a first edge feature.
[0122] Step 206: Determine first processed image data corresponding to the image data to be processed in the current frame according to the first scene information.
[0123] Step 208: extract edges from the first processed image data to obtain second edge features.
[0124] Step 210 , obtaining a similarity ratio corresponding to a previous frame of image data of a current frame of image data to be processed.
[0125] Among them, the similarity is used to characterize the similarity between the second target image and the second processed image data, the second processed image data is the image data corresponding to the second scene information of the previous frame image data, and the second target image is the result data generated by the image reconstruction model based on the previous frame image data, the edge features of the previous frame image data, the second processed image data and the edge features corresponding to the second processed image data.
[0126] Step 212, determine whether the similarity is less than a preset threshold, if so, execute step 214, if not, execute step 216.
[0127] Step 214, obtaining a preset rendering method, and using the preset rendering method to render the current frame of image data to be processed.
[0128] Step 216 , determining whether the first graphic color texture information included in the first scene information matches the second graphic color texture information included in the second scene information, if so, executing step 218 , if not, executing step 214 .
[0129] Step 218: input the current frame image data to be processed, the first edge feature, the first processed image data and the second edge feature into the image reconstruction model, and obtain the first target image output by the image reconstruction model.
[0130] In this embodiment, the above-mentioned image processing method also involves detecting whether the scene information of the image data has changed. If it has changed, the GPU's preset rendering method is used to process the image data. If the scene information has not changed significantly, the image reconstruction model processing method is used to process the image data, thereby improving the speed of image processing while ensuring the accuracy of image processing.
[0131] In an exemplary embodiment, Figure 7 As shown, an image processing method is provided. This embodiment takes the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0132] Step 302, obtaining sample data.
[0133] The sample data includes low-resolution sample image data, high-resolution sample image data corresponding to the low-resolution sample image data, third edge information included in the low-resolution sample image data, and fourth edge information included in the high-resolution sample image data.
[0134] Step 304, training a neural network model based on the low-resolution sample image data, the high-resolution sample image data corresponding to the low-resolution sample image data, the third edge information included in the low-resolution sample image data, and the fourth edge information included in the high-resolution sample image data to generate an image reconstruction model.
[0135] In the above-mentioned image reconstruction model generation method, the image reconstruction model is pre-established so that during image processing, the pre-generated image reconstruction model can be directly used to realize the generation of the target image, thereby improving the efficiency of image processing. In addition, in the process of training and generating the image reconstruction model, the edge features of the high-resolution image, the low-resolution image, the edge features included in the high-resolution image, and the edge features included in the low-resolution image data are used to form sample data, so that the trained image reconstruction model can realize image reconstruction based on the edge information of the high-resolution and low-resolution image data, thereby improving the accuracy of the reconstructed target image and improving the effect of the target image reconstructed by using the image reconstruction model.
[0136] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0137] Based on the same inventive concept, the embodiment of the present application also provides an image processing device for implementing the above-mentioned image processing method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in one or more image processing device embodiments provided below can refer to the limitations on the image processing method above, and will not be repeated here.
[0138] In an exemplary embodiment, Figure 8As shown, an image processing device 400 is provided, comprising: a first data acquisition module 402, a first edge feature extraction module 404, a second data acquisition module 406, a second edge feature extraction module 408 and a receiving module 410, wherein:
[0139] A first data acquisition module 402 is used to acquire the current frame of image data to be processed and determine the first scene information of the current frame of image data to be processed;
[0140] A first edge feature extraction module 404 is used to extract edges of the image data to be processed in the current frame to obtain a first edge feature;
[0141] A second data acquisition module 406 is used to determine first processed image data corresponding to the image data to be processed in the current frame according to the first scene information;
[0142] A second edge feature extraction module 408 is used to extract edges from the first processed image data to obtain second edge features;
[0143] The receiving module 410 is used to input the current frame image data to be processed, the first edge feature, the first processed image data and the second edge feature into the image reconstruction model, and obtain the first target image output by the image reconstruction model.
[0144] In one embodiment, the device also includes a judgment module, which is used to obtain the similarity rate corresponding to the previous frame image data of the current frame image data to be processed, and the similarity rate is used to characterize the similarity between the second target image and the second processed image data, the second processed image data is the image data corresponding to the second scene information of the previous frame image data, and the second target image is the result data generated by the image reconstruction model according to the previous frame image data, the edge features of the previous frame image data, the second processed image data and the edge features corresponding to the second processed image data; when the similarity rate is less than a preset threshold value, the preset rendering method is obtained, and the preset rendering method is used to render the current frame image data to be processed.
[0145] In one embodiment, the judgment module is also used to obtain the second scene information corresponding to the previous frame of image data when the similarity is greater than or equal to a preset threshold; determine whether the current frame of image data to be processed has undergone a scene change based on the first scene information and the second scene information; if so, execute the step of obtaining a preset rendering method and rendering the current frame of image data to be processed using the preset rendering method.
[0146] In one embodiment, the judgment module is also used to execute the step of inputting the current frame image data to be processed, the first edge feature, the first processed image data and the second edge feature into the image generation model when no scene change occurs in the current frame image to be processed.
[0147] In one of the embodiments, the judgment module is also used to judge whether the first graphic color texture information included in the first scene information matches the second graphic color texture information included in the second scene information; when the first graphic color texture information does not match the second graphic color texture information, the scene change occurs in the current frame of image data to be processed.
[0148] In one embodiment, the image processing device also includes a model training module, which is used to obtain sample data, the sample data includes low-resolution image data, high-resolution image data corresponding to the low-resolution image data, third edge information included in the low-resolution image data, and fourth edge information included in the high-resolution image data; according to the low-resolution image data, the high-resolution image data corresponding to the low-resolution image data, the third edge information included in the low-resolution image data, and the fourth edge information included in the high-resolution image data, a neural network model is trained to generate an image reconstruction model.
[0149] In an exemplary embodiment, Fig. 9 As shown, an image reconstruction model generation device 500 is provided, comprising: a sample data acquisition module 502 and a model training module 504, wherein:
[0150] The sample data acquisition module 502 is used to acquire sample data, which includes low-resolution image data, high-resolution image data corresponding to the low-resolution image data, third edge information included in the low-resolution image data, and fourth edge information included in the high-resolution image data.
[0151] The model training module 504 is used to train a neural network model to generate an image reconstruction model based on the low-resolution image data, the high-resolution image data corresponding to the low-resolution image data, the third edge information included in the low-resolution image data, and the fourth edge information included in the high-resolution image data.
[0152] Each module in the above-mentioned image processing device and image reconstruction module generation device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0153] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (Near Field Communication, NFC) or other technologies. When the computer program is executed by the processor, an image processing method or an image reconstruction model generation method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0154] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0155] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in each method embodiment when executing the computer program.
[0156] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in each method embodiment are implemented.
[0157] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in each method embodiment when executed by a processor.
[0158] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0159] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0160] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0161] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire the current frame of image data to be processed, and determine the first scene information of the current frame of image data to be processed; Performing edge extraction on the current frame of image data to be processed to obtain a first edge feature; Determine, according to the first scene information, first processed image data corresponding to the current frame of image data to be processed; Performing edge extraction on the first processed image data to obtain a second edge feature; The current frame image data to be processed, the first edge feature, the first processed image data and the second edge feature are input into an image reconstruction model, and a first target image output by the image reconstruction model is obtained.
2. The method according to claim 1, characterized in that: Before inputting the current frame to-be-processed image data, the first edge feature, the first processed image data, and the second edge feature into an image generation model, the method further includes: Obtaining a similarity rate corresponding to a previous frame of image data of the current frame to be processed, wherein the similarity rate is used to characterize a similarity between a second target image and second processed image data, wherein the second processed image data is image data corresponding to second scene information of the previous frame of image data, and the second target image is result data generated by the image reconstruction model according to the previous frame of image data, edge features of the previous frame of image data, the second processed image data, and edge features corresponding to the second processed image data; When the similarity is less than a preset threshold, a preset rendering method is obtained, and the preset rendering method is used to render the current frame of image data to be processed.
3. The method according to claim 2, characterized in that After obtaining the similarity rate corresponding to the previous frame of image data of the current frame to be processed, the method further includes: When the similarity is greater than or equal to a preset threshold, Determining whether a scene change occurs in the current frame of image data to be processed according to the first scene information and the second scene information; In the case where the scene of the current frame of image data to be processed changes, the step of obtaining the preset rendering method and rendering the current frame of image data to be processed by using the preset rendering method is executed.
4. The method according to claim 3, characterized in that After determining whether the current frame of image data to be processed has undergone a scene change, the method further includes: In the case where the current frame image data to be processed does not undergo scene change, the step of inputting the current frame image data to be processed, the first edge feature, the first processed image data and the second edge feature into the image reconstruction model is performed.
5. The method according to claim 3 or 4, characterized in that: The determining, according to the first scene information and the second scene information, whether the current frame of image data to be processed has undergone a scene change includes: Determining whether the first graphic color texture information included in the first scene information matches the second graphic color texture information included in the second scene information; When the first graphic color texture information does not match the second graphic color texture information, the scene change occurs in the current frame of image data to be processed.
6. The method according to claim 1, characterized in that Before inputting the current frame to-be-processed image data, the first edge feature, the first processed image data and the second edge feature into the image reconstruction model, the method further includes: Acquire sample data, the sample data comprising low-resolution sample image data, high-resolution sample image data corresponding to the low-resolution sample image data, third edge information included in the low-resolution sample image data, and fourth edge information included in the high-resolution sample image data; A neural network model is trained based on the low-resolution sample image data, the high-resolution sample image data corresponding to the low-resolution sample image data, the third edge information included in the low-resolution sample image data, and the fourth edge information included in the high-resolution sample image data to generate the image reconstruction model.
7. A method for generating an image reconstruction model, characterized in that: The method comprises: Acquire sample data, the sample data comprising low-resolution sample image data, high-resolution sample image data corresponding to the low-resolution sample image data, third edge information included in the low-resolution sample image data, and fourth edge information included in the high-resolution sample image data; A neural network model is trained based on the low-resolution sample image data, the high-resolution sample image data corresponding to the low-resolution sample image data, the third edge information included in the low-resolution sample image data, and the fourth edge information included in the high-resolution sample image data to generate the image reconstruction model.
8. An image processing device, characterized in that: The device comprises: A first data acquisition module, used to acquire the current frame of image data to be processed, and determine the first scene information of the current frame of image data to be processed; A first edge feature extraction module, used for performing edge extraction on the current frame of image data to be processed to obtain a first edge feature; A second data acquisition module, configured to determine first processed image data corresponding to the current frame of image data to be processed according to the first scene information; A second edge feature extraction module, used for performing edge extraction on the first processed image data to obtain a second edge feature; A receiving module is used to input the current frame image data to be processed, the first edge feature, the first processed image data and the second edge feature into an image reconstruction model, and obtain a first target image output by the image reconstruction model.
9. An image reconstruction model generation device, characterized in that: The model includes: a sample data acquisition module, configured to acquire sample data, wherein the sample data includes low-resolution sample image data, high-resolution sample image data corresponding to the low-resolution sample image data, third edge information included in the low-resolution sample image data, and fourth edge information included in the high-resolution sample image data; A model training module is used to train a neural network model based on the low-resolution sample image data, the high-resolution sample image data corresponding to the low-resolution sample image data, the third edge information included in the low-resolution sample image data, and the fourth edge information included in the high-resolution sample image data to generate the image reconstruction model.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
