Image generation method and device, equipment and medium
By performing scene semantic analysis and dynamic scene template matching on the captured preview images, feature data is automatically selected and fused, solving the problem of poor image quality and achieving high-quality image synthesis effects.
Patent Information
- Application Number
- CN202511843439.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-08
- Publication Date
- 2026-02-10
AI Technical Summary
In existing technologies, the image quality is poor due to the influence of factors such as the shooting scene, especially when image materials are applied to photos, resulting in poor synthesis effects.
By performing scene semantic analysis on the captured preview images, scene semantic information is generated. Combined with the semantic similarity and placement fusion degree of dynamic scene templates, feature data is automatically selected and fused to generate high-quality images.
It significantly improves the quality and visual harmony of image synthesis, solves the problems of inconsistent lighting and shadows and stitching marks, and provides a more natural and believable final product.
Smart Images

Figure CN121509809A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of image processing, and particularly relates to an image generation method and device, equipment and a medium. BACKGROUND
[0002] With the development of photography technology and image processing technology, a user usually applies the content in a part of an image as image material in a photo. When the content in the part of the image is applied as the image material in the photo, the user needs to perform cutout processing on the image, and stores the content obtained through the cutout processing as the image material; after a photo is captured, the photo and the image material are imported into an image editing software, and a new image is obtained through manual adjustment of parameters.
[0003] However, due to the influence of a photo capturing scene factor, the quality of the new image is poor. SUMMARY
[0004] Embodiments of the present application provide an image generation method, device, equipment and medium, and can solve the problem of poor image quality.
[0005] In a first aspect, an image generation method is provided, and the method comprises the following steps: displaying a shooting preview image; performing scene semantic analysis on the shooting preview image to obtain first scene semantic information of the shooting preview image; determining first feature data from feature data of multiple regions according to the first scene semantic information; fusing the first feature data with the shooting preview image to obtain a first image.
[0006] In a second aspect, an image generation device is provided, and the device comprises the following modules: a display module configured to display a shooting preview image; an analysis module configured to perform scene semantic analysis on the shooting preview image to obtain first scene semantic information of the shooting preview image; a first determination module configured to determine first feature data from feature data of multiple regions according to the first scene semantic information; a fusion module configured to fuse the first feature data with the shooting preview image to obtain a first image.
[0007] In a third aspect, an electronic device is provided, and the electronic device comprises a processor and a memory, the memory stores programs or instructions that can be run on the processor, and the programs or instructions are executed by the processor to implement the steps of the image generation method provided in the embodiments of the present application.
[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, the readable storage medium storing a program or instructions, the program or instructions being executed by a processor to implement the steps of the image generation method provided by the embodiment of the present application.
[0009] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, and the processor being configured to run a program or instructions to implement the steps of the image generation method provided by the embodiment of the present application.
[0010] In a sixth aspect, an embodiment of the present application provides a computer program product, the program product being stored in a storage medium, and the program product being executed by at least one processor to implement the steps of the image generation method provided by the embodiment of the present application.
[0011] In the embodiment of the present application, the shooting preview image is displayed, the scene semantic analysis is performed on the shooting preview image to obtain first scene semantic information of the shooting preview image, the first feature data is determined from the feature data of the plurality of regions according to the first scene semantic information, and the first feature data is fused with the shooting preview image to obtain the first image. In this way, the feature data that needs to be fused with the shooting preview image is determined according to the scene semantic information of the shooting preview image, and then the feature data is fused with the shooting preview image, so that the quality of the image obtained by fusion can be improved. BRIEF DESCRIPTION OF DRAWINGS
[0012] Figure 1 FIG. 1 is a flowchart of an image generation method provided by some embodiments of the present application; Figure 2 FIG. 2 is a flowchart of generating a dynamic scene template provided by some embodiments of the present application; Figure 3 FIG. 3 is a structural diagram of an image generation device provided by some embodiments of the present application; Figure 4 FIG. 4 is a structural diagram of an electronic device provided by some embodiments of the present application; Figure 5 FIG. 5 is a hardware structural diagram of an electronic device provided by some embodiments of the present application. DETAILED DESCRIPTION
[0013] The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art belong to the scope of protection of the present application.
[0014] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0015] The image generation method, apparatus, device, and medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0016] Figure 1 This is a schematic flowchart illustrating an image generation method provided in some embodiments of this application. The image generation method includes: Step 101: Display the captured preview image; Step 102: Perform scene semantic analysis on the captured preview image to obtain the first scene semantic information of the captured preview image; In some embodiments of this application, step 102 may include: performing scene semantic analysis on the captured preview image to obtain scene feature information, light and shadow information, and spatial information of the captured preview image; and generating first scene semantic information based on the scene feature information, light and shadow information, and spatial information.
[0017] In some embodiments of this application, in step 102, the scene type and object category of the captured preview image can be identified to obtain scene feature information of the captured preview image; the brightness, light intensity, light direction and color temperature of the captured preview image can be analyzed to obtain light and shadow information of the captured preview image; the depth of field and perspective structure of the captured preview image can be determined to obtain spatial information of the captured preview image; and first scene semantic information can be generated based on scene feature information, light and shadow information and spatial information.
[0018] In some embodiments of this application, when identifying the scene type and object category of a captured preview image and obtaining scene feature information of the captured preview image, a pre-trained image scene classification network can be invoked. This network utilizes multi-layer convolutional kernels to slide and scan the captured preview image, progressively capturing local features from edges or colors to object parts or scene elements. After integrating these local features, global features of fixed length and vector form are obtained. These global features are then compared with the global features of various scene labels pre-stored in the image scene classification network using cosine similarity calculation. One or more scene labels with a cosine similarity exceeding a similarity threshold are output, thereby identifying the scene type information of the captured preview image. Scene types include, but are not limited to, outdoor, beach, and urban night scenes. By invoking a pre-trained object recognition network, pixel-by-pixel semantic parsing or region prediction is performed on the captured preview image to locate and identify key objects within the captured preview image. The object detection network is jointly trained with bounding box regression and classification, outputting category labels for multiple objects, including people, buildings, sky, and vegetation, along with their position coordinates in the image coordinate system. These coordinates are represented in normalized form or in pixel units. The object recognition network performs pixel-level classification of the image through an encoder-decoder structure and skip connections, outputting a segmentation mask of the same size as the captured preview image. Each pixel is labeled with its object category. Contour and position information of each object region are extracted through connected component analysis, thus completing the recognition of objects in the captured preview image. When the captured preview image is input into the image scene classification network and the object recognition network, the image scene classification network outputs the classification result of the scene type in the captured preview image in the form of labels, while the object recognition network outputs the category and position information of objects in the captured preview image in the form of bounding box coordinates and category labels.
[0019] In some embodiments of this application, when extracting scene semantic features, a Bidirectional Feature Pyramid Network (BiFPN) and EfficientNet-B0 can be combined as the backbone network. BiFPN can efficiently fuse information between feature maps of different scales, enhancing the expressive power of features through bidirectional paths from top to bottom and bottom to top. EfficientNet-B0, with its efficient model structure, achieves powerful feature extraction capabilities with relatively few computational resources. The combination of BiFPN and EfficientNet-B0 can realize multi-scale scene information fusion and output scene type, object detection boxes, and semantic segmentation masks, etc.
[0020] In some embodiments of this application, when analyzing the brightness, light intensity, light direction, and color temperature of a captured preview image to obtain its light and shadow information, statistical methods can be used to analyze the overall brightness distribution characteristics of the captured preview image, construct a brightness histogram to identify the dynamic range of image brightness and darkness and the brightness interval, analyze the distribution characteristics of each color channel in the RGB or HSV color space, extract its mean, variance, and inter-channel correlation to characterize the overall color shift and color style of the captured preview image, identify highlight and shadow areas in the captured preview image, estimate the incident direction and intensity of the light source through regional gradients, second-order statistics, and distribution continuity characteristics, and infer the color temperature of the light source by combining a color temperature estimation algorithm. The brightness, light intensity, light direction, and color temperature are then fused into a structured, multi-dimensional light and shadow vector to characterize the light and shadow information of the captured preview image.
[0021] In some embodiments of this application, when determining the depth of field and perspective structure of the captured preview image and obtaining its spatial information, significant contours and leading lines in the captured preview image can be identified using real-time edge detection and line extraction algorithms. Composition patterns are then evaluated in conjunction with object recognition results to generate composition data describing the layout features of the captured preview image. The captured preview image is processed using a monocular depth estimation model based on a convolutional neural network, outputting a depth map with the same resolution as the captured preview image. In this depth map, pixel values represent the relative distance between corresponding scene points and the camera's optical center. The composition data and the depth map are combined to form the spatial information of the captured preview image. When processing the captured preview image, the monocular depth estimation model infers the scene's geometry from the captured preview image in an end-to-end manner. The monocular depth estimation model extracts multi-scale image features through the encoder, and the decoder gradually upsamples and fuses features at different levels. Finally, it regresses to generate a depth map with the same resolution as the captured preview image. The gray value of each pixel in the depth map has a monotonic relationship with the physical distance or inverse depth of the scene point corresponding to that pixel in three-dimensional space relative to the optical center of the camera. This expresses the relative distance and spatial layout of objects in the scene corresponding to the captured preview image.
[0022] After obtaining the scene feature information, lighting information, and spatial information of the shooting preview image, scene semantic information of the shooting preview image is generated based on the scene feature information, lighting information, and spatial information of the shooting preview image.
[0023] Step 103: Based on the semantic information of the first scene, determine the first feature data from the feature data of multiple regions; In some embodiments of this application, the feature data of multiple regions can be feature data obtained by pre-extracting features from regions selected by the user from multiple images. After the user selects a region from an image, the features of the region selected by the user from that image are extracted, and the extracted features are used as the feature data corresponding to the region selected by the user from that image.
[0024] In some embodiments of this application, step 103 may include: determining the semantic similarity between the first scene semantic information and the second scene semantic information; wherein the second scene semantic information is any one of a plurality of third scene semantic information, and the plurality of third scene semantic information corresponds one-to-one with a plurality of feature data; determining the placement fusion degree of the feature data of the second region corresponding to the second scene semantic information in the captured preview image; determining the matching degree corresponding to the feature data of the second region based on the semantic similarity and the placement fusion degree; and determining the first feature data based on the matching degree corresponding to the feature data of the plurality of regions.
[0025] In some embodiments of this application, determining the semantic similarity between the first scene semantic information and the second scene semantic information may include: determining the scene similarity between the scene features corresponding to the first scene semantic information and the scene features of the second scene semantic information; determining the light and shadow similarity between the light and shadow information corresponding to the first scene semantic information and the light and shadow information of the second scene semantic information; determining the spatial similarity between the spatial information corresponding to the first scene semantic information and the spatial information of the second scene semantic information; and determining the semantic similarity based on the scene similarity, light and shadow similarity, and spatial similarity.
[0026] In some embodiments of this application, after a user selects a region from an image, the scene type and object category of the image can be identified to obtain the scene features of the image; the brightness, light intensity, light direction, and color temperature of the image can be analyzed to obtain the light and shadow information of the image; the depth of field and perspective structure of the image can be determined to obtain the spatial information of the image; and the light and shadow information and color distribution information of the region selected by the user can be extracted from the image. The specific processes of identifying the scene type and object category of the image to obtain the scene features, analyzing the brightness, light intensity, light direction, and color temperature of the image to obtain the light and shadow information, and estimating the depth of field and perspective structure of the image to obtain the spatial information of the image can be referred to the description in the above embodiments. The embodiments of this application will not be elaborated upon here.
[0027] In some embodiments of this application, when extracting the light and shadow information and color distribution information of a user-selected area in an image, the arithmetic mean of the pixels in the luminance channel can be calculated to obtain the average luminance value of the area; the standard deviation of the pixel values in the luminance channel can be calculated, which is used to characterize the contrast of the area; using the Sobel operator or similar gradient convolution kernel, the magnitude and direction of the illumination gradient of each pixel in the area can be calculated, and its gradient direction histogram or average gradient magnitude can be statistically analyzed; combining the average luminance value, contrast, and illumination gradient, the light and shadow information of the area can be obtained. The pixels in the area are converted from the device-dependent color space to a uniform color space that conforms to human visual perception, such as the CIELAB color space. Under this space, the histogram distribution of the luminance, red-green axis, and yellow-blue axis components are statistically analyzed, and their mean, standard deviation, and higher-order moment features are extracted. The k-means clustering algorithm is used to extract representative dominant colors and their proportions, generating a set of quantified color distribution information. This color distribution information can objectively describe the inherent color composition of the element and the visual atmosphere it presents.
[0028] After obtaining the scene type, object category, lighting and shadow information, spatial information, and regional lighting and color distribution information of an image, scene semantic information is generated. Scene semantic information is a structured data object, which can be represented as: S o rig=C s O l ,L g ,P g ,L e C e Where, Sorig represents the scene semantic information of the image; C s Indicates the scene type; O l A list representing the object category and its location information; L g Represents the light and shadow information of an image; P g This represents spatial information, specifically depth map data depicting spatial perspective relationships; L e Represents the lighting and shadow information of the region; C e This represents the color distribution information of the region. The scene semantic information of the image fully encapsulates the original environmental features upon which the user-selected region exists.
[0029] After obtaining the scene semantic information and feature data of the image, the scene semantic information and feature data of the image are combined and encapsulated to generate a dynamic scene template.
[0030] In some embodiments of this application, when generating a dynamic scene template, texture features and contour information of feature data can be extracted to form a visual description of elements; the visual description of elements can be associated with regional attributes to form a core element package; and the core element package can be bound with the scene semantic information of the image to generate a dynamic scene template.
[0031] In some embodiments of this application, when extracting texture features from feature data, the region can be convolved by applying a multi-scale, multi-directional Gabor filter bank; its texture response at different frequencies and directions can be extracted; or the Local Binary Patterns (LBP) algorithm can be used to calculate the local binary pattern (LBP) encoding of each pixel in the region and statistically analyze its histogram distribution; the surface details, roughness, and smoothness information of the region can be converted into a low-dimensional, compact numerical feature vector, and this feature vector can be used as the texture feature of the feature data.
[0032] In some embodiments of this application, a lightweight convolutional neural network can be used to extract texture features from feature data. The input of the convolutional neural network is the region corresponding to the feature data. Multi-scale features are extracted through multiple layers of deep separable convolutions, and finally a multi-dimensional texture feature vector is output. The convolutional neural network can be pre-trained on the ImageNet dataset as a base model, and then fine-tuned through a series of sets of feature data containing different scenes (e.g., landscapes, portraits, still life). The loss function is optimized to a triplet loss. The principle is to construct sample triplets (anchor sample, positive sample, negative sample) to make the feature distance between the anchor sample and the positive sample as close as possible, while making the feature distance between the anchor sample and the negative sample as far as possible, thereby improving the similarity of features of the same type of elements and enhancing the model's ability to distinguish texture features of feature data.
[0033] In some embodiments of this application, when extracting the contour information of feature data, the pixel-level boundary of the region can be identified based on the region segmentation mask and the Canny edge detection operator. The pixel-level boundary can be converted into a smooth and continuous contour path composed of a series of ordered two-dimensional or three-dimensional vector coordinate points through polygon fitting or spline curve fitting algorithms. The contour path is then used as the contour information of the feature data.
[0034] In some embodiments of this application, the logical structure of the dynamic scene template can be represented as: T d yn=D e lem(F t ex,I c ont),P l ocal,S o rig; where T d yn represents a dynamic scene template, D elem represents feature data, which is composed of texture features F t ex and contour information I c ont constitutes, P l ocal is a collection of information describing the light and shadow and color distribution of a region, S o rig represents the scene semantic information of the image. This logical structure ensures that all relevant information is encapsulated within a unified data entity.
[0035] In this embodiment, the dynamic scene template enables deep coupling between feature data and scene semantic information, giving the dynamic scene template context awareness and providing a foundation for high-precision matching and adaptive fusion in different scenarios.
[0036] In some embodiments of this application, the dynamic scene template can adopt a multi-level structured design, as shown in Table 1 below. It is mainly encapsulated through JSON format to ensure data integrity and cross-platform compatibility.
[0037] Table 1
[0038] Figure 2 This is a schematic diagram of the process for generating dynamic scene templates provided in some embodiments of this application; the process for generating dynamic scene templates includes the following steps: Step 201: The user selects a region in the image; Step 202: Extract features from the region selected by the user to obtain feature data; Step 203: Extract texture features and contour information from the feature data to form a visual description of the elements; Step 204: Associate the visual descriptions of the elements with the attributes of the selected area to form a core element package; Step 205: Perform scene semantic analysis on the image and extract the light and shadow information and color distribution information of the area selected by the user. Based on the scene semantic analysis results, light and shadow information and color distribution information, generate the scene semantic information of the image. Step 206: Bind the core element package to the scene semantic information of the image to generate a dynamic scene template.
[0039] in, Figure 2 The implementation process of each step in the process of generating dynamic scene templates shown can be referred to the description in the above embodiments, and will not be repeated here in the embodiments of this application.
[0040] In some embodiments of this application, the dynamic scene template can be serialized to generate a transmittable template data packet; the template data packet is then uploaded to a cloud server via a network interface to achieve template sharing. Other users can obtain the template data packet from the cloud server and perform deserialization to obtain the dynamic scene template.
[0041] In some embodiments of this application, scene semantic information of the captured preview image and scene semantic information of the image in the dynamic scene template can be extracted separately, including scene type, object category, lighting and shadow information, and depth map features. For scene type and object category, the semantic association strength is calculated through a pre-constructed scene semantic knowledge graph or word embedding model to obtain scene similarity. For lighting and shadow information, cosine similarity is calculated in the dimensions of brightness, lighting direction, lighting intensity, and color temperature to obtain lighting and shadow similarity. For depth map, the consistency of its macroscopic depth distribution is evaluated through structural similarity index or histogram matching to obtain spatial similarity. The scene similarity, lighting and shadow similarity, and spatial similarity are fused to obtain the semantic similarity of the two scene semantic information.
[0042] In some embodiments of this application, determining the placement fusion degree of the feature data of the second region corresponding to the semantic information of the second scene in the captured preview image may include: determining candidate regions in the captured preview image that can be used for feature data fusion of the second region; projecting the contour of the feature data of the second region onto the candidate regions; determining the compatibility between the projection of the contour and the object in the captured preview image to obtain the placement fusion degree.
[0043] In some embodiments of this application, when determining the placement blending degree of feature data in a captured preview image, candidate regions in the captured preview image that can be used for feature data fusion can be identified based on the composition features and object layout in the scene semantic information of the captured preview image. The outline information of the feature data in the dynamic scene template is virtually projected onto the candidate region, and its compatibility with surrounding objects in terms of size ratio, relative angle and occlusion relationship is evaluated. A quantitative score is then performed according to preset composition rules to obtain the placement blending degree.
[0044] In some embodiments of this application, when determining the matching degree corresponding to the feature data of the second region based on semantic similarity and placement fusion degree, the semantic similarity and placement fusion degree can be weighted and fused to obtain the matching degree corresponding to the feature data of the second region. The weighted fusion of semantic similarity and placement fusion degree is shown in the following formula (1): M=W1*Sim(S r eal, S o rig)+W2*Fit(D e lem,F′ c omp)(1) In formula (1), M is the matching degree corresponding to the feature data, W1 is the weight corresponding to the semantic similarity, W2 is the weight corresponding to the placement fusion degree, and Sim(S r eal, S o (rig) represents the scene semantic information S of the captured preview image. r Scene semantic information S of images in dynamic scene templates o The semantic similarity of rig, Fit(D) e lem,F′ c omp) is the feature data D e The compositional features of the lem and the preview image F′ c The degree of integration between OMPs.
[0045] In this embodiment, by performing multi-dimensional matching degree calculations, the inefficient traditional methods based on keyword search or manual browsing are completely abandoned. Instead of simply comparing surface-level image features, the matching delves into the intrinsic logic and semantics of the scene. This allows for the accurate identification of dynamic scene templates that are highly coordinated with the current shooting scene in terms of atmosphere, lighting, composition, and content. This ensures that the dynamic scene templates recommended to the user are the most likely to produce high-quality composite effects. This not only greatly enhances the user experience but also guarantees the success rate of subsequent fusion steps and the quality of the final generated image from the source.
[0046] In the embodiments of this application, a high degree of automation and intelligence can be achieved from material extraction to final shooting. By understanding the scene semantics of the image corresponding to the feature data and the shooting preview image, the generation, matching and recommendation of dynamic scene templates can be completed automatically. The post-compositing process that requires complex manual operation is transformed into an intuitive interaction that can be completed at the front end of shooting, which greatly reduces the technical threshold and operational burden for users.
[0047] In some possible implementations of this application, after determining the matching degree corresponding to the feature data of multiple regions, the feature data of the region with the highest matching degree can be used as the first feature data; or, the feature data of the regions corresponding to the first n matching degrees after sorting the matching degrees from largest to smallest can be recommended to the user, and the user can select from the feature data of the recommended n regions and use the feature data of the selected region as the first feature data.
[0048] Step 104: Fuse the first feature data with the captured preview image to obtain the first image.
[0049] In some embodiments of this application, step 104 may include: adjusting the first color parameter information of the first feature data according to the light and shadow information of the captured preview image to obtain second color parameter information; wherein, the color parameter information includes at least one of brightness, contrast, hue and saturation; performing a geometric transformation on the second color parameter information according to the spatial information of the captured preview image to obtain third color parameter information; fusing the third color parameter information with the virtual shadow corresponding to the light and shadow information to obtain first fused data; and fusing the first fused data with the captured preview image to obtain a first image.
[0050] In some embodiments of this application, in step 104, the brightness, contrast, hue, and saturation of the first feature data can be adjusted based on the light and shadow information of the captured preview image to obtain adjusted feature data of brightness, contrast, hue, and saturation; geometric transformation is performed on the adjusted feature data of brightness, contrast, hue, and saturation based on the spatial information of the captured preview image to obtain geometrically transformed feature data; the geometrically transformed feature data is fused with the virtual shadow corresponding to the light and shadow information to obtain first fused data; the first fused data is fused with the captured preview image to obtain a first image.
[0051] In some embodiments of this application, adjusting the first color parameter information of the first feature data based on the light and shadow information of the captured preview image to obtain the second color parameter information may include: comparing the light and shadow information of the captured preview image with the light and shadow information corresponding to the first feature data, generating a pixel-level adjustment mapping through color gamut mapping and illumination transformation; and adjusting the first color parameter information of the pixels in the first feature data according to the pixel-level adjustment mapping to obtain the second color parameter information.
[0052] In some embodiments of this application, a pixel-level adjustment mapping is generated through color gamut mapping and illumination transformation, including: determining mapping coefficients based on the LAB mean of the captured preview image and the LAB mean of the first feature data; determining a first pixel value of the first feature data based on the mapping coefficients; determining a first illumination component of the first feature data based on the first pixel value and the reflection component of the first feature data; and determining a second illumination component based on the first illumination component, a luminance coefficient, and a contrast offset; wherein the pixel-level adjustment mapping includes the second illumination component.
[0053] In some embodiments of this application, adjusting the first color parameter information of pixels in the first feature data according to the pixel-level adjustment mapping to obtain the second color parameter information includes: determining the second pixel value of the first feature data according to the second illumination component and the reflection component.
[0054] In some embodiments of this application, the second color parameter information is geometrically transformed based on the spatial information of the captured preview image to obtain the third color parameter information, including: determining the pose of the third region in three-dimensional space based on the depth map of the captured preview image; wherein the third region is the region in the captured preview image that can be fused with the first feature data; and based on the pose, the second color parameter information is scaled and perspective distortion corrected by three-dimensional projection transformation and affine transformation to obtain the third color parameter information.
[0055] In some embodiments of this application, when adjusting the lighting and shadows, the brightness, light intensity, light direction, and color temperature contained in the scene semantic information of the captured preview image are compared with the brightness, light intensity, light direction, and color temperature contained in the lighting and shadow information of the feature data. A pixel-level adjustment map is generated through color gamut mapping and lighting transformation algorithms. Based on this pixel-level adjustment map, the brightness, contrast, hue, and saturation of each pixel in the feature data are adjusted in real time to match the light intensity and color temperature of the captured scene. At the same time, based on the estimated light direction, a virtual shadow conforming to the laws of physical projection is generated at the spatial position corresponding to the feature data to enhance the visual realism.
[0056] In some embodiments of this application, during color gamut matching, feature data can be converted from RGB to CIELAB space and based on the LAB mean (L...) of the shooting scene. real ,a real ,b real ) and the mean of feature data LAB (L obj ,a obj ,b obj Calculate the mapping coefficients, which are: K L = L real / L obj K a =a real / a obj K b =b real / b obj The LAB value of the mapped pixel is the product of the original LAB value in the feature data and the mapping coefficient. The mapped LAB value is then converted into the RGB space to complete the color gamut matching.
[0057] In some embodiments of this application, when determining the first illumination component of the first feature data based on the first pixel value and the reflection component of the first feature data, the Retinex algorithm can be used to separate the illumination component and the reflection component. The core of this algorithm is to separate the pixel value of the feature data into the illumination component and the reflection component, as shown in formula (2): L(x,y)=log(I(x,y))-log(R(x,y)) (2) In formula (2), L(x,y) is the illumination component, I(x,y) is the original pixel value, and R(x,y) is the reflection component, i.e., the inherent texture of the region.
[0058] In some embodiments of this application, when determining the second illumination component based on the first illumination component, the luminance coefficient, and the contrast offset, the second illumination component can be determined using the following formula (3): L′(x,y)= L(x,y)*K bright +b contras (3) In formula (3), L′(x,y) is the second illumination component, L(x,y) is the first illumination component, and K bright b is the real-time brightness coefficient, used to dynamically increase or decrease light intensity. contras This is a real-time contrast offset used to adjust the degree of difference between the bright and dark areas of an image.
[0059] In some embodiments of this application, when determining the second pixel value of the first feature data based on the second illumination component and the reflection component, the second pixel value can be determined by the following formula (4): I′(x,y)=exp(L′(x,y)+ log(R(x,y))(4) In formula (4), I′(x,y) is the second pixel value, L′(x,y) is the second illumination component, R(x,y) is the original pixel value, and exp is the exponential operation.
[0060] In this embodiment, the adjusted illumination component and reflection component are recombined and restored to the actual pixel value through exponential operation, thereby completing the adjustment of brightness and contrast, so that the lighting effect of the feature data is more adapted to the real-time scene.
[0061] In some embodiments of this application, when performing geometric and perspective adaptive transformations, the location and surface orientation of the region to be fused in three-dimensional space can be determined based on the depth map data in the scene semantic information of the captured preview image. Combined with camera intrinsic parameters, the feature data is scaled and perspective distortion corrected using three-dimensional projection transformation and affine transformation algorithms to ensure its spatial shape matches the depth distribution and physical structure of the region to be embedded, thus adhering to perspective imaging principles. Specifically, the three-dimensional projection transformation and affine transformation algorithms construct a three-dimensional projection transformation matrix based on a pinhole camera model to achieve perspective consistency between elements and the real-time scene. The specific process is as follows: The camera intrinsic parameter matrix F is determined by the mobile phone camera hardware parameters, where, , and These are the focal lengths along the x-axis and y-axis, respectively. and The x-axis and y-axis components of the principal point coordinates.
[0062] The rotation matrix for estimating the placement position of feature data from the scene depth map of the captured preview image. With translation vector To construct the external transformation matrix ,in, .
[0063] After transformation, the world coordinates of any point in the region Obtain image coordinates ;in, , , This is used to calculate the perspective position of the feature data in the captured preview image, ensuring that it is consistent with the scene depth corresponding to the captured preview image.
[0064] After adjustments in both lighting and geometry, the feature data is transformed into a completely new visual entity that is perfectly coordinated with the current shooting scene—the fusion element in this embodiment. This fusion element not only undergoes visual modification, but all its visual attributes are dynamically generated to match the current shooting preview image.
[0065] In this embodiment, a preview image is acquired; scene semantic analysis is performed on the preview image to obtain first scene semantic information; based on the first scene semantic information, first feature data is determined from multiple feature data; and the first feature data is fused with the preview image to obtain a first image. Thus, by determining the feature data to be fused with the preview image using the scene semantic information, and then fusing the feature data with the preview image, the quality of the fused image can be improved. Furthermore, it can significantly enhance the realism and visual harmony of the synthesized image, abandoning simple image overlay. It dynamically reshapes template elements based on the physical information of the current environment, such as light and shadow and perspective, ensuring that the fused elements can be seamlessly embedded into the new scene. This fundamentally solves common problems in related technologies, such as splicing marks and lighting mismatches, resulting in a natural and believable final image.
[0066] In some embodiments of this application, the image generation method provided in this application may further include: obtaining user feedback information on a first image; and adjusting the weights corresponding to semantic similarity and placement fusion degree according to the feedback information.
[0067] In some embodiments of this application, the user's selection behavior on the recommended dynamic scene template can be recorded, and the user's satisfaction feedback on the generated first image can be obtained to form user preference data; the user preference data can be analyzed to identify the user's selection tendency between high semantic similarity and high placement fusion; based on the selection tendency, the weight coefficients of semantic similarity and placement fusion in the weighted fusion can be dynamically adjusted to optimize the subsequent matching results.
[0068] For example, if users frequently select and highly score dynamic scene templates that share a high degree of semantic consistency with the shooting scene, even if the placement integration is not high, then the proportion of semantic similarity in the weighting will be increased accordingly. Conversely, if users prefer dynamic scene templates that bring visual impact, i.e., those with extremely high placement integration, and are less concerned about strict semantic matching of the scene, then the weight of placement integration will be increased. This adjustment process essentially allows the algorithm to learn the user's true aesthetic preferences and, through iterative optimization, find a set of weighting schemes that maximizes the prediction of user satisfaction.
[0069] The image generation method provided in this application has the ability to learn adaptively and evolve personally. It is no longer a static, rule-fixed image generation method, but an image generation method that can grow through continuous interaction with users. It continuously adjusts the weight coefficients of semantic similarity and placement fusion through user feedback, making the image generation method highly compatible with the aesthetic preferences and creative habits of specific users.
[0070] In some embodiments of this application, the image generation method provided in this application may further include: receiving a first input to the first fusion data; in response to the first input, generating second fusion data based on scene information corresponding to the position of the first input in the captured preview image; and fusing the second fusion data with the captured preview image to obtain a second image.
[0071] In some embodiments of this application, the first input is used to adjust the position of the first fused data.
[0072] In some embodiments of this application, the first input originates from a detected touch event of the user acting on the fusion element area of the captured preview image. When a drag operation is detected, a position offset vector is generated based on the touch point displacement to obtain new target position coordinates. Based on the target position coordinates, scene information corresponding to the target position coordinates is queried from the scene semantic information of the captured preview image; the feature data is readjusted based on the scene information of the target position coordinates to generate new fusion data; the new fusion data is fused with the captured preview image to obtain a second image. The process of generating new fusion data is similar to the process of generating fusion data described above, and will not be elaborated upon here. The specific process can be referred to the process of generating fusion data in the above embodiments.
[0073] In this embodiment, users can preview the fused image intuitively while shooting, and can adjust the position of the fused data in real time and preview the adjusted image. This frees users from tedious post-editing, allowing them to focus more on composition and creative expression before shooting, greatly enhancing the creative fun and immediacy of photography.
[0074] The image generation method provided in this application can be executed by an image generation device. This application uses an image generation device executing the image generation method as an example to illustrate the image generation device provided in this application.
[0075] Figure 3 This is a schematic diagram of the structure of an image generation apparatus provided in some embodiments of this application. The image generation apparatus 300 includes: Display module 301 is used to display the captured preview image; Analysis module 302 is used to perform scene semantic analysis on the captured preview image to obtain the first scene semantic information of the captured preview image; The first determining module 303 is used to determine the first feature data from the feature data of multiple regions based on the semantic information of the first scene; The fusion module 304 is used to fuse the first feature data with the captured preview image to obtain the first image.
[0076] In some embodiments of this application, the analysis module 302 is specifically used for: Scene semantic analysis is performed on the captured preview image to obtain scene feature information, light and shadow information, and spatial information of the captured preview image; Based on scene feature information, lighting and shadow information, and spatial information, the first scene semantic information is generated.
[0077] In some embodiments of this application, the first determining module 303 includes: The first determining submodule is used to determine the semantic similarity between the semantic information of the first scene and the semantic information of the second scene; wherein, the semantic information of the second scene is any one of the semantic information of multiple third scene scenes, and the multiple semantic information of the third scene corresponds one-to-one with the feature data of multiple regions; The second determining submodule is used to determine the placement and fusion degree of the feature data of the second region corresponding to the semantic information of the second scene in the captured preview image; The third determination submodule is used to determine the matching degree of the feature data corresponding to the second region based on semantic similarity and placement fusion degree; The fourth determination submodule is used to determine the first feature data based on the matching degree corresponding to the feature data of multiple regions.
[0078] In some embodiments of this application, the second determining submodule is specifically used for: Identify candidate regions in the captured preview image that can be used for feature data fusion in the second region; Project the outline of the second region onto the candidate region; The degree of compatibility between the projection of the outline and the object in the captured preview image is determined to obtain the placement blending degree.
[0079] In some embodiments of this application, the fusion module 304 includes: The adjustment submodule is used to adjust the first color parameter information of the first feature data according to the light and shadow information of the captured preview image to obtain the second color parameter information; wherein, the color parameter information includes at least one of brightness, contrast, hue and saturation; The transformation submodule is used to perform geometric transformation on the second color parameter information based on the spatial information of the captured preview image to obtain the third color parameter information; The fusion submodule is used to fuse the third color parameter information with the virtual shadow corresponding to the light and shadow information to obtain the first fusion data; and to fuse the first fusion data with the captured preview image to obtain the first image.
[0080] In some embodiments of this application, the adjustment submodule includes: The generation unit is used to compare the light and shadow information of the captured preview image with the light and shadow information corresponding to the first feature data, and generate a pixel-level adjustment mapping through color gamut mapping and illumination transformation; The adjustment unit is used to adjust the first color parameter information of the pixels in the first feature data according to the pixel-level adjustment mapping to obtain the second color parameter information.
[0081] In some embodiments of this application, the generation unit is specifically used for: The mapping coefficients are determined based on the mean LAB value of the captured preview image and the mean LAB value of the first feature data. The first pixel value of the first feature data is determined based on the mapping coefficient. The first illumination component of the first feature data is determined based on the first pixel value and the reflection component of the first feature data. The second illumination component is determined based on the first illumination component, the luminance coefficient, and the contrast offset; wherein, the pixel-level adjustment mapping includes the second illumination component.
[0082] In some embodiments of this application, the transformation submodule is specifically used for: Based on the depth map of the captured preview image, the pose of the third region in three-dimensional space is determined; wherein, the third region is the region in the captured preview image that can be fused with the first feature data; Based on the posture, the second color parameter information is scaled and perspective distortion corrected by three-dimensional projection transformation and affine transformation to obtain the third color parameter information.
[0083] In some embodiments of this application, the image generation apparatus 300 further includes: The receiving module is used to receive the first input to the first fused data; The generation module is used to generate second fused data in response to the first input, based on the scene information corresponding to the position of the first input in the captured preview image; Accordingly, the fusion module 304 is also used to: fuse the second fusion data with the captured preview image to obtain the second image.
[0084] The image generation device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.
[0085] The image generation device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.
[0086] The image generation apparatus provided in this application embodiment can achieve... Figure 1 and Figure 2 The various processes implemented in the image generation method embodiment will not be described again here to avoid repetition.
[0087] Optionally, such as Figure 4 As shown, this application embodiment also provides an electronic device 400, including a processor 401 and a memory 402. The memory 402 stores a program or instructions that can run on the processor 401. When the program or instructions are executed by the processor 401, they implement the various steps of the image generation method embodiment provided in this application embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0088] Figure 5 These are schematic diagrams of the hardware structure of electronic devices provided in some embodiments of this application.
[0089] The electronic device 500 includes, but is not limited to, components such as: radio frequency unit 501, network module 502, audio output unit 503, input unit 504, sensor 505, display unit 506, user input unit 507, interface unit 508, memory 509, and processor 510.
[0090] Those skilled in the art will understand that the electronic device 500 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 510 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 5 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0091] The display unit 506 is used to: display the captured preview image; The processor 510 is used to: perform scene semantic analysis on the captured preview image to obtain first scene semantic information of the captured preview image; determine first feature data from feature data of multiple regions based on the first scene semantic information; and fuse the first feature data with the captured preview image to obtain a first image.
[0092] In some embodiments of this application, the processor 510 is specifically used for: Scene semantic analysis is performed on the captured preview image to obtain scene feature information, light and shadow information, and spatial information of the captured preview image; based on the scene feature information, light and shadow information, and spatial information, the first scene semantic information is generated.
[0093] In some embodiments of this application, the processor 510 is specifically used for: Determine the semantic similarity between the semantic information of the first scene and the semantic information of the second scene; wherein, the semantic information of the second scene is any one of the semantic information of multiple third scenes, and the semantic information of multiple third scenes corresponds one-to-one with the feature data of multiple regions; Determine the placement and fusion degree of the feature data of the second region corresponding to the semantic information of the second scene in the captured preview image; The matching degree of the feature data of the second region is determined based on semantic similarity and placement fusion degree. The first feature data is determined based on the matching degree of the feature data corresponding to multiple regions.
[0094] In some embodiments of this application, the processor 510 is specifically used for: Identify candidate regions in the captured preview image that can be used for feature data fusion in the second region; Project the outline of the second region onto the candidate region; The degree of compatibility between the projection of the outline and the object in the captured preview image is determined to obtain the placement blending degree.
[0095] In some embodiments of this application, the processor 510 is specifically used for: Based on the light and shadow information of the captured preview image, the first color parameter information of the first feature data is adjusted to obtain the second color parameter information; wherein, the color parameter information includes at least one of brightness, contrast, hue and saturation; Based on the spatial information of the captured preview image, the second color parameter information is geometrically transformed to obtain the third color parameter information; The third color parameter information is fused with the virtual shadow corresponding to the light and shadow information to obtain the first fused data; The first fused data is fused with the captured preview image to obtain the first image.
[0096] In some embodiments of this application, the processor 510 is specifically used for: The light and shadow information of the captured preview image is compared with the light and shadow information corresponding to the first feature data, and a pixel-level adjustment mapping is generated through color gamut mapping and illumination transformation; Based on the pixel-level adjustment mapping, the first color parameter information of the pixels in the first feature data is adjusted to obtain the second color parameter information.
[0097] In some embodiments of this application, the processor 510 is specifically used for: The mapping coefficients are determined based on the mean LAB value of the captured preview image and the mean LAB value of the first feature data. The first pixel value of the first feature data is determined based on the mapping coefficient. The first illumination component of the first feature data is determined based on the first pixel value and the reflection component of the first feature data. The second illumination component is determined based on the first illumination component, the luminance coefficient, and the contrast offset; wherein, the pixel-level adjustment mapping includes the second illumination component.
[0098] In some embodiments of this application, the processor 510 is specifically used for: Based on the depth map of the captured preview image, the pose of the third region in three-dimensional space is determined; wherein, the third region is the region in the captured preview image that can be fused with the first feature data; Based on the posture, the second color parameter information is scaled and perspective distortion corrected by three-dimensional projection transformation and affine transformation to obtain the third color parameter information.
[0099] In some embodiments of this application, the user input unit 507 is used for: Receive the first input to the first fused data; Accordingly, the processor 510 is further configured to: generate second fusion data in response to the first input, based on scene information corresponding to the position of the first input in the captured preview image; and fuse the second fusion data with the captured preview image to obtain a second image.
[0100] It should be understood that, in this embodiment, the input unit 504 may include a graphics processing unit (GPU) 5041 and a microphone 5042. The GPU 5041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 506 may include a display panel 5061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 507 includes at least one of a touch panel 5071 and other input devices 5072. The touch panel 5071 is also called a touch screen. The touch panel 5071 may include a touch detection device and a touch controller. Other input devices 5072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0101] The memory 509 can be used to store software programs and various data. The memory 509 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 509 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 509 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0102] Processor 510 may include one or more processing units; optionally, processor 510 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 510.
[0103] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the image generation method provided in this application and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0104] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0105] This application also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the image generation method provided in this application and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0106] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0107] This application also provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the image generation method embodiment provided in this application, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0108] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0109] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they 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 this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0110] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. An image generation method, characterized in that, The method includes: Displays a preview image of the captured image; Perform scene semantic analysis on the captured preview image to obtain the first scene semantic information of the captured preview image; Based on the semantic information of the first scene, the first feature data is determined from the feature data of multiple regions; The first feature data is fused with the captured preview image to obtain the first image.
2. The method according to claim 1, characterized in that, The step of performing scene semantic analysis on the captured preview image to obtain the first scene semantic information of the captured preview image includes: Scene semantic analysis is performed on the captured preview image to obtain scene feature information, light and shadow information, and spatial information of the captured preview image; The first scene semantic information is generated based on the scene feature information, the light and shadow information, and the spatial information.
3. The method according to claim 1, characterized in that, The step of determining the first feature data from feature data of multiple regions based on the first scene semantic information includes: Determine the semantic similarity between the semantic information of the first scene and the semantic information of the second scene; wherein, the semantic information of the second scene is any one of the semantic information of a plurality of third scene semantic information, and the plurality of third scene semantic information corresponds one-to-one with the feature data of the plurality of regions; Determine the placement and fusion degree of the feature data of the second region corresponding to the semantic information of the second scene in the captured preview image; Based on the semantic similarity and the placement fusion degree, the matching degree corresponding to the feature data of the second region is determined; The first feature data is determined based on the matching degree corresponding to the feature data of the multiple regions.
4. The method according to claim 3, characterized in that, The determination of the placement and blending degree of feature data of the second region corresponding to the semantic information of the second scene in the captured preview image includes: Determine candidate regions in the captured preview image that can be used for feature data fusion with the second region; Project the outline of the second region onto the candidate region; The degree of compatibility between the projection of the contour and the object in the captured preview image is determined to obtain the placement blending degree.
5. The method according to any one of claims 1 to 4, characterized in that, The step of fusing the first feature data with the captured preview image to obtain the first image includes: Based on the light and shadow information of the captured preview image, the first color parameter information of the first feature data is adjusted to obtain the second color parameter information; wherein, the color parameter information includes at least one of brightness, contrast, hue and saturation; Based on the spatial information of the captured preview image, the second color parameter information is geometrically transformed to obtain the third color parameter information; The third color parameter information is fused with the virtual shadow corresponding to the light and shadow information to obtain the first fused data; The first fused data is fused with the captured preview image to obtain the first image.
6. The method according to claim 5, characterized in that, The step of adjusting the first color parameter information of the first feature data to obtain the second color parameter information based on the light and shadow information of the captured preview image includes: The light and shadow information of the captured preview image is compared with the light and shadow information corresponding to the first feature data, and a pixel-level adjustment mapping is generated through color gamut mapping and illumination transformation; According to the pixel-level adjustment mapping, the first color parameter information of the pixels in the first feature data is adjusted to obtain the second color parameter information.
7. The method according to claim 6, characterized in that, The process of generating pixel-level adjustment mappings through color gamut mapping and illumination transformation includes: The mapping coefficient is determined based on the mean LAB value of the captured preview image and the mean LAB value of the first feature data; The first pixel value of the first feature data is determined based on the mapping coefficient. Based on the first pixel value and the reflection component of the first feature data, the first illumination component of the first feature data is determined; The second illumination component is determined based on the first illumination component, the luminance coefficient, and the contrast offset; wherein the pixel-level adjustment mapping includes the second illumination component.
8. The method according to claim 5, characterized in that, The step of performing a geometric transformation on the second color parameter information based on the spatial information of the captured preview image to obtain the third color parameter information includes: Based on the depth map of the captured preview image, the pose of the third region in three-dimensional space is determined; wherein, the third region is the region in the captured preview image that can be fused with the first feature data; Based on the posture, the second color parameter information is scaled and perspective distortion corrected by three-dimensional projection transformation and affine transformation to obtain the third color parameter information.
9. The method according to claim 5, characterized in that, The method further includes: Receive a first input to the first fused data; In response to the first input, second fusion data is generated based on the scene information corresponding to the position of the first input in the captured preview image; The second fused data is fused with the captured preview image to obtain a second image.
10. An image generation apparatus, characterized in that, The device includes: The display module is used to display the captured preview image; The analysis module is used to perform scene semantic analysis on the captured preview image to obtain the first scene semantic information of the captured preview image; The first determining module is used to determine first feature data from feature data of multiple regions based on the semantic information of the first scene; The fusion module is used to fuse the first feature data with the captured preview image to obtain a first image.
11. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing programs or instructions that can run on the processor, the programs or instructions being executed by the processor to implement the steps of the image generation method as described in any one of claims 1-9.
12. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the image generation method as described in any one of claims 1-9.