Image processing method and electronic device
Patent Information
- Application Number
- CN202610779037.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-01
- Publication Date
- 2026-10-30
AI Technical Summary
但是,这种方案的色差调整效果较差
[0009]应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开的技术方案。
Smart Images

Figure CN123015703A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to, but is not limited to, the field of image processing technology, and in particular to an image processing method and an electronic device. Background Technology
[0002] When an object is imaged, the different refractive indices of the lens for different colors of light result in chromatic aberration, which directly affects the image's appearance. This chromatic aberration is particularly pronounced in bright, high-contrast scenes. Some techniques utilize adjustment platforms to modify image parameters to mitigate chromatic aberration. However, this approach often yields poor results in this regard. Summary of the Invention
[0003] In view of the above, the present disclosure provides at least one image processing method and an electronic device.
[0004] The technical solution of this disclosure embodiment is implemented as follows: On one hand, this disclosure provides an image processing method, including: acquiring a first image; determining a scene of the first image based on multispectral image data of the first image; determining correction parameters corresponding to the first image based on the scene of the first image; processing the first image based on the correction parameters to obtain a second image for output; the color difference value of the second image is less than the color difference value of the first image.
[0005] On the other hand, embodiments of this disclosure provide an electronic device, including: a processor, a memory, and a communication bus; the communication bus is used to realize a communication connection between the processor and the memory; the processor is used to execute the following steps in the memory: acquiring a first image; determining the scene of the first image based on the multispectral image data of the first image; determining the correction parameters corresponding to the first image based on the scene of the first image; processing the first image based on the correction parameters to obtain a second image for output; the color difference value of the second image is less than the color difference value of the first image.
[0006] In another aspect, embodiments of this disclosure provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements some or all of the steps in the above-described method.
[0007] In another aspect, embodiments of this disclosure provide a computer program including computer-readable code, which, when executed in an electronic device, causes a processor in the electronic device to perform some or all of the steps in the above-described method.
[0008] In another aspect, embodiments of this disclosure provide a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by an electronic device, it implements some or all of the steps in the above-described method.
[0009] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of this disclosure. Attached Figure Description
[0010] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the specification, serve to illustrate the technical solutions of this disclosure.
[0011] Figure 1 A schematic diagram of the implementation flow of an image processing method provided in this embodiment of the present disclosure. Figure 1 ; Figure 2 A schematic diagram of the hardware entity of an electronic device provided in an embodiment of this disclosure; Figure 3 This is a schematic diagram illustrating the process of determining the scene and purple fringing removal parameters in an image processing method provided in this embodiment of the present disclosure; Figure 4 A schematic diagram of the implementation flow of an image processing method provided in this embodiment of the present disclosure. Figure 2 ; Figure 5 A schematic diagram of the implementation flow of an image processing method provided in this embodiment of the present disclosure. Figure 3 ; Figure 6 This is a schematic diagram of the composition structure of an image processing apparatus provided in an embodiment of the present disclosure. Detailed Implementation
[0012] To make the objectives, technical solutions, and advantages of this disclosure clearer, the technical solutions of this disclosure are further described in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limitations on this disclosure. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0013] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0014] The terms “first / second / third” are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that “first / second / third” may be interchanged in a specific order or sequence where permitted, so that the embodiments of this disclosure described herein can be implemented in an order other than that illustrated or described herein.
[0015] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains. The terminology used herein is for descriptive purposes only and is not intended to limit the scope of this disclosure.
[0016] This disclosure provides an image processing method that can be applied to electronic devices. For example... Figure 1 As shown, the method includes the following steps 101 to 104: Step 101: Acquire the first image.
[0017] The first image is the one whose color difference needs to be adjusted. For example, the first image is an image containing purple fringing.
[0018] In some implementations, a camera can be used to capture the first image. This camera may include, but is not limited to, a camera, a mobile phone, a drone, or a satellite remote sensing device.
[0019] In some implementations, a scanning sensor can be used to acquire the first image. This scanning sensor may include a multispectral scanner or a multispectral sensor.
[0020] In some implementations, a software algorithm can be used to generate the first image.
[0021] Step 102: Determine the scene of the first image based on the multispectral image data of the first image.
[0022] Multispectral image data includes image data of a first image across multiple spectral channels. Each spectral channel records the reflectance intensity of a specific wavelength. Multiple spectral channels may include, but are not limited to: ultraviolet channels, visible light channels (blue, green, yellow, red), near-infrared channels, short-wave infrared channels, mid-wave infrared channels, and long-wave infrared channels. The spectral bands of the multispectral image can be discrete and discontinuous. The scene of the image is used to characterize the objects contained in the image, their materials, and the type of light. For example, the scene of the image may include, but is not limited to: portraits, macro, plants, landscapes, night scenes / backlighting, architecture / cities, water / glass, metal / high reflectivity, etc.
[0023] In some implementations, a rotatable filter wheel on the imaging device can be used to switch between multiple bands to capture multispectral image data of the first image.
[0024] In some implementations, multispectral imaging technology can be used to acquire multispectral image data of the first image.
[0025] In some implementations, software algorithms can be used to add multiple spectral dimensions to the first image to obtain multispectral image data of the first image.
[0026] Step 103: Based on the scene of the first image, determine the correction parameters corresponding to the first image.
[0027] In some implementations, the correction parameters for the first image can be determined based on the scene of the first image and the correspondence between the image scene and the correction parameters.
[0028] In some implementations, correction parameters for the first image can be determined based on the scene of the first image and the color difference value of the first image.
[0029] In some implementations, correction parameters for the first image can be determined based on the scene of the first image and the color deviation of different spectral channels.
[0030] Step 104: Process the first image based on the correction parameters to obtain the second image for output; the color difference value of the second image is less than the color difference value of the first image.
[0031] The second image is the image after color difference adjustment. For example, the second image is an image without purple fringing. The color difference value of the second image is less than that of the first image, indicating that the color consistency of the second image is better than that of the first image, that is, the color of the second image is superior.
[0032] In some implementations, the entire region of the first image can be processed based on correction parameters to obtain a second image for output.
[0033] In some implementations, a portion of the first image can be processed based on correction parameters to obtain a second image for output. For example, the purple-edged region in the first image can be processed based on correction parameters to obtain the second image for output.
[0034] In this embodiment, the acquired first image is adjusted in real time based on the multispectral image data of the first image to obtain a second image for output. This real-time adjustment of color difference during the shooting process eliminates color deviations caused by changes in lighting, sensor differences, and atmospheric effects, resulting in output image data with consistent color. This improves image output quality, enabling immediate use upon capture and reducing information loss due to post-processing. Determining the scene of the first image based on its multispectral image data allows for accurate scene identification. This enables the determination of more suitable correction parameters for the first image, which in turn allow for precise adjustment of color difference. This dynamic adjustment of image color difference based on scene differences improves the effectiveness of color difference adjustment and is applicable to image acquisition and processing in various scenarios.
[0035] In some embodiments, step 102 above can be implemented in at least the following ways: The first approach determines the scene of the first image based on the spectral features and / or color consistency of the multispectral image data. The spectral features are used to represent the spectral behavior of the first image.
[0036] Spectral features are used to represent the characteristic information generated by the interaction between objects and light in the first image. Spectral features are inherent properties of objects, similar to human fingerprints. Different substances (such as water surfaces, buildings, and glass) absorb, reflect, and scatter light of different wavelengths when illuminated, forming characteristic information such as wavelength, intensity, and shape; this characteristic information is called spectral features. Color consistency in multispectral image data is used to represent the degree of color similarity of objects in the first image across multiple spectral channels.
[0037] The second approach involves determining at least one material type included in the first image based on multispectral image data, and then determining the scene of the first image based on the material type.
[0038] The third method involves determining the illumination pattern of the first image based on multispectral image data, and then determining the scene of the first image based on the illumination pattern.
[0039] In some embodiments, step 102 described above can be implemented by the following steps A1 to A4: Step A1: Construct spectral vectors for multiple pixels based on image data of multiple pixels in the first image within the corresponding bands of multiple spectral channels; the multispectral image data includes image data of multiple pixels in the first image within the corresponding bands of multiple spectral channels.
[0040] In some implementations, for each pixel in the first image, a spectral vector is constructed based on physical measurements of each pixel within the corresponding bands of multiple spectral channels. These physical measurements represent the intensity of an object's reflection / emission of electromagnetic radiation at a specific wavelength. The physical measurements within the corresponding bands of multiple spectral channels can be simply referred to as multi-band values.
[0041] In some implementations, for each pixel in the first image, the physical measurements of each pixel within the corresponding bands of multiple spectral channels can be arranged into a one-dimensional vector according to band order to obtain the spectral vector of each pixel. For example, the spectral vector of each pixel can be represented as: S=(R,G,B,NIR,UV); where R is the red visible light band, G is the green visible light band, B is the blue visible light band, NIR is the near-infrared band, and UV is the ultraviolet band.
[0042] Step A2: Determine the color consistency of the first image across multiple spectral channels based on the difference between the spectral vectors of multiple pixels and the spectral vector of a reference pixel; the reference pixel is the pixel in the region where the object is located.
[0043] The difference between the spectral vector of each pixel and the spectral vector of the reference pixel is used to reflect the degree of spectral similarity between each pixel and the reference pixel, and can be used to distinguish true colors from anomalous artifacts.
[0044] In some implementations, the spectral shape difference between the multiple pixels and the reference pixel can be determined based on the spectral vectors of the multiple pixels and the spectral vector of the reference pixel; based on the spectral shape difference, the color consistency of the first image in each spectral channel can be determined. The spectral shape difference can be determined based on the angle between the spectral vectors of the multiple pixels and the spectral vector of the reference pixel in a high-dimensional space.
[0045] In some implementations, the numerical differences between the multiple pixels and the reference pixel in each spectral channel can be determined based on the spectral vectors of multiple pixels and the reference pixel; based on these numerical differences, the color consistency of the first image in each spectral channel can be determined. The numerical differences can be obtained by calculating the spectral vectors of the multiple pixels and the reference pixel using an error function. Error functions include, but are not limited to, root mean square error, mean absolute error, and relative error.
[0046] In some implementations, the spectral vector can be viewed as a probability distribution, and the divergence between the multiple pixels and the reference pixel in each spectral channel can be determined based on the spectral vectors of multiple pixels and the reference pixel; based on the divergence, the color consistency of the first image in each spectral channel can be determined.
[0047] Step A3: Based on color consistency, determine at least one lighting mode.
[0048] An image may contain multiple scenes, and the lighting patterns of different scenes differ. For example, in backlit scenes: RGB inconsistencies often appear in bright edge areas, but remain consistent in NIR → NIR is relatively stable; in night scenes: the overall illumination is low, but artificial light sources are high in UV or specific wavelengths → color consistency is significantly compromised; in HDR scenes: spectral consistency decreases (overflow) in local areas, but is normal in other areas; therefore, the lighting pattern can be inferred from color consistency.
[0049] In some implementations, the correspondence between reference color consistency and illumination patterns can be obtained through multiple experiments. This correspondence includes the correspondence between reference color consistency and illumination patterns for different combinations of spectral channels. For example, if RGB color consistency is greater than a first threshold and NIR color consistency is less than a second threshold, the corresponding illumination pattern is backlighting. RGB color consistency greater than the first threshold indicates RGB inconsistency; NIR color consistency less than the second threshold indicates NIR color consistency. Thus, at least one illumination pattern matching the color consistency can be determined from the correspondence between reference color consistency and illumination patterns.
[0050] In some implementations, a mapping function between color consistency and lighting pattern can be obtained through multiple trials; thus, the mapping function can be used to process color consistency to obtain at least one lighting pattern.
[0051] Step A4: Determine at least one scene of the first image based on at least one lighting pattern.
[0052] Different lighting modes can correspond to the same or different scenes.
[0053] In some implementations, the correspondence between reference lighting patterns and scenes can be obtained through multiple trials. This correspondence includes multiple correspondences between reference lighting patterns and multiple scenes. Thus, from the correspondences between reference lighting patterns and scenes, the scene matching each lighting pattern can be determined, resulting in at least one scene.
[0054] In this embodiment, by analyzing the differences between the spectral vectors of multiple pixels and the spectral vector of a reference pixel, the color consistency of the first image across multiple spectral channels can be accurately measured. This method, which compares the differences between the spectral vectors of multiple pixels and the reference pixel, establishes a multi-dimensional color consistency measurement index. Compared to the traditional RGB three-channel approach, utilizing multiple spectral channels captures richer spectral information, eliminates noise interference from a single channel, and improves the robustness of color representation. Since color consistency reflects changes in lighting conditions, it allows for the inference of lighting patterns from color consistency. It does not rely on multiple images or known objects; lighting attributes can be inferred solely from the color consistency within a single image, making it highly applicable. Because different scenes have different lighting patterns, the scene contained in the first image can be accurately inferred from the lighting pattern. Compared to directly inferring the scene from image data, this disclosure enhances generalization ability and interpretability by using the lighting pattern as an intermediate physical variable. Therefore, intelligent inference of image scenes is achieved through the color consistency of the first image across multiple spectral channels, improving the image processing speed.
[0055] In some embodiments, step 102 described above can be implemented by the following steps B1 to B3: Step B1: Analyze the multispectral image data to obtain the spectral features of the first image in multiple spectral channels; the spectral features include at least one of the following: spectral vector, spectral shape, spectral difference features, spectral statistical features, and spectral spatial joint features.
[0056] Spectral features are used to represent the band information, statistical information, difference information, and trends of the first image across multiple spectral channels. Spectral vectors include multi-band values (e.g., R, G, B, NIR, UV) of pixels or local regions in the first image. Spectral shape includes features such as the relative intensity of different bands and the ratios between bands, for example, R / G, NIR / G, UV / B, etc. Spectral difference features include the spectral difference between each pixel and its surrounding pixels, as well as the similarity to a spectral library (human skin, vegetation, sky, metallic reflections, etc.). Spectral statistical features include the multi-spectral mean and variance of local regions in the first image. Spectral spatial joint features include the multi-spectral mean and variance of local regions, and the correlation between bands.
[0057] In some implementations, multispectral image data can be analyzed using a preset analysis unit to obtain the spectral features of the first image in multiple spectral channels. The preset analysis unit includes at least one of pixel units, local region units, and image units.
[0058] Step B2: Based on spectral characteristics, determine at least one material type.
[0059] An image can contain multiple objects, each with its own or different materials. Material type refers to the classification of the physical and optical properties of an object's surface, which determines how light interacts with matter. For example, if materials are classified according to their reflection mechanism, material types can include, but are not limited to: diffuse reflectors (such as paper and concrete), specular reflectors (such as metal and water surfaces), and mixed reflectors (such as polished stone). If materials are classified according to their surface structure, material types can include, but are not limited to: smooth, rough, anisotropic (such as brushed metal), and porous (such as sponge).
[0060] The correspondence between material type and spectral characteristics is essentially a macroscopic manifestation of the microscopic physicochemical properties of a substance on the electromagnetic spectrum. For example, for materials such as metals and semiconductors, through electronic transitions, the spectral characteristics are characterized by strong absorption at specific wavelengths (narrow band or wide band). For materials such as aqueous substances, organic matter, and minerals, through molecular transitions, the spectral characteristics are characterized by characteristic absorption peaks in the infrared region (1 to 15 μm).
[0061] In some implementations, the correspondence between reference spectral features and material types can be obtained through multiple experiments; thus, at least one material type matching the spectral features can be determined from the correspondence between reference spectral features and material types.
[0062] In some implementations, a material prediction model can be used to process spectral features to obtain at least one material type.
[0063] Step B3: Determine at least one scene of the first image based on at least one material type.
[0064] In some implementations, the correspondence between reference material types and scenes can be obtained through multiple trials. This correspondence includes multiple correspondences between reference material types and multiple scenes. Thus, from the correspondences between reference material types and scenes, at least one scene matching at least one material type can be determined.
[0065] In this embodiment, by analyzing multispectral image data, the spectral features of the first image in multiple spectral channels can be obtained. These spectral features can record the interaction between objects and light, reflecting the physical structure. Compared to RGB three-channel, multispectral image data extends the spectral features to N dimensions, increasing the richness of the spectral features. Because the spectral features are extended to N dimensions, their feature richness is high. Therefore, the material type contained in the first image can be inferred based on the spectral features, greatly improving material differentiation and enabling the identification of "metachromatic" materials that appear to be the same color but have different spectra. Since objects with different materials exist in different scenes, the scene contained in the first image can be accurately inferred based on the material type.
[0066] In some embodiments, step 102 described above can be implemented by the following steps C1 to C3: Step C1: Based on the image data of multiple pixels in the first image within the corresponding bands of multiple spectral channels, construct the spatial features of the first image in multiple spectral channels; the multispectral image data includes the image data of multiple pixels in the first image within the corresponding bands of multiple spectral channels; the spatial features are used to reflect the spatial distribution of the first image in multiple spectral channels.
[0067] Spatial features refer to the geometric, textural, shape, and structural attributes of pixels in the first image in terms of spatial distribution. These features share commonalities across different spectral channels, but also exhibit significant differences. For example, the spatial features of the visible light channel are: vegetation appears green, water appears blue or black, the outlines of buildings and the direction of roads are clear, and different colored features (such as red roofs and green grass) can be distinguished. The spatial features of the near-infrared channel are: vegetation has increased reflectivity, resulting in significant contrast with non-vegetated features; water has strong absorption and appears pure black; and waterway boundaries are clear. Spatial features include at least texture differences and brightness differences.
[0068] In some implementations, spatial features of each spectral channel can be extracted from image data of multiple pixels in the first image within the corresponding band of each spectral channel; the spatial features include at least one of first-order statistical features, second-order statistical features, edge and contour features, and shape and topological features; cross-channel feature fusion is performed on the spatial features of multiple spectral channels to obtain fused features; the spectral features and fused features are jointly processed to obtain spatial features; the feature fusion includes at least one of pixel-level fusion, feature-level fusion, and decision-level fusion.
[0069] First-order statistical features describe the statistical distribution of grayscale values of a single pixel. Second-order statistical features describe the spatial relationship between a pixel and its neighboring pixels, including the gray-level co-occurrence matrix and local binary pattern (LBP). Edge and contour features describe the boundary information of an object. Shape and topological features describe the overall shape and spatial structure of an object.
[0070] In some implementations, pixel-level fusion can be achieved by fusing pixel values from multiple spectral channels to obtain a fused image, and then extracting fusion features from the fused image. Feature-level fusion can be achieved by stitching together spatial features from multiple spectral channels to obtain unified fusion features. Decision-level fusion can be achieved by classifying and recognizing image data from each spectral channel to obtain recognition results, and then fusing the recognition results from multiple spectral channels to obtain fusion features.
[0071] In some implementations, image data of multiple pixels in a first image within corresponding bands of multiple spectral channels can be input into a feature extraction network to output multidimensional features. These multidimensional features include at least one of low-dimensional, mid-dimensional, and high-dimensional features. Multi-scale fusion of the multidimensional features yields the spatial features of the first image across multiple spectral channels. The feature extraction network may include, but is not limited to, multi-branch networks or three-dimensional convolutional neural networks (3D CNNs).
[0072] Low-dimensional features are used to represent the edges and textures of objects in the first image. Mid-dimensional features are used to represent the shape and structure of objects in the first image. High-dimensional features are used to represent the high-level semantic features of objects in the first image.
[0073] Step C2: Analyze the multispectral image data to obtain the spectral features of the first image in multiple spectral channels; the spectral features include at least one of the following: spectral vector, spectral shape, spectral difference features, spectral statistical features, and spectral spatial joint features.
[0074] Here, step C2 corresponds to step B1 in the aforementioned embodiment. When implementing it, the implementation method of step B1 can be referred to. This disclosure embodiment will not repeat the details.
[0075] In some implementations, multispectral image data can be analyzed using a preset analysis unit to obtain the spectral features of the first image in multiple spectral channels. The preset analysis unit includes at least one of pixel units, local region units, and image units.
[0076] Step C3: Based on spatial and spectral features, determine at least one scene of the first image.
[0077] In some implementations, spectral and spatial features can be input into a scene recognition network, which outputs at least one scene and a confidence score for each scene. The scene recognition network may include, but is not limited to, multi-branch classifiers and small neural networks.
[0078] For example, if a large number of "bright but multispectral inconsistent" edges are detected, the probability of outputting a backlight / high contrast scene is high; if the overall NIR reflectance is high and the band changes are smooth, the probability of outputting a plant scene is high; if the overall brightness is low but UV / NIR is prominent in a specific position, the probability of outputting a night scene is high.
[0079] In this embodiment of the disclosure, spectral features are used to represent the band features of the first image, and spatial features are used to represent the geometric, texture, shape and structural attributes of the first image. By combining spectral features and spatial features, mutual verification and enhancement can be achieved in both physical attribute recognition and spatial semantic understanding. This effectively overcomes the limitations of single features being susceptible to interference and difficult to distinguish visually similar scenes, and achieves more accurate and robust recognition and inference of image scenes.
[0080] In some embodiments, step 102 described above can be implemented by the following steps D1 to D4: Step D1: Determine the color consistency of the first image across multiple spectral channels.
[0081] Here, step D1 corresponds to the aforementioned steps A1 to A2. When implementing it, the implementation method of the aforementioned steps A1 to A2 can be referred to. This embodiment of the present disclosure will not repeat the details.
[0082] Step D2: Determine the spectral features of the first image in multiple spectral channels.
[0083] Here, step D2 corresponds to the aforementioned step B1, and its implementation can refer to the aforementioned implementation method of step B1. This embodiment of the present disclosure will not repeat the details.
[0084] Step D3: Determine the spatial features of the first image in multiple spectral channels. Here, step D32 corresponds to the aforementioned step C1. When implementing it, the implementation method of the aforementioned step C1 can be referred to. This embodiment of the present disclosure will not repeat it here.
[0085] Step D4: Based on the color consistency, spectral features, and spatial features of the first image across multiple spectral channels, determine at least one scene of the first image.
[0086] In some implementations, at least one scene of the first image is determined by a scene recognition model based on the color consistency, spectral features, and spatial features of the first image across multiple spectral channels.
[0087] In this embodiment of the disclosure, a multi-dimensional joint analysis framework is constructed by integrating the color consistency (measuring the degree of difference between spectral vectors between pixels to reflect the intrinsic relationship between illumination and material), spectral features (band information, statistical information, difference information and trends of each pixel in multiple spectral channels), and spatial features (texture structure, geometric distribution and contextual relationship) of multispectral images in multiple spectral channels. The framework utilizes color consistency to constrain the reliability of the decoupling between illumination and material, uses spectral features to achieve accurate identification of material components, and uses spatial features to capture the macroscopic organizational pattern of the scene. The three are mutually verified and fused, thereby achieving high-precision identification of image scenes under complex environmental interference.
[0088] In some embodiments, step 103 above can be implemented by the following steps 1031 to 1032: Step 1031: Determine the scene parameters and scene confidence of at least one scene corresponding to the first image; the scene parameters include intensity parameters and range parameters.
[0089] The intensity parameters must include at least the removal intensity P and the scene intensity configuration S. The range parameters must include at least one of the range factor k and the removal range.
[0090] In some implementations, the removal range can be determined based on scene weights and a range factor. For example, the formula for calculating the removal range can be: R = k·W(px); where R represents the removal range, k represents the range factor, and W represents the scene weight.
[0091] In some implementations, the removal intensity can be determined based on scene intensity configuration and scene weights. For example, the formula for calculating the removal intensity can be: P = S × W (%); where P represents the removal intensity, S represents the scene intensity configuration, and W represents the scene weights.
[0092] In some implementations, scene parameters for each scene can be obtained through multiple trials; a scene parameter table is then constructed based on the scene parameters of multiple scenes. As shown in Table 1 below: For portrait scenes, the weight is 0.6, the removal intensity is 48%, the range factor is 3, the removal range is 9px, and the reference pixel is a floating range based on 9px (used when the shorter side occupies 3000 pixels). For macro scenes, the weight is 0.7, the removal intensity is 56%, the range factor is 3.5, the removal range is 10.5px to 11px, and the reference pixel is a floating range based on 11px (used when the shorter side occupies 3000 pixels). For plant scenes, the weight is 0.8, the removal intensity is 64%, the range factor is 4, the removal range is 12px, and the reference pixel is a floating range based on 12px (used when the shorter side occupies 3000 pixels). Landscape scenes have a weight of 0.95, a removal intensity of 76%, a range factor of 5, a removal range of 15px, and a reference pixel range based on a 15px floating range (used when the shorter side occupies 3000 pixels). Night scenes / backlight scenes have a weight of 1, a removal intensity of 80%, a range factor of 5, a removal range of 15px, and a reference pixel range based on a 15px floating range (used when the shorter side occupies 3000 pixels). Buildings / city scenes have a weight of 1, a removal intensity of 80%, a range factor of 5.5, a removal range of 16.5px to 17px, and a reference pixel range based on a 17px floating range (used when the shorter side occupies 3000 pixels). Water / glass scenes have a weight of 1, a removal intensity of 80%, a range factor of 5, a removal range of 15px, and a reference pixel range based on a 15px floating range (used when the shorter side occupies 3000 pixels). The weight for metallic / highly reflective scenes is 1.1, the removal intensity is 88%, the range factor is 6, the removal range is 18px, and the reference pixel is a floating range based on 18px (used when the shorter side occupies 3000 pixels).
[0093]
[0094] Table 1 Step 1032: Based on the scene parameters and scene confidence of at least one scene, determine the correction parameters corresponding to the first image; wherein, the correction parameters include correction intensity and correction range.
[0095] In some implementations, the intensity parameters of at least one scene can be weighted based on the scene confidence of at least one scene to obtain the corrected intensity corresponding to the first image; the range parameters of at least one scene can be weighted based on the scene confidence of at least one scene to obtain the corrected range corresponding to the first image. In this case, the first image corresponds to a set of parameter combinations of corrected intensity and corrected range.
[0096] In some implementations, a target scene can be selected from at least one scene based on the scene confidence of at least one scene; and correction parameters corresponding to the first image can be determined based on the scene parameters and scene confidence of the target scene. The target scene can be one of the k scenes ranked first by scene confidence.
[0097] In some implementations, the intensity parameter of each scene can be weighted based on the scene confidence level to obtain the correction intensity for each scene; similarly, the range parameter of each scene can be weighted based on the scene confidence level to obtain the correction range for each scene. In this case, each scene in the first image corresponds to a set of parameter combinations for correction intensity and correction range, enabling more precise adjustment of image color difference. Thus, configuring different correction intensities and correction ranges according to different scenes can achieve the most suitable scene elimination effect.
[0098] In this embodiment of the disclosure, the correction parameters corresponding to the first image are determined based on the scene parameters and scene confidence of at least one scene corresponding to the first image. A confidence-weighted parameter fusion mechanism can be constructed to give greater weight to high-confidence scene parameters and suppress or correct low-confidence parameters, thereby generating correction parameters for the first image. This achieves adaptive optimization of the image processing flow, making the corrected image more consistent with the characteristics of the real scene in terms of visual fidelity, physical consistency and semantic accuracy.
[0099] In some embodiments, step 102 described above can be implemented by the following steps E1 to E2: Step E1: Determine at least one region to be processed based on the color values of the first image in multiple spectral channels; the multispectral image data includes the color values of the first image in multiple spectral channels.
[0100] The area to be processed can be an area with significant color difference. For example, the area to be processed can be a purple-edged area.
[0101] In some implementations, color deviations in multiple spectral channels can be determined based on the color values of the first image in multiple spectral channels; and the distribution and intensity of at least one region to be processed can be determined based on the color deviations.
[0102] In some implementations, the pixel values of the first image in the first color space can be differentially analyzed to obtain the color deviation of the first image in the first color space; the regions where the color deviation is greater than a deviation threshold are located are identified as the regions to be processed in the first image. Multispectral image data includes the pixel values of the first image in the first color space. The first color space can be the YUV color space, and regions with a sharp increase in UV deviation are purple-edge regions. Regions where the color deviation is greater than the deviation threshold indicate a significant color jump and belong to heterochromatic regions, i.e., purple-edge regions.
[0103] In some implementations, edge detection and local color statistics can be used to determine the region to be processed based on the color values of the first image in multiple spectral channels.
[0104] In some implementations, edge detection can be performed on the first image in the second color space to obtain a first candidate region; statistical analysis can be performed on the pixel values of the first candidate region in the red, blue, and green channels to obtain the statistical features of the first candidate region in the red, blue, and green channels; the statistical features in the red and blue channels can be compared with the statistical features in the green channel to determine the differences between the red and blue channels and the green channel; the differences are used to reflect the color deviation of the first image in multiple spectral channels; the regions where the differences are greater than the difference threshold are selected as second candidate regions; color consistency checks are performed on the second candidate regions based on the neighborhood tone variance to select the regions to be processed from the second candidate regions.
[0105] The second color space can be the RGB color space. Statistical analysis of the pixel values in the red, blue, and green channels of the first candidate region refers to local color statistics. The first candidate region is a high-gradient region. The second candidate region is a region with abnormal purple enhancement. The region to be processed is a region with abnormal purple enhancement accompanied by a sudden increase in brightness.
[0106] In some implementations, the Scharr gradient can be calculated on the RGB image, and the region with the high gradient can be used as the first candidate region (potential purple fringing region).
[0107] In some implementations, the formula for calculating the difference between the red and blue channels and the green channel can be: RB_excess = (R + B) - 2G.
[0108] In some implementations, color consistency checks can be performed on the second candidate region in the YUV color space based on the regional hue variance, and regions with inconsistent colors in the second candidate region can be regarded as regions to be processed.
[0109] In the first candidate region, local color statistics are determined. Purple fringing often appears at high-contrast edges and is characterized by: (Feature 1) B and R channels being stronger than G (purple shift); for example, if RB_excess>T1 (difference threshold), there is abnormal purple enhancement, and the region containing pixels with a difference greater than the difference threshold is selected as the second candidate region. (Feature 2) Hue falls within the purple range (approximately 260°–320°), and candidate edge points are converted to HSV: H∈[260,320]. (Feature 3) Local brightness abrupt changes (purple fringing is often accompanied by strong brightness gradients); "local consistency statistics" are used to exclude true purple objects. True purple objects are characterized by: consistent Hue, smooth color changes in the neighborhood, and no high-intensity edge differences (small brightness jumps).
[0110] In the YUV color space, when the U and V color difference signals of the edge region exhibit low variance, low gradient, and small cross-edge difference in the local neighborhood, the region can be considered to have high hue consistency and be the same color edge of the real object; conversely, if there is a significant jump in U / V, it is considered to be a different color edge, including purple edges.
[0111] Step E2: Based on the image data of the region to be processed in multiple spectral channels, determine at least one scene of the region to be processed.
[0112] In some implementations, image data of the region to be processed in multiple spectral channels can be analyzed to obtain the spectral features of the region to be processed in multiple spectral channels; based on the spectral features of the region to be processed, at least one material of the region to be processed can be determined; based on at least one material of the region to be processed, at least one scene of the region to be processed can be determined.
[0113] In some implementations, a spectral vector of the region to be processed can be constructed based on image data of the region to be processed in multiple spectral channels; the color consistency of the region to be processed in multiple spectral channels can be determined based on the difference between the spectral vector of the region to be processed and the spectral vector of the reference pixel; at least one lighting mode of the region to be processed can be determined based on the color consistency of the region to be processed; and at least one scene of the region to be processed can be determined based on at least one lighting mode of the region to be processed.
[0114] In some implementations, spatial and spectral features of the region to be processed can be constructed based on image data of the region in multiple spectral channels; and at least one scene of the region to be processed can be determined based on the spatial and spectral features of the region to be processed.
[0115] In this embodiment, the region to be processed with obvious color difference in the first image is first identified. Then, at least one scene of the region to be processed is inferred by analyzing the spectral characteristics, color consistency and spatial characteristics of the region to be processed. Compared with directly identifying at least one scene of the first image, the optical defect of obvious color difference in the region to be processed can be used as a strong indicator for scene diagnosis. The distribution location, intensity and spectral morphology of the region to be processed are strongly correlated with extreme lighting conditions (such as strong backlight, direct point light source, high dynamic range scene), thereby focusing the ambiguity of the whole image recognition to the discriminative local abnormal area, and achieving more accurate and robust scene type determination and verification under complex exposure, strong contrast or bad shooting conditions.
[0116] In some embodiments, when step 102 is implemented via steps E1 to E2, step 103 can be implemented via step 1033 as follows: Step 1033: Determine the correction parameters corresponding to the region to be processed based on the scene parameters and scene confidence of at least one scene in the region to be processed.
[0117] Here, the operation of step 1033 is similar to the operation of step 1032 described above. When implementing it, you can refer to the implementation method of step 1033 described above. This embodiment of the disclosure will not repeat it here.
[0118] Accordingly, step 104 above can be achieved through the following step 1041: Step 1041: Correct the region to be processed in the first image based on the correction parameters corresponding to the region to be processed, and obtain the second image.
[0119] In this embodiment, the correction parameters corresponding to the region to be processed are determined based on the scene parameters and scene confidence of at least one scene in the region to be processed. Compared with determining the correction parameters of the first image based on the scene parameters and scene confidence of the first image, this method can achieve defect-driven precise local optimization. The region to be processed often corresponds to the local scene with the most extreme lighting and the strongest contrast in the image. Its scene parameters deviate significantly from the statistical characteristics of the whole image. If global correction is used, it is easy to cause over-suppression of normal areas or insufficient correction of purple edge areas. However, based on the local scene analysis of the region to be processed, the correction parameters can be focused on the edge pixels where there is a real color difference. While effectively eliminating purple edge artifacts, the original color details and texture information of non-purple edge areas are preserved to the greatest extent, achieving a dual improvement in repair accuracy and image fidelity.
[0120] In some embodiments, step 103 above can also be implemented by the following step 1034: Step 1034: Based on the scene of the first image, determine the correction parameters corresponding to the first image through the first model; the first model is trained based on the scene and correction parameters of the sample image.
[0121] The first model is used to determine the correction parameters of the image. The first model can be a neural network model. For example, the first model can be an adaptive correction model based on scene confidence, such as a Bayesian neural network model or a reinforcement learning model. Alternatively, the first model can also be a correction mapping model, such as an attention-guided model or a CNN network model. Of course, the first model can also be set to other models as needed, and this disclosure does not limit this.
[0122] In some embodiments, step 103 above can also be implemented by the following steps 1035 to 1036: Step 1035: Obtain the input parameter information.
[0123] In some implementations, user-inputted parameters can be received. These parameters can be used to adjust the first model or the processing logic of the image processing method. The processing logic may include recognition logic for the region to be processed, scene recognition logic, etc.
[0124] Step 1036: Based on the scene and parameter information of the first image, determine the correction parameters corresponding to the first image through the first model.
[0125] In some implementations, the process by which the first model processes the scene of the first image can be adjusted based on parameter information to achieve the effect of adjusting and correcting parameters.
[0126] In this embodiment, the input parameter information (such as target scene preference, correction intensity, or specific region annotation) is used as a priori constraints to dynamically adjust the correction parameter generation logic of the first model in the first image scene processing process. This shifts the model output from pure data-driven inference to human-machine collaborative optimization, thereby improving the accuracy of the correction results in adapting to the user's subjective intent and specific needs while maintaining automation efficiency. Since the image processing method provided in this embodiment is executed by the first model, correction parameters can be quickly obtained by only inputting parameter information and / or the scene of the first image. Compared with the method of manually obtaining correction parameters, this greatly reduces the complex and redundant computation, improves the image processing speed, and has good real-time performance, making it suitable for deployment on terminal devices.
[0127] This disclosure provides an electronic device, such as... Figure 2As shown, the electronic device 20 includes: a processor 201, a memory 202, and a communication bus 203; the communication bus 203 is used to realize the communication connection between the processor 201 and the memory 202; the processor 201 is used to execute the following steps in the memory 202: acquiring a first image; determining the scene of the first image based on the multispectral image data of the first image; determining the correction parameters corresponding to the first image based on the scene of the first image; processing the first image based on the correction parameters to obtain a second image for output; the color difference value of the second image is less than the color difference value of the first image.
[0128] In some embodiments, the image processing program is stored in the memory 202, and the processor 201 executes the image processing program in the memory 202 to implement the image processing method described above. The image processing program is obtained based on the multispectral image data of the first image; the processor 201 is an image processor 201.
[0129] In this embodiment of the disclosure, the image processor is naturally matched with the highly parallel characteristics of image data through its parallel architecture, which fundamentally eliminates the bottleneck of CPU serial processing. Therefore, executing image processing methods on the image processor can greatly improve image processing speed and optimize time consumption.
[0130] The following describes the application of the image processing method provided in the embodiments of this disclosure in real-world scenarios.
[0131] This disclosure proposes a multispectral-assisted adaptive adjustment scheme for purple fringing processing (corresponding to the above image processing method), which mainly includes two parts: scene classification and recognition, and purple fringing detection and elimination.
[0132] A spectral sensor is used to identify the current scene, and based on this data, the intensity and range of purple fringing removal can be dynamically adjusted according to the scene.
[0133] The purple fringing removal process first performs edge detection using the Scharr operator, then determines whether the edge is purple fringing (corresponding to the area to be processed mentioned above). Based on the multispectral output results, the intensity and range of purple fringing removal are dynamically adjusted (corresponding to the correction intensity and correction range of the area to be processed mentioned above). The effect of purple fringing is weakened by adjusting the saturation of the purple fringed area in the image. The purple fringing removal intensity and range parameters for each scene (as shown in Table 1 above) can be written into an XML file and burned to the device. The values in the XML file can be adjusted at any time. After purple fringing removal, the corrected UV plane is smoothed to reduce noise and improve image quality.
[0134] The advantages of using the solutions of this disclosure include at least the following: 1. The appropriate purple edge removal intensity and range can be configured according to the purple edge characteristics of different scenarios to achieve the best removal effect for the scenario.
[0135] 2. The discrimination logic in the purple fringing recognition process can be manually adjusted to reduce the impact on other color details while removing purple fringing. 3. It greatly reduces complex and redundant calculations, has good real-time performance, and is conducive to deployment on terminal devices.
[0136] 4. The intensity of purple edge adjustment can be dynamically controlled, and the solution is universally applicable.
[0137] The specific solutions in this disclosure include: Multispectral imaging technology can capture image data from multiple spectral channels (such as red, green, blue, and near-infrared), providing richer color and brightness information than traditional RGB images. Purple fringing is related to light dispersion and sensor response; multispectral image data can help to more accurately analyze and correct purple fringing areas.
[0138] Multispectral sensors utilize color consistency and spectral features in multispectral image data to identify the current scene, such as outdoor backlighting or bright night scenes. By analyzing color deviations in different spectral channels, they identify the distribution and intensity of purple fringing regions. Different purple fringing removal intensities and ranges can be configured for different scenes and intensities, achieving good results in purple fringing removal across all scenes.
[0139] like Figure 3 As shown, the overall process for determining the scene and purple fringing removal parameters (corresponding to the aforementioned correction parameters) in this embodiment includes: spectral analysis of the current scene's light signal using a multispectral sensor to obtain the scene and purple fringing removal parameters. For example, an image can identify three scenes: Scene 1, Scene 2, and Scene 3. Scene 1 can correspond to three purple fringing removal parameters: Parameter 1, Parameter 2, and Parameter 3. Parameter 1 includes purple fringing removal intensity 1 and purple fringing removal range 1. Parameter 2 includes purple fringing removal intensity 2 and purple fringing removal range 2. Parameter 3 includes purple fringing removal intensity 3 and purple fringing removal range 3.
[0140] Purple edge detection and removal section: A mobile imaging system implementation plan for real-time dynamic processing of purple fringing characterizes the severity of purple fringing by setting threshold conditions for edge intensity, brightness information, and hue variance. It then performs corresponding intensity and range removal operations for different scenes and varying degrees of purple fringing. Color consistency is checked using neighborhood hue variance to ensure no misjudgment of purple objects. Since the HSV color space is more suitable for color recognition, especially since hue can directly represent color type, this embodiment converts the YUV of the selected edge regions to HSV for purple fringing detection to achieve more accurate identification. The processing flow is as follows: Figure 4As shown, the steps include: Step 401, initialization and parameter acquisition; Step 402, copying the Y-plane to the output; Step 403, calculating local statistics; Step 404, edge detection and purple fringing recognition; Step 405, mask expansion; Step 406, dynamically adjusting saturation parameters to eliminate purple fringing; Step 407, bilateral filtering smoothing; Step 408, output.
[0141] The purple fringing recognition and removal function implemented in this embodiment can effectively identify and eliminate purple fringing in images through the above steps. First, the system initializes and acquires necessary parameters, including threshold conditions such as edge intensity, brightness information, and hue variance, for subsequent processing. Then, the Y-plane data is directly copied to the output, keeping the image brightness information unchanged. Subsequently, a temporary buffer is allocated to store intermediate results, and local statistical information of the UV plane, including mean and variance, is calculated to provide statistical support for purple fringing detection. Edge detection is performed using the Scharr operator, and the purple fringing region is identified by combining local statistical information, generating a corresponding mask (pixels that satisfy the intersection of edge recognition and purple fringing recognition in the original RGB image are set to 1, describing the overall purple fringing distribution; this is the mask). To ensure comprehensive correction, the mask is expanded. Then, the true problem edges (edges whose colors do not match the main body) are obtained through hue consistency detection. Based on the severity of the purple fringing, saturation-related parameters are dynamically adjusted to reduce the purple fringing effect. Finally, bilateral filtering is used to smooth the UV plane, removing noise and jagged edges, and improving image quality. The entire process has been verified to effectively and accurately remove purple fringing on the device. This solution runs on a GPU, which can greatly improve processing speed and optimize processing time.
[0142] like Figure 5As shown, the purple fringing detection and processing part includes: Step 501, extracting the YUV image from the image processing path. Step 502, performing the Scharr operator on the Y channel of the YUV image to calculate and identify edges, and simultaneously identifying the current brightness through the Y channel; the result obtained at this time is objects with edges, including objects whose colors are consistent with and inconsistent with the edges. Step 503, performing a color consistency check using the UV information in the YUV channel; at this time, objects with uniform color and the same color edges will be excluded, and the output will be objects with edges of different colors. Step 504, converting the image from YUV to HSV for purple fringing detection and removal; here, the purple fringing removal intensity and purple fringing removal range parameters detected by the spectral sensor will be used. By applying the above two parameters, the saturation of the purple fringing area is adjusted to achieve the process of removing the purple fringing, which can achieve the effect of removing only the purple fringing without changing the color tone of other areas. Step 505, converting the image from HSV to YUV for post-processing. Among them, the purple fringing removal operation includes: expanding the purple fringing area outward by one pixel (removal range + purple fringing), and reducing the blue and red parts of the purple fringing area while reducing the saturation.
[0143] Based on the foregoing embodiments, this disclosure provides an image processing apparatus, which includes the included units and the modules included in each unit, which can be implemented by a processor in an electronic device; of course, it can also be implemented by specific logic circuits; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor unit (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.
[0144] Figure 6 This is a schematic diagram of the composition structure of an image processing apparatus provided in an embodiment of the present disclosure, such as... Figure 6 As shown, the image processing apparatus 600 includes: an acquisition unit 610 and a processing unit 620, wherein: The acquisition unit 610 is configured to acquire the first image captured. The processing unit 620 is configured to determine the scene of the first image based on the multispectral image data of the first image; The processing unit 620 is also configured to determine correction parameters corresponding to the first image based on the scene of the first image; The processing unit 620 is also configured to process the first image based on the correction parameters to obtain a second image for output; the color difference value of the second image is less than the color difference value of the first image.
[0145] In some embodiments, the processing unit 620 is further configured to: construct spectral vectors of multiple pixels based on image data of multiple pixels in a first image within corresponding bands of multiple spectral channels; the multispectral image data includes image data of multiple pixels in a first image within corresponding bands of multiple spectral channels; determine color consistency of the first image in multiple spectral channels based on the difference between the spectral vectors of the multiple pixels and the spectral vector of a reference pixel; the reference pixel is a pixel in the region where the object is located; determine at least one lighting mode based on color consistency; and determine at least one scene of the first image based on at least one lighting mode.
[0146] In some embodiments, the processing unit 620 is further configured to: analyze multispectral image data to obtain spectral features of the first image in multiple spectral channels; the spectral features include at least one of spectral vector, spectral shape, spectral difference features, spectral statistical features, and spectral spatial joint features; determine at least one material type based on the spectral features; and determine at least one scene of the first image based on the at least one material type.
[0147] In some embodiments, the processing unit 620 is further configured to: construct spatial features of the first image in multiple spectral channels based on image data of multiple pixels in the first image within corresponding bands of multiple spectral channels; the multispectral image data includes image data of multiple pixels in the first image within corresponding bands of multiple spectral channels; the spatial features are used to represent the spatial distribution of the first image in multiple spectral channels; analyze the multispectral image data to obtain spectral features of the first image in multiple spectral channels; the spectral features include at least one of spectral vector, spectral shape, spectral difference features, spectral statistical features, and spectral spatial joint features; and determine at least one scene of the first image based on the spatial features and spectral features.
[0148] In some embodiments, the processing unit 620 is further configured to: determine scene parameters and scene confidence of at least one scene corresponding to the first image; the scene parameters include intensity parameters and range parameters; and determine correction parameters corresponding to the first image based on the scene parameters and scene confidence of at least one scene; wherein the correction parameters include correction intensity and correction range.
[0149] In some embodiments, the processing unit 620 is further configured to: determine at least one region to be processed based on the color values of the first image in multiple spectral channels; the multispectral image data includes the color values of the first image in multiple spectral channels; and determine at least one scene of the region to be processed based on the image data of the region to be processed in multiple spectral channels.
[0150] In some embodiments, the processing unit 620 is further configured to: determine correction parameters corresponding to the region to be processed based on scene parameters and scene confidence of at least one scene of the region to be processed; correspondingly, the processing unit 620 is further configured to: correct the region to be processed in the first image based on the correction parameters corresponding to the region to be processed to obtain a second image.
[0151] In some embodiments, the processing unit 620 is further configured to: determine correction parameters corresponding to the first image based on the scene of the first image using a first model; the first model is trained based on the scene and correction parameters of the sample image. The acquisition unit 610 is further configured to acquire input parameter information; correspondingly, the processing unit 620 is further configured to determine the correction parameters corresponding to the first image based on the scene and parameter information of the first image through the first model.
[0152] The descriptions of the apparatus embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. In some embodiments, the functions or modules included in the apparatus provided in this disclosure can be used to perform the methods described in the method embodiments above. For technical details not disclosed in the apparatus embodiments of this disclosure, please refer to the descriptions of the method embodiments of this disclosure for understanding.
[0153] It should be noted that, in the embodiments of this disclosure, if the above-described image processing method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this disclosure, or the part that contributes to related technologies, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods of the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, mobile hard drive, read-only memory (ROM), magnetic disk, or optical disk. Thus, the embodiments of this disclosure are not limited to any specific hardware, software, or firmware, or any combination of hardware, software, and firmware.
[0154] This disclosure provides an electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor, and the processor executes the program to implement some or all of the steps in the above-described method.
[0155] This disclosure provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements some or all of the steps in the above-described method. The computer-readable storage medium can be transient or non-transient.
[0156] This disclosure provides a computer program including computer-readable code. When the computer-readable code is executed in an electronic device, a processor in the electronic device performs some or all of the steps in the above-described method.
[0157] This disclosure provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements some or all of the steps in the above-described method. This computer program product can be implemented specifically through hardware, software, or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium; in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.
[0158] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between them, while their similarities or commonalities can be referenced interchangeably. The descriptions of the above embodiments of the device, storage medium, computer program, and computer program product are similar to the descriptions of the above method embodiments and have similar beneficial effects. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product of this disclosure, please refer to the descriptions of the method embodiments of this disclosure for understanding.
[0159] It should be understood that the phrase "an embodiment" or "one embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this disclosure. Therefore, "in one embodiment" or "one embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this disclosure, the sequence numbers of the above steps / processes do not imply a sequential order of execution; the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this disclosure. The sequence numbers of the above embodiments of this disclosure are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0160] 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. Unless otherwise specified, 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.
[0161] In the several embodiments provided in this disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components may be combined, or integrated into another system, or some features may be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0162] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0163] In addition, each functional unit in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0164] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0165] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, or the part that contributes to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods of the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, magnetic disks, or optical disks.
[0166] The above description is merely an embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure.
Claims
1. An image processing method, comprising: Acquire the first captured image; Based on the multispectral image data of the first image, the scene of the first image is determined; Based on the scene of the first image, determine the correction parameters corresponding to the first image; The first image is processed based on the correction parameters to obtain a second image for output; the color difference value of the second image is less than the color difference value of the first image.
2. The method according to claim 1, wherein, Determining the scene of the first image based on the multispectral image data of the first image includes: Based on the image data of multiple pixels in the first image within the corresponding bands of multiple spectral channels, a spectral vector of the multiple pixels is constructed; the multispectral image data includes the image data of multiple pixels in the first image within the corresponding bands of multiple spectral channels. The color consistency of the first image across multiple spectral channels is determined based on the difference between the spectral vectors of the multiple pixels and the spectral vector of a reference pixel; the reference pixel is the pixel in the region where the object is located. Based on the color consistency, at least one lighting mode is determined; Based on the at least one lighting pattern, at least one scene of the first image is determined.
3. The method according to claim 1, wherein, Determining the scene of the first image based on the multispectral image data of the first image includes: The multispectral image data is analyzed to obtain the spectral features of the first image in multiple spectral channels; the spectral features include at least one of the following: spectral vector, spectral shape, spectral difference features, spectral statistical features, and spectral spatial joint features. Based on the spectral characteristics, at least one material type is determined; Based on the at least one material type, at least one scene of the first image is determined.
4. The method according to claim 1, wherein, Determining the scene of the first image based on the multispectral image data of the first image includes: Based on image data of multiple pixels in the first image within corresponding bands of multiple spectral channels, spatial features of the first image in multiple spectral channels are constructed; the multispectral image data includes image data of multiple pixels in the first image within corresponding bands of multiple spectral channels; the spatial features are used to reflect the spatial distribution of the first image in multiple spectral channels. The multispectral image data is analyzed to obtain the spectral features of the first image in multiple spectral channels; the spectral features include at least one of the following: spectral vector, spectral shape, spectral difference features, spectral statistical features, and spectral spatial joint features. Based on the spatial features and the spectral features, at least one scene of the first image is determined.
5. The method according to any one of claims 1 to 4, wherein, The step of determining the correction parameters corresponding to the first image based on the scene of the first image includes: Determine scene parameters and scene confidence levels for at least one scene corresponding to the first image; the scene parameters include intensity parameters and range parameters; Based on the scene parameters and scene confidence of the at least one scene, the correction parameters corresponding to the first image are determined; The correction parameters include the correction intensity and the correction range.
6. The method according to any one of claims 1 to 4, wherein, Determining the scene of the first image based on the multispectral image data of the first image includes: Based on the color values of the first image in multiple spectral channels, at least one region to be processed is determined; the multispectral image data includes the color values of the first image in multiple spectral channels; Based on image data of the region to be processed in multiple spectral channels, at least one scene of the region to be processed is determined.
7. The method according to claim 6, wherein, The step of determining the correction parameters corresponding to the first image based on the scene of the first image includes: Based on the scene parameters and scene confidence of at least one scene in the region to be processed, the correction parameters corresponding to the region to be processed are determined; The step of processing the first image based on the correction parameters to obtain a second image for output includes: The region to be processed in the first image is corrected based on the correction parameters corresponding to the region to be processed, and the second image is obtained.
8. The method according to claim 1, wherein determining the correction parameters corresponding to the first image based on the scene of the first image includes: Based on the scene of the first image, the correction parameters corresponding to the first image are determined by the first model; The first model is trained based on the scene and corrected parameters of the sample images; The method further includes: Obtain the input parameter information; The step of determining the correction parameters corresponding to the first image based on the scene of the first image includes: Based on the scene of the first image and the parameter information, the correction parameters corresponding to the first image are determined by the first model.
9. An electronic device, comprising: Processor, memory, and communication bus; The communication bus is used to realize the communication connection between the processor and the memory; The processor is used to perform the following steps in the memory: Acquire the first captured image; Based on the multispectral image data of the first image, the scene of the first image is determined; Based on the scene of the first image, determine the correction parameters corresponding to the first image; The first image is processed based on the correction parameters to obtain a second image for output; the color difference value of the second image is less than the color difference value of the first image.
10. The electronic device according to claim 9, further comprising: The image processing program is stored in the memory, and the image processing program is obtained based on the multispectral image data of the first image; The processor is an image processor.
