Image processing method and device, electronic equipment and chip
By estimating and processing the channel color difference of the target pixel point in Bayer data, the pseudo-color problem caused by the HA algorithm at high frequency texture is solved, and a higher quality image interpolation effect is achieved.
Patent Information
- Application Number
- CN202310988848.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-07
- Publication Date
- 2025-02-18
AI Technical Summary
Since the sampling rate of R and B channel components of Bayer data is small, if the HA algorithm is used for interpolation at high-frequency textures, it will cause more obvious pseudo-color in the image and even affect the image quality.
By obtaining the channel chromatic aberration information corresponding to the neighborhood pixel points of the target pixel point of the image, estimating the channel chromatic aberration of the target pixel point based on these information, obtaining the channel chromatic aberration information of the target pixel point, and determining the interpolation result of the target pixel point based on this information .
The median filtering algorithm uses the chromatic aberration estimation of neighboring pixels to determine the pixel information of the central pixel point, so that the pixel information of the target pixel point is closer to the real value, effectively processing the pseudo-color of the image at high-frequency texture, and improving the picture quality The effect and guarantee image quality.
Smart Images

Figure CN119477675A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, device, electronic device and chip. Background Art
[0002] Image interpolation can interpolate any channel data of the red, green and blue (RGB) data collected by the image sensor into three-channel RGB data. The quality of the interpolation result directly affects the final image quality obtained by image signal processing (ISP). Summary of the invention
[0003] In view of this, the present application provides an image processing method, device, electronic device and chip, the main purpose of which is to improve the technical problem that due to the low sampling rate of the R and B channel components of the Bayer data, if the HA algorithm is used for interpolation at the high-frequency texture, it will cause obvious pseudo-color in the image and even affect the image quality.
[0004] In a first aspect, the present application provides an image processing method, comprising:
[0005] Acquire channel color difference information corresponding to neighboring pixel points of a target pixel point in the image, wherein the channel color difference information includes R channel color difference information and / or B channel color difference information;
[0006] Based on the channel color difference information corresponding to the neighborhood pixel points, the channel color difference of the target pixel point is estimated to obtain the channel color difference information of the target pixel point;
[0007] An interpolation result of the target pixel is determined according to the channel color difference information of the target pixel.
[0008] In a second aspect, the present application provides an image processing device, comprising:
[0009] An acquisition module is configured to acquire channel color difference information corresponding to a neighborhood pixel point of a target pixel point in an image, wherein the channel color difference information includes R channel color difference information and / or B channel color difference information;
[0010] An estimation module is configured to estimate the channel color difference of the target pixel point based on the channel color difference information corresponding to the neighborhood pixel point, so as to obtain the channel color difference information of the target pixel point;
[0011] The determination module is configured to determine the interpolation result of the target pixel point according to the channel color difference information of the target pixel point.
[0012] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the image processing method described in the first aspect.
[0013] In a fourth aspect, the present application provides an electronic device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the image processing method described in the first aspect when executing the computer program.
[0014] In a fifth aspect, the present application provides a chip comprising one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of an electronic device and send the signal to the processor, wherein the signal includes computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device executes the image processing method described in the first aspect.
[0015] By means of the above technical scheme, the present application provides an image processing method, device, electronic device and chip, specifically first obtaining the channel color difference information corresponding to the neighborhood pixel points of the target pixel point of the image, the channel color difference information including the R channel color difference information and / or the B channel color difference information; then estimating the channel color difference of the target pixel point based on the channel color difference information corresponding to the neighborhood pixel points to obtain the channel color difference information of the target pixel point; and then determining the interpolation result of the target pixel point according to the channel color difference information of the target pixel point. Compared with the current prior art, the present application can determine the pixel information of the central pixel point by estimating the color difference of the neighborhood pixel points through the median filtering algorithm, and interpolate the target pixel point, so that the pixel information of the target pixel point can be closer to the true value, so that in the interpolation, the pseudo-color appearing in the high-frequency texture of the image can be better processed, and to a certain extent, it is ensured that the image will not have obvious pseudo-color at the high-frequency texture, thereby improving the image quality effect and ensuring the image quality.
[0016] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0019] Figure 1 A schematic diagram of a process flow of an image processing method provided in an embodiment of the present application is shown;
[0020] Figure 2 A schematic diagram of a process flow of an image processing method provided in an embodiment of the present application is shown;
[0021] Figure 3 A schematic diagram showing an example provided by an embodiment of the present application;
[0022] Figure 4 A schematic diagram showing an example provided by an embodiment of the present application;
[0023] Figure 5 A schematic diagram showing an example provided by an embodiment of the present application;
[0024] Figure 6 An effect diagram of an example provided by an embodiment of the present application is shown;
[0025] Figure 7 An effect diagram of an example provided by an embodiment of the present application is shown;
[0026] Figure 8 A schematic structural diagram of an image processing device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0027] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0028] In the related art, the HA algorithm is used to interpolate an image by assuming that the color difference between pixels is constant and estimating the pixel data of R, G, and B and the color difference in the corresponding direction.
[0029] However, since the sampling rate of the R and B channel components of the Bayer data is relatively low, if the HA algorithm is used for interpolation at high-frequency textures, it will cause obvious pseudo-color in the image and even affect the image quality.
[0030] In order to improve the technical problem that due to the low sampling rate of the R and B channel components of the Bayer data, if the HA algorithm is used for interpolation at the high-frequency texture, the image will have obvious pseudo-color and even affect the image quality. This embodiment provides an image processing method, such as Figure 1 As shown, the method includes:
[0031] Step 101: Obtain channel color difference information corresponding to neighborhood pixels of a target pixel in an image.
[0032] The channel color difference information includes R channel color difference information and / or B channel color difference information.
[0033] In the embodiment of the present application, the image has a corresponding image resolution, where the resolution is the number of pixels per unit area of the image, and the pixel is the unit of resolution. A pixel is usually the smallest complete sampling of the image, and therefore, the target image contains many pixel points.
[0034] For example, if the width of image A is 1280 pixels and the height is 720 pixels, then its resolution is 1280×720, that is, it can be understood that image A contains 1280×720 pixels.
[0035] In the embodiment of the present application, the color difference may be the difference in color, and the R channel color difference information may be the difference between the G channel pixel and the R channel pixel. Specifically, the R channel color difference information may be obtained by subtracting the G channel pixel from the R channel pixel.
[0036] Correspondingly, the B channel color difference information may be the difference between the G channel pixel and the B channel pixel. Specifically, the B channel color difference information may be obtained by subtracting the G channel pixel from the B channel pixel.
[0037] Exemplarily, if pixel a includes a B channel pixel, the G channel pixel of the neighboring pixel b of pixel a is 10, and the R channel pixel of pixel b is 8, it can be determined that the R channel color difference information of pixel b is 2. Correspondingly, if pixel a includes an R channel pixel, the G channel pixel of the neighboring pixel b of pixel a is 10, and the B channel pixel of pixel b is 8, it can be determined that the B channel color difference information of pixel b is 2.
[0038] Step 102: Estimate the channel color difference of the target pixel based on the channel color difference information corresponding to the neighborhood pixel points to obtain the channel color difference information of the target pixel point.
[0039] Optionally, the median filter is a method that can set the grayscale value of each pixel to the median of the grayscale values of all pixels in a certain neighborhood window of the point; the basic principle of median filtering is to replace the value of a point in a digital image or digital sequence with the median of the values of all points in a neighborhood of the point. The range of median filtering is usually 3*3, 5*5 area, and can also be different shapes, such as linear, circular, cross, circular ring, etc.
[0040] In an embodiment of the present application, the channel color difference of the neighborhood pixels of the target pixel is estimated by a median filtering algorithm, and the median of the color difference is the channel color difference of the target pixel.
[0041] Step 103: Determine the interpolation result of the target pixel point according to the channel color difference information of the target pixel point.
[0042] In the embodiment of the present application, the core of interpolation is to insert pixels into Bayer data and make its pixel information equal to the median value of the pixels around it.
[0043] Compared with the current existing technology, this embodiment can use the median filtering algorithm to estimate the color difference of the neighborhood pixels to determine the pixel information of the central pixel, and interpolate the target pixel, so that the pixel information of the target pixel can be closer to the true value, so that in the interpolation, the pseudo color appearing in the high-frequency texture of the image can be better processed, which ensures to a certain extent that the image will not have obvious pseudo color in the high-frequency texture, improves the image quality effect, and ensures the image quality.
[0044] Further, in order to illustrate the specific implementation process of the method of this embodiment, this embodiment provides the following Figure 2 The specific method shown, wherein the method includes:
[0045] Step 201: Obtain G channel information included in the neighborhood pixel points and channel information not included in the target pixel points.
[0046] The channel information not included in the target pixel is R channel information and / or B channel information, and the neighborhood pixel points are the pixel points other than the target pixel point in the nine-square pixel window centered on the target pixel point.
[0047] Optionally, before step 201, the method of this embodiment may further include: acquiring horizontal pixel gradient information and vertical pixel gradient information of the target pixel; and determining an interpolation result of the G channel of the target pixel according to the horizontal pixel gradient information and the vertical pixel gradient information.
[0048] In the embodiments of the present application, the image sensor generally collects RGB data through a color filter array (CFA), and each pixel collects only one channel data of R, G, and B. The most commonly used CFA array is the Bayer array - R, G, and B are repeatedly arranged in a fixed pattern, and a group of 2*2 pixels includes 1 B pixel, 1 R pixel, and 2 G pixels.
[0049] For example, in a 5*5 pixel area, the distribution of Bayer data is as follows: Figure 3 As shown, where M represents R pixel or B pixel, G represents G pixel. Figure 3 In the example, the G channel pixel (G0) at the center pixel M0 is interpolated and estimated. The horizontal component G0 of G0 can be calculated by formula 1. H , Formula 1 is as follows:
[0050] G0 H =(G2+G3)÷2+(2×M0-M1-M4)÷4 (Formula 1)
[0051] In the embodiment of the present application, the target pixel point is also the central pixel point in the pixel area, and G0 in Formula 1 H It can represent the horizontal component of the central pixel in any pixel area, G2 and G3 can represent the G channel pixels of two neighboring pixels adjacent to the central pixel in the horizontal direction, M1 and M4 can represent two neighboring pixels adjacent to G2 and G3 in the horizontal direction, and contain the same R channel pixels or B channel pixels as the central pixel.
[0052] For example, the target pixel is the central pixel M0 in the pixel area, M0 includes R channel pixels, M1 and M4 include R channel pixels, and correspondingly, if M0 includes B channel pixels, M1 and M4 include B channel pixels.
[0053] For example, based on Figure 3 The distribution of Bayer data, the vertical component of the G pixel at the center pixel M0 is G0 V , can be calculated by the following formula 2, which is as follows:
[0054] G0 v =(G6+G7)÷2+(2×M0-M5-M8)÷4 (Formula 2)
[0055] In the embodiment of the present application, G0 in Formula 2 v It can represent the vertical component of the central pixel in any pixel area. G6 and G7 can represent the G channel pixels of two neighboring pixels adjacent to the central pixel in the vertical direction. M5 and M8 can represent two neighboring pixels adjacent to G6 and G7 in the vertical direction and contain the same R channel pixels or B channel pixels as the central pixel.
[0056] For example, the target pixel is the central pixel M0 in the pixel area, M0 includes R channel pixels, M5 and M8 include R channel pixels, and correspondingly, if M0 includes B channel pixels, M5 and M8 include B channel pixels.
[0057] For example, based on Figure 3The distribution of Bayer data is used to obtain the horizontal component G0 of G0. H and the component G0 in the vertical direction V After that, we need to determine the horizontal gradient Grad0 of G0 by using Formula 3 and Formula 4 respectively. H and the gradient Grad0 in the vertical direction V , Formula 3 and Formula 4 are as follows:
[0058] Grad0 H= ∣G2-G3∣﹢∣2×M0-M1-M4∣ (Formula 3)
[0059] Grad0 V= |G6-G7|﹢|2×M0-M5-M8| (Formula 4)
[0060] Exemplary according to the horizontal gradient Grad0 H and vertical gradient Grad0 V The relative size relationship of and output the interpolation result of G0.
[0061] Specifically, if Grad0 H <Grad0 V , then G0=G0 H , if Grad0 H >Grad0 V , then G0=G0 V ,
[0062] If Grad0 H =Grad0 V , G0 can be determined by formula 5, which is as follows:
[0063] G0=(G0 H +G0 V )÷2 (Formula 5)
[0064] Exemplarily, the G channel interpolation result of the target pixel position is determined by the horizontal gradient and the vertical gradient of the target pixel position.
[0065] Step 202: Determine R channel color difference information and / or B channel color difference information of the neighborhood pixel points based on the G channel information included in the neighborhood pixel points and the channel information not included in the target pixel points.
[0066] Optionally, step 202 may specifically include: based on the R channel color difference information of the neighborhood pixels, estimating the channel color difference of the target pixel using a median filtering algorithm to obtain the R channel color difference information of the target pixel; and / or, based on the B channel color difference information of the neighborhood pixels, estimating the channel color difference of the target pixel using a median filtering algorithm to obtain the B channel color difference information of the target pixel.
[0067] In an embodiment of the present application, after inserting G channel pixels into the pixel points of the image, it is necessary to insert R channel pixels and B channel pixels into the image. Specifically, it is necessary to first estimate the B channel information of the R pixel points, or estimate the R channel information of the B pixel points, and then estimate the R channel information and B channel information at the G pixel position.
[0068] For example, in a 3*3 pixel area, when estimating the B channel information of an R pixel, or estimating the R channel information of a B pixel, the distribution of Bayer data is as follows: Figure 4 As shown, if the center pixel of the window is R0, the color difference of the neighborhood B channel △ can be calculated by formula 6 i , Formula 6 is as follows:
[0069] △ i =G i -B i (Formula 6)
[0070] In formula 6, i=1, 2, 3, 4.
[0071] Exemplarily, if the center pixel of the window is R0, it is necessary to calculate the color difference of the B channels of the four neighboring pixels respectively. Taking the calculation of the B channel color difference △1 of the neighboring pixel B1 as an example, it is necessary to obtain the G channel information of the B1 channel, for example, G1. The B channel color difference information of the B1 pixel is obtained by the above formula six. The B channel color difference information of the pixels B2, B3, and B4 is calculated in the same way as the B channel color difference information of the B1 pixel, and examples are not given one by one here.
[0072] For example, based on Figure 4 The distribution of Bayer data shown in the figure, if the center pixel of the window is B0, the color difference of the neighborhood R channel can be calculated by formula 7 i , Formula 7 is as follows:
[0073] △ i =G i -R i (Formula 7)
[0074] In formula 7, i=1, 2, 3, 4.
[0075] Exemplarily, if the center pixel of the window is B0, it is necessary to calculate the color difference of the R channel of the four neighboring pixels respectively. Taking the calculation of the R channel color difference △1 of the neighboring pixel R1 as an example, it is necessary to obtain the G channel information of the R1 channel, for example, G1. The R channel color difference information of the R1 pixel is obtained by the above formula seven. The R channel color difference information of the pixels R2, R3, and R4 is calculated in the same way as the R channel color difference information of the R1 pixel, and examples are not given one by one here.
[0076] Step 203: Estimate the channel color difference of the target pixel based on the channel color difference information corresponding to the neighborhood pixel points to obtain the channel color difference information of the target pixel point.
[0077] Optionally, step 203 may specifically include: determining the interpolation result of the R channel of the target pixel point based on the interpolation result of the G channel of the target pixel point and the color difference information of the R channel of the target pixel point; and / or determining the interpolation result of the B channel of the target pixel point based on the interpolation result of the G channel of the target pixel point and the color difference information of the B channel of the target pixel point.
[0078] Exemplarily, step 202, Figure 4 The distribution of the Bayer data shown can determine the channel color difference of the central pixel through Formula 8. The channel color difference of the central pixel is the channel color difference information of the target pixel. Formula 8 is specifically as follows:
[0079] △=MedianFilter(△1,△2,△3,△4) (Formula 8)
[0080] In Formula 8, MedianFilter is a median filter function.
[0081] For example, if the central pixel is R0, the B channel color difference information of the central pixel can be obtained by formula eight. Correspondingly, if the central pixel is B0, the R channel color difference information of the central pixel can be obtained by formula eight.
[0082] Exemplarily, based on step 202, Figure 4 The distribution of Bayer data shown in the figure, if the central pixel contains the R channel pixel, the interpolation result of the B channel of the central pixel can be determined by Formula 9, which is specifically as follows:
[0083] B0=G0-△ (Formula 9)
[0084] If the center pixel contains a B channel pixel, the interpolation result of the R channel of the center pixel can be determined by Formula 10, which is specifically as follows:
[0085] R0=G0-△ (Formula 10)
[0086] In an embodiment of the present application, after interpolating the channel pixels contained in the target pixel point as R channel pixels or B channel pixels, it is also necessary to insert R channel pixels and B channel pixels into the target pixel point that only contains G channel pixels.
[0087] For example, each G pixel has adjacent R pixels and B pixels in the four directions of up, down, left, and right. In a 3*3 pixel area, when estimating the B channel information and R channel information of the G pixel point, the distribution of Bayer data is as follows: Figure 5 shown.
[0088] Exemplarily, the R channel color difference ΔR of the neighborhood can be calculated by Formula 11 and Formula 12 respectively: i and B channel color difference △B i , Formula 11 and Formula 12 are specifically as follows:
[0089] △R i =G i -R i (Formula 11)
[0090] △B i =G i -B i (Formula 12)
[0091] The G channel pixel information has been confirmed in the above step 201, and the R channel pixel information and the B channel pixel information have been calculated in the above step 203, which will not be described in detail here.
[0092] Exemplarily, the color difference △R and △B at the position of the central pixel G0 can be estimated by median filtering through Formula 13 and Formula 14, respectively. Formula 13 and Formula 14 are specifically as follows:
[0093] △R=MedianFilter(△R1,△R2,△R3,△R4) (Formula 13)
[0094] △B=MedianFilter(△B1,△B2,△B3,△B4) (Formula 14)
[0095] Among them, MedianFilter is the median filter function.
[0096] Exemplarily, the R channel interpolation result R0 and the B channel interpolation result B0 corresponding to the position G0 may be determined by Formula 15 and Formula 16 respectively as follows:
[0097] R0=G0-△R (Formula 15)
[0098] B0=G0-△B (Formula 16)
[0099] Step 204: Determine the interpolation result of the target pixel point according to the channel color difference information of the target pixel point.
[0100] Optionally, step 204 may specifically include: updating the interpolation result of the R channel of the target pixel point and the interpolation result of the B channel of the target pixel point according to the channel color difference information corresponding to the neighborhood pixels of the target pixel point; and interpolating the target pixel point based on the updated processing result.
[0101] Exemplarily, based on step 203, based on the channel color difference information of all neighboring pixels of the target pixel, the R channel information and the B channel information of the target pixel are updated by Formula 17 and Formula 18, respectively. Formula 17 and Formula 18 are specifically as follows:
[0102] △R=MedianFilter(△R0,△R1,△R2,△R3,△R4,△R5,△R6,
[0103] △R7, △R8)(Formula 17)
[0104] △B=MedianFilter(△B0,△B1,△B2,△B3,△B4,△B5,△B6,
[0105] △B7, △B8)(Formula 18)
[0106] The final R channel value and B channel value of each pixel are determined by formula 19 and formula 20. Formula 19 and formula 20 are specifically as follows:
[0107] R=G-△R (Formula 19)
[0108] B=G-△B (Formula 20)
[0109] In the embodiment of the present application, the process of interpolating the single-channel Bayer data into three-channel RGB data is called demosaicing, and the quality of the interpolation result directly affects the final image quality. Since the R and B channel components of the Bayer data have only a 1 / 4 sampling rate, if the interpolation result error is relatively large, it will introduce more obvious pseudo-color, seriously affecting the image quality. Therefore, how to effectively remove pseudo-color is a problem with great practical application value.
[0110] The core idea of the HA algorithm is the principle of constant color difference. First, under the assumption of constant color difference, the components of the G pixel in the horizontal and vertical directions are estimated, and the horizontal gradient and vertical gradient are calculated respectively. According to the relative magnitude relationship between the horizontal gradient and the vertical gradient, the final G channel interpolation result is output. The interpolation process of the RB channel may include: if there are 4 data of the same channel in the neighborhood, the final RB interpolation data is output by estimating the color difference of the corresponding channels of the 4 neighborhoods; if there are only 2 data of the same channel in the neighborhood, the color difference is estimated in the corresponding direction for interpolation.
[0111] However, the RGB image reconstructed by the HA algorithm has serious pseudo-color in the high-frequency texture. Compared with the RB channel interpolation method of the HA algorithm, the interpolation method based on median filtering in the embodiment of the present application is significantly better than the HA algorithm in pseudo-color performance. Figure 6 and Figure 7 Both are the improved effects of the present technical solution. The left image is the output result of the HA algorithm, and the right image is the output result of the present technical solution. By comparison, it can be seen that the output result of the present application embodiment is better than the HA algorithm in terms of pseudo-color performance of highlights on branches and pseudo-color on lines.
[0112] Compared with the current existing technology, this embodiment first inserts G channel pixels into each pixel of the image based on the HA algorithm, and then inserts R channel pixels and B channel pixels into the image pixels through the median filtering algorithm. Finally, the interpolation result is updated based on all pixel data in the neighborhood, which can ensure the reliability of the inserted pixel information to a greater extent. By estimating the color difference of the neighborhood pixels, the pixel information of the central pixel is determined, and the target pixel is interpolated. The pixel information of the target pixel can be made closer to the true value, so that in the interpolation, the pseudo color appearing in the high-frequency texture of the image is better processed, which ensures that the image will not have obvious pseudo color at the high-frequency texture to a certain extent, improves the image quality effect, and ensures the image quality.
[0113] Further, as Figure 1 and Figure 2 The specific implementation of the method shown in the embodiment provides an image processing device, such as Figure 8 As shown, the device includes: an acquisition module 31, an estimation module 32, and a determination module 33.
[0114] An acquisition module is configured to acquire channel color difference information corresponding to a neighborhood pixel point of a target pixel point in an image, wherein the channel color difference information includes R channel color difference information and / or B channel color difference information;
[0115] An estimation module is configured to estimate the channel color difference of the target pixel point based on the channel color difference information corresponding to the neighborhood pixel point, so as to obtain the channel color difference information of the target pixel point;
[0116] The determination module is configured to determine the interpolation result of the target pixel point according to the channel color difference information of the target pixel point.
[0117] In some examples of this embodiment, the acquisition module 31 is also configured to acquire horizontal pixel gradient information and vertical pixel gradient information of the target pixel point; and determine the interpolation result of the G channel of the target pixel point based on the horizontal pixel gradient information and the vertical pixel gradient information.
[0118] In some examples of this embodiment, the acquisition module 31 is specifically configured to acquire the G channel information contained in the neighborhood pixel point and the channel information not contained in the target pixel point, the channel information not contained in the target pixel point is R channel information and / or B channel information, and the neighborhood pixel point is a pixel point other than the target pixel point in the nine-square grid pixel window centered on the target pixel point; based on the G channel information contained in the neighborhood pixel point and the channel information not contained in the target pixel point, determine the R channel color difference information and / or B channel color difference information of the neighborhood pixel point.
[0119] In some examples of the present embodiment, the estimation module 32 is specifically configured to estimate the channel color difference of the target pixel point based on the R channel color difference information of the neighborhood pixel points by using a median filtering algorithm to obtain the R channel color difference information of the target pixel point; and / or, estimate the channel color difference of the target pixel point based on the B channel color difference information of the neighborhood pixel points by using a median filtering algorithm to obtain the B channel color difference information of the target pixel point.
[0120] In some examples of this embodiment, the determination module 33 is specifically configured to determine the interpolation result of the R channel of the target pixel point based on the interpolation result of the G channel of the target pixel point and the color difference information of the R channel of the target pixel point; and / or, determine the interpolation result of the B channel of the target pixel point based on the interpolation result of the G channel of the target pixel point and the color difference information of the B channel of the target pixel point.
[0121] In some examples of this embodiment, the determination module 33 is also configured to update the interpolation results of the R channel of the target pixel point and the interpolation results of the B channel of the target pixel point according to the channel color difference information corresponding to the neighborhood pixels of the target pixel point; and interpolate the target pixel point based on the updated processing results.
[0122] It should be noted that for other corresponding descriptions of the functional units involved in the image processing device provided in this embodiment, reference can be made to Figure 1 and Figure 2 The corresponding description in will not be repeated here.
[0123] Based on the above Figure 1 and Figure 2 The method shown in the embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned Figure 1 and Figure 2 The method shown.
[0124] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.
[0125] Based on the above Figure 1 and Figure 2 The method shown, and Figure 8 In order to achieve the above-mentioned purpose, the embodiment of the present application also provides an electronic device, such as a smart phone, a tablet computer, a drone, a smart robot and other smart terminals, which includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 and Figure 2 The method shown.
[0126] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
[0127] Those skilled in the art will appreciate that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.
[0128] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.
[0129] Based on the above Figure 1 and Figure 2 The method shown, and Figure 8 The virtual device embodiment shown in the embodiment further provides a chip, including one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of an electronic device and send the signal to the processor, the signal including a computer instruction stored in the memory; when the processor executes the computer instruction, the electronic device executes the above-mentioned Figure 1 and Figure 2 The method shown.
[0130] Through the description of the above implementation mode, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware platform, or by hardware. By applying the scheme of the present embodiment, compared with the current prior art, the present embodiment first inserts G channel pixels to each pixel of the image based on the HA algorithm, and then inserts R channel pixels and B channel pixels into the image pixels through the median filtering algorithm, and finally updates the interpolation result based on all pixel data in the neighborhood, which can guarantee the reliability of the inserted pixel information to a greater extent, and determine the pixel information of the central pixel by estimating the color difference of the neighborhood pixel points, and interpolating the target pixel points, which can make the pixel information of the target pixel points closer to the true value, so that in the interpolation, the pseudo-color appearing in the image at the high-frequency texture is better processed, and it is ensured that the image will not appear more obvious pseudo-color at the high-frequency texture to a certain extent, and the image quality effect is improved, and the image quality is guaranteed.
[0131] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0132] The above is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features applied for herein.
Claims
1. An image processing method, characterized in that: include: Acquire channel color difference information corresponding to neighboring pixel points of a target pixel point in the image, wherein the channel color difference information includes R channel color difference information and / or B channel color difference information; Based on the channel color difference information corresponding to the neighborhood pixel points, the channel color difference of the target pixel point is estimated to obtain the channel color difference information of the target pixel point; An interpolation result of the target pixel is determined according to the channel color difference information of the target pixel.
2. The method according to claim 1, characterized in that Before obtaining the channel color difference information corresponding to the neighborhood pixel points of the target pixel point in the image, the method further includes: Obtaining horizontal pixel gradient information and vertical pixel gradient information of the target pixel; An interpolation result of the G channel of the target pixel is determined according to the horizontal pixel gradient information and the vertical pixel gradient information.
3. The method according to claim 2, characterized in that The step of obtaining channel color difference information corresponding to neighboring pixel points of a target pixel point in an image includes: Obtain G channel information included in the neighborhood pixel point and channel information not included in the target pixel point, where the channel information not included in the target pixel point is R channel information and / or B channel information, and the neighborhood pixel point is a pixel point other than the target pixel point in a nine-square grid pixel window centered on the target pixel point; Based on the G channel information included in the neighborhood pixel point and the channel information not included in the target pixel point, the R channel color difference information and / or the B channel color difference information of the neighborhood pixel point is determined.
4. The method according to claim 3, characterized in that Based on the channel color difference information corresponding to the neighborhood pixel points, estimating the channel color difference of the target pixel point to obtain the channel color difference information of the target pixel point includes: Based on the R channel color difference information of the neighborhood pixel points, the channel color difference of the target pixel point is estimated by using a median filtering algorithm to obtain the R channel color difference information of the target pixel point; and / or, Based on the B channel color difference information of the neighborhood pixel points, the channel color difference of the target pixel point is estimated by using a median filtering algorithm to obtain the B channel color difference information of the target pixel point.
5. The method according to claim 4, characterized in that Determining an interpolation result of the target pixel based on the channel color difference information of the target pixel includes: Determine the interpolation result of the R channel of the target pixel based on the interpolation result of the G channel of the target pixel and the color difference information of the R channel of the target pixel; and / or, Based on the interpolation result of the G channel of the target pixel point and the color difference information of the B channel of the target pixel point, the interpolation result of the B channel of the target pixel point is determined.
6. The method according to claim 5, characterized in that The method further comprises: According to the channel color difference information corresponding to the neighboring pixel points of the target pixel point, the interpolation result of the R channel of the target pixel point and the interpolation result of the B channel of the target pixel point are updated respectively; The target pixel point is interpolated based on the update processing result.
7. An image processing device, characterized in that: include: An acquisition module is configured to acquire channel color difference information corresponding to a neighborhood pixel point of a target pixel point in an image, wherein the channel color difference information includes R channel color difference information and / or B channel color difference information; An estimation module is configured to estimate the channel color difference of the target pixel point based on the channel color difference information corresponding to the neighborhood pixel point, so as to obtain the channel color difference information of the target pixel point; The determination module is configured to determine the interpolation result of the target pixel point according to the channel color difference information of the target pixel point.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
10. A chip, characterized in that: The electronic device comprises one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of the electronic device and send the signal to the processor, wherein the signal includes a computer instruction stored in the memory; when the processor executes the computer instruction, the electronic device executes the method described in any one of claims 1 to 6.