Image generation method and device, computer readable storage medium and electronic device

By performing G-channel interpolation on the image and using G-channel information as a guide, the problems of false color at high-contrast edges and insufficient resolution in image interpolation are solved, thereby improving the image's visualization effect and overall resolution.

CN115731129BActive Publication Date: 2026-07-03BEIJING HORIZON INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING HORIZON INFORMATION TECH CO LTD
Filing Date
2022-11-23
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing image interpolation techniques, especially those using linear interpolation, often result in false colors at high-contrast edges, affecting the overall image resolution and leading to poor image visualization for backend tasks.

Method used

By performing G-channel interpolation on images in a preset format, and using the information from the G-channel as a guide, interpolation processing is performed on other channels to improve the image's visualization effect, especially in avoiding false color at high-contrast edges and improving the overall image resolution.

Benefits of technology

By effectively utilizing the human eye's sensitivity to G-channel information, the visualization effect of images is improved, especially in high-contrast edge positions, avoiding false color and improving the overall image resolution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115731129B_ABST
    Figure CN115731129B_ABST
Patent Text Reader

Abstract

A method, apparatus, computer-readable storage medium, and electronic device for image generation are disclosed. The method includes: acquiring a first image in a preset format, the first image having multiple channels including a G channel; performing G channel interpolation processing on the first image to obtain a first target pixel value set, the first target pixel value set including: each pixel in the first image corresponding to a pixel value in the G channel; determining a guided channel from the remaining channels of the first image other than the G channel; using the first target pixel value set as guidance information, performing guided channel interpolation processing on the first image to obtain a second target pixel value set, the second target pixel value set including: each pixel in the first image corresponding to a pixel value in the guided channel; and generating a second image for a predetermined task based on the second target pixel value set. Embodiments of this disclosure can improve the visualization effect of images used for backend tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to image technology, and in particular to an image generation method, apparatus, computer-readable storage medium, and electronic device. Background Technology

[0002] Generally speaking, when performing image processing, after obtaining the image captured by the front-end image sensor, interpolation processing is required to obtain the image for the back-end task. The back-end task can be a detection task, such as a detection task related to the intelligent cockpit of a vehicle. Summary of the Invention

[0003] To address the technical problem of poor visualization of images used for backend tasks, this disclosure is proposed. Embodiments of this disclosure provide an image generation method, apparatus, computer-readable storage medium, and electronic device.

[0004] According to one aspect of the present disclosure, an image generation method is provided, comprising:

[0005] Obtain a first image in a preset format, wherein the first image has multiple channels including a G channel;

[0006] The first image is subjected to interpolation processing of the G channel to obtain a first target pixel value set, which includes: each pixel in the first image corresponds to the pixel value of the G channel.

[0007] The guided channel is determined from the remaining channels of the first image, excluding the G channel;

[0008] Using the first target pixel value set as guiding information, the first image is subjected to interpolation processing of the guided channel to obtain a second target pixel value set, wherein the second target pixel value set includes: each pixel in the first image corresponds to the pixel value of the guided channel;

[0009] A second image for a predetermined task is generated based on the second target pixel value set.

[0010] According to another aspect of the present disclosure, an image generation apparatus is provided, comprising:

[0011] The first acquisition module is used to acquire a first image in a preset format, wherein the first image has multiple channels including a G channel;

[0012] The second acquisition module is used to perform interpolation processing of the G channel on the first image acquired by the first acquisition module to obtain a first target pixel value set, wherein the first target pixel value set includes: each pixel in the first image corresponds to the pixel value of the G channel.

[0013] A determining module is configured to determine the guided channel from the remaining channels of the first image other than the G channel;

[0014] The third acquisition module is used to use the first target pixel value set obtained by the second acquisition module as guidance information to perform interpolation processing on the first image according to the guided channel determined by the determination module to obtain a second target pixel value set. The second target pixel value set includes: each pixel in the first image corresponds to the pixel value of the guided channel.

[0015] The generation module is used to generate a second image for a predetermined task based on the set of second target pixel values ​​obtained by the third acquisition module.

[0016] According to another aspect of this disclosure, a computer-readable storage medium is provided, the storage medium storing a computer program for performing the above-described image generation method.

[0017] According to another aspect of this disclosure, an electronic device is provided, the electronic device comprising:

[0018] processor;

[0019] Memory used to store the processor's executable instructions;

[0020] The processor is configured to read the executable instructions from the memory and execute the instructions to implement the image generation method described above.

[0021] Based on the image generation method, apparatus, computer-readable storage medium, and electronic device provided in the above embodiments of this disclosure, a first image of a preset format can be interpolated using the G channel. The resulting set of first target pixel values ​​can be used as guiding information to perform interpolation processing on the guided channel of the first image. In this way, by using the information of the G channel to guide the interpolation process of other channels, the human eye's greater sensitivity to the information of the G channel can be effectively utilized to improve the visualization effect of the image used for back-end tasks. Furthermore, for the case where the preset format is RGBIR, the advantage of the G channel having a high proportion and containing a lot of information in the image distribution can also be utilized to improve the performance of other channels at high-contrast edge positions, avoid false color at high-contrast edge positions, improve the overall resolution of the image, and thus further improve the visualization effect of the image used for back-end tasks.

[0022] The technical solutions of this disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0023] The above and other objects, features, and advantages of this disclosure will become more apparent from the more detailed description of the embodiments thereof in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the embodiments of this disclosure to explain the disclosure and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.

[0024] Figure 1 This is a schematic flowchart of an image generation method provided in an exemplary embodiment of this disclosure.

[0025] Figure 2 This is a schematic diagram of RGBIR format data.

[0026] Figure 3 This is a diagram of Bayer format data.

[0027] Figure 4 This is a flowchart illustrating an image generation method provided in another exemplary embodiment of this disclosure.

[0028] Figure 5 This is a schematic flowchart of an image generation method provided in another exemplary embodiment of the present disclosure.

[0029] Figure 6 This is a schematic flowchart of an image generation method provided in yet another exemplary embodiment of this disclosure.

[0030] Figure 7 This is a schematic flowchart of an image generation method provided in yet another exemplary embodiment of this disclosure.

[0031] Figure 8 This is a schematic flowchart of an image generation method provided in yet another exemplary embodiment of this disclosure.

[0032] Figure 9 This is a schematic diagram of the structure of an image generation apparatus provided in an exemplary embodiment of the present disclosure.

[0033] Figure 10 This is a schematic diagram of the structure of an image generation apparatus provided in another exemplary embodiment of the present disclosure.

[0034] Figure 11 This is a schematic diagram of the structure of an image generation apparatus provided in another exemplary embodiment of the present disclosure.

[0035] Figure 12 This is a schematic diagram of the structure of an image generation apparatus provided in yet another exemplary embodiment of this disclosure.

[0036] Figure 13 This is a schematic diagram of the structure of an image generation apparatus provided in yet another exemplary embodiment of this disclosure.

[0037] Figure 14 This is a structural diagram of an electronic device provided in an exemplary embodiment of this disclosure. Detailed Implementation

[0038] Hereinafter, exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present disclosure, and not all embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described herein.

[0039] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of this disclosure.

[0040] Those skilled in the art will understand that the terms "first," "second," etc., in the embodiments of this disclosure are only used to distinguish different steps, devices, or modules, and do not represent any specific technical meaning, nor do they indicate a necessary logical order between them.

[0041] It should also be understood that in the embodiments disclosed herein, "a plurality of" may refer to two or more, and "at least one" may refer to one, two or more.

[0042] It should also be understood that any component, data or structure mentioned in the embodiments of this disclosure can generally be understood as one or more unless expressly defined or given to the contrary in the context.

[0043] Furthermore, the term "and / or" in this disclosure is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this disclosure generally indicates that the preceding and following related objects have an "or" relationship.

[0044] It should also be understood that the description of the various embodiments in this disclosure emphasizes the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, they will not be described in detail.

[0045] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.

[0046] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit this disclosure or its application or use.

[0047] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0048] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0049] The embodiments disclosed herein can be applied to electronic devices such as terminal devices, computer systems, and servers, and can operate together with a wide range of other general-purpose or special-purpose computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, and servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments including any of the above systems, etc.

[0050] Electronic devices such as terminal devices, computer systems, and servers can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in distributed cloud computing environments, where tasks are executed by remote processing devices linked through communication networks. In distributed cloud computing environments, program modules can reside on local or remote computing system storage media, including storage devices.

[0051] Application Overview

[0052] Generally speaking, after obtaining the image captured by the front-end image sensor, interpolation processing is required to obtain the image used for back-end tasks.

[0053] Optionally, the front-end image sensor can be an RGBIR image sensor; wherein, the RGBIR image sensor can be an RGBIR image sensor that supports a 2*2 array or an RGBIR image sensor that supports a 4*4 array; R represents red, G represents green, B represents blue, and IR represents infrared.

[0054] After obtaining the image acquired by the RGBIR image sensor, the image can be converted into a Bayer pattern image that is compatible with the image signal processing pipeline (ISP pipeline) based on image interpolation processing (this process can be called image remosaic processing). Then, the Bayer pattern image is input into the image signal processing pipeline. By processing the Bayer pattern image through the image signal processing pipeline, images for back-end tasks can be obtained, such as RGB color images and IR single-channel images, to simultaneously meet the visualization needs of high-light and low-light scenes.

[0055] In the process of realizing this disclosure, the inventors discovered that the interpolation processing of the above-mentioned images usually adopts a linear interpolation method. This not only leads to false color at high-contrast edge positions, but also affects the overall resolution of the image. Therefore, the visualization effect of the image used for backend tasks is poor, which can easily have an adverse effect on the backend tasks.

[0056] Exemplary methods

[0057] Figure 1 This is a schematic flowchart of an image generation method provided in an exemplary embodiment of this disclosure. Figure 1 The method shown can be applied to electronic devices. Figure 1 The method shown may include steps 110, 120, 130, 140 and 150, each of which will be explained below.

[0058] Step 110: Obtain a first image in a preset format, wherein the first image has multiple channels including a G channel.

[0059] It should be noted that the preset formats include, but are not limited to, RGBIR format, Bayer format, etc.; for RGBIR format data, please refer to [link / reference needed]. Figure 2 For data in Bayer format, please refer to [link / reference]. Figure 3 .

[0060] In step 110, the raw image acquired by the RGBIR image sensor can be obtained, and this raw image can be used as a first image in a preset format. At this time, the first image can include four channels: R channel, G channel, B channel, and IR channel. Furthermore, the number of pixels corresponding to the R channel, G channel, B channel, and IR channel in the first image can be the same (for cases where the RGBIR image sensor supports a 2x2 array), or, as... Figure 2As shown, the number of pixels corresponding to the G channel in the first image can be greater than the number of pixels corresponding to the R channel, B channel, and IR channel respectively (this is the case where the RGBIR image sensor supports a 4*4 array mode, and the following explanation will use this case as an example).

[0061] In step 110, after acquiring the original image from the RGBIR image sensor, the original image can also be remosaic processed to obtain a Bayer format processed image. This Bayer format processed image can be used as the first image in a preset format. In this case, the first image can include three channels: the R channel, the G channel, and the B channel. Furthermore, the number of pixels corresponding to the G channel in the first image can be greater than the number of pixels corresponding to the R channel and the B channel, respectively.

[0062] Step 120: Perform G-channel interpolation on the first image to obtain a first target pixel value set, which includes the pixel values ​​of each pixel in the first image corresponding to the G-channel.

[0063] Optionally, when interpolating the G channel of the first image, a linear interpolation method or other types of interpolation methods can be used.

[0064] It should be noted that, since the first image is in a preset format, some pixels in the first image correspond to the pixel values ​​of the G channel. For example, the first image records G... 01 G 03 G 05 G 07 G 10 G 12 ... G 76 The pixels in question correspond to the pixel values ​​of the G channel. Therefore, in step 120, we only need to perform interpolation processing on the G channel to obtain the pixel values ​​of the remaining pixels corresponding to the G channel. Then, we combine the obtained pixel values ​​with the pixel values ​​of the G channel of some pixels recorded in the first image to obtain the first target pixel value set.

[0065] Step 130: Determine the guided channel from the remaining channels of the first image other than the G channel.

[0066] In step 130, a channel can be selected from the remaining channels of the first image other than the G channel, and the selected channel can be used as the guided channel. That is, the number of guided channels can be one.

[0067] In step 130, at least two channels may be selected from the remaining channels of the first image other than the G channel, and each of the selected at least two channels may be used as a guided channel. That is, the number of guided channels may be at least one.

[0068] Step 140: Using the first target pixel value set as guiding information, interpolation processing of the guided channel is performed on the first image to obtain the second target pixel value set. The second target pixel value set includes: each pixel in the first image corresponds to the pixel value of the guided channel.

[0069] It should be noted that the first image records some pixels that correspond to the pixel values ​​of the guided channel. For example, when the guided channel is the R channel, the first image records R... 02 R 06 R 20 R 24 ... R 64 The pixels in question correspond to the pixel values ​​of the R channel. Therefore, in step 140, using the first target pixel value set as guiding information, the pixel values ​​of the remaining pixels corresponding to the R channel are obtained through interpolation of the R channel. Then, the obtained pixel values ​​are combined with the pixel values ​​of the R channel of some pixels recorded in the first image to obtain the second target pixel value set.

[0070] Since the number of guided channels is at least one, the number of second target pixel value sets can also be at least one, and there can be a one-to-one correspondence between at least one second target pixel value set and at least one guided channel.

[0071] Step 150: Generate a second image for the predetermined task based on the second target pixel value set.

[0072] Optionally, the scheduled task can be a scheduled backend task, such as a detection task or a classification task.

[0073] Optionally, if the preset format is RGBIR, the second image may include an RGB color image and / or an IR single-channel image; if the preset format is Bayer format, the second image may be an RGB color image.

[0074] It should be noted that there are multiple possible implementations for step 150, and examples will be provided later for clarity.

[0075] Based on the image generation method provided in the above embodiments of this disclosure, a first image in a preset format can be interpolated using the G channel, and the resulting set of first target pixel values ​​can be used as guiding information to perform interpolation processing on the guided channel of the first image. In this way, by using the information of the G channel to guide the interpolation process of other channels, it is possible not only to effectively utilize the characteristic that the human eye is more sensitive to the information of the G channel and improve the visualization effect of the image used for back-end tasks, but also to take advantage of the high proportion of the G channel in the image distribution and the large amount of information it contains to improve the performance of other channels at high-contrast edge positions, avoid false color at high-contrast edge positions, improve the overall resolution of the image, and thus further improve the visualization effect of the image used for back-end tasks.

[0076] exist Figure 1 Based on the illustrated embodiments, as Figure 4 As shown, step 140 includes steps 1401, 1403, 1405, 1407, and 1409.

[0077] Step 1401: Determine the first target neighbor pixel and the second target neighbor pixel for the first pixel in the first image.

[0078] For ease of understanding, the first image will be used below. Figure 2 The image shown is used as an example for illustration.

[0079] When the guided channel is the R channel, the first pixel can be the IR channel. 11 The first neighboring pixel of the target can be R. 02 The point where the target is located, the neighboring pixels of the second target can be R. 20 The location.

[0080] When the guided channel is the B channel, the first pixel can be R. 24 The first neighboring pixel of the target can be B. 22 The point where the target is located, the neighboring pixel of the second target can be B. 26 The point where it is located, or the first target's neighboring pixel, can be B. 04 The point where the target is located, the neighboring pixel of the second target can be B. 44 The location.

[0081] When the guided channel is an IR channel, the first pixel can be G. 12 The point where the target is located, the first neighboring pixel can be IR. 11 The point where the target is located, the neighboring pixels of the second target can be IR. 13 The location.

[0082] Step 1403: Based on the first image, determine the first pixel value of the guided channel corresponding to the first target neighborhood pixel.

[0083] In step 1403, the first pixel value can be directly extracted from the first image.

[0084] When the guided channel is the R channel and the first pixel is the IR channel... 11 In the case of the point where it is located, the value of the first pixel can be R. 02 .

[0085] When the guided channel is channel B, the first pixel is R. 24 The point where it is located, and the first target's neighboring pixel is B. 22 In the case of the point where it is located, the first pixel value can be B. 22 .

[0086] When the guided channel is the IR channel, the first pixel is G. 12 In the case of the point, the first pixel value can be IR. 11 .

[0087] Step 1405: Based on the first image, determine the second pixel value of the guided channel corresponding to the second target neighborhood pixel.

[0088] In step 1405, the second pixel value can be directly extracted from the first image.

[0089] When the guided channel is the R channel and the first pixel is the IR channel... 11 In the case of the point where it is located, the value of the second pixel can be R. 20 .

[0090] When the guided channel is channel B, the first pixel is R. 24 The point where it is located, and the neighboring pixel of the second target is B. 26 In the case of the point where it is located, the value of the second pixel can be B. 26 .

[0091] When the guided channel is the IR channel, the first pixel is G. 12 In the case of the point where it is located, the second pixel value can be IR. 13 .

[0092] Step 1407: Based on the first target pixel value set, determine the third pixel value of the first pixel corresponding to the G channel, the fourth pixel value of the first target neighbor pixel corresponding to the G channel, and the fifth pixel value of the second target neighbor pixel corresponding to the G channel.

[0093] In step 1407, the third pixel value, the fourth pixel value, and the fifth pixel value can be directly extracted from the first target pixel value set.

[0094] When the guided channel is the R channel and the first pixel is the IR channel... 11 In the case of the point where it is located, the value of the third pixel can be G. 11 The fourth pixel value can be G 02 The fifth pixel value can be G 20 .

[0095] When the guided channel is channel B, the first pixel is R. 24 The point where it is located, and the first target's neighboring pixel is B. 22 In the case of the point where it is located, the value of the third pixel can be G. 24 The fourth pixel value can be G 22 The fifth pixel value can be G 26 .

[0096] When the guided channel is the IR channel, the first pixel is G. 12 In the case of the point where it is located, the value of the third pixel can be G. 12 The fourth pixel value can be G 11 The fifth pixel value can be G 13 .

[0097] Step 1409: Based on the third pixel value, the fourth pixel value, and the fifth pixel value, interpolation is performed between the first pixel value and the second pixel value to obtain the sixth pixel value corresponding to the guided channel of the first pixel point.

[0098] It should be noted that steps 1401 to 1409 describe an implementation method for obtaining the sixth pixel value of the guided channel corresponding to the first pixel in the first image by using the interpolation result of the G channel as guiding information. For the remaining pixels in the first image, the pixel value corresponding to the guided channel can be extracted from the first image, or the pixel value corresponding to the guided channel can be determined according to the processing method for the first pixel. Thus, the pixel values ​​corresponding to the guided channels of all pixels in the first image can be obtained, and the set of these pixel values ​​can be used as the second target pixel value set.

[0099] In one alternative implementation, step 1409 includes:

[0100] Determine the first absolute value of the difference between the fourth pixel value and the third pixel value;

[0101] Determine the second absolute value of the difference between the fifth pixel value and the third pixel value;

[0102] Based on the first absolute value and the second absolute value, a first weight corresponding to the first target direction and a second weight corresponding to the second target direction are determined; wherein, the first target direction is the direction from the neighboring pixels of the first target to the first pixel, and the second target direction is the direction from the neighboring pixels of the second target to the first pixel;

[0103] Based on the first weight and the second weight, interpolation is performed between the first pixel value and the second pixel value to obtain the sixth pixel value of the first pixel point corresponding to the guided channel.

[0104] When the guided channel is the R channel and the first pixel is the IR channel... 11 In the case of the point in question, the first absolute value can be represented as grad. 02 =ABS(G 02 -G 11 The second absolute value can be represented as grad. 20 =ABS(G 20 -G 11 The first weight can be represented as weight. 02 The second weight can be represented as weight 20 .

[0105] When the guided channel is channel B, the first pixel is R. 24 The point where it is located, and the first target's neighboring pixel is B. 22 In the case of the point, the first absolute value can be represented as gdiff. 22 =ABS(G 22 -G 24 The second absolute value can be represented as gdiff. 26 =ABS(G 26 -G 24 The first weight can be represented as weight. 22 The second weight can be represented as weight 26 .

[0106] When the guided channel is the IR channel, the first pixel is G. 12 In the case of the point, the first absolute value can be represented as gdiff. 11 =ABS(G 11 -G 12 The second absolute value can be represented as gdiff. 13 =ABS(G 13 -G 12 The first weight can be represented as weight. 11 The second weight can be represented as weight 13 .

[0107] Here, ABS represents the operation of finding the absolute value.

[0108] The first and second absolute values ​​obtained through calculation can be used to determine the first weight corresponding to the first target direction and the second weight corresponding to the second target direction.

[0109] Optionally, the first weight and the second weight can be determined using the following rules:

[0110] If the first absolute value is greater than the second absolute value, then the first weight is less than the second weight.

[0111] If the first absolute value equals the second absolute value, then the first weight equals the second weight.

[0112] If the first absolute value is less than the second absolute value, then the first weight is greater than the second weight.

[0113] Here, when the first absolute value equals the second absolute value, both the first weight and the second weight can be 0.5.

[0114] It should be noted that the first and second absolute values ​​can be used to represent the gradient change between neighboring pixels and the center pixel. By adopting the above rule, it can be ensured that the direction with a larger gradient change corresponds to a smaller weight, and the direction with a smaller gradient change corresponds to a larger weight. This helps to ensure the rationality and reliability of the sixth pixel value when the first and second weights are used to determine the sixth pixel value.

[0115] Optionally, based on the first absolute value and the second absolute value, determining the first weight corresponding to the first target direction and the second weight corresponding to the second target direction includes:

[0116] Determine the sum of the first absolute value and the second absolute value;

[0117] In response to a sum of zero, the first weight corresponding to the first target direction and the second weight corresponding to the second target direction are both determined to be preset weights.

[0118] In response to the sum being non-zero, a first weight corresponding to the first target direction is determined based on the ratio of the second absolute value to the sum, and a second weight corresponding to the second target direction is determined based on the ratio of the first absolute value to the sum.

[0119] Here, we can calculate the sum of the first and second absolute values ​​and determine whether the calculated sum is zero; where the sum can be represented as weight. sum .

[0120] If the calculated sum is zero, the area near the first pixel can be considered relatively flat. Therefore, the first target direction and the second target direction can be assigned the same weight. In this case, the first weight and the second weight can both be preset weights, such as 0.5.

[0121] If the calculated sum is not zero, it can be assumed that the area near the first pixel is not flat enough. Then, the first weight can be determined based on the ratio of the second absolute value to the sum, and the second weight can be determined based on the ratio of the first absolute value to the sum. For example, the ratio of the second absolute value to the sum can be directly determined as the first weight, and the ratio of the first absolute value to the sum can be determined as the second weight.

[0122] When the guided channel is the R channel and the first pixel is the IR channel... 11 In the case of the point, the weight is used as the first weight. 02 =grad 02 / weight sum weight as the second weight 20 =grad 20 / weight sum .

[0123] When the guided channel is channel B, the first pixel is R. 24 The point where it is located, and the first target's neighboring pixel is B. 22 In the case of the point, the weight is used as the first weight. 22 =gdiff 22 / weight sum weight as the second weight 26 =gdiff 26 / weight sum .

[0124] When the guided channel is the IR channel, the first pixel is G. 12 In the case of the point, the weight is used as the first weight. 11 =gdiff 13 / weight sum weight as the second weight 13 =gdiff 11 / weight sum .

[0125] In this way, the flatness of the region near the first pixel can be determined based on the sum of the first absolute value and the second absolute value, and the first weight and the second weight can be reasonably determined based on the flatness of the region near the first pixel to ensure the reliability of the determined first weight and the second weight.

[0126] Optionally, the default format is RGBIR format or Bayer format, and the channel being guided is the R channel or the B channel;

[0127] Based on the first weight and the second weight, interpolation is performed between the first pixel value and the second pixel value to obtain the sixth pixel value corresponding to the guided channel for the first pixel point, including:

[0128] The first relative color difference value is determined based on the first pixel value and the fourth pixel value;

[0129] The second relative color difference value is determined based on the second pixel value and the fifth pixel value;

[0130] Using the first weight and the second weight, the first relative color difference value and the second relative color difference value are weighted to obtain the first weighted value;

[0131] Based on the third pixel value and the first weighted value, the first pixel point is determined to correspond to the sixth pixel value of the guided channel.

[0132] Here, by using the first weight and the second weight, the first relative color difference value and the second relative color difference value can be weighted and summed; the sum of the third pixel value and the first weighted value can be determined as the sixth pixel value.

[0133] When the guided channel is the R channel and the first pixel is the IR channel... 11 In the case of the point in question, the first relative color difference value can be expressed as R. 02 -G 02 The second relative color difference value can be expressed as R. 20 -G 20 The first weighted value can be represented as weight. 02 *(R 02 -G 02 )+weight 20 *(R 20 -G 20 The sixth pixel value can be represented as R. 11 =G 11 +weight 02 *(R 02 -G 02 )+weight 20 *(R 20 -G 20 ).

[0134] When the guided channel is channel B, the first pixel is R. 24 The point where it is located, and the first target's neighboring pixel is B. 22 In the case of the point in question, the first relative color difference value can be expressed as B. 22 -G 22 / 2, the second relative color difference value can be expressed as R 26 -G 26 / 2, the first weighted value can be represented as weight 22 *(B 22 -G 22 / 2)+weight 26 *(R 26 -G 26 / 2), the sixth pixel value can be represented as B 24 =G 24 / 2+weight 22 *(B 22 -G 22 / 2)+weight 26 *(R 26 -G 26 / 2).

[0135] Thus, when the guided channel is an R channel or a B channel, the value of the sixth pixel can be calculated efficiently and reliably through simple subtraction, weighting, and addition operations.

[0136] Optionally, the default format is RGBIR format, and the channel being guided is an IR channel;

[0137] Based on the first weight and the second weight, interpolation is performed between the first pixel value and the second pixel value to obtain the sixth pixel value corresponding to the guided channel for the first pixel point, including:

[0138] Using the first weight and the second weight, the first pixel value and the second pixel value are weighted to obtain the second weighted value;

[0139] Based on the second weighted value, the first pixel point is determined to correspond to the sixth pixel value of the guided channel.

[0140] Alternatively, the second weighted value can be directly used as the sixth pixel value.

[0141] When the guided channel is the IR channel, the first pixel is G. 12 In the case of the point where it is located, the value of the sixth pixel can be represented as IR. 12 =Weight 11 *IR 11 +Weight 13 *IR 13 .

[0142] Thus, when the guided channel is an IR channel, the sixth pixel value can be calculated efficiently and reliably through simple weighted calculations, so as to determine the set of second target pixel values.

[0143] In the embodiments of this disclosure, for a first pixel in a first image, suitable first target neighboring pixels and second target neighboring pixels can be determined for it in the first image. By referring to the interpolation result of the G channel, a reasonable interpolation can be made between the first pixel value of the first target neighboring pixel corresponding to the guided channel and the second pixel value of the second target neighboring pixel corresponding to the guided channel. This allows for efficient and reliable acquisition of the sixth pixel value of the first pixel corresponding to the guided channel, thereby enabling efficient and reliable acquisition of the set of second target pixel values.

[0144] In one optional example, the default format is RGBIR format, and the channel being guided is either the B channel or the IR channel;

[0145] Step 1401 includes:

[0146] Along a first preset direction, determine a first reference neighbor pixel and a second reference neighbor pixel for a first pixel in the first image;

[0147] Along the second preset direction, a third reference neighbor pixel and a fourth reference neighbor pixel are determined for the first pixel;

[0148] Based on the first target pixel value set, the first reference neighbor pixel is determined to correspond to the seventh pixel value of the G channel, the second reference neighbor pixel is determined to correspond to the eighth pixel value of the G channel, the third reference neighbor pixel is determined to correspond to the ninth pixel value of the G channel, and the fourth reference neighbor pixel is determined to correspond to the tenth pixel value of the G channel.

[0149] Based on the seventh pixel value, the eighth pixel value, the ninth pixel value, and the tenth pixel value, a target preset direction is determined from the first preset direction and the second preset direction;

[0150] Along the target preset direction, determine the first target neighbor pixel and the second target neighbor pixel for the first pixel.

[0151] Optionally, the first preset direction can be a horizontal direction, and the second preset direction can be a vertical direction.

[0152] Optionally, the seventh, eighth, ninth, and tenth pixel values ​​can be extracted directly from the first target pixel value set.

[0153] In one optional implementation, determining a target preset direction from a first preset direction and a second preset direction based on the seventh pixel value, the eighth pixel value, the ninth pixel value, and the tenth pixel value includes:

[0154] Determine the third absolute value of the difference between the seventh pixel value and the eighth pixel value;

[0155] Determine the fourth absolute value of the difference between the ninth pixel value and the tenth pixel value;

[0156] The third absolute value is compared with the fourth absolute value to obtain the comparison result;

[0157] Based on the comparison results, the target preset direction is determined from the first preset direction and the second preset direction.

[0158] Optionally, the comparison results can be used to characterize the size relationship between the third absolute value and the fourth absolute value.

[0159] It should be noted that the third absolute value can be considered as the gradient change corresponding to the first preset direction for the first pixel, and the fourth absolute value can be considered as the gradient change corresponding to the second preset direction for the first pixel. Based on the comparison results, the preset direction with the smaller corresponding gradient change can be selected from the first preset direction and the second preset direction as the target preset direction.

[0160] When the guided channel is channel B, the first pixel is R. 24 In the case of the point where it is located, the first reference neighboring pixel can be G. 23 The second reference neighbor pixel can be G. 25 The point where it is located, the third reference neighbor pixel can be G. 14 The point where it is located, the fourth reference neighbor pixel can be G. 34 The value of the seventh pixel at the point can be G. 23 The value of the eighth pixel can be G. 25 The value of the ninth pixel can be G. 14 The tenth pixel value can be G 34 .

[0161] The third absolute value corresponding to the first preset direction can be represented as var. hori1 =ABS(G 23 -G 25 The fourth absolute value corresponding to the second preset direction can be represented as var. veri1 =ABS(G 14 -G 34 ).

[0162] In var hori1 Less than var veri1 In this case, the first preset direction can be used as the target preset direction, and along the first preset direction, a first target neighbor pixel and a second target neighbor pixel can be determined for the first pixel. At this time, the first target neighbor pixel can be B. 22 The point where the target is located, the neighboring pixel of the second target can be B. 26 The location.

[0163] In var veri1 Less than var hori1In this case, the second preset direction can be used as the target preset direction, and along the second preset direction, the first target neighbor pixel and the second target neighbor pixel can be determined for the first pixel. At this time, the first target neighbor pixel can be B. 04 The point where the target is located, the neighboring pixel of the second target can be B. 44 The location.

[0164] When the guided channel is the IR channel, the first pixel is G. 12 In the case of the point where it is located, the first reference neighbor pixel can be IR. 11 The second reference neighbor pixel can be IR. 13 The point where it is located, the third reference neighbor pixel can be R. 02 The second reference neighbor pixel can be B. 22 The value of the seventh pixel at the point can be G. 11 The value of the eighth pixel can be G. 13 The value of the ninth pixel can be G. 02 The tenth pixel value can be G 22 .

[0165] The third absolute value corresponding to the first preset direction can be represented as var. hori1 =ABS(G 11 -G 13 The fourth absolute value corresponding to the second preset direction can be represented as var. veri1 =ABS(G 02 -G 22 ).

[0166] In var hori1 Less than var veri1 In this case, the first preset direction can be used as the target preset direction, and along the first preset direction, a first target neighbor pixel and a second target neighbor pixel can be determined for the first pixel. At this time, the first target neighbor pixel can be an IR. 11 The point where the target is located, the neighboring pixels of the second target can be IR. 13 The location.

[0167] In var veri1 Less than var hori1 In this case, the second preset direction can be used as the target preset direction, and along the second preset direction, the first target neighbor pixel and the second target neighbor pixel can be determined for the first pixel. At this time, the first target neighbor pixel can be R. 02 The point where the target is located, the neighboring pixel of the second target can be B. 22 The location.

[0168] In the embodiments of this disclosure, reference neighboring pixels can be determined along a first preset direction and a second preset direction for a first pixel. Based on the pixel values ​​of the G channel corresponding to each reference neighboring pixel recorded in the first target pixel value set, a target preset direction can be reasonably selected from the first preset direction and the second preset direction so as to use the target preset direction as the direction for determining the target neighboring pixels for the first pixel. This helps to ensure the rationality of the determined target neighboring pixels, thereby helping to ensure the reliability of the subsequently obtained sixth pixel value.

[0169] In one optional example, the channel being guided is the IR channel;

[0170] Step 140 also includes:

[0171] In response to the comparison result indicating that the third absolute value is greater than the fourth absolute value, the step of interpolating between the first pixel value and the second pixel value based on the third pixel value, the fourth pixel value and the fifth pixel value is performed to obtain the sixth pixel value of the first pixel point corresponding to the guided channel;

[0172] In response to the comparison result indicating that the third absolute value is less than the fourth absolute value, interpolation is performed between the first pixel value and the second pixel value according to a preset interpolation method to obtain the sixth pixel value of the first pixel point corresponding to the guided channel.

[0173] Optionally, the preset interpolation method can be linear interpolation.

[0174] In the third absolute value var hori1 Greater than the fourth absolute value var veri1 In this case, it can be assumed that in the region near the first pixel, the gradient change in the vertical direction is less than the gradient change in the horizontal direction. Therefore, it can be referenced... Figure 4 The relevant description in the illustrated embodiment determines that the first pixel corresponds to the sixth pixel value of the guided channel.

[0175] In the third absolute value var hori1 Less than the fourth absolute value var veri1 In this case, it can be assumed that in the region near the first pixel, the gradient change in the horizontal direction is less than the gradient change in the vertical direction, since the first pixel value IR 11 Second pixel value IR 13 These are all pixel values ​​recorded in the first image itself, the first pixel value IR 11 Second pixel value IR 13 This can be considered an accurate pixel value; therefore, linear interpolation can be directly used for the first pixel value IR. 11 Second pixel value IR 13Interpolation is performed between the two values ​​to obtain the sixth pixel value corresponding to the first pixel in the guided channel. Assume the sixth pixel value is represented as IR. 12 Then IR 12 =(IR 11 +IR 13 ) / 2.

[0176] In the embodiments of this disclosure, when the gradient change in the horizontal direction in the region near the first pixel is smaller than that in the vertical direction, linear interpolation can be performed directly along the horizontal direction to efficiently and reliably obtain the sixth pixel value of the first pixel corresponding to the guided channel. When the gradient change in the vertical direction in the region near the first pixel is smaller than that in the horizontal direction, the information of the G channel can be used to guide the interpolation process of other channels, thereby improving the visualization effect of the image used for backend tasks.

[0177] exist Figure 1 Based on the illustrated embodiments, as Figure 5 As shown, step 120 includes steps 1201, 1203, 1205, 1207, 1209 and 1211.

[0178] Step 1201: Along the first preset direction, determine the third target neighbor pixel and the fourth target neighbor pixel for the second pixel in the first image.

[0179] Optionally, the first preset direction can be the horizontal direction.

[0180] Assuming the first image is as follows Figure 2 As shown, the second pixel can be an IR. 11 The point where the target is located, the third target's neighboring pixels can be G. 10 The point where the fourth target's neighboring pixels are located can be G. 12 The location.

[0181] Step 1203: Along the second preset direction, determine the fifth target neighbor pixel and the sixth target neighbor pixel for the second pixel.

[0182] Optionally, the second preset direction can be the vertical direction.

[0183] Assuming the first image is as follows Figure 2 As shown, the second pixel can be an IR. 11 The point where the fifth target's neighboring pixels are located can be G. 01 The point where the target is located, the sixth target's neighboring pixel can be G. 21 The location.

[0184] Step 1205: Based on the first target pixel value set, determine the eleventh pixel value of the G channel corresponding to the third target neighbor pixel, the twelfth pixel value of the G channel corresponding to the fourth target neighbor pixel, the thirteenth pixel value of the G channel corresponding to the fifth target neighbor pixel, and the fourteenth pixel value of the G channel corresponding to the sixth target neighbor pixel.

[0185] In step 1205, the eleventh, twelfth, thirteenth, and fourteenth pixel values ​​can be directly extracted from the first target pixel value set. Specifically, the eleventh pixel value can be G. 10 The twelfth pixel value G 12 The thirteenth pixel value can be G. 01 The value of the fourteenth pixel can be G. 21 .

[0186] Step 1207: Based on the eleventh pixel value, twelfth pixel value, thirteenth pixel value, and fourteenth pixel value, determine the third weight corresponding to the first preset direction and the fourth weight corresponding to the second preset direction.

[0187] In one alternative implementation, step 1207 includes:

[0188] Determine the fifth absolute value of the difference between the twelfth pixel value and the eleventh pixel value;

[0189] Determine the sixth absolute value of the difference between the fourteenth pixel value and the thirteenth pixel value;

[0190] Based on the fifth and sixth absolute values, the third weight corresponding to the first preset direction and the fourth weight corresponding to the second preset direction are determined.

[0191] Here, the fifth absolute value corresponding to the first preset direction can be represented as var. hori2 =ABS(G 12 -G 10 The sixth absolute value corresponding to the second preset direction can be represented as var. veri2 =ABS(G 21 -G 01 The fifth and sixth absolute values ​​can be used to determine the third weight corresponding to the first preset direction and the fourth weight corresponding to the second preset direction.

[0192] Alternatively, the third and fourth weights can be determined according to the following rules:

[0193] If the fifth absolute value is greater than the sixth absolute value, then the third weight is less than the fourth weight.

[0194] If the fifth absolute value equals the sixth absolute value, then the third weight equals the fourth weight;

[0195] If the fifth absolute value is less than the sixth absolute value, then the third weight is greater than the fourth weight.

[0196] Assume the third weight is represented as weight hori The fourth weight is represented as weight. veri Then we can have: weight hori =var veri2 / (var hori2 +var veri2 ), weight veri =var hori2 / (var hori2 +var veri2 ).

[0197] By using the above rules to determine the third and fourth weights, we can ensure that the direction with a larger gradient change corresponds to a smaller weight, and the direction with a smaller gradient change corresponds to a larger weight. This helps to ensure the rationality and reliability of the determined fifteenth pixel value when the third and fourth weights are used to determine the fifteenth pixel value.

[0198] Step 1209: Using the third and fourth weights, the average values ​​of the eleventh and twelfth pixels, and the average values ​​of the thirteenth and fourteenth pixels are weighted to obtain the third weighted value.

[0199] In step 1209, the average value of the eleventh pixel value and the twelfth pixel value can be calculated first, and the average value of the thirteenth pixel value and the fourteenth pixel value can be calculated. Then, the two average values ​​calculated are weighted and summed using the third weight and the fourth weight to obtain the third weighted value.

[0200] Step 1211: Based on the third weighted value, determine the fifteenth pixel value of the G channel corresponding to the second pixel point.

[0201] In step 1211, the third weighted value can be directly used as the value of the fifteenth pixel.

[0202] Alternatively, the value of the fifteenth pixel can be represented as G. 11 =weight hori *(G 10 +G 12 ) / 2+weight veri *(G 01 +G 21 ) / 2.

[0203] It should be noted that the above describes a specific implementation method for obtaining the fifteenth pixel value of the G channel corresponding to the second pixel in the first image by interpolation. For the remaining pixels in the first image, the pixel value corresponding to the G channel can either be extracted from the first image, or the pixel value corresponding to the G channel can be determined according to the processing method for the second pixel, thereby obtaining the first target pixel value set.

[0204] In the embodiments of this disclosure, for the second pixel, target neighboring pixels can be determined along the first preset direction and the second preset direction respectively. Based on the pixel values ​​of the G channel corresponding to each target neighboring pixel recorded in the first image, weights can be reasonably determined for the first preset direction and the second preset direction respectively. Based on the determined weights and the pixel values ​​of the G channel corresponding to each target neighboring pixel respectively, the pixel values ​​of the G channel corresponding to the second pixel can be determined efficiently and reliably through weighted operations, thereby obtaining the first target pixel value set efficiently and reliably.

[0205] exist Figure 1 Based on the embodiment shown, the preset format is RGBIR format, and the number of guided channels is three, namely the R channel, B channel, and IR channel;

[0206] like Figure 6 As shown, step 150 includes steps 1501, 1503 and 1505.

[0207] Step 1501: Based on the first target pixel value set, the second target pixel value set corresponding to the R channel, and the second target pixel value set corresponding to the B channel, convert the first image into a third image in Bayer format.

[0208] It should be noted that the first target pixel value set includes the pixel values ​​of each pixel in the first image corresponding to the G channel, the second target pixel value set corresponding to the R channel includes the pixel values ​​of each pixel in the first image corresponding to the R channel, and the second target pixel value set corresponding to the B channel includes the pixel values ​​of each pixel in the first image corresponding to the B channel. In step 1501, by integrating the information included in the first target pixel value set, the second target pixel value set corresponding to the R channel, and the second target pixel value set corresponding to the B channel, a third image in Bayer format can be obtained.

[0209] In one example, the first image is as follows: Figure 2 As shown, then... Figure 2 IR in 11 Replace with R 11 ,Will Figure 2 R in 02 Replace with B02 ,Will Figure 2 IR in 13 Replace with R 13 ,Will Figure 2 IR in 15 Replace with R 15 ,Will Figure 2 R in 06 Replace with B 06 ..., from this we can obtain Figure 3 The image shown, Figure 3 The image shown can then be used as a third image.

[0210] Step 1503: Based on the second target pixel value set corresponding to the IR channel, remove the IR component from the third image to obtain the fourth image.

[0211] In step 1503, for any pixel in the third image (assuming it is the third pixel), the pixel value (i.e., the IR pixel value) corresponding to the third pixel in the second target pixel value set corresponding to the IR channel can be determined. Then, the pixel value of the third pixel in the third image is subtracted from the IR pixel value. Each pixel in the third image can be processed in a similar way, thereby obtaining a fourth image with the IR component removed.

[0212] Step 1505: Input the fourth image into the image signal processing channel for processing to generate a second image for the predetermined task.

[0213] In step 1505, the fourth image can be provided to the image signal processing channel, which can process the fourth image according to a predetermined rule to generate a second image for a predetermined backend task.

[0214] It should be noted that the second image may include an RGB color image and / or an IR single-channel image. The RGB color image may be obtained by interpolating the third image through the image signal processing channel. The interpolation here may be done by linear interpolation or by using the specific implementation method described above, which uses the information of the G channel to guide the interpolation process of other channels. In this case, the third image may be used as another first image different from the first image in step 110.

[0215] In the embodiments of this disclosure, the interpolation of the R, B, and IR channels is guided by the information of the G channel, and then combined with IR component removal processing, a fourth image that can be adapted to the image signal processing channel can be obtained. The image signal processing channel can process the fourth image normally and avoid interference from the IR component. After IR component removal, high-contrast edges are less likely to show stripe abnormalities, which can improve the visualization effect of the image used for back-end tasks.

[0216] exist Figure 1 Based on the embodiment shown, the preset format is RGBIR format, and the guided channel is an IR channel;

[0217] like Figure 7 As shown, step 150 includes steps 1507 and 1509.

[0218] Step 1507: Based on the second target pixel value set, determine the fifth image, which has one channel and is an IR channel.

[0219] Since the guided channel is an IR channel, the second target pixel value set can include the pixel values ​​of each pixel in the first image corresponding to the IR channel. In step 1507, by integrating the information included in the second target pixel value set, a fifth image can be obtained. The fifth image is an IR single-channel image.

[0220] Step 1509: Input the fifth image into the image signal processing channel for processing to generate a second image for the predetermined task.

[0221] In step 1509, the fifth image can be provided to the image signal processing channel, which can process the fifth image according to a predetermined rule to generate a second image for a predetermined backend task. The second image can be a black and white image.

[0222] In the embodiments of this disclosure, the interpolation of the IR channel is guided by the information of the G channel, and the fifth image can be obtained efficiently and reliably by referring to the obtained second target pixel value set. The fifth image is processed by the image signal processing channel, and the second image can be obtained efficiently and reliably, and the visualization effect of the image used for back-end tasks can be improved.

[0223] In an optional example, such as Figure 8 As shown, RGBIR pattern raw data can be acquired first through an RGBIR image sensor, and the acquired RGBIR pattern raw data is used as the first image mentioned above.

[0224] Next, interpolation can be performed on the G channel, which has a higher pixel distribution in the first image (see [link to interpolation method] for details). Figure 5 (As described in the embodiment shown), during G-channel interpolation, gradient change information within the neighborhood can be used as a guide. The direction with a larger gradient change corresponds to a smaller weight, and the direction with a smaller gradient change corresponds to a larger weight.

[0225] Next, the interpolation results of the G channel can be used to guide the interpolation of the R, B, and IR channels, thereby obtaining Bayer pattern raw data. This Bayer pattern raw data is used as the third image mentioned above. By removing the IR component from the third image, a fourth image can be obtained. This fourth image is then input into the image signal processing channel for processing, generating the image used for the subsequent detection task.

[0226] By employing the embodiments of this disclosure, the advantages of the G channel, which has a high proportion and contains more information in the first image, can be leveraged to guide the interpolation process of the B, R, and IR channels. This improves the pseudo-color performance of the image at high-contrast edge positions and enhances the overall resolution of the image after remosaic interpolation. It also ensures that the grayscale changes at high-contrast edge positions after IR component interpolation are consistent with those of G / R / B, and that no striped anomalies are produced at high-contrast edges. This effectively improves the visualization effect of the image used for backend tasks.

[0227] Any of the image generation methods provided in this disclosure can be executed by any suitable device with data processing capabilities, including but not limited to: terminal devices and servers. Alternatively, any of the image generation methods provided in this disclosure can be executed by a processor, such as by a processor executing any of the image generation methods mentioned in this disclosure by calling corresponding instructions stored in memory. Further details will not be elaborated below.

[0228] Exemplary device

[0229] Figure 9 This is a schematic diagram of the structure of an image generation apparatus provided in an exemplary embodiment of the present disclosure. Figure 9 The apparatus shown includes a first acquisition module 910, a second acquisition module 920, a determination module 930, a third acquisition module 940, and a generation module 950.

[0230] The first acquisition module 910 is used to acquire a first image in a preset format, wherein the first image has multiple channels including a G channel.

[0231] The second acquisition module 920 is used to perform G-channel interpolation processing on the first image acquired by the first acquisition module 910 to obtain a first target pixel value set, which includes: each pixel in the first image corresponds to a pixel value in the G channel.

[0232] The determination module 930 is used to determine the guided channel from the channels of the first image other than the G channel;

[0233] The third acquisition module 940 is used to perform interpolation processing on the first image using the first target pixel value set obtained by the second acquisition module 920 as guidance information, and to obtain the second target pixel value set. The second target pixel value set includes: each pixel in the first image corresponds to the pixel value of the guided channel.

[0234] The generation module 950 is used to generate a second image for a predetermined task based on the second target pixel value set obtained by the third acquisition module 940.

[0235] In an optional example, such as Figure 10 As shown, the third acquisition module 940 includes:

[0236] The first determining submodule 9401 is used to determine a first target neighbor pixel and a second target neighbor pixel for a first pixel in a first image acquired by the first acquiring module 910.

[0237] The second determining submodule 9403 is used to determine, based on the first image acquired by the first acquiring module 910, the first target neighborhood pixel determined by the first determining submodule 9401 corresponds to the first pixel value of the guided channel determined by the determining module 930.

[0238] The third determining submodule 9405 is used to determine, based on the first image acquired by the first acquiring module 910, the second target neighborhood pixel determined by the first determining submodule 9401 corresponds to the second pixel value of the guided channel determined by the determining module 930.

[0239] The fourth determining submodule 9407 is used to determine, based on the first target pixel value set obtained by the second obtaining module 920, the third pixel value of the first pixel corresponding to the G channel, the fourth pixel value of the first target neighbor pixel determined by the first determining submodule 9401 corresponding to the G channel, and the fifth pixel value of the second target neighbor pixel determined by the first determining submodule 9401 corresponding to the G channel.

[0240] The first interpolation submodule 9409 is used to interpolate between the first pixel value determined by the second determination submodule 9403 and the second pixel value determined by the third determination submodule 9407 based on the third pixel value, the fourth pixel value and the fifth pixel value determined by the fourth determination submodule 9407, to obtain the sixth pixel value of the first pixel point corresponding to the guided channel determined by the determination module 930.

[0241] In one optional example, the first interpolation submodule 9409 includes:

[0242] The first determining unit is used to determine the first absolute value of the difference between the fourth pixel value and the third pixel value determined by the fourth determining submodule 9407;

[0243] The second determining unit is used to determine the second absolute value of the difference between the fifth pixel value and the third pixel value determined by the fourth determining submodule 9407;

[0244] The third determining unit is used to determine the first weight corresponding to the first target direction and the second weight corresponding to the second target direction based on the first absolute value determined by the first determining unit and the second absolute value determined by the second determining unit; wherein, the first target direction is the direction from the first target neighboring pixel to the first pixel, and the second target direction is the direction from the second target neighboring pixel to the first pixel;

[0245] An interpolation unit is used to interpolate between the first pixel value determined by the second determining submodule 9403 and the second pixel value determined by the third determining submodule 9405 based on the first weight and the second weight determined by the third determining unit, to obtain the sixth pixel value of the first pixel point corresponding to the guided channel determined by the determining module 930.

[0246] In one optional example, the default format is RGBIR or Bayer format, and the guided channel is the R channel or the B channel;

[0247] Interpolation unit, including:

[0248] The first determining subunit is used to determine a first relative color difference value based on the first pixel value determined by the second determining submodule 9403 and the fourth pixel value determined by the fourth determining submodule 9407.

[0249] The second determining subunit is used to determine the second relative color difference value based on the second pixel value determined by the third determining submodule 9405 and the fifth pixel value determined by the fourth determining submodule 9407;

[0250] The first weighting subunit is used to weight the first relative color difference value determined by the first determining subunit and the second relative color difference value determined by the second determining subunit using the first weight and the second weight determined by the third determining unit to obtain the first weighted value.

[0251] The third determining subunit is used to determine, based on the third pixel value determined by the fourth determining subunit 9407 and the first weighted value obtained by the first weighting subunit, that the first pixel point corresponds to the sixth pixel value of the guided channel determined by the determining module 930.

[0252] In one optional example, the default format is RGBIR format, and the channel being guided is the IR channel;

[0253] Interpolation unit, including:

[0254] The second weighting subunit is used to perform weighting processing on the first pixel value determined by the second determining submodule 9403 and the second pixel value determined by the third determining submodule 9405 using the first weight and the second weight determined by the third determining unit to obtain the second weighted value.

[0255] The fourth determining subunit is used to determine, based on the second weighted value obtained by the second weighting subunit, the sixth pixel value of the first pixel point corresponding to the guided channel determined by the determining module 930.

[0256] In one optional example,

[0257] If the first absolute value is greater than the second absolute value, then the first weight is less than the second weight.

[0258] If the first absolute value equals the second absolute value, then the first weight equals the second weight.

[0259] If the first absolute value is less than the second absolute value, then the first weight is greater than the second weight.

[0260] In one optional example, the third determining unit includes:

[0261] The fifth determining subunit is used to determine the sum of the first absolute value determined by the first determining unit and the second absolute value determined by the second determining unit;

[0262] The sixth determining subunit is used to determine, in response to the sum value determined by the fifth determining subunit being zero, that the first weight corresponding to the first target direction and the second weight corresponding to the second target direction are both preset weights.

[0263] The seventh determining subunit is used to determine the first weight corresponding to the first target direction based on the ratio of the second absolute value determined by the second determining unit to the sum determined by the fifth determining subunit, in response to the fact that the sum determined by the fifth determining subunit is not zero, and to determine the second weight corresponding to the second target direction based on the ratio of the first absolute value determined by the first determining unit to the sum determined by the fifth determining subunit.

[0264] In one optional example, the default format is RGBIR format, and the channel being guided is either the B channel or the IR channel;

[0265] The first determining submodule 9401 includes:

[0266] The fourth determining unit is used to determine a first reference neighbor pixel and a second reference neighbor pixel for a first pixel in the first image along a first preset direction.

[0267] The fifth determining unit is used to determine the third reference neighbor pixel and the fourth reference neighbor pixel for the first pixel along the second preset direction;

[0268] The sixth determining unit is used to determine, based on the first target pixel value set obtained by the second acquisition module 920, the seventh pixel value of the first reference neighbor pixel corresponding to the G channel, the eighth pixel value of the second reference neighbor pixel corresponding to the G channel, the ninth pixel value of the third reference neighbor pixel corresponding to the G channel, and the tenth pixel value of the fourth reference neighbor pixel corresponding to the G channel.

[0269] The seventh determining unit is used to determine the target preset direction from the first preset direction and the second preset direction based on the seventh pixel value, the eighth pixel value, the ninth pixel value and the tenth pixel value determined by the sixth determining unit;

[0270] The eighth determining unit is used to determine a first target neighbor pixel and a second target neighbor pixel for the first pixel along the target preset direction determined by the seventh determining unit.

[0271] In one optional example, the seventh determining unit includes:

[0272] The eighth determining subunit is used to determine the third absolute value of the difference between the seventh pixel value determined by the sixth determining unit and the eighth pixel value;

[0273] The ninth determining subunit is used to determine the fourth absolute value of the difference between the ninth pixel value and the tenth pixel value determined by the sixth determining unit;

[0274] The comparison subunit is used to compare the third absolute value determined by the eighth determination subunit with the fourth absolute value determined by the ninth determination subunit to obtain the comparison result;

[0275] The tenth determining subunit is used to determine the target preset direction from the first preset direction and the second preset direction based on the comparison result obtained by the comparison subunit.

[0276] In one optional example, the channel being guided is the IR channel;

[0277] The third acquisition module 940 also includes:

[0278] The trigger submodule is used to trigger the first interpolation submodule 9409 in response to the comparison result obtained by the comparison subunit indicating that the third absolute value determined by the eighth determination subunit is greater than the fourth absolute value determined by the ninth determination subunit.

[0279] The second interpolation submodule is used to interpolate between the first pixel value determined by the second determination submodule 9403 and the second pixel value determined by the third determination submodule 9405 according to a preset interpolation method, in response to the comparison result obtained by the comparison submodule indicating that the third absolute value determined by the eighth determination submodule is less than the fourth absolute value determined by the ninth determination submodule. This results in the sixth pixel value of the first pixel corresponding to the guided channel determined by the determination module 930.

[0280] In an optional example, such as Figure 11 As shown, the second acquisition module 920 includes:

[0281] The fifth determining submodule 9201 is used to determine the third target neighbor pixel and the fourth target neighbor pixel for the second pixel in the first image along the first preset direction;

[0282] The sixth determining submodule 9203 is used to determine the fifth target neighbor pixel and the sixth target neighbor pixel for the second pixel along the second preset direction;

[0283] The seventh determining submodule 9205 is used to determine, based on the first image acquired by the first acquiring module 910, the eleventh pixel value of the G channel corresponding to the third target neighbor pixel determined by the fifth determining submodule 9201, the twelfth pixel value of the G channel corresponding to the fourth target neighbor pixel, the thirteenth pixel value of the G channel corresponding to the fifth target neighbor pixel determined by the sixth determining submodule 9203, and the fourteenth pixel value of the G channel corresponding to the sixth target neighbor pixel.

[0284] The eighth determining submodule 9207 is used to determine the third weight corresponding to the first preset direction and the fourth weight corresponding to the second preset direction based on the eleventh pixel value, twelfth pixel value, thirteenth pixel value and fourteenth pixel value determined by the seventh determining submodule 9205.

[0285] The weighting submodule 9209 is used to perform weighting processing on the average value of the eleventh and twelfth pixel values ​​and the average value of the thirteenth and fourteenth pixel values ​​determined by the seventh determination submodule 9205 using the third and fourth weights determined by the eighth determination submodule 9207, to obtain the third weighted value.

[0286] The ninth determining submodule 9211 is used to determine the fifteenth pixel value of the G channel corresponding to the second pixel point based on the third weighted value obtained by the weighting submodule 9209.

[0287] In one optional example, the eighth determined submodule 9207 includes:

[0288] The ninth determining unit is used to determine the fifth absolute value of the difference between the twelfth pixel value and the eleventh pixel value determined by the seventh determining submodule 9205;

[0289] The tenth determining unit is used to determine the sixth absolute value of the difference between the fourteenth pixel value and the thirteenth pixel value determined by the seventh determining submodule 9205;

[0290] The eleventh determining unit is used to determine the third weight corresponding to the first preset direction and the fourth weight corresponding to the second preset direction based on the fifth absolute value determined by the ninth determining unit and the sixth absolute value determined by the tenth determining unit.

[0291] In one optional example,

[0292] If the fifth absolute value is greater than the sixth absolute value, then the third weight is less than the fourth weight.

[0293] If the fifth absolute value equals the sixth absolute value, then the third weight equals the fourth weight;

[0294] If the fifth absolute value is less than the sixth absolute value, then the third weight is greater than the fourth weight.

[0295] In one optional example, the default format is RGBIR format, and the number of guided channels is three, namely the R channel, the B channel, and the IR channel.

[0296] like Figure 12 As shown, the generation module 950 includes:

[0297] The conversion submodule 9501 is used to convert the first image obtained by the first acquisition module 910 into a third image in Bayer format based on the first target pixel value set obtained by the second acquisition module 920, the second target pixel value set corresponding to the R channel obtained by the third acquisition module 940, and the second target pixel value set corresponding to the B channel obtained by the third acquisition module 940.

[0298] The removal module 9503 is used to remove the IR components from the third image obtained by the conversion submodule 9501 based on the second target pixel value set corresponding to the IR channel obtained by the third acquisition module 940, so as to obtain the fourth image.

[0299] The first generation submodule 9505 is used to input the fourth image obtained by the removal module 9503 into the image signal processing channel for processing, and generate a second image for a predetermined task.

[0300] In one optional example, the default format is RGBIR format, and the channel being guided is the IR channel;

[0301] like Figure 13 As shown, the generation module 950 includes:

[0302] The tenth determining submodule 9507 is used to determine the fifth image based on the second target pixel value set obtained by the third acquisition module 940. The fifth image has one channel and the channel is an IR channel.

[0303] The second generation submodule 9509 is used to input the fifth image determined by the tenth determination submodule 9507 into the image signal processing channel for processing, and generate a second image for a predetermined task.

[0304] Exemplary electronic devices

[0305] Below, for reference Figure 14 This describes an electronic device according to embodiments of the present disclosure. The electronic device may be either or both of a first device and a second device, or a standalone device independent of them, which may communicate with the first device and the second device to receive acquired input signals from them.

[0306] Figure 14 A block diagram of an electronic device according to an embodiment of the present disclosure is shown.

[0307] like Figure 14 As shown, the electronic device 1400 includes one or more processors 1401 and memory 1402.

[0308] The processor 1401 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 1400 to perform desired functions.

[0309] The memory 1402 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 1401 may execute the program instructions to implement the image generation methods of the various embodiments of this disclosure described above and / or other desired functions. Various contents such as input signals, signal components, and noise components may also be stored in the computer-readable storage medium.

[0310] In one example, the electronic device 1400 may also include an input device 1403 and an output device 1404, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).

[0311] For example, when the electronic device is a first device or a second device, the input device 1403 can be the microphone or microphone array described above, used to capture the input signal from the sound source. When the electronic device is a standalone device, the input device 1403 can be a communication network connector, used to receive the acquired input signal from the first device and the second device.

[0312] In addition, the input device 1403 may also include, for example, a keyboard, a mouse, etc.

[0313] The output device 1404 can output various information to the outside, including distance information, direction information, etc. The output device 1404 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0314] Of course, for the sake of simplicity, Figure 14 Only some of the components of the electronic device 1400 relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device 1400 may include any other suitable components depending on the specific application.

[0315] Exemplary computer program products and computer-readable storage media

[0316] In addition to the methods and apparatus described above, embodiments of this disclosure may also be computer program products comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the image generation methods according to various embodiments of this disclosure as described in the "Exemplary Methods" section of this specification.

[0317] The computer program product can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of this disclosure. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0318] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the steps in the image generation methods according to various embodiments of this disclosure as described in the "Exemplary Methods" section of this specification.

[0319] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0320] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.

[0321] The block diagrams of devices, apparatuses, devices, and systems disclosed herein are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.

[0322] It should also be noted that in the apparatus, devices, and methods of this disclosure, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions to this disclosure.

[0323] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.

[0324] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.

Claims

1. An image generation method, comprising: Obtain a first image in a preset format, wherein the first image has multiple channels including a G channel; The first image is subjected to interpolation processing of the G channel to obtain a first target pixel value set, which includes: each pixel in the first image corresponds to the pixel value of the G channel. The guided channel is determined from the remaining channels of the first image, excluding the G channel; Using the first target pixel value set as guiding information, the first image is subjected to interpolation processing of the guided channel to obtain a second target pixel value set, wherein the second target pixel value set includes: each pixel in the first image corresponds to the pixel value of the guided channel; Based on the second target pixel value set, a second image is generated for the predetermined task; The step of using the first target pixel value set as guidance information to perform interpolation processing on the first image using the guided channel to obtain the second target pixel value set includes: Determine a first target neighbor pixel and a second target neighbor pixel for a first pixel in the first image; Based on the first image, it is determined that the first target neighboring pixel corresponds to the first pixel value of the guided channel; Based on the first image, it is determined that the second target neighboring pixel corresponds to the second pixel value of the guided channel; Based on the first target pixel value set, the first pixel point corresponds to the third pixel value of the G channel, the first target neighbor pixel point corresponds to the fourth pixel value of the G channel, and the second target neighbor pixel point corresponds to the fifth pixel value of the G channel. Based on the third pixel value, the fourth pixel value, and the fifth pixel value, interpolation is performed between the first pixel value and the second pixel value to obtain the sixth pixel value corresponding to the guided channel.

2. The method according to claim 1, wherein, The step of interpolating between the first pixel value and the second pixel value based on the third pixel value, the fourth pixel value, and the fifth pixel value to obtain the sixth pixel value corresponding to the guided channel for the first pixel point includes: Determine the first absolute value of the difference between the fourth pixel value and the third pixel value; Determine the second absolute value of the difference between the fifth pixel value and the third pixel value; Based on the first absolute value and the second absolute value, a first weight corresponding to the first target direction and a second weight corresponding to the second target direction are determined; wherein, the first target direction is the direction from the first target neighboring pixel to the first pixel, and the second target direction is the direction from the second target neighboring pixel to the first pixel; Based on the first weight and the second weight, interpolation is performed between the first pixel value and the second pixel value to obtain the sixth pixel value of the first pixel corresponding to the guided channel.

3. The method according to claim 2, wherein, The preset format is RGBIR format or Bayer format, and the guided channel is an R channel or a B channel; The step of interpolating between the first pixel value and the second pixel value based on the first weight and the second weight to obtain the sixth pixel value of the first pixel corresponding to the guided channel includes: Based on the first pixel value and the fourth pixel value, a first relative color difference value is determined; Based on the second pixel value and the fifth pixel value, a second relative color difference value is determined; Using the first weight and the second weight, the first relative color difference value and the second relative color difference value are weighted to obtain the first weighted value; Based on the third pixel value and the first weighted value, the first pixel point is determined to correspond to the sixth pixel value of the guided channel.

4. The method according to claim 2, wherein, The preset format is RGBIR format, and the guided channel is an IR channel; The step of interpolating between the first pixel value and the second pixel value based on the first weight and the second weight to obtain the sixth pixel value of the first pixel corresponding to the guided channel includes: Using the first weight and the second weight, the first pixel value and the second pixel value are weighted to obtain the second weighted value; Based on the second weighted value, the first pixel point is determined to correspond to the sixth pixel value of the guided channel.

5. The method according to claim 2, wherein, If the first absolute value is greater than the second absolute value, then the first weight is less than the second weight; If the first absolute value is equal to the second absolute value, then the first weight is equal to the second weight; If the first absolute value is less than the second absolute value, then the first weight is greater than the second weight.

6. The method according to claim 2, wherein, The step of determining the first weight corresponding to the first target direction and the second weight corresponding to the second target direction based on the first absolute value and the second absolute value includes: Determine the sum of the first absolute value and the second absolute value; In response to the sum being zero, it is determined that both the first weight corresponding to the first target direction and the second weight corresponding to the second target direction are preset weights. In response to the sum being non-zero, a first weight corresponding to the first target direction is determined based on the ratio of the second absolute value to the sum, and a second weight corresponding to the second target direction is determined based on the ratio of the first absolute value to the sum.

7. The method according to claim 1, wherein, The preset format is RGBIR format, and the guided channel is a B channel or an IR channel; Determining the first target neighbor pixel and the second target neighbor pixel for the first pixel in the first image includes: Along a first preset direction, a first reference neighbor pixel and a second reference neighbor pixel are determined for a first pixel in the first image; Along the second preset direction, a third reference neighbor pixel and a fourth reference neighbor pixel are determined for the first pixel; Based on the first target pixel value set, it is determined that the first reference neighbor pixel corresponds to the seventh pixel value of the G channel, the second reference neighbor pixel corresponds to the eighth pixel value of the G channel, the third reference neighbor pixel corresponds to the ninth pixel value of the G channel, and the fourth reference neighbor pixel corresponds to the tenth pixel value of the G channel. Based on the seventh pixel value, the eighth pixel value, the ninth pixel value, and the tenth pixel value, a target preset direction is determined from the first preset direction and the second preset direction; Along the preset direction of the target, a first target neighbor pixel and a second target neighbor pixel are determined for the first pixel.

8. The method according to claim 7, wherein, The step of determining the target preset direction from the first preset direction and the second preset direction based on the seventh pixel value, the eighth pixel value, the ninth pixel value, and the tenth pixel value includes: Determine the third absolute value of the difference between the seventh pixel value and the eighth pixel value; Determine the fourth absolute value of the difference between the ninth pixel value and the tenth pixel value; The third absolute value is compared with the fourth absolute value to obtain the comparison result; Based on the comparison results, a target preset direction is determined from the first preset direction and the second preset direction.

9. The method according to claim 1, wherein, The step of interpolating the first image using the G channel to obtain the first target pixel value set includes: Along a first preset direction, a third target neighbor pixel and a fourth target neighbor pixel are determined for the second pixel in the first image; Along the second preset direction, a fifth target neighbor pixel and a sixth target neighbor pixel are determined for the second pixel; Based on the first image, it is determined that the third target neighbor pixel corresponds to the eleventh pixel value of the G channel, the fourth target neighbor pixel corresponds to the twelfth pixel value of the G channel, the fifth target neighbor pixel corresponds to the thirteenth pixel value of the G channel, and the sixth target neighbor pixel corresponds to the fourteenth pixel value of the G channel. Based on the eleventh pixel value, the twelfth pixel value, the thirteenth pixel value, and the fourteenth pixel value, a third weight corresponding to the first preset direction and a fourth weight corresponding to the second preset direction are determined; Using the third weight and the fourth weight, the average value of the eleventh pixel value and the twelfth pixel value, and the average value of the thirteenth pixel value and the fourteenth pixel value are weighted to obtain a third weighted value; Based on the third weighted value, the second pixel point is determined to correspond to the fifteenth pixel value of the G channel.

10. The method according to claim 9, wherein, The step of determining the third weight corresponding to the first preset direction and the fourth weight corresponding to the second preset direction based on the eleventh pixel value, the twelfth pixel value, the thirteenth pixel value, and the fourteenth pixel value includes: Determine the fifth absolute value of the difference between the twelfth pixel value and the eleventh pixel value; Determine the sixth absolute value of the difference between the fourteenth pixel value and the thirteenth pixel value; Based on the fifth absolute value and the sixth absolute value, the third weight corresponding to the first preset direction and the fourth weight corresponding to the second preset direction are determined.

11. The method according to claim 1, wherein, The preset format is RGBIR format, and the number of guided channels is three, namely the R channel, B channel, and IR channel; The step of generating a second image for a predetermined task based on the second target pixel value set includes: Based on the first target pixel value set, the second target pixel value set corresponding to the R channel, and the second target pixel value set corresponding to the B channel, the first image is converted into a third image in Bayer format; Based on the set of second target pixel values ​​corresponding to the IR channel, the third image is subjected to IR component removal to obtain the fourth image; The fourth image is input into the image signal processing channel for processing to generate a second image for a predetermined task.

12. The method according to claim 1, wherein, The preset format is RGBIR format, and the guided channel is an IR channel; The step of generating a second image for a predetermined task based on the second target pixel value set includes: Based on the second target pixel value set, a fifth image is determined, wherein the fifth image has one channel and the channel is an IR channel; The fifth image is input into the image signal processing channel for processing to generate a second image for the predetermined task.

13. An image generation apparatus, comprising: The first acquisition module is used to acquire a first image in a preset format, wherein the first image has multiple channels including a G channel; The second acquisition module is used to perform interpolation processing of the G channel on the first image acquired by the first acquisition module to obtain a first target pixel value set, wherein the first target pixel value set includes: each pixel in the first image corresponds to the pixel value of the G channel. A determining module is configured to determine the guided channel from the remaining channels of the first image other than the G channel; The third acquisition module is used to perform interpolation processing on the first image using the first target pixel value set obtained by the second acquisition module as guidance information, based on the guided channel determined by the determination module, to obtain a second target pixel value set. The second target pixel value set includes: each pixel in the first image corresponding to the pixel value of the guided channel. The third acquisition module includes: a first determination submodule, used to determine a first target neighbor pixel and a second target neighbor pixel for the first pixel in the first image; and a second determination submodule, used to determine, based on the first image, the first pixel value of the first target neighbor pixel corresponding to the guided channel. A third determining submodule is used to determine, based on the first image, the second pixel value of the second target neighboring pixel corresponding to the guided channel; a fourth determining submodule is used to determine, based on the first target pixel value set, the third pixel value of the first pixel corresponding to the G channel, the fourth pixel value of the first target neighboring pixel corresponding to the G channel, and the fifth pixel value of the second target neighboring pixel corresponding to the G channel; a first interpolation submodule is used to interpolate between the first pixel value and the second pixel value based on the third pixel value, the fourth pixel value, and the fifth pixel value to obtain the sixth pixel value of the first pixel corresponding to the guided channel; The generation module is used to generate a second image for a predetermined task based on the set of second target pixel values ​​obtained by the third acquisition module and using an image signal processing channel.

14. A computer-readable storage medium storing a computer program for performing the image generation method according to any one of claims 1-12.

15. An electronic device, the electronic device comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the image generation method according to any one of claims 1-12.