Pseudo-color processing method for converting RGBG image format into RGB image format

By calculating the complementary components of B and R in the RGBG image and performing interpolation processing, the pseudo-color problem when converting the RGBG image format to the RGB image format is solved, and the quality after image conversion is significantly improved.

CN119863404APending Publication Date: 2025-04-22ZHONGYIN MICROELECTRONICS NANJING CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510322360.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

When converting RGBG image format to RGB image format, traditional methods will lead to significant pseudo-color phenomena, affecting image quality.

Method used

By obtaining the coefficients of the RGB image and the interpolation algorithm, the complementary components of B and R in the image are calculated and brought in to obtain the optimized RGB image. The specific steps include calculating the complementary components of B and R, and optimizing the pseudo-color effect of the image through an interpolation algorithm.

Benefits of technology

Under the condition of retaining the original image information to the greatest extent, the pseudo-color phenomenon is significantly reduced, making the image conversion quality higher, making it difficult for human eyes to detect the pseudo-color effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119863404A_ABST
    Figure CN119863404A_ABST
Patent Text Reader

Abstract

The invention aims to provide a pseudo-color processing method for converting an RGBG image format into an RGB image format. The method comprises the following steps: acquiring an RGB image and a coefficient of an interpolation algorithm; calculating a complementary component of B in the image according to the RGB image and the coefficient of the interpolation algorithm; calculating a complementary component of R in the image according to the RGB image and the coefficient of the interpolation algorithm; and substituting the B complementary component and the R complementary component to obtain an RGB image. According to the method, the pseudo-color effect generated by the converted image can be processed under the condition that the information of the original image is reserved to the greatest extent, so that the degree that human eyes are not easy to perceive is achieved, and the image quality of image conversion is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method for pseudo-color processing of converting an RGBG image format into an RGB image format. Background Art

[0002] The RGBG format is a special arrangement of image sensor pixels, mainly used for high-resolution image capture. The RGBG format is a type of Bayer filter, characterized in that each pixel consists of a red filter, two green filters and one blue filter. This arrangement can effectively improve the resolution and detail of the image, especially in high-resolution image capture. By using the RGBG filter array, the sensor can capture more color information more accurately, thereby improving the quality and clarity of the image. The RGB format is an image storage format that obtains a variety of colors through the changes in the three color channels of red (R), green (G), and blue (B) and their superposition with each other.

[0003] Interpolation algorithm, also known as interpolation method or interpolation method, is to interpolate continuous functions based on discrete data so that this continuous curve passes through all given discrete data points. It is an important method for approximating discrete functions. By using the value of the function at a finite number of points, the approximate value of the function at other points can be estimated. Interpolation algorithm is used to fill the gaps between pixels when transforming images, and is a commonly used technique in mathematics and computer science.

[0004] There are several traditional conversion algorithms for converting RGBG format data to RGB format data: average method, maximum method, and weighted average method. The average method is to add the values ​​of two red components or blue components and divide them by 2 to get a new red component or blue component. This method is simple, but may lose some details; the maximum method is to select the maximum value of the two red components or blue components as the new red component or blue component. This method can retain more brightness information; the weighted average method is to calculate the new red component or blue component based on the specific weights of the two red components or blue components. This method can be adjusted according to actual conditions to obtain better image quality. The above algorithms can achieve the purpose of converting RGBG format to RGB format, but there will be differences in the final display effect of the image, especially in terms of pseudo-color. Using current technology to achieve image format conversion will result in obvious pseudo-color phenomenon. Summary of the invention

[0005] The purpose of the present invention is to provide a method for pseudo-color processing of converting an RGBG image format to an RGB image format, which can process the pseudo-color effect generated by the converted image to a level that is not easily perceived by the human eye while retaining the information of the original image to the greatest extent, thereby improving the image quality of the image conversion.

[0006] A method for pseudo-color processing of converting an RGBG image format to an RGB image format, comprising: Get the RGB image and the coefficients of the interpolation algorithm; Calculating the padding component of B in the image according to the RGB image and the coefficients of the interpolation algorithm; Calculating the padding component of R in the image according to the RGB image and the coefficients of the interpolation algorithm; Substitute the B padding component and the R padding component to obtain an RGB image.

[0007] Preferably, the step of bringing in the B padding component and the R padding component to obtain the RGB image comprises: Calculate the difference between the left and right points of the current pixel; Compare the difference between the left and right points of the current pixel with the preset value, and calculate the interpolation value based on the comparison result.

[0008] Preferably, the step of calculating the padding component of R in the image according to the RGB image and the coefficients of the interpolation algorithm comprises: Determine the three pixel information before and after the current BG pixel; If the three pixels before and after the BG pixel are at the edge of the start or end of a row, the missing pixel information before and after the BG pixel to be interpolated is copied to the pixel at the start or end point of the copy process.

[0009] Preferably, comparing the difference between the left point and the right point of the current pixel with a preset value and calculating the interpolation value according to the comparison result comprises: , , , , , , , , , , Among them, PI represents input data, PO represents output data, r1 represents the first point on the right of the current pixel, l1 represents the first point on the left of the current pixel, r2 represents the second point on the right of the current pixel, l2 represents the second point on the left of the current pixel, r3 represents the third point on the right of the current pixel, l3 represents the third point on the left of the current pixel, PD represents pixel data, and Dt represents the set threshold. Indicates the current pixel. , , , are different interpolation coefficients; Determine whether compare0 is true. If not, output the result of Algorithm4. If compare0 is true, then determine whether compare1 is true. If true, continue to determine compare3. If compare3 holds, output Algorithm0, otherwise output Algorithm1; If compare1 is not true, then determine whether compare2 is true. If true, continue to determine compare4. If compare4 holds, output Algorithm2, otherwise output Algorithm3; If compare2 does not hold, output Algorithm4.

[0010] Preferably, it also includes constructing an interpolation function, specifically: The interpolation function is constructed based on the information of the three pixels before and after the current pixel and the interpolation coefficient.

[0011] Preferably, comparing the difference between the first point on the left and the first point on the right of the current pixel with a preset value, and calculating the interpolation value according to the comparison result comprises: The grayscale value of the current pixel is calculated based on the grayscale values ​​of the three pixels before and after the current pixel.

[0012] Preferably, calculating the interpolation coefficients includes: The interpolation coefficient is calculated based on the pixel values ​​of the three pixels before and after the current pixel and the pixel value of the pixel to be interpolated.

[0013] A system for converting an RGBG image format to an RGB image format for pseudo-color processing, comprising: A data acquisition module, used to obtain RGB images and coefficients of interpolation algorithms; A B component calculation module, used to calculate the B padding component in the image according to the RGB image and the coefficients of the interpolation algorithm; An R component calculation module, used to calculate the R padding component in the image according to the RGB image and the coefficients of the interpolation algorithm; The image processing module is used to bring in the B padding component and the R padding component to obtain an RGB image.

[0014] An electronic device comprises: a chip, a processor and a memory, wherein the memory is used to store computer program codes, the computer program codes include computer instructions, and when the chip executes the computer instructions, the electronic device executes a method for pseudo-color processing of converting an RGBG image format to an RGB image format.

[0015] A computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a method for pseudo-color processing of converting an RGBG image format to an RGB image format.

[0016] The beneficial effects of the present invention are: 1. The present invention successfully converts an RGBG image into an RGB image through interpolation algorithm operation, and optimizes the pseudo-color problem in the image conversion process; 2. The present invention selects multiple points near the point to be interpolated into the interpolation window, which can calculate the interpolation more accurately and has good robustness. 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 invention and, together with the description, serve to explain the principles of the invention.

[0018] In order to more clearly illustrate the embodiments of the present invention 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 be obtained based on these drawings without paying any creative labor.

[0019] Figure 1 A flow chart of a method for pseudo-color processing of converting an RGBG image format to an RGB image format according to the present invention; Figure 2 A system architecture diagram of converting RGBG image format to RGB image format pseudo-color processing according to the present invention; Figure 3 This is the RGBG to RGB interpolation principle diagram of the present invention; Figure 4 This is a schematic diagram of the interpolation R component of the present invention; Figure 5 This is a schematic diagram of the interpolation B component of the present invention; Figure 6A schematic diagram of the hardware structure of an electronic device of the present invention; Figure 7 The data flow diagram for the selection output of the present invention is shown. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0021] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0022] In addition, the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0023] There are several traditional conversion algorithms for converting RGBG format data to RGB format data: average method, maximum method, and weighted average method. The average method is to add the values ​​of two red components or blue components and divide them by 2 to get a new red component or blue component. This method is simple, but may lose some details; the maximum method is to select the maximum value of the two red components or blue components as the new red component or blue component. This method can retain more brightness information; the weighted average method is to calculate the new red component or blue component based on the specific weights of the two red components or blue components. This method can be adjusted according to actual conditions to obtain better image quality. The above algorithms can achieve the purpose of converting RGBG format to RGB format, but there will be differences in the final display effect of the image, especially in terms of pseudo-color. Using current technology to achieve image format conversion will result in obvious pseudo-color phenomenon.

[0024] The present invention successfully converts an RGBG image into an RGB image through interpolation algorithm operation, and optimizes the pseudo-color problem in the image conversion process; the present invention selects multiple points near the point to be interpolated into the interpolation window, can calculate the interpolation more accurately, and has good robustness.

[0025] Example 1 A method for pseudo-color processing of RGBG image format to RGB image format, reference Figure 1 ,include: S100, obtaining the RGB image and the coefficients of the interpolation algorithm; Image interpolation algorithm refers to a method in image processing that uses known pixel information to estimate and generate unknown pixel values ​​to generate higher resolution images.

[0026] S200, calculating the padding component of B in the image according to the RGB image and the coefficients of the interpolation algorithm; S300, calculating the padding component of R in the image according to the RGB image and the coefficients of the interpolation algorithm; Since in the RGBG image format, the ratio of the number of G components to the number of R and B components is 2:1, compared with the RGB image format, the amount of G color component data is equal, so there is no need to process the G color component, while the R and B color components are less, so when converting RGBG to RGB, the data of the R and B color components need to be supplemented.

[0027] ‌RGB components refer to the three color components of red (R), green (G), and blue (B). ‌In the RGB color space, each pixel is composed of these three components. The value range of each component is 0 to 255, and the data type is generally an 8-bit unsigned integer. ‌By adjusting the different combinations and proportions of these three components, all colors that human vision can perceive can be reproduced on the screen.

[0028] In the embodiment of the present invention, the blue and red padding components are calculated by an interpolation algorithm, and the RGBG image is converted into an RGB image, the RGBG image is successfully converted into an RGB image, and the pseudo-color problem in the image conversion process is optimized.

[0029] S400, B padding component and R padding component are brought in to obtain an RGB image.

[0030] The present invention discloses an algorithm for converting an RGBG image format into an RGB image format for processing pseudo-color. Under the condition of retaining the information of the original image to the greatest extent, the pseudo-color effect generated by the converted image is processed to a level that is not easily perceived by the human eye, thereby improving the image quality of the image conversion.

[0031] Preferably, in S400, the B padding component and the R padding component are brought in to obtain the RGB image, including: Calculate the difference between the first point on the left and the first point on the right of the current pixel; Compare the difference between the first point on the left and the first point on the right of the current pixel with the preset value, and calculate the interpolation value based on the comparison result.

[0032] Since the ratio of the number of G components to the number of R and B components in the RGBG image format is 2:1, compared with the RGB image format, the amount of G color component data is equal, so there is no need to process the G color component, while the R and B color components are less, so when converting RGBG to RGB, it is necessary to fill in the data of the R and B color components, and the filling method is to fill in the interpolation algorithm. The RGB algorithm module receives the image data in the RGBG format, interpolates the pixel points of RG to calculate the value of B, and interpolates the pixel points of BG to calculate the value of R, such as Figure 3 shown.

[0033] Preferably, reference Figure 4 and Figure 5 , S300, calculating the padding component of R in the image according to the RGB image and the coefficients of the interpolation algorithm includes: Determine the three pixel information before and after the current BG pixel; If the three pixels before and after the BG pixel are at the edge of the start or end of a row, the missing pixel information before and after the BG pixel to be interpolated is copied to the pixel at the start or end point of the copy process.

[0034] In the process of filling the R color component, the three pixel information before and after the current BG pixel is required for interpolation judgment and interpolation calculation. If the BG pixel is at the edge of the beginning or end of a row, the missing pixel information before and after the BG pixel to be interpolated is copied to the pixel at the starting point or the end point of the copy processing.

[0035] Complementing missing pixels‌ refers to repairing or supplementing pixel data that is lost or damaged during transmission, processing or storage during image or video processing. This processing is crucial to improving the quality of images and videos, because missing pixels can cause problems such as noise, color distortion, blurred edges or discontinuous areas in images or videos‌.

[0036] In the embodiment of the present invention, the missing pixels can be supplemented by calculation and inference based on the surrounding pixel information. By supplementing the missing pixels, the resolution of the image can be significantly improved, making the image clearer and more delicate. In addition, supplementing the missing pixels can also improve the visual effect of the image, making it more realistic and natural.

[0037] Preferably, reference Figure 7, compare the difference between the first point on the left and the first point on the right of the current pixel with the preset value, and calculate the interpolation value based on the comparison result, including: Compare the difference between the left and right points of the current pixel with the preset value, and calculate the interpolation value based on the comparison result, including: , , , , , , , , , , Among them, PI represents input data, PO represents output data, r1 represents the first point on the right of the current pixel, l1 represents the first point on the left of the current pixel, r2 represents the second point on the right of the current pixel, l2 represents the second point on the left of the current pixel, r3 represents the third point on the right of the current pixel, l3 represents the third point on the left of the current pixel, PD represents pixel data, and Dt represents the set threshold. Indicates the current pixel. , , , are different interpolation coefficients; Determine whether compare0 is true. If not, output the result of Algorithm4. If compare0 is true, then determine whether compare1 is true. If true, continue to determine compare3. If compare3 holds, output Algorithm0, otherwise output Algorithm1; If compare1 is not true, then determine whether compare2 is true. If true, continue to determine compare4. If compare4 holds, output Algorithm2, otherwise output Algorithm3; If compare2 does not hold, output Algorithm4.

[0038] Preferably, it also includes constructing an interpolation function, specifically: The interpolation function is constructed based on the three pixel information before and after the current pixel and the interpolation coefficient, which is expressed as: , Where n=3, is the horizontal coordinate of the neighboring point of the interpolation point, is the ordinate of the neighboring point of the point to be interpolated, j=0, 1, 2…, n; is the horizontal coordinate of the point to be interpolated, is the interpolation coefficient.

[0039] In the embodiment of the present invention, the interpolation function does not have the derivative term of the traditional interpolation function, which saves the process of derivative calculation. The interpolation function can help the algorithm better estimate the interpolation data of the interpolation point, which can greatly improve the interpolation efficiency and improve the interpolation accuracy.

[0040] An interpolation function is a mathematical function used to estimate the values ​​between known data points based on the values ​​of these data points. It fills in the blanks of the data by interpolating between known data points. An interpolation function can estimate the approximate value of a function at other points based on the values ​​taken at a finite number of points. Interpolation functions fill in the gaps between pixels by constructing a function to simulate and estimate the values ​​of unknown pixels. This is particularly important when data is insufficient or missing, and can help generate additional pixels to support analysis needs. Interpolation functions are used to fit given discrete pixels. Through interpolation functions, the overall trends and characteristics of images can be better understood and analyzed. In image processing, interpolation functions can be used to fill in the gaps between pixels, making the image smoother and more natural when scaled or transformed.

[0041] Compare the difference between the first point on the left and the first point on the right of the current pixel with the preset value, and calculate the interpolation value based on the comparison result, including: The gray value of the current pixel is calculated based on the gray values ​​of the three pixels before and after the current pixel, expressed as: , in, is the gray value of the first point to the right of the current pixel, is the gray value of the second point to the right of the current pixel, is the gray value of the third point to the right of the current pixel, is the ordinate of the point to be interpolated, are the coordinates of the first point on the right, are the coordinates of the second point on the right, is the coordinate of the third point on the right. In the embodiment of the present invention, after calculating the three pixel points on the right, the three pixel points on the left are calculated. The calculation method is the same as that for the right.

[0042] In an embodiment of the present invention, the grayscale value of the point to be interpolated is calculated based on the known points around the point to be interpolated, and the grayscale values ​​of all the points to be interpolated on the image can be obtained by repeated iterations, and then the B component and R component to be interpolated are corrected according to the grayscale value. The grayscale value is determined by comparing the brightness of each pixel in the image. In RGB mode, the grayscale value is obtained by calculating the average value of the three channels of red, green and blue. Specifically, the grayscale value can be calculated by the following formula: grayscale value = 0.299 red value + 0.587 green value + 0.114 blue value. If the values ​​of the three RGB channels are equal, the pixel is pure gray; if the value of a channel is higher, the pixel is biased towards the color of the channel. The grayscale value refers to the brightness level of the pixel in the image, usually ranging from 0 to 255, where 0 represents black and 255 represents white. The grayscale value is used to describe the brightness of the image.

[0043] Preferably, calculating the interpolation coefficients includes: The interpolation coefficient is calculated based on the pixel values ​​of the three pixels before and after the current pixel and the pixel value of the pixel to be interpolated, which is expressed as: , , Among them, C is the interpolation selection window, which is a 3*3 matrix, and Y is the pixel value after interpolation. is the weight coefficient, which is set according to the G / B component of the image. is the pixel value of the image before interpolation.

[0044] Interpolation coefficients are coefficients used to calculate the interpolation results during the interpolation process. Interpolation is to construct a mathematical function or curve from known data points to estimate the values ​​of other unknown data points. There are many interpolation methods, the most common ones include linear interpolation, polynomial interpolation, and spline interpolation. Linear interpolation is suitable for simple linear relationships between two known data points. Polynomial interpolation is suitable for situations where a higher-order mathematical model is required. Spline interpolation is suitable for situations where a smooth curve is required.

[0045] Image interpolation technology is mainly divided into two categories according to the difference in interpolation processing methods: linear interpolation algorithm and nonlinear interpolation algorithm. The classic linear interpolation algorithms include nearest neighbor interpolation and bilinear interpolation algorithms. The image edge jagged phenomenon processed by these two algorithms is obvious and the edge contour is blurred, so it is not suitable for processing images with complex edge details. Bicubic interpolation, interpolation based on regional relationship, cubic B-spline interpolation, Lanczos interpolation and other algorithms have more complex function models, and introduce the influencing factors of the gray value change and gray value change rate of the pixel to be interpolated around the known pixel in the algorithm idea. However, the kernel functions of the above interpolation algorithms all have the properties of low-pass filtering, which will destroy the high-frequency area of ​​the image, and the edge of the processed image will still be blurred and distorted. In order to solve the problems existing in traditional linear interpolation, experts in the field of digital image processing began to study nonlinear interpolation algorithms and introduced wavelet transform interpolation from the perspective of transform domain, first separating the high-frequency and low-frequency information of the image, and then processing the high-frequency information of the image. This algorithm can better preserve the edge details of the image, but there are problems such as complex interpolation models and noise when processing high-frequency information.

[0046] The present invention uses a pixel difference network to divide the edge, replacing the original edge division method; in order to maintain the continuity of the edge contour, the algorithm in this paper maintains the continuity of the edge contour by linear interpolation of the edge line direction in the local area of ​​the edge point, while also maintaining the integrity of the edge structure. Experiments show that compared with traditional algorithms, the algorithm proposed in this invention can obtain a higher peak signal-to-noise ratio for various images while maintaining the image structure unchanged, and compared with other image interpolation algorithms, it also has better evaluation index data.

[0047] Example 2 A system for converting RGBG image format to RGB image format pseudo-color processing, reference Figure 2 ,include: A data acquisition module, used to obtain RGB images and coefficients of interpolation algorithms; The data acquisition module collects analog and digital signals from sensors, cameras and other devices under test, such as data of physical phenomena such as voltage, current, temperature, pressure or sound. And measures, analyzes and displays these data through a combination of modular hardware, application software and computers.

[0048] A B component calculation module, used to calculate the B padding component in the image according to the RGB image and the coefficients of the interpolation algorithm; The B component calculation module performs preprocessing and feature extraction on the input image data based on the data obtained from the data acquisition module to obtain data for subsequent algorithm processing. The data processing module can complete a series of data processing tasks, including data set preprocessing, data set cleaning, feature selection, feature conversion and feature combination.

[0049] An R component calculation module, used to calculate the R padding component in the image according to the RGB image and the coefficients of the interpolation algorithm; The R component calculation module performs preprocessing and feature extraction on the input image data based on the data obtained from the data acquisition module to obtain data for subsequent algorithm processing. The data processing module can complete a series of data processing tasks, including data set preprocessing, data set cleaning, feature selection, feature conversion and feature combination.

[0050] The image processing module is used to bring in the B padding component and the R padding component to obtain an RGB image.

[0051] An interpolation algorithm is set in the image processing module to bring in the B padding component and the R padding component, so that the image in RGBG format is successfully converted into an RGB image, and an RGB image without pseudo-color phenomenon is obtained.

[0052] like Figure 2 The figure shows a system architecture diagram of pseudo-color processing of an RGBG image format to an RGB image format of the present invention. The arrow on the left represents the coefficient value of the RGBG data and the interpolation algorithm input to the present invention, and the arrow on the right represents the RGB format data after the data conversion is completed. After entering the algorithm module, the RGBG format image passes through the control logic, and then enters the interpolation algorithm module, and finally outputs the data.

[0053] Example 3 An electronic device comprises: a chip, a processor and a memory, wherein the memory is used to store computer program codes, the computer program codes include computer instructions, and when the chip executes the computer instructions, the electronic device executes a method for pseudo-color processing of converting an RGBG image format to an RGB image format.

[0054] refer to Figure 6, the electronic device 2 includes a processor 21, a memory 22, an input device 23, and an output device 24. The processor 21, the memory 22, the input device 23, and the output device 24 are coupled via a connector, and the connector includes various interfaces, transmission lines, or buses, etc., which are not limited in the embodiments of the present invention. It should be understood that in various embodiments of the present invention, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, for example, through various interfaces, transmission lines, buses, etc.

[0055] The processor 21 may be one or more graphics processing units (GPUs). When the processor 21 is a GPU, the GPU may be a single-core GPU or a multi-core GPU. Optionally, the processor 21 may be a processor group consisting of multiple GPUs, and the multiple processors are coupled to each other via one or more buses. Optionally, the processor may also be other types of processors, etc., which are not limited in the embodiments of the present invention.

[0056] The memory 22 can be used to store computer program instructions and various computer program codes including program codes for executing the scheme of the present invention. Optionally, the memory includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or portable read only memory (CD-ROM), which is used for related instructions and data.

[0057] The input device 23 is used to input data and / or signals, and the output device 24 is used to output data and / or signals. The output device 24 and the input device 23 may be independent devices or an integrated device.

[0058] Example 4 A computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a method for pseudo-color processing of converting an RGBG image format to an RGB image format.

[0059] The present invention successfully converts an RGBG image into an RGB image through interpolation algorithm operation, and optimizes the pseudo-color problem in the image conversion process; the present invention selects multiple points near the point to be interpolated into the interpolation window, can calculate the interpolation more accurately, and has good robustness.

[0060] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for pseudo-color processing of converting an RGBG image format to an RGB image format, characterized in that: include: Get the RGB image and the coefficients of the interpolation algorithm; Calculating the padding component of B in the image according to the RGB image and the coefficients of the interpolation algorithm; Calculating the padding component of R in the image according to the RGB image and the coefficients of the interpolation algorithm; Substitute the B padding component and the R padding component to obtain an RGB image.

2. The method for pseudo-color processing of converting an RGBG image format to an RGB image format according to claim 1, characterized in that: Substituting the B padding component and the R padding component to obtain the RGB image includes: Calculate the difference between the left and right points of the current pixel; Compare the difference between the left and right points of the current pixel with the preset value, and calculate the interpolation value based on the comparison result.

3. The method for pseudo-color processing of converting an RGBG image format to an RGB image format according to claim 1, characterized in that: The calculating the padding component of R in the image according to the coefficients of the RGB image and the interpolation algorithm comprises: Determine the three pixel information before and after the current BG pixel; If the three pixels before and after the BG pixel are at the edge of the start or end of a row, the missing pixel information before and after the BG pixel to be interpolated is copied to the pixel at the start or end point of the copy process.

4. The method for pseudo-color processing of converting an RGBG image format to an RGB image format according to claim 1, characterized in that: The step of comparing the difference between the left point and the right point of the current pixel with a preset value and calculating the interpolation value according to the comparison result comprises: , , , , , , , , , , Among them, PI represents input data, PO represents output data, r1 represents the first point on the right of the current pixel, l1 represents the first point on the left of the current pixel, r2 represents the second point on the right of the current pixel, l2 represents the second point on the left of the current pixel, r3 represents the third point on the right of the current pixel, l3 represents the third point on the left of the current pixel, PD represents pixel data, Dt represents the set threshold, Indicates the current pixel. , , , are different interpolation coefficients; Determine whether compare0 is true. If not, output the result of Algorithm4. If compare0 is true, then determine whether compare1 is true. If true, continue to determine compare3. If compare3 holds, output Algorithm0, otherwise output Algorithm1; If compare1 is not true, then determine whether compare2 is true. If true, continue to determine compare4. If compare4 holds, output Algorithm2, otherwise output Algorithm3; If compare2 does not hold, output Algorithm4.

5. The method for pseudo-color processing of converting an RGBG image format to an RGB image format according to claim 3, characterized in that: It also includes constructing interpolation functions, specifically: The interpolation function is constructed based on the information of the three pixels before and after the current pixel and the interpolation coefficient.

6. The method for pseudo-color processing of converting an RGBG image format to an RGB image format according to claim 2, characterized in that: The step of comparing the difference between the first point on the left and the first point on the right of the current pixel with a preset value and calculating the interpolation value according to the comparison result comprises: The grayscale value of the current pixel is calculated based on the grayscale values ​​of the three pixels before and after the current pixel.

7. The method for pseudo-color processing of converting an RGBG image format to an RGB image format according to claim 5, characterized in that: Calculating the interpolation coefficients includes: The interpolation coefficient is calculated based on the pixel values ​​of the three pixels before and after the current pixel and the pixel value of the pixel to be interpolated.

8. A system for converting RGBG image format to RGB image format pseudo-color processing, characterized in that: include: A data acquisition module, used to obtain RGB images and coefficients of interpolation algorithms; A B component calculation module, used to calculate the B padding component in the image according to the RGB image and the coefficients of the interpolation algorithm; An R component calculation module, used to calculate the R padding component in the image according to the RGB image and the coefficients of the interpolation algorithm; The image processing module is used to bring in the B padding component and the R padding component to obtain an RGB image.

9. An electronic device, characterized in that: include: A chip, a processor and a memory, wherein the memory is used to store computer program codes, wherein the computer program codes include computer instructions. When the chip executes the computer instructions, the electronic device executes a method for pseudo-color processing of converting an RGBG image format to an RGB image format as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a method for pseudo-color processing of converting an RGBG image format to an RGB image format according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Bayer color image interpolation method based on direction flag bits

    CN104537625A

  • Bayer image processing method and system, electronic equipment and storage medium

    CN111539892A

  • Adaptive interpolation with artifact reduction of images

    US20080240559A1